var AK=Object.defineProperty;var MK=(e,t,n)=>t in e?AK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var nn=(e,t,n)=>(MK(e,typeof t!="symbol"?t+"":t,n),n);function bLe(){import("data:text/javascript,")}function RK(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Cs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function o9(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C={exports:{}},Zt={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Jv=Symbol.for("react.element"),OK=Symbol.for("react.portal"),IK=Symbol.for("react.fragment"),DK=Symbol.for("react.strict_mode"),NK=Symbol.for("react.profiler"),BK=Symbol.for("react.provider"),zK=Symbol.for("react.context"),FK=Symbol.for("react.forward_ref"),$K=Symbol.for("react.suspense"),HK=Symbol.for("react.memo"),WK=Symbol.for("react.lazy"),VE=Symbol.iterator;function VK(e){return e===null||typeof e!="object"?null:(e=VE&&e[VE]||e["@@iterator"],typeof e=="function"?e:null)}var SO={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bO=Object.assign,xO={};function g1(e,t,n){this.props=e,this.context=t,this.refs=xO,this.updater=n||SO}g1.prototype.isReactComponent={};g1.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};g1.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wO(){}wO.prototype=g1.prototype;function a9(e,t,n){this.props=e,this.context=t,this.refs=xO,this.updater=n||SO}var s9=a9.prototype=new wO;s9.constructor=a9;bO(s9,g1.prototype);s9.isPureReactComponent=!0;var UE=Array.isArray,CO=Object.prototype.hasOwnProperty,l9={current:null},_O={key:!0,ref:!0,__self:!0,__source:!0};function kO(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)CO.call(t,r)&&!_O.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,Me=G[me];if(0>>1;mei(we,le))Vei(Ze,we)?(G[me]=Ze,G[Ve]=le,me=Ve):(G[me]=we,G[be]=le,me=be);else if(Vei(Ze,le))G[me]=Ze,G[Ve]=le,me=Ve;else break e}}return ee}function i(G,ee){var le=G.sortIndex-ee.sortIndex;return le!==0?le:G.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],h=1,g=null,m=3,v=!1,b=!1,w=!1,P=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(G){for(var ee=n(u);ee!==null;){if(ee.callback===null)r(u);else if(ee.startTime<=G)r(u),ee.sortIndex=ee.expirationTime,t(l,ee);else break;ee=n(u)}}function M(G){if(w=!1,T(G),!b)if(n(l)!==null)b=!0,J(O);else{var ee=n(u);ee!==null&&Z(M,ee.startTime-G)}}function O(G,ee){b=!1,w&&(w=!1,E(B),B=-1),v=!0;var le=m;try{for(T(ee),g=n(l);g!==null&&(!(g.expirationTime>ee)||G&&!j());){var me=g.callback;if(typeof me=="function"){g.callback=null,m=g.priorityLevel;var Me=me(g.expirationTime<=ee);ee=e.unstable_now(),typeof Me=="function"?g.callback=Me:g===n(l)&&r(l),T(ee)}else r(l);g=n(l)}if(g!==null)var Ce=!0;else{var be=n(u);be!==null&&Z(M,be.startTime-ee),Ce=!1}return Ce}finally{g=null,m=le,v=!1}}var I=!1,D=null,B=-1,$=5,H=-1;function j(){return!(e.unstable_now()-H<$)}function ne(){if(D!==null){var G=e.unstable_now();H=G;var ee=!0;try{ee=D(!0,G)}finally{ee?V():(I=!1,D=null)}}else I=!1}var V;if(typeof _=="function")V=function(){_(ne)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,te=q.port2;q.port1.onmessage=ne,V=function(){te.postMessage(null)}}else V=function(){P(ne,0)};function J(G){D=G,I||(I=!0,V())}function Z(G,ee){B=P(function(){G(e.unstable_now())},ee)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_continueExecution=function(){b||v||(b=!0,J(O))},e.unstable_forceFrameRate=function(G){0>G||125me?(G.sortIndex=le,t(u,G),n(l)===null&&G===n(u)&&(w?(E(B),B=-1):w=!0,Z(M,le-me))):(G.sortIndex=Me,t(l,G),b||v||(b=!0,J(O))),G},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(G){var ee=m;return function(){var le=m;m=ee;try{return G.apply(this,arguments)}finally{m=le}}}})(EO);(function(e){e.exports=EO})(S0);/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var PO=C.exports,ma=S0.exports;function Ie(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u6=Object.prototype.hasOwnProperty,qK=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,jE={},YE={};function KK(e){return u6.call(YE,e)?!0:u6.call(jE,e)?!1:qK.test(e)?YE[e]=!0:(jE[e]=!0,!1)}function XK(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ZK(e,t,n,r){if(t===null||typeof t>"u"||XK(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function fo(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Ni={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ni[e]=new fo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ni[t]=new fo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ni[e]=new fo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ni[e]=new fo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ni[e]=new fo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ni[e]=new fo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ni[e]=new fo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ni[e]=new fo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ni[e]=new fo(e,5,!1,e.toLowerCase(),null,!1,!1)});var c9=/[\-:]([a-z])/g;function d9(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(c9,d9);Ni[t]=new fo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(c9,d9);Ni[t]=new fo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(c9,d9);Ni[t]=new fo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ni[e]=new fo(e,1,!1,e.toLowerCase(),null,!1,!1)});Ni.xlinkHref=new fo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ni[e]=new fo(e,1,!1,e.toLowerCase(),null,!0,!0)});function f9(e,t,n,r){var i=Ni.hasOwnProperty(t)?Ni[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` `+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{dx=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?pm(e):""}function QK(e){switch(e.tag){case 5:return pm(e.type);case 16:return pm("Lazy");case 13:return pm("Suspense");case 19:return pm("SuspenseList");case 0:case 2:case 15:return e=fx(e.type,!1),e;case 11:return e=fx(e.type.render,!1),e;case 1:return e=fx(e.type,!0),e;default:return""}}function h6(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Jp:return"Fragment";case Qp:return"Portal";case c6:return"Profiler";case h9:return"StrictMode";case d6:return"Suspense";case f6:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case AO:return(e.displayName||"Context")+".Consumer";case LO:return(e._context.displayName||"Context")+".Provider";case p9:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case g9:return t=e.displayName||null,t!==null?t:h6(e.type)||"Memo";case Hc:t=e._payload,e=e._init;try{return h6(e(t))}catch(n){}}return null}function JK(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return h6(t);case 8:return t===h9?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function gd(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function RO(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function eX(e){var t=RO(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sy(e){e._valueTracker||(e._valueTracker=eX(e))}function OO(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=RO(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function y5(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch(t){return e.body}}function p6(e,t){var n=t.checked;return gr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function KE(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=gd(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function IO(e,t){t=t.checked,t!=null&&f9(e,"checked",t,!1)}function g6(e,t){IO(e,t);var n=gd(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?m6(e,t.type,n):t.hasOwnProperty("defaultValue")&&m6(e,t.type,gd(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function XE(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function m6(e,t,n){(t!=="number"||y5(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var gm=Array.isArray;function b0(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=by.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cv(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Om={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},tX=["Webkit","ms","Moz","O"];Object.keys(Om).forEach(function(e){tX.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Om[t]=Om[e]})});function zO(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Om.hasOwnProperty(e)&&Om[e]?(""+t).trim():t+"px"}function FO(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=zO(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var nX=gr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function S6(e,t){if(t){if(nX[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ie(62))}}function b6(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var x6=null;function m9(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var w6=null,x0=null,w0=null;function JE(e){if(e=n2(e)){if(typeof w6!="function")throw Error(Ie(280));var t=e.stateNode;t&&(t=W4(t),w6(e.stateNode,e.type,t))}}function $O(e){x0?w0?w0.push(e):w0=[e]:x0=e}function HO(){if(x0){var e=x0,t=w0;if(w0=x0=null,JE(e),t)for(e=0;e>>=0,e===0?32:31-(hX(e)/pX|0)|0}var xy=64,wy=4194304;function mm(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function w5(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=mm(s):(o&=a,o!==0&&(r=mm(o)))}else a=n&~i,a!==0?r=mm(a):o!==0&&(r=mm(o));if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function e2(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Es(t),e[t]=n}function yX(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Dm),lP=String.fromCharCode(32),uP=!1;function sI(e,t){switch(e){case"keyup":return jX.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lI(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var e0=!1;function qX(e,t){switch(e){case"compositionend":return lI(t);case"keypress":return t.which!==32?null:(uP=!0,lP);case"textInput":return e=t.data,e===lP&&uP?null:e;default:return null}}function KX(e,t){if(e0)return e==="compositionend"||!_9&&sI(e,t)?(e=oI(),R3=x9=Kc=null,e0=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=hP(n)}}function fI(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fI(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hI(){for(var e=window,t=y5();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch(r){n=!1}if(n)e=t.contentWindow;else break;t=y5(e.document)}return t}function k9(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function iZ(e){var t=hI(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&fI(n.ownerDocument.documentElement,n)){if(r!==null&&k9(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=pP(n,o);var a=pP(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,t0=null,T6=null,Bm=null,L6=!1;function gP(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;L6||t0==null||t0!==y5(r)||(r=t0,"selectionStart"in r&&k9(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Bm&&mv(Bm,r)||(Bm=r,r=k5(T6,"onSelect"),0i0||(e.current=D6[i0],D6[i0]=null,i0--)}function Kn(e,t){i0++,D6[i0]=e.current,e.current=t}var md={},qi=_d(md),No=_d(!1),ch=md;function q0(e,t){var n=e.type.contextTypes;if(!n)return md;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Bo(e){return e=e.childContextTypes,e!=null}function P5(){Jn(No),Jn(qi)}function wP(e,t,n){if(qi.current!==md)throw Error(Ie(168));Kn(qi,t),Kn(No,n)}function wI(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Ie(108,JK(e)||"Unknown",i));return gr({},n,r)}function T5(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||md,ch=qi.current,Kn(qi,e),Kn(No,No.current),!0}function CP(e,t,n){var r=e.stateNode;if(!r)throw Error(Ie(169));n?(e=wI(e,t,ch),r.__reactInternalMemoizedMergedChildContext=e,Jn(No),Jn(qi),Kn(qi,e)):Jn(No),Kn(No,n)}var vu=null,V4=!1,Ex=!1;function CI(e){vu===null?vu=[e]:vu.push(e)}function mZ(e){V4=!0,CI(e)}function kd(){if(!Ex&&vu!==null){Ex=!0;var e=0,t=Mn;try{var n=vu;for(Mn=1;e>=a,i-=a,Su=1<<32-Es(t)+i|n<B?($=D,D=null):$=D.sibling;var H=m(E,D,T[B],M);if(H===null){D===null&&(D=$);break}e&&D&&H.alternate===null&&t(E,D),_=o(H,_,B),I===null?O=H:I.sibling=H,I=H,D=$}if(B===T.length)return n(E,D),ir&&Rf(E,B),O;if(D===null){for(;BB?($=D,D=null):$=D.sibling;var j=m(E,D,H.value,M);if(j===null){D===null&&(D=$);break}e&&D&&j.alternate===null&&t(E,D),_=o(j,_,B),I===null?O=j:I.sibling=j,I=j,D=$}if(H.done)return n(E,D),ir&&Rf(E,B),O;if(D===null){for(;!H.done;B++,H=T.next())H=g(E,H.value,M),H!==null&&(_=o(H,_,B),I===null?O=H:I.sibling=H,I=H);return ir&&Rf(E,B),O}for(D=r(E,D);!H.done;B++,H=T.next())H=v(D,E,B,H.value,M),H!==null&&(e&&H.alternate!==null&&D.delete(H.key===null?B:H.key),_=o(H,_,B),I===null?O=H:I.sibling=H,I=H);return e&&D.forEach(function(ne){return t(E,ne)}),ir&&Rf(E,B),O}function P(E,_,T,M){if(typeof T=="object"&&T!==null&&T.type===Jp&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case yy:e:{for(var O=T.key,I=_;I!==null;){if(I.key===O){if(O=T.type,O===Jp){if(I.tag===7){n(E,I.sibling),_=i(I,T.props.children),_.return=E,E=_;break e}}else if(I.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===Hc&&AP(O)===I.type){n(E,I.sibling),_=i(I,T.props),_.ref=Yg(E,I,T),_.return=E,E=_;break e}n(E,I);break}else t(E,I);I=I.sibling}T.type===Jp?(_=eh(T.props.children,E.mode,M,T.key),_.return=E,E=_):(M=$3(T.type,T.key,T.props,null,E.mode,M),M.ref=Yg(E,_,T),M.return=E,E=M)}return a(E);case Qp:e:{for(I=T.key;_!==null;){if(_.key===I)if(_.tag===4&&_.stateNode.containerInfo===T.containerInfo&&_.stateNode.implementation===T.implementation){n(E,_.sibling),_=i(_,T.children||[]),_.return=E,E=_;break e}else{n(E,_);break}else t(E,_);_=_.sibling}_=Ix(T,E.mode,M),_.return=E,E=_}return a(E);case Hc:return I=T._init,P(E,_,I(T._payload),M)}if(gm(T))return b(E,_,T,M);if(Wg(T))return w(E,_,T,M);Ly(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,_!==null&&_.tag===6?(n(E,_.sibling),_=i(_,T),_.return=E,E=_):(n(E,_),_=Ox(T,E.mode,M),_.return=E,E=_),a(E)):n(E,_)}return P}var X0=MI(!0),RI=MI(!1),r2={},Pl=_d(r2),bv=_d(r2),xv=_d(r2);function Uf(e){if(e===r2)throw Error(Ie(174));return e}function I9(e,t){switch(Kn(xv,t),Kn(bv,e),Kn(Pl,r2),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:y6(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=y6(t,e)}Jn(Pl),Kn(Pl,t)}function Z0(){Jn(Pl),Jn(bv),Jn(xv)}function OI(e){Uf(xv.current);var t=Uf(Pl.current),n=y6(t,e.type);t!==n&&(Kn(bv,e),Kn(Pl,n))}function D9(e){bv.current===e&&(Jn(Pl),Jn(bv))}var dr=_d(0);function I5(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Px=[];function N9(){for(var e=0;en?n:4,e(!0);var r=Tx.transition;Tx.transition={};try{e(!1),t()}finally{Mn=n,Tx.transition=r}}function KI(){return Ga().memoizedState}function bZ(e,t,n){var r=ud(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},XI(e))ZI(t,n);else if(n=PI(e,t,n,r),n!==null){var i=lo();Ps(n,e,r,i),QI(n,t,r)}}function xZ(e,t,n){var r=ud(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(XI(e))ZI(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Rs(s,a)){var l=t.interleaved;l===null?(i.next=i,R9(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch(u){}finally{}n=PI(e,t,i,r),n!==null&&(i=lo(),Ps(n,e,r,i),QI(n,t,r))}}function XI(e){var t=e.alternate;return e===pr||t!==null&&t===pr}function ZI(e,t){zm=D5=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function QI(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,y9(e,n)}}var N5={readContext:Ua,useCallback:Hi,useContext:Hi,useEffect:Hi,useImperativeHandle:Hi,useInsertionEffect:Hi,useLayoutEffect:Hi,useMemo:Hi,useReducer:Hi,useRef:Hi,useState:Hi,useDebugValue:Hi,useDeferredValue:Hi,useTransition:Hi,useMutableSource:Hi,useSyncExternalStore:Hi,useId:Hi,unstable_isNewReconciler:!1},wZ={readContext:Ua,useCallback:function(e,t){return hl().memoizedState=[e,t===void 0?null:t],e},useContext:Ua,useEffect:RP,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,N3(4194308,4,UI.bind(null,t,e),n)},useLayoutEffect:function(e,t){return N3(4194308,4,e,t)},useInsertionEffect:function(e,t){return N3(4,2,e,t)},useMemo:function(e,t){var n=hl();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=hl();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=bZ.bind(null,pr,e),[r.memoizedState,e]},useRef:function(e){var t=hl();return e={current:e},t.memoizedState=e},useState:MP,useDebugValue:H9,useDeferredValue:function(e){return hl().memoizedState=e},useTransition:function(){var e=MP(!1),t=e[0];return e=SZ.bind(null,e[1]),hl().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pr,i=hl();if(ir){if(n===void 0)throw Error(Ie(407));n=n()}else{if(n=t(),Si===null)throw Error(Ie(349));(fh&30)!==0||NI(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,RP(zI.bind(null,r,o,e),[e]),r.flags|=2048,_v(9,BI.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=hl(),t=Si.identifierPrefix;if(ir){var n=bu,r=Su;n=(r&~(1<<32-Es(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wv++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Sl]=t,e[Sv]=r,sD(e,t,!1,!1),t.stateNode=e;e:{switch(a=b6(n,r),n){case"dialog":Zn("cancel",e),Zn("close",e),i=r;break;case"iframe":case"object":case"embed":Zn("load",e),i=r;break;case"video":case"audio":for(i=0;iJ0&&(t.flags|=128,r=!0,qg(o,!1),t.lanes=4194304)}else{if(!r)if(e=I5(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),qg(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!ir)return Wi(t),null}else 2*zr()-o.renderingStartTime>J0&&n!==1073741824&&(t.flags|=128,r=!0,qg(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=zr(),t.sibling=null,n=dr.current,Kn(dr,r?n&1|2:n&1),t):(Wi(t),null);case 22:case 23:return Y9(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(ua&1073741824)!==0&&(Wi(t),t.subtreeFlags&6&&(t.flags|=8192)):Wi(t),null;case 24:return null;case 25:return null}throw Error(Ie(156,t.tag))}function AZ(e,t){switch(P9(t),t.tag){case 1:return Bo(t.type)&&P5(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Z0(),Jn(No),Jn(qi),N9(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return D9(t),null;case 13:if(Jn(dr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ie(340));K0()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Jn(dr),null;case 4:return Z0(),null;case 10:return M9(t.type._context),null;case 22:case 23:return Y9(),null;case 24:return null;default:return null}}var My=!1,Gi=!1,MZ=typeof WeakSet=="function"?WeakSet:Set,at=null;function l0(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Er(e,t,r)}else n.current=null}function Y6(e,t,n){try{n()}catch(r){Er(e,t,r)}}var HP=!1;function RZ(e,t){if(A6=C5,e=hI(),k9(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(M){n=null;break e}var a=0,s=-1,l=-1,u=0,h=0,g=e,m=null;t:for(;;){for(var v;g!==n||i!==0&&g.nodeType!==3||(s=a+i),g!==o||r!==0&&g.nodeType!==3||(l=a+r),g.nodeType===3&&(a+=g.nodeValue.length),(v=g.firstChild)!==null;)m=g,g=v;for(;;){if(g===e)break t;if(m===n&&++u===i&&(s=a),m===o&&++h===r&&(l=a),(v=g.nextSibling)!==null)break;g=m,m=g.parentNode}g=v}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(M6={focusedElem:e,selectionRange:n},C5=!1,at=t;at!==null;)if(t=at,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,at=e;else for(;at!==null;){t=at;try{var b=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var w=b.memoizedProps,P=b.memoizedState,E=t.stateNode,_=E.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ss(t.type,w),P);E.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ie(163))}}catch(M){Er(t,t.return,M)}if(e=t.sibling,e!==null){e.return=t.return,at=e;break}at=t.return}return b=HP,HP=!1,b}function Fm(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&Y6(t,n,o)}i=i.next}while(i!==r)}}function j4(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function q6(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function cD(e){var t=e.alternate;t!==null&&(e.alternate=null,cD(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Sl],delete t[Sv],delete t[I6],delete t[pZ],delete t[gZ])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function dD(e){return e.tag===5||e.tag===3||e.tag===4}function WP(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dD(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function K6(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=E5));else if(r!==4&&(e=e.child,e!==null))for(K6(e,t,n),e=e.sibling;e!==null;)K6(e,t,n),e=e.sibling}function X6(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(X6(e,t,n),e=e.sibling;e!==null;)X6(e,t,n),e=e.sibling}var Ri=null,bs=!1;function Oc(e,t,n){for(n=n.child;n!==null;)fD(e,t,n),n=n.sibling}function fD(e,t,n){if(El&&typeof El.onCommitFiberUnmount=="function")try{El.onCommitFiberUnmount(z4,n)}catch(s){}switch(n.tag){case 5:Gi||l0(n,t);case 6:var r=Ri,i=bs;Ri=null,Oc(e,t,n),Ri=r,bs=i,Ri!==null&&(bs?(e=Ri,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ri.removeChild(n.stateNode));break;case 18:Ri!==null&&(bs?(e=Ri,n=n.stateNode,e.nodeType===8?kx(e.parentNode,n):e.nodeType===1&&kx(e,n),pv(e)):kx(Ri,n.stateNode));break;case 4:r=Ri,i=bs,Ri=n.stateNode.containerInfo,bs=!0,Oc(e,t,n),Ri=r,bs=i;break;case 0:case 11:case 14:case 15:if(!Gi&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&((o&2)!==0||(o&4)!==0)&&Y6(n,t,a),i=i.next}while(i!==r)}Oc(e,t,n);break;case 1:if(!Gi&&(l0(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Er(n,t,s)}Oc(e,t,n);break;case 21:Oc(e,t,n);break;case 22:n.mode&1?(Gi=(r=Gi)||n.memoizedState!==null,Oc(e,t,n),Gi=r):Oc(e,t,n);break;default:Oc(e,t,n)}}function VP(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new MZ),t.forEach(function(r){var i=HZ.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ps(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=zr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*IZ(r/1960))-r,10e?16:e,Xc===null)var r=!1;else{if(e=Xc,Xc=null,F5=0,(ln&6)!==0)throw Error(Ie(331));var i=ln;for(ln|=4,at=e.current;at!==null;){var o=at,a=o.child;if((at.flags&16)!==0){var s=o.deletions;if(s!==null){for(var l=0;lzr()-G9?Jf(e,0):U9|=n),zo(e,t)}function bD(e,t){t===0&&((e.mode&1)===0?t=1:(t=wy,wy<<=1,(wy&130023424)===0&&(wy=4194304)));var n=lo();e=Tu(e,t),e!==null&&(e2(e,t,n),zo(e,n))}function $Z(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bD(e,n)}function HZ(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ie(314))}r!==null&&r.delete(t),bD(e,n)}var xD;xD=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||No.current)Io=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return Io=!1,TZ(e,t,n);Io=(e.flags&131072)!==0}else Io=!1,ir&&(t.flags&1048576)!==0&&_I(t,A5,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;B3(e,t),e=t.pendingProps;var i=q0(t,qi.current);_0(t,n),i=z9(null,t,r,e,i,n);var o=F9();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Bo(r)?(o=!0,T5(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,O9(t),i.updater=U4,t.stateNode=i,i._reactInternals=t,$6(t,r,e,n),t=V6(null,t,r,!0,o,n)):(t.tag=0,ir&&o&&E9(t),oo(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(B3(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=VZ(r),e=Ss(r,e),i){case 0:t=W6(null,t,r,e,n);break e;case 1:t=zP(null,t,r,e,n);break e;case 11:t=NP(null,t,r,e,n);break e;case 14:t=BP(null,t,r,Ss(r.type,e),n);break e}throw Error(Ie(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ss(r,i),W6(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ss(r,i),zP(e,t,r,i,n);case 3:e:{if(iD(t),e===null)throw Error(Ie(387));r=t.pendingProps,o=t.memoizedState,i=o.element,TI(e,t),O5(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Q0(Error(Ie(423)),t),t=FP(e,t,r,n,i);break e}else if(r!==i){i=Q0(Error(Ie(424)),t),t=FP(e,t,r,n,i);break e}else for(da=ad(t.stateNode.containerInfo.firstChild),fa=t,ir=!0,ws=null,n=RI(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(K0(),r===i){t=Lu(e,t,n);break e}oo(e,t,r,n)}t=t.child}return t;case 5:return OI(t),e===null&&B6(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,R6(r,i)?a=null:o!==null&&R6(r,o)&&(t.flags|=32),rD(e,t),oo(e,t,a,n),t.child;case 6:return e===null&&B6(t),null;case 13:return oD(e,t,n);case 4:return I9(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=X0(t,null,r,n):oo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ss(r,i),NP(e,t,r,i,n);case 7:return oo(e,t,t.pendingProps,n),t.child;case 8:return oo(e,t,t.pendingProps.children,n),t.child;case 12:return oo(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,Kn(M5,r._currentValue),r._currentValue=a,o!==null)if(Rs(o.value,a)){if(o.children===i.children&&!No.current){t=Lu(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=wu(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?l.next=l:(l.next=h.next,h.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),z6(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Ie(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),z6(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}oo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,_0(t,n),i=Ua(i),r=r(i),t.flags|=1,oo(e,t,r,n),t.child;case 14:return r=t.type,i=Ss(r,t.pendingProps),i=Ss(r.type,i),BP(e,t,r,i,n);case 15:return tD(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ss(r,i),B3(e,t),t.tag=1,Bo(r)?(e=!0,T5(t)):e=!1,_0(t,n),AI(t,r,i),$6(t,r,i,n),V6(null,t,r,!0,e,n);case 19:return aD(e,t,n);case 22:return nD(e,t,n)}throw Error(Ie(156,t.tag))};function wD(e,t){return qO(e,t)}function WZ(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fa(e,t,n,r){return new WZ(e,t,n,r)}function K9(e){return e=e.prototype,!(!e||!e.isReactComponent)}function VZ(e){if(typeof e=="function")return K9(e)?1:0;if(e!=null){if(e=e.$$typeof,e===p9)return 11;if(e===g9)return 14}return 2}function cd(e,t){var n=e.alternate;return n===null?(n=Fa(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $3(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")K9(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Jp:return eh(n.children,i,o,t);case h9:a=8,i|=8;break;case c6:return e=Fa(12,n,t,i|2),e.elementType=c6,e.lanes=o,e;case d6:return e=Fa(13,n,t,i),e.elementType=d6,e.lanes=o,e;case f6:return e=Fa(19,n,t,i),e.elementType=f6,e.lanes=o,e;case MO:return q4(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case LO:a=10;break e;case AO:a=9;break e;case p9:a=11;break e;case g9:a=14;break e;case Hc:a=16,r=null;break e}throw Error(Ie(130,e==null?e:typeof e,""))}return t=Fa(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function eh(e,t,n,r){return e=Fa(7,e,r,t),e.lanes=n,e}function q4(e,t,n,r){return e=Fa(22,e,r,t),e.elementType=MO,e.lanes=n,e.stateNode={isHidden:!1},e}function Ox(e,t,n){return e=Fa(6,e,null,t),e.lanes=n,e}function Ix(e,t,n){return t=Fa(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function UZ(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=px(0),this.expirationTimes=px(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=px(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function X9(e,t,n,r,i,o,a,s,l){return e=new UZ(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Fa(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},O9(o),e}function GZ(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Sa})(Wl);const Iy=o9(Wl.exports);var ZP=Wl.exports;l6.createRoot=ZP.createRoot,l6.hydrateRoot=ZP.hydrateRoot;var Ts=Boolean(globalThis==null?void 0:globalThis.document)?C.exports.useLayoutEffect:C.exports.useEffect,J4={exports:{}},eS={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var XZ=C.exports,ZZ=Symbol.for("react.element"),QZ=Symbol.for("react.fragment"),JZ=Object.prototype.hasOwnProperty,eQ=XZ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tQ={key:!0,ref:!0,__self:!0,__source:!0};function ED(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)JZ.call(t,r)&&!tQ.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:ZZ,type:e,key:o,ref:a,props:i,_owner:eQ.current}}eS.Fragment=QZ;eS.jsx=ED;eS.jsxs=ED;(function(e){e.exports=eS})(J4);const Rn=J4.exports.Fragment,S=J4.exports.jsx,X=J4.exports.jsxs;var e8=C.exports.createContext({});e8.displayName="ColorModeContext";function i2(){const e=C.exports.useContext(e8);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}var Dy={light:"chakra-ui-light",dark:"chakra-ui-dark"};function nQ(e={}){const{preventTransition:t=!0}=e,n={setDataset:r=>{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i==null||i()},setClassName(r){document.body.classList.add(r?Dy.dark:Dy.light),document.body.classList.remove(r?Dy.light:Dy.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var o;return((o=n.query().matches)!=null?o:r==="dark")?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var rQ="chakra-ui-color-mode";function iQ(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch(r){}return n||t},set(t){try{localStorage.setItem(e,t)}catch(n){}}}}var oQ=iQ(rQ),QP=()=>{};function JP(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function PD(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=oQ}=e,s=i==="dark"?"dark":"light",[l,u]=C.exports.useState(()=>JP(a,s)),[h,g]=C.exports.useState(()=>JP(a)),{getSystemTheme:m,setClassName:v,setDataset:b,addListener:w}=C.exports.useMemo(()=>nQ({preventTransition:o}),[o]),P=i==="system"&&!l?h:l,E=C.exports.useCallback(M=>{const O=M==="system"?m():M;u(O),v(O==="dark"),b(O),a.set(O)},[a,m,v,b]);Ts(()=>{i==="system"&&g(m())},[]),C.exports.useEffect(()=>{const M=a.get();if(M){E(M);return}if(i==="system"){E("system");return}E(s)},[a,s,i,E]);const _=C.exports.useCallback(()=>{E(P==="dark"?"light":"dark")},[P,E]);C.exports.useEffect(()=>{if(!!r)return w(E)},[r,w,E]);const T=C.exports.useMemo(()=>({colorMode:t!=null?t:P,toggleColorMode:t?QP:_,setColorMode:t?QP:E,forced:t!==void 0}),[P,_,E,t]);return S(e8.Provider,{value:T,children:n})}PD.displayName="ColorModeProvider";var tC={exports:{}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",h="[object Boolean]",g="[object Date]",m="[object Error]",v="[object Function]",b="[object GeneratorFunction]",w="[object Map]",P="[object Number]",E="[object Null]",_="[object Object]",T="[object Proxy]",M="[object RegExp]",O="[object Set]",I="[object String]",D="[object Undefined]",B="[object WeakMap]",$="[object ArrayBuffer]",H="[object DataView]",j="[object Float32Array]",ne="[object Float64Array]",V="[object Int8Array]",q="[object Int16Array]",te="[object Int32Array]",J="[object Uint8Array]",Z="[object Uint8ClampedArray]",G="[object Uint16Array]",ee="[object Uint32Array]",le=/[\\^$.*+?()[\]{}|]/g,me=/^\[object .+?Constructor\]$/,Me=/^(?:0|[1-9]\d*)$/,Ce={};Ce[j]=Ce[ne]=Ce[V]=Ce[q]=Ce[te]=Ce[J]=Ce[Z]=Ce[G]=Ce[ee]=!0,Ce[s]=Ce[l]=Ce[$]=Ce[h]=Ce[H]=Ce[g]=Ce[m]=Ce[v]=Ce[w]=Ce[P]=Ce[_]=Ce[M]=Ce[O]=Ce[I]=Ce[B]=!1;var be=typeof Cs=="object"&&Cs&&Cs.Object===Object&&Cs,we=typeof self=="object"&&self&&self.Object===Object&&self,Ve=be||we||Function("return this")(),Ze=t&&!t.nodeType&&t,it=Ze&&!0&&e&&!e.nodeType&&e,pt=it&&it.exports===Ze,kt=pt&&be.process,gt=function(){try{var U=it&&it.require&&it.require("util").types;return U||kt&&kt.binding&&kt.binding("util")}catch(re){}}(),ht=gt&>.isTypedArray;function vt(U,re,he){switch(he.length){case 0:return U.call(re);case 1:return U.call(re,he[0]);case 2:return U.call(re,he[0],he[1]);case 3:return U.call(re,he[0],he[1],he[2])}return U.apply(re,he)}function Te(U,re){for(var he=-1,Ke=Array(U);++he-1}function z1(U,re){var he=this.__data__,Ke=es(he,U);return Ke<0?(++this.size,he.push([U,re])):he[Ke][1]=re,this}Vo.prototype.clear=Fd,Vo.prototype.delete=B1,Vo.prototype.get=qu,Vo.prototype.has=$d,Vo.prototype.set=z1;function zs(U){var re=-1,he=U==null?0:U.length;for(this.clear();++re1?he[zt-1]:void 0,yt=zt>2?he[2]:void 0;for(gn=U.length>3&&typeof gn=="function"?(zt--,gn):void 0,yt&&Wh(he[0],he[1],yt)&&(gn=zt<3?void 0:gn,zt=1),re=Object(re);++Ke-1&&U%1==0&&U0){if(++re>=i)return arguments[0]}else re=0;return U.apply(void 0,arguments)}}function Ju(U){if(U!=null){try{return cn.call(U)}catch(re){}try{return U+""}catch(re){}}return""}function _a(U,re){return U===re||U!==U&&re!==re}var Gd=ql(function(){return arguments}())?ql:function(U){return Gn(U)&&xn.call(U,"callee")&&!Ne.call(U,"callee")},Zl=Array.isArray;function Vt(U){return U!=null&&Uh(U.length)&&!tc(U)}function Vh(U){return Gn(U)&&Vt(U)}var ec=an||Z1;function tc(U){if(!Yo(U))return!1;var re=$s(U);return re==v||re==b||re==u||re==T}function Uh(U){return typeof U=="number"&&U>-1&&U%1==0&&U<=a}function Yo(U){var re=typeof U;return U!=null&&(re=="object"||re=="function")}function Gn(U){return U!=null&&typeof U=="object"}function jd(U){if(!Gn(U)||$s(U)!=_)return!1;var re=lt(U);if(re===null)return!0;var he=xn.call(re,"constructor")&&re.constructor;return typeof he=="function"&&he instanceof he&&cn.call(he)==Jt}var Gh=ht?ot(ht):Xu;function Yd(U){return Zr(U,jh(U))}function jh(U){return Vt(U)?q1(U,!0):Hs(U)}var fn=ts(function(U,re,he,Ke){Uo(U,re,he,Ke)});function Ut(U){return function(){return U}}function Yh(U){return U}function Z1(){return!1}e.exports=fn})(tC,tC.exports);const Cl=tC.exports;function Ls(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Gf(e,...t){return aQ(e)?e(...t):e}var aQ=e=>typeof e=="function",sQ=e=>/!(important)?$/.test(e),eT=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,nC=(e,t)=>n=>{const r=String(t),i=sQ(r),o=eT(r),a=e?`${e}.${o}`:o;let s=Ls(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=eT(s),i?`${s} !important`:s};function Ev(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{var u;const s=nC(t,o)(a);let l=(u=n==null?void 0:n(s,a))!=null?u:s;return r&&(l=r(l,a)),l}}var Ny=(...e)=>t=>e.reduce((n,r)=>r(n),t);function gs(e,t){return n=>{const r={property:n,scale:e};return r.transform=Ev({scale:e,transform:t}),r}}var lQ=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function uQ(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:lQ(t),transform:n?Ev({scale:n,compose:r}):r}}var TD=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function cQ(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...TD].join(" ")}function dQ(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...TD].join(" ")}var fQ={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},hQ={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function pQ(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var gQ={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},LD="& > :not(style) ~ :not(style)",mQ={[LD]:{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}},vQ={[LD]:{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}},rC={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},yQ=new Set(Object.values(rC)),AD=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),SQ=e=>e.trim();function bQ(e,t){var g;var n;if(e==null||AD.has(e))return e;const r=new RegExp("(?^[a-z-A-Z]+)\\((?(.*))\\)","g"),{type:i,values:o}=(g=(n=r.exec(e))==null?void 0:n.groups)!=null?g:{};if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(SQ).filter(Boolean);if((l==null?void 0:l.length)===0)return e;const u=s in rC?rC[s]:s;l.unshift(u);const h=l.map(m=>{if(yQ.has(m))return m;const v=m.indexOf(" "),[b,w]=v!==-1?[m.substr(0,v),m.substr(v+1)]:[m],P=MD(w)?w:w&&w.split(" "),E=`colors.${b}`,_=E in t.__cssMap?t.__cssMap[E].varRef:b;return P?[_,...Array.isArray(P)?P:[P]].join(" "):_});return`${a}(${h.join(", ")})`}var MD=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),xQ=(e,t)=>bQ(e,t!=null?t:{});function wQ(e){return/^var\(--.+\)$/.test(e)}var CQ=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},ul=e=>t=>`${e}(${t})`,sn={filter(e){return e!=="auto"?e:fQ},backdropFilter(e){return e!=="auto"?e:hQ},ring(e){return pQ(sn.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?cQ():e==="auto-gpu"?dQ():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=CQ(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(wQ(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:xQ,blur:ul("blur"),opacity:ul("opacity"),brightness:ul("brightness"),contrast:ul("contrast"),dropShadow:ul("drop-shadow"),grayscale:ul("grayscale"),hueRotate:ul("hue-rotate"),invert:ul("invert"),saturate:ul("saturate"),sepia:ul("sepia"),bgImage(e){return e==null||MD(e)||AD.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var i;const{space:t,divide:n}=(i=gQ[e])!=null?i:{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},oe={borderWidths:gs("borderWidths"),borderStyles:gs("borderStyles"),colors:gs("colors"),borders:gs("borders"),radii:gs("radii",sn.px),space:gs("space",Ny(sn.vh,sn.px)),spaceT:gs("space",Ny(sn.vh,sn.px)),degreeT(e){return{property:e,transform:sn.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:Ev({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:gs("sizes",Ny(sn.vh,sn.px)),sizesT:gs("sizes",Ny(sn.vh,sn.fraction)),shadows:gs("shadows"),logical:uQ,blur:gs("blur",sn.blur)},H3={background:oe.colors("background"),backgroundColor:oe.colors("backgroundColor"),backgroundImage:oe.propT("backgroundImage",sn.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:sn.bgClip},bgSize:oe.prop("backgroundSize"),bgPosition:oe.prop("backgroundPosition"),bg:oe.colors("background"),bgColor:oe.colors("backgroundColor"),bgPos:oe.prop("backgroundPosition"),bgRepeat:oe.prop("backgroundRepeat"),bgAttachment:oe.prop("backgroundAttachment"),bgGradient:oe.propT("backgroundImage",sn.gradient),bgClip:{transform:sn.bgClip}};Object.assign(H3,{bgImage:H3.backgroundImage,bgImg:H3.backgroundImage});var vn={border:oe.borders("border"),borderWidth:oe.borderWidths("borderWidth"),borderStyle:oe.borderStyles("borderStyle"),borderColor:oe.colors("borderColor"),borderRadius:oe.radii("borderRadius"),borderTop:oe.borders("borderTop"),borderBlockStart:oe.borders("borderBlockStart"),borderTopLeftRadius:oe.radii("borderTopLeftRadius"),borderStartStartRadius:oe.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:oe.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:oe.radii("borderTopRightRadius"),borderStartEndRadius:oe.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:oe.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:oe.borders("borderRight"),borderInlineEnd:oe.borders("borderInlineEnd"),borderBottom:oe.borders("borderBottom"),borderBlockEnd:oe.borders("borderBlockEnd"),borderBottomLeftRadius:oe.radii("borderBottomLeftRadius"),borderBottomRightRadius:oe.radii("borderBottomRightRadius"),borderLeft:oe.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:oe.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:oe.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:oe.borders(["borderLeft","borderRight"]),borderInline:oe.borders("borderInline"),borderY:oe.borders(["borderTop","borderBottom"]),borderBlock:oe.borders("borderBlock"),borderTopWidth:oe.borderWidths("borderTopWidth"),borderBlockStartWidth:oe.borderWidths("borderBlockStartWidth"),borderTopColor:oe.colors("borderTopColor"),borderBlockStartColor:oe.colors("borderBlockStartColor"),borderTopStyle:oe.borderStyles("borderTopStyle"),borderBlockStartStyle:oe.borderStyles("borderBlockStartStyle"),borderBottomWidth:oe.borderWidths("borderBottomWidth"),borderBlockEndWidth:oe.borderWidths("borderBlockEndWidth"),borderBottomColor:oe.colors("borderBottomColor"),borderBlockEndColor:oe.colors("borderBlockEndColor"),borderBottomStyle:oe.borderStyles("borderBottomStyle"),borderBlockEndStyle:oe.borderStyles("borderBlockEndStyle"),borderLeftWidth:oe.borderWidths("borderLeftWidth"),borderInlineStartWidth:oe.borderWidths("borderInlineStartWidth"),borderLeftColor:oe.colors("borderLeftColor"),borderInlineStartColor:oe.colors("borderInlineStartColor"),borderLeftStyle:oe.borderStyles("borderLeftStyle"),borderInlineStartStyle:oe.borderStyles("borderInlineStartStyle"),borderRightWidth:oe.borderWidths("borderRightWidth"),borderInlineEndWidth:oe.borderWidths("borderInlineEndWidth"),borderRightColor:oe.colors("borderRightColor"),borderInlineEndColor:oe.colors("borderInlineEndColor"),borderRightStyle:oe.borderStyles("borderRightStyle"),borderInlineEndStyle:oe.borderStyles("borderInlineEndStyle"),borderTopRadius:oe.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:oe.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:oe.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:oe.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(vn,{rounded:vn.borderRadius,roundedTop:vn.borderTopRadius,roundedTopLeft:vn.borderTopLeftRadius,roundedTopRight:vn.borderTopRightRadius,roundedTopStart:vn.borderStartStartRadius,roundedTopEnd:vn.borderStartEndRadius,roundedBottom:vn.borderBottomRadius,roundedBottomLeft:vn.borderBottomLeftRadius,roundedBottomRight:vn.borderBottomRightRadius,roundedBottomStart:vn.borderEndStartRadius,roundedBottomEnd:vn.borderEndEndRadius,roundedLeft:vn.borderLeftRadius,roundedRight:vn.borderRightRadius,roundedStart:vn.borderInlineStartRadius,roundedEnd:vn.borderInlineEndRadius,borderStart:vn.borderInlineStart,borderEnd:vn.borderInlineEnd,borderTopStartRadius:vn.borderStartStartRadius,borderTopEndRadius:vn.borderStartEndRadius,borderBottomStartRadius:vn.borderEndStartRadius,borderBottomEndRadius:vn.borderEndEndRadius,borderStartRadius:vn.borderInlineStartRadius,borderEndRadius:vn.borderInlineEndRadius,borderStartWidth:vn.borderInlineStartWidth,borderEndWidth:vn.borderInlineEndWidth,borderStartColor:vn.borderInlineStartColor,borderEndColor:vn.borderInlineEndColor,borderStartStyle:vn.borderInlineStartStyle,borderEndStyle:vn.borderInlineEndStyle});var _Q={color:oe.colors("color"),textColor:oe.colors("color"),fill:oe.colors("fill"),stroke:oe.colors("stroke")},iC={boxShadow:oe.shadows("boxShadow"),mixBlendMode:!0,blendMode:oe.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:oe.prop("backgroundBlendMode"),opacity:!0};Object.assign(iC,{shadow:iC.boxShadow});var kQ={filter:{transform:sn.filter},blur:oe.blur("--chakra-blur"),brightness:oe.propT("--chakra-brightness",sn.brightness),contrast:oe.propT("--chakra-contrast",sn.contrast),hueRotate:oe.degreeT("--chakra-hue-rotate"),invert:oe.propT("--chakra-invert",sn.invert),saturate:oe.propT("--chakra-saturate",sn.saturate),dropShadow:oe.propT("--chakra-drop-shadow",sn.dropShadow),backdropFilter:{transform:sn.backdropFilter},backdropBlur:oe.blur("--chakra-backdrop-blur"),backdropBrightness:oe.propT("--chakra-backdrop-brightness",sn.brightness),backdropContrast:oe.propT("--chakra-backdrop-contrast",sn.contrast),backdropHueRotate:oe.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:oe.propT("--chakra-backdrop-invert",sn.invert),backdropSaturate:oe.propT("--chakra-backdrop-saturate",sn.saturate)},W5={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:sn.flexDirection},experimental_spaceX:{static:mQ,transform:Ev({scale:"space",transform:e=>e!==null?{"--chakra-space-x":e}:null})},experimental_spaceY:{static:vQ,transform:Ev({scale:"space",transform:e=>e!=null?{"--chakra-space-y":e}:null})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:oe.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:oe.space("gap"),rowGap:oe.space("rowGap"),columnGap:oe.space("columnGap")};Object.assign(W5,{flexDir:W5.flexDirection});var RD={gridGap:oe.space("gridGap"),gridColumnGap:oe.space("gridColumnGap"),gridRowGap:oe.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},EQ={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:sn.outline},outlineOffset:!0,outlineColor:oe.colors("outlineColor")},Ia={width:oe.sizesT("width"),inlineSize:oe.sizesT("inlineSize"),height:oe.sizes("height"),blockSize:oe.sizes("blockSize"),boxSize:oe.sizes(["width","height"]),minWidth:oe.sizes("minWidth"),minInlineSize:oe.sizes("minInlineSize"),minHeight:oe.sizes("minHeight"),minBlockSize:oe.sizes("minBlockSize"),maxWidth:oe.sizes("maxWidth"),maxInlineSize:oe.sizes("maxInlineSize"),maxHeight:oe.sizes("maxHeight"),maxBlockSize:oe.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:oe.propT("float",sn.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Ia,{w:Ia.width,h:Ia.height,minW:Ia.minWidth,maxW:Ia.maxWidth,minH:Ia.minHeight,maxH:Ia.maxHeight,overscroll:Ia.overscrollBehavior,overscrollX:Ia.overscrollBehaviorX,overscrollY:Ia.overscrollBehaviorY});var PQ={listStyleType:!0,listStylePosition:!0,listStylePos:oe.prop("listStylePosition"),listStyleImage:!0,listStyleImg:oe.prop("listStyleImage")};function TQ(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},AQ=LQ(TQ),MQ={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},RQ={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Dx=(e,t,n)=>{const r={},i=AQ(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},OQ={srOnly:{transform(e){return e===!0?MQ:e==="focusable"?RQ:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Dx(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Dx(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Dx(t,e,n)}},Wm={position:!0,pos:oe.prop("position"),zIndex:oe.prop("zIndex","zIndices"),inset:oe.spaceT("inset"),insetX:oe.spaceT(["left","right"]),insetInline:oe.spaceT("insetInline"),insetY:oe.spaceT(["top","bottom"]),insetBlock:oe.spaceT("insetBlock"),top:oe.spaceT("top"),insetBlockStart:oe.spaceT("insetBlockStart"),bottom:oe.spaceT("bottom"),insetBlockEnd:oe.spaceT("insetBlockEnd"),left:oe.spaceT("left"),insetInlineStart:oe.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:oe.spaceT("right"),insetInlineEnd:oe.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Wm,{insetStart:Wm.insetInlineStart,insetEnd:Wm.insetInlineEnd});var IQ={ring:{transform:sn.ring},ringColor:oe.colors("--chakra-ring-color"),ringOffset:oe.prop("--chakra-ring-offset-width"),ringOffsetColor:oe.colors("--chakra-ring-offset-color"),ringInset:oe.prop("--chakra-ring-inset")},Qn={margin:oe.spaceT("margin"),marginTop:oe.spaceT("marginTop"),marginBlockStart:oe.spaceT("marginBlockStart"),marginRight:oe.spaceT("marginRight"),marginInlineEnd:oe.spaceT("marginInlineEnd"),marginBottom:oe.spaceT("marginBottom"),marginBlockEnd:oe.spaceT("marginBlockEnd"),marginLeft:oe.spaceT("marginLeft"),marginInlineStart:oe.spaceT("marginInlineStart"),marginX:oe.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:oe.spaceT("marginInline"),marginY:oe.spaceT(["marginTop","marginBottom"]),marginBlock:oe.spaceT("marginBlock"),padding:oe.space("padding"),paddingTop:oe.space("paddingTop"),paddingBlockStart:oe.space("paddingBlockStart"),paddingRight:oe.space("paddingRight"),paddingBottom:oe.space("paddingBottom"),paddingBlockEnd:oe.space("paddingBlockEnd"),paddingLeft:oe.space("paddingLeft"),paddingInlineStart:oe.space("paddingInlineStart"),paddingInlineEnd:oe.space("paddingInlineEnd"),paddingX:oe.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:oe.space("paddingInline"),paddingY:oe.space(["paddingTop","paddingBottom"]),paddingBlock:oe.space("paddingBlock")};Object.assign(Qn,{m:Qn.margin,mt:Qn.marginTop,mr:Qn.marginRight,me:Qn.marginInlineEnd,marginEnd:Qn.marginInlineEnd,mb:Qn.marginBottom,ml:Qn.marginLeft,ms:Qn.marginInlineStart,marginStart:Qn.marginInlineStart,mx:Qn.marginX,my:Qn.marginY,p:Qn.padding,pt:Qn.paddingTop,py:Qn.paddingY,px:Qn.paddingX,pb:Qn.paddingBottom,pl:Qn.paddingLeft,ps:Qn.paddingInlineStart,paddingStart:Qn.paddingInlineStart,pr:Qn.paddingRight,pe:Qn.paddingInlineEnd,paddingEnd:Qn.paddingInlineEnd});var DQ={textDecorationColor:oe.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:oe.shadows("textShadow")},NQ={clipPath:!0,transform:oe.propT("transform",sn.transform),transformOrigin:!0,translateX:oe.spaceT("--chakra-translate-x"),translateY:oe.spaceT("--chakra-translate-y"),skewX:oe.degreeT("--chakra-skew-x"),skewY:oe.degreeT("--chakra-skew-y"),scaleX:oe.prop("--chakra-scale-x"),scaleY:oe.prop("--chakra-scale-y"),scale:oe.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:oe.degreeT("--chakra-rotate")},BQ={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:oe.prop("transitionDuration","transition.duration"),transitionProperty:oe.prop("transitionProperty","transition.property"),transitionTimingFunction:oe.prop("transitionTimingFunction","transition.easing")},zQ={fontFamily:oe.prop("fontFamily","fonts"),fontSize:oe.prop("fontSize","fontSizes",sn.px),fontWeight:oe.prop("fontWeight","fontWeights"),lineHeight:oe.prop("lineHeight","lineHeights"),letterSpacing:oe.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},FQ={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:oe.spaceT("scrollMargin"),scrollMarginTop:oe.spaceT("scrollMarginTop"),scrollMarginBottom:oe.spaceT("scrollMarginBottom"),scrollMarginLeft:oe.spaceT("scrollMarginLeft"),scrollMarginRight:oe.spaceT("scrollMarginRight"),scrollMarginX:oe.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:oe.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:oe.spaceT("scrollPadding"),scrollPaddingTop:oe.spaceT("scrollPaddingTop"),scrollPaddingBottom:oe.spaceT("scrollPaddingBottom"),scrollPaddingLeft:oe.spaceT("scrollPaddingLeft"),scrollPaddingRight:oe.spaceT("scrollPaddingRight"),scrollPaddingX:oe.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:oe.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function OD(e){return Ls(e)&&e.reference?e.reference:String(e)}var tS=(e,...t)=>t.map(OD).join(` ${e} `).replace(/calc/g,""),tT=(...e)=>`calc(${tS("+",...e)})`,nT=(...e)=>`calc(${tS("-",...e)})`,oC=(...e)=>`calc(${tS("*",...e)})`,rT=(...e)=>`calc(${tS("/",...e)})`,iT=e=>{const t=OD(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:oC(t,-1)},Ff=Object.assign(e=>({add:(...t)=>Ff(tT(e,...t)),subtract:(...t)=>Ff(nT(e,...t)),multiply:(...t)=>Ff(oC(e,...t)),divide:(...t)=>Ff(rT(e,...t)),negate:()=>Ff(iT(e)),toString:()=>e.toString()}),{add:tT,subtract:nT,multiply:oC,divide:rT,negate:iT});function $Q(e,t="-"){return e.replace(/\s+/g,t)}function HQ(e){const t=$Q(e.toString());return VQ(WQ(t))}function WQ(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function VQ(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function UQ(e,t=""){return[t,e].filter(Boolean).join("-")}function GQ(e,t){return`var(${e}${t?`, ${t}`:""})`}function jQ(e,t=""){return HQ(`--${UQ(e,t)}`)}function Fn(e,t,n){const r=jQ(e,n);return{variable:r,reference:GQ(r,t)}}function YQ(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function qQ(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function aC(e){if(e==null)return e;const{unitless:t}=qQ(e);return t||typeof e=="number"?`${e}px`:e}var ID=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,t8=e=>Object.fromEntries(Object.entries(e).sort(ID));function oT(e){const t=t8(e);return Object.assign(Object.values(t),t)}function KQ(e){const t=Object.keys(t8(e));return new Set(t)}function aT(e){var n;if(!e)return e;e=(n=aC(e))!=null?n:e;const t=e.endsWith("px")?-1:-.0625;return typeof e=="number"?`${e+t}`:e.replace(new RegExp("(\\d+\\.?\\d*)","u"),r=>`${parseFloat(r)+t}`)}function ym(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${aC(e)})`),t&&n.push("and",`(max-width: ${aC(t)})`),n.join(" ")}function XQ(e){var o;if(!e)return null;e.base=(o=e.base)!=null?o:"0px";const t=oT(e),n=Object.entries(e).sort(ID).map(([a,s],l,u)=>{var g;let[,h]=(g=u[l+1])!=null?g:[];return h=parseFloat(h)>0?aT(h):void 0,{_minW:aT(s),breakpoint:a,minW:s,maxW:h,maxWQuery:ym(null,h),minWQuery:ym(s),minMaxQuery:ym(s,h)}}),r=KQ(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>r.has(l))},asObject:t8(e),asArray:oT(e),details:n,media:[null,...t.map(a=>ym(a)).slice(1)],toArrayValue(a){if(!Ls(a))throw new Error("toArrayValue: value must be an object");const s=i.map(l=>{var u;return(u=a[l])!=null?u:null});for(;YQ(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const h=i[u];return h!=null&&l!=null&&(s[h]=l),s},{})}}}var Ai={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},Ic=e=>DD(t=>e(t,"&"),"[role=group]","[data-group]",".group"),du=e=>DD(t=>e(t,"~ &"),"[data-peer]",".peer"),DD=(e,...t)=>t.map(e).join(", "),nS={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:Ic(Ai.hover),_peerHover:du(Ai.hover),_groupFocus:Ic(Ai.focus),_peerFocus:du(Ai.focus),_groupFocusVisible:Ic(Ai.focusVisible),_peerFocusVisible:du(Ai.focusVisible),_groupActive:Ic(Ai.active),_peerActive:du(Ai.active),_groupDisabled:Ic(Ai.disabled),_peerDisabled:du(Ai.disabled),_groupInvalid:Ic(Ai.invalid),_peerInvalid:du(Ai.invalid),_groupChecked:Ic(Ai.checked),_peerChecked:du(Ai.checked),_groupFocusWithin:Ic(Ai.focusWithin),_peerFocusWithin:du(Ai.focusWithin),_peerPlaceholderShown:du(Ai.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},ZQ=Object.keys(nS);function sT(e,t){return Fn(String(e).replace(/\./g,"-"),void 0,t)}function QQ(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=sT(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const m=i.split("."),[v,...b]=m,w=`${v}.-${b.join(".")}`,P=Ff.negate(s),E=Ff.negate(u);r[w]={value:P,var:l,varRef:E}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const h=m=>{const b=[String(i).split(".")[0],m].join(".");if(!e[b])return m;const{reference:P}=sT(b,t==null?void 0:t.cssVarPrefix);return P},g=Ls(s)?s:{default:s};n=Cl(n,Object.entries(g).reduce((m,[v,b])=>{var _;var w;const P=h(b);if(v==="default")return m[l]=P,m;const E=(_=(w=nS)==null?void 0:w[v])!=null?_:v;return m[E]={[l]:P},m},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function JQ(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function eJ(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var tJ=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur"];function nJ(e){return eJ(e,tJ)}function rJ(e){return e.semanticTokens}function iJ(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function oJ({tokens:e,semanticTokens:t}){var i,o;const n=Object.entries((i=sC(e))!=null?i:{}).map(([a,s])=>[a,{isSemantic:!1,value:s}]),r=Object.entries((o=sC(t,1))!=null?o:{}).map(([a,s])=>[a,{isSemantic:!0,value:s}]);return Object.fromEntries([...n,...r])}function sC(e,t=1/0){return!Ls(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(Ls(i)||Array.isArray(i)?Object.entries(sC(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function aJ(e){var t;const n=iJ(e),r=nJ(n),i=rJ(n),o=oJ({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=QQ(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:XQ(n.breakpoints)}),n}var n8=Cl({},H3,vn,_Q,W5,Ia,kQ,IQ,EQ,RD,OQ,Wm,iC,Qn,FQ,zQ,DQ,NQ,PQ,BQ),sJ=Object.assign({},Qn,Ia,W5,RD,Wm),lJ=Object.keys(sJ),uJ=[...Object.keys(n8),...ZQ],cJ={...n8,...nS},dJ=e=>e in cJ,fJ=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=Gf(e[a],t);if(s==null)continue;if(s=Ls(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!pJ(t),mJ=(e,t)=>{var a,s;if(t==null)return t;const n=l=>{var u,h;return(h=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:h.varRef},r=l=>{var u;return(u=n(l))!=null?u:l},[i,o]=hJ(t);return t=(s=(a=n(i))!=null?a:r(o))!=null?s:r(t),t};function vJ(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var g,m;var s;const l=Gf(o,r),u=fJ(l)(r);let h={};for(let v in u){const b=u[v];let w=Gf(b,r);v in n&&(v=n[v]),gJ(v,w)&&(w=mJ(r,w));let P=t[v];if(P===!0&&(P={property:v}),Ls(w)){h[v]=(g=h[v])!=null?g:{},h[v]=Cl({},h[v],i(w,!0));continue}let E=(m=(s=P==null?void 0:P.transform)==null?void 0:s.call(P,w,r,l))!=null?m:w;E=P!=null&&P.processResult?i(E,!0):E;const _=Gf(P==null?void 0:P.property,r);if(!a&&(P==null?void 0:P.static)){const T=Gf(P.static,r);h=Cl({},h,T)}if(_&&Array.isArray(_)){for(const T of _)h[T]=E;continue}if(_){_==="&"&&Ls(E)?h=Cl({},h,E):h[_]=E;continue}if(Ls(E)){h=Cl({},h,E);continue}h[v]=E}return h};return i}var ND=e=>t=>vJ({theme:t,pseudos:nS,configs:n8})(e);function er(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function yJ(e,t){if(Array.isArray(e))return e;if(Ls(e))return t(e);if(e!=null)return[e]}function SJ(e,t){for(let n=t+1;n{Cl(u,{[T]:m?_[T]:{[E]:_[T]}})});continue}if(!v){m?Cl(u,_):u[E]=_;continue}u[E]=_}}return u}}function xJ(e){return t=>{var a;const{variant:n,size:r,theme:i}=t,o=bJ(i);return Cl({},Gf((a=e.baseStyle)!=null?a:{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function wJ(e,t,n){var o;var r,i;return(o=(i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)!=null?o:n}function bn(e){return JQ(e,["styleConfig","size","variant","colorScheme"])}function CJ(e){if(e.sheet)return e.sheet;for(var t=0;t0?Oi(y1,--Ho):0,e1--,jr===10&&(e1=1,iS--),jr}function ha(){return jr=Ho<$D?Oi(y1,Ho++):0,e1++,jr===10&&(e1=1,iS++),jr}function Tl(){return Oi(y1,Ho)}function W3(){return Ho}function o2(e,t){return Pv(y1,e,t)}function Tv(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function HD(e){return iS=e1=1,$D=vl(y1=e),Ho=0,[]}function WD(e){return y1="",e}function V3(e){return FD(o2(Ho-1,uC(e===91?e+2:e===40?e+1:e)))}function IJ(e){for(;(jr=Tl())&&jr<33;)ha();return Tv(e)>2||Tv(jr)>3?"":" "}function DJ(e,t){for(;--t&&ha()&&!(jr<48||jr>102||jr>57&&jr<65||jr>70&&jr<97););return o2(e,W3()+(t<6&&Tl()==32&&ha()==32))}function uC(e){for(;ha();)switch(jr){case e:return Ho;case 34:case 39:e!==34&&e!==39&&uC(jr);break;case 40:e===41&&uC(e);break;case 92:ha();break}return Ho}function NJ(e,t){for(;ha()&&e+jr!==47+10;)if(e+jr===42+42&&Tl()===47)break;return"/*"+o2(t,Ho-1)+"*"+rS(e===47?e:ha())}function BJ(e){for(;!Tv(Tl());)ha();return o2(e,Ho)}function zJ(e){return WD(U3("",null,null,null,[""],e=HD(e),0,[0],e))}function U3(e,t,n,r,i,o,a,s,l){for(var u=0,h=0,g=a,m=0,v=0,b=0,w=1,P=1,E=1,_=0,T="",M=i,O=o,I=r,D=T;P;)switch(b=_,_=ha()){case 40:if(b!=108&&Oi(D,g-1)==58){lC(D+=kn(V3(_),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:D+=V3(_);break;case 9:case 10:case 13:case 32:D+=IJ(b);break;case 92:D+=DJ(W3()-1,7);continue;case 47:switch(Tl()){case 42:case 47:By(FJ(NJ(ha(),W3()),t,n),l);break;default:D+="/"}break;case 123*w:s[u++]=vl(D)*E;case 125*w:case 59:case 0:switch(_){case 0:case 125:P=0;case 59+h:v>0&&vl(D)-g&&By(v>32?uT(D+";",r,n,g-1):uT(kn(D," ","")+";",r,n,g-2),l);break;case 59:D+=";";default:if(By(I=lT(D,t,n,u,h,i,s,T,M=[],O=[],g),o),_===123)if(h===0)U3(D,t,I,I,M,o,g,s,O);else switch(m===99&&Oi(D,3)===110?100:m){case 100:case 109:case 115:U3(e,I,I,r&&By(lT(e,I,I,0,0,i,s,T,i,M=[],g),O),i,O,g,s,r?M:O);break;default:U3(D,I,I,I,[""],O,0,s,O)}}u=h=v=0,w=E=1,T=D="",g=a;break;case 58:g=1+vl(D),v=b;default:if(w<1){if(_==123)--w;else if(_==125&&w++==0&&OJ()==125)continue}switch(D+=rS(_),_*w){case 38:E=h>0?1:(D+="\f",-1);break;case 44:s[u++]=(vl(D)-1)*E,E=1;break;case 64:Tl()===45&&(D+=V3(ha())),m=Tl(),h=g=vl(T=D+=BJ(W3())),_++;break;case 45:b===45&&vl(D)==2&&(w=0)}}return o}function lT(e,t,n,r,i,o,a,s,l,u,h){for(var g=i-1,m=i===0?o:[""],v=o8(m),b=0,w=0,P=0;b0?m[E]+" "+_:kn(_,/&\f/g,m[E])))&&(l[P++]=T);return oS(e,t,n,i===0?r8:s,l,u,h)}function FJ(e,t,n){return oS(e,t,n,BD,rS(RJ()),Pv(e,2,-2),0)}function uT(e,t,n,r){return oS(e,t,n,i8,Pv(e,0,r),Pv(e,r+1,-1),r)}function E0(e,t){for(var n="",r=o8(e),i=0;i6)switch(Oi(e,t+1)){case 109:if(Oi(e,t+4)!==45)break;case 102:return kn(e,/(.+:)(.+)-([^]+)/,"$1"+yn+"$2-$3$1"+V5+(Oi(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~lC(e,"stretch")?UD(kn(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Oi(e,t+1)!==115)break;case 6444:switch(Oi(e,vl(e)-3-(~lC(e,"!important")&&10))){case 107:return kn(e,":",":"+yn)+e;case 101:return kn(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+yn+(Oi(e,14)===45?"inline-":"")+"box$3$1"+yn+"$2$3$1"+Vi+"$2box$3")+e}break;case 5936:switch(Oi(e,t+11)){case 114:return yn+e+Vi+kn(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return yn+e+Vi+kn(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return yn+e+Vi+kn(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return yn+e+Vi+e+e}return e}var qJ=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case i8:t.return=UD(t.value,t.length);break;case zD:return E0([Xg(t,{value:kn(t.value,"@","@"+yn)})],i);case r8:if(t.length)return MJ(t.props,function(o){switch(AJ(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return E0([Xg(t,{props:[kn(o,/:(read-\w+)/,":"+V5+"$1")]})],i);case"::placeholder":return E0([Xg(t,{props:[kn(o,/:(plac\w+)/,":"+yn+"input-$1")]}),Xg(t,{props:[kn(o,/:(plac\w+)/,":"+V5+"$1")]}),Xg(t,{props:[kn(o,/:(plac\w+)/,Vi+"input-$1")]})],i)}return""})}},KJ=[qJ],GD=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var P=w.getAttribute("data-emotion");P.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var i=t.stylisPlugins||KJ,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(w){for(var P=w.getAttribute("data-emotion").split(" "),E=1;E=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var aee={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},see=/[A-Z]|^ms/g,lee=/_EMO_([^_]+?)_([^]*?)_EMO_/g,QD=function(t){return t.charCodeAt(1)===45},fT=function(t){return t!=null&&typeof t!="boolean"},Nx=VD(function(e){return QD(e)?e:e.replace(see,"-$&").toLowerCase()}),hT=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(lee,function(r,i,o){return yl={name:i,styles:o,next:yl},i})}return aee[t]!==1&&!QD(t)&&typeof n=="number"&&n!==0?n+"px":n};function Lv(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return yl={name:n.name,styles:n.styles,next:yl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)yl={name:r.name,styles:r.styles,next:yl},r=r.next;var i=n.styles+";";return i}return uee(e,t,n)}case"function":{if(e!==void 0){var o=yl,a=n(e);return yl=o,Lv(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function uee(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{t.includes(r)||(n[r]=e[r])}),n}function Eee(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},oN=Pee(Eee);function aN(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var sN=e=>aN(e,t=>t!=null);function Tee(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Lee=Tee();function lN(e,...t){return _ee(e)?e(...t):e}function Aee(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}Object.freeze(["base","sm","md","lg","xl","2xl"]);function Mee(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=C.exports.createContext(void 0);i.displayName=r;function o(){var a;const s=C.exports.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}var Ree=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Oee=VD(function(e){return Ree.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Iee=Oee,Dee=function(t){return t!=="theme"},vT=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?Iee:Dee},yT=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},Nee=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return XD(n,r,i),dee(function(){return ZD(n,r,i)}),null},Bee=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=yT(t,n,r),l=s||vT(i),u=!l("as");return function(){var h=arguments,g=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&g.push("label:"+o+";"),h[0]==null||h[0].raw===void 0)g.push.apply(g,h);else{g.push(h[0][0]);for(var m=h.length,v=1;v[g,m.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([g,m])=>[g,m.className]))}function l(h){const v=`chakra-${(["container","root"].includes(h!=null?h:"")?[e]:[e,h]).filter(Boolean).join("__")}`;return{className:v,selector:`.${v}`,toString:()=>h}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var Fee=En("accordion").parts("root","container","button","panel").extend("icon"),$ee=En("alert").parts("title","description","container").extend("icon","spinner"),Hee=En("avatar").parts("label","badge","container").extend("excessLabel","group"),Wee=En("breadcrumb").parts("link","item","container").extend("separator");En("button").parts();var Vee=En("checkbox").parts("control","icon","container").extend("label");En("progress").parts("track","filledTrack").extend("label");var Uee=En("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Gee=En("editable").parts("preview","input","textarea"),jee=En("form").parts("container","requiredIndicator","helperText"),Yee=En("formError").parts("text","icon"),qee=En("input").parts("addon","field","element"),Kee=En("list").parts("container","item","icon"),Xee=En("menu").parts("button","list","item").extend("groupTitle","command","divider"),Zee=En("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Qee=En("numberinput").parts("root","field","stepperGroup","stepper");En("pininput").parts("field");var Jee=En("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),ete=En("progress").parts("label","filledTrack","track"),tte=En("radio").parts("container","control","label"),nte=En("select").parts("field","icon"),rte=En("slider").parts("container","track","thumb","filledTrack","mark"),ite=En("stat").parts("container","label","helpText","number","icon"),ote=En("switch").parts("container","track","thumb"),ate=En("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),ste=En("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),lte=En("tag").parts("container","label","closeButton"),ute=En("card").parts("container","header","body","footer");function Di(e,t){cte(e)&&(e="100%");var n=dte(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function zy(e){return Math.min(1,Math.max(0,e))}function cte(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function dte(e){return typeof e=="string"&&e.indexOf("%")!==-1}function uN(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Fy(e){return e<=1?"".concat(Number(e)*100,"%"):e}function jf(e){return e.length===1?"0"+e:String(e)}function fte(e,t,n){return{r:Di(e,255)*255,g:Di(t,255)*255,b:Di(n,255)*255}}function ST(e,t,n){e=Di(e,255),t=Di(t,255),n=Di(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=0,s=(r+i)/2;if(r===i)a=0,o=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function hte(e,t,n){var r,i,o;if(e=Di(e,360),t=Di(t,100),n=Di(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=Bx(s,a,e+1/3),i=Bx(s,a,e),o=Bx(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function bT(e,t,n){e=Di(e,255),t=Di(t,255),n=Di(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t>16,g:(e&65280)>>8,b:e&255}}var hC={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function yte(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof e=="string"&&(e=xte(e)),typeof e=="object"&&(fu(e.r)&&fu(e.g)&&fu(e.b)?(t=fte(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):fu(e.h)&&fu(e.s)&&fu(e.v)?(r=Fy(e.s),i=Fy(e.v),t=pte(e.h,r,i),a=!0,s="hsv"):fu(e.h)&&fu(e.s)&&fu(e.l)&&(r=Fy(e.s),o=Fy(e.l),t=hte(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=uN(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Ste="[-\\+]?\\d+%?",bte="[-\\+]?\\d*\\.\\d+%?",Zc="(?:".concat(bte,")|(?:").concat(Ste,")"),zx="[\\s|\\(]+(".concat(Zc,")[,|\\s]+(").concat(Zc,")[,|\\s]+(").concat(Zc,")\\s*\\)?"),Fx="[\\s|\\(]+(".concat(Zc,")[,|\\s]+(").concat(Zc,")[,|\\s]+(").concat(Zc,")[,|\\s]+(").concat(Zc,")\\s*\\)?"),ys={CSS_UNIT:new RegExp(Zc),rgb:new RegExp("rgb"+zx),rgba:new RegExp("rgba"+Fx),hsl:new RegExp("hsl"+zx),hsla:new RegExp("hsla"+Fx),hsv:new RegExp("hsv"+zx),hsva:new RegExp("hsva"+Fx),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function xte(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(hC[e])e=hC[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=ys.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=ys.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=ys.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=ys.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=ys.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=ys.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=ys.hex8.exec(e),n?{r:la(n[1]),g:la(n[2]),b:la(n[3]),a:wT(n[4]),format:t?"name":"hex8"}:(n=ys.hex6.exec(e),n?{r:la(n[1]),g:la(n[2]),b:la(n[3]),format:t?"name":"hex"}:(n=ys.hex4.exec(e),n?{r:la(n[1]+n[1]),g:la(n[2]+n[2]),b:la(n[3]+n[3]),a:wT(n[4]+n[4]),format:t?"name":"hex8"}:(n=ys.hex3.exec(e),n?{r:la(n[1]+n[1]),g:la(n[2]+n[2]),b:la(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function fu(e){return Boolean(ys.CSS_UNIT.exec(String(e)))}var a2=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=vte(t)),this.originalInput=t;var i=yte(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,a=t.g/255,s=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=uN(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=bT(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=bT(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=ST(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=ST(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),xT(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),gte(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(Di(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(Di(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+xT(this.r,this.g,this.b,!1),n=0,r=Object.entries(hC);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=zy(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=zy(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=zy(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=zy(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(a)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:i,v:o})),o=(o+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(cN(e));return e.count=t,n}var r=wte(e.hue,e.seed),i=Cte(r,e),o=_te(r,i,e),a={h:r,s:i,v:o};return e.alpha!==void 0&&(a.a=e.alpha),new a2(a)}function wte(e,t){var n=Ete(e),r=U5(n,t);return r<0&&(r=360+r),r}function Cte(e,t){if(t.hue==="monochrome")return 0;if(t.luminosity==="random")return U5([0,100],t.seed);var n=dN(e).saturationRange,r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55;break}return U5([r,i],t.seed)}function _te(e,t,n){var r=kte(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100;break}return U5([r,i],n.seed)}function kte(e,t){for(var n=dN(e).lowerBounds,r=0;r=i&&t<=a){var l=(s-o)/(a-i),u=o-l*i;return l*t+u}}return 0}function Ete(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if(typeof e=="string"){var n=hN.find(function(a){return a.name===e});if(n){var r=fN(n);if(r.hueRange)return r.hueRange}var i=new a2(e);if(i.isValid){var o=i.toHsv().h;return[o,o]}}return[0,360]}function dN(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=hN;t=i.hueRange[0]&&e<=i.hueRange[1])return i}throw Error("Color not found")}function U5(e,t){if(t===void 0)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0;t=(t*9301+49297)%233280;var i=t/233280;return Math.floor(r+i*(n-r))}function fN(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],i=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,i]}}var hN=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function Pte(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,ao=(e,t,n)=>{const r=Pte(e,`colors.${t}`,t),{isValid:i}=new a2(r);return i?r:n},Lte=e=>t=>{const n=ao(t,e);return new a2(n).isDark()?"dark":"light"},Ate=e=>t=>Lte(e)(t)==="dark",t1=(e,t)=>n=>{const r=ao(n,e);return new a2(r).setAlpha(t).toRgbString()};function CT(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( 45deg, ${t} 25%, transparent 25%, transparent 50%, ${t} 50%, ${t} 75%, transparent 75%, transparent )`,backgroundSize:`${e} ${e}`}}function Mte(e){const t=cN().toHexString();return!e||Tte(e)?t:e.string&&e.colors?Ote(e.string,e.colors):e.string&&!e.colors?Rte(e.string):e.colors&&!e.string?Ite(e.colors):t}function Rte(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function Ote(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function d8(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function Dte(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function pN(e){return Dte(e)&&e.reference?e.reference:String(e)}var yS=(e,...t)=>t.map(pN).join(` ${e} `).replace(/calc/g,""),_T=(...e)=>`calc(${yS("+",...e)})`,kT=(...e)=>`calc(${yS("-",...e)})`,pC=(...e)=>`calc(${yS("*",...e)})`,ET=(...e)=>`calc(${yS("/",...e)})`,PT=e=>{const t=pN(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:pC(t,-1)},yu=Object.assign(e=>({add:(...t)=>yu(_T(e,...t)),subtract:(...t)=>yu(kT(e,...t)),multiply:(...t)=>yu(pC(e,...t)),divide:(...t)=>yu(ET(e,...t)),negate:()=>yu(PT(e)),toString:()=>e.toString()}),{add:_T,subtract:kT,multiply:pC,divide:ET,negate:PT});function Nte(e){return!Number.isInteger(parseFloat(e.toString()))}function Bte(e,t="-"){return e.replace(/\s+/g,t)}function gN(e){const t=Bte(e.toString());return t.includes("\\.")?e:Nte(e)?t.replace(".","\\."):e}function zte(e,t=""){return[t,gN(e)].filter(Boolean).join("-")}function Fte(e,t){return`var(${gN(e)}${t?`, ${t}`:""})`}function $te(e,t=""){return`--${zte(e,t)}`}function li(e,t){const n=$te(e,t==null?void 0:t.prefix);return{variable:n,reference:Fte(n,Hte(t==null?void 0:t.fallback))}}function Hte(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{definePartsStyle:Wte,defineMultiStyleConfig:Vte}=er(Fee.keys),Ute={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},Gte={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},jte={pt:"2",px:"4",pb:"5"},Yte={fontSize:"1.25em"},qte=Wte({container:Ute,button:Gte,panel:jte,icon:Yte}),Kte=Vte({baseStyle:qte}),{definePartsStyle:s2,defineMultiStyleConfig:Xte}=er($ee.keys),pa=Fn("alert-fg"),Au=Fn("alert-bg"),Zte=s2({container:{bg:Au.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:pa.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:pa.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function f8(e){const{theme:t,colorScheme:n}=e,r=t1(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var Qte=s2(e=>{const{colorScheme:t}=e,n=f8(e);return{container:{[pa.variable]:`colors.${t}.500`,[Au.variable]:n.light,_dark:{[pa.variable]:`colors.${t}.200`,[Au.variable]:n.dark}}}}),Jte=s2(e=>{const{colorScheme:t}=e,n=f8(e);return{container:{[pa.variable]:`colors.${t}.500`,[Au.variable]:n.light,_dark:{[pa.variable]:`colors.${t}.200`,[Au.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:pa.reference}}}),ene=s2(e=>{const{colorScheme:t}=e,n=f8(e);return{container:{[pa.variable]:`colors.${t}.500`,[Au.variable]:n.light,_dark:{[pa.variable]:`colors.${t}.200`,[Au.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:pa.reference}}}),tne=s2(e=>{const{colorScheme:t}=e;return{container:{[pa.variable]:"colors.white",[Au.variable]:`colors.${t}.500`,_dark:{[pa.variable]:"colors.gray.900",[Au.variable]:`colors.${t}.200`},color:pa.reference}}}),nne={subtle:Qte,"left-accent":Jte,"top-accent":ene,solid:tne},rne=Xte({baseStyle:Zte,variants:nne,defaultProps:{variant:"subtle",colorScheme:"blue"}}),mN={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},ine={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},one={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},ane={...mN,...ine,container:one},vN=ane,sne=e=>typeof e=="function";function uo(e,...t){return sne(e)?e(...t):e}var{definePartsStyle:yN,defineMultiStyleConfig:lne}=er(Hee.keys),P0=Fn("avatar-border-color"),$x=Fn("avatar-bg"),une={borderRadius:"full",border:"0.2em solid",[P0.variable]:"white",_dark:{[P0.variable]:"colors.gray.800"},borderColor:P0.reference},cne={[$x.variable]:"colors.gray.200",_dark:{[$x.variable]:"colors.whiteAlpha.400"},bgColor:$x.reference},TT=Fn("avatar-background"),dne=e=>{const{name:t,theme:n}=e,r=t?Mte({string:t}):"colors.gray.400",i=Ate(r)(n);let o="white";return i||(o="gray.800"),{bg:TT.reference,"&:not([data-loaded])":{[TT.variable]:r},color:o,[P0.variable]:"colors.white",_dark:{[P0.variable]:"colors.gray.800"},borderColor:P0.reference,verticalAlign:"top"}},fne=yN(e=>({badge:uo(une,e),excessLabel:uo(cne,e),container:uo(dne,e)}));function Dc(e){const t=e!=="100%"?vN[e]:void 0;return yN({container:{width:e,height:e,fontSize:`calc(${t!=null?t:e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t!=null?t:e} / 2.5)`,lineHeight:e!=="100%"?t!=null?t:e:void 0}})}var hne={"2xs":Dc(4),xs:Dc(6),sm:Dc(8),md:Dc(12),lg:Dc(16),xl:Dc(24),"2xl":Dc(32),full:Dc("100%")},pne=lne({baseStyle:fne,sizes:hne,defaultProps:{size:"md"}}),gne={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},T0=Fn("badge-bg"),_l=Fn("badge-color"),mne=e=>{const{colorScheme:t,theme:n}=e,r=t1(`${t}.500`,.6)(n);return{[T0.variable]:`colors.${t}.500`,[_l.variable]:"colors.white",_dark:{[T0.variable]:r,[_l.variable]:"colors.whiteAlpha.800"},bg:T0.reference,color:_l.reference}},vne=e=>{const{colorScheme:t,theme:n}=e,r=t1(`${t}.200`,.16)(n);return{[T0.variable]:`colors.${t}.100`,[_l.variable]:`colors.${t}.800`,_dark:{[T0.variable]:r,[_l.variable]:`colors.${t}.200`},bg:T0.reference,color:_l.reference}},yne=e=>{const{colorScheme:t,theme:n}=e,r=t1(`${t}.200`,.8)(n);return{[_l.variable]:`colors.${t}.500`,_dark:{[_l.variable]:r},color:_l.reference,boxShadow:`inset 0 0 0px 1px ${_l.reference}`}},Sne={solid:mne,subtle:vne,outline:yne},Um={baseStyle:gne,variants:Sne,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:bne,definePartsStyle:xne}=er(Wee.keys),wne={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Cne=xne({link:wne}),_ne=bne({baseStyle:Cne}),kne={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},SN=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:St("inherit","whiteAlpha.900")(e),_hover:{bg:St("gray.100","whiteAlpha.200")(e)},_active:{bg:St("gray.200","whiteAlpha.300")(e)}};const r=t1(`${t}.200`,.12)(n),i=t1(`${t}.200`,.24)(n);return{color:St(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:St(`${t}.50`,r)(e)},_active:{bg:St(`${t}.100`,i)(e)}}},Ene=e=>{const{colorScheme:t}=e,n=St("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached] > &:not(:last-of-type)":{marginEnd:"-1px"},...uo(SN,e)}},Pne={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},Tne=e=>{var s;const{colorScheme:t}=e;if(t==="gray"){const l=St("gray.100","whiteAlpha.200")(e);return{bg:l,_hover:{bg:St("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:St("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=(s=Pne[t])!=null?s:{},a=St(n,`${t}.200`)(e);return{bg:a,color:St(r,"gray.800")(e),_hover:{bg:St(i,`${t}.300`)(e),_disabled:{bg:a}},_active:{bg:St(o,`${t}.400`)(e)}}},Lne=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:St(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:St(`${t}.700`,`${t}.500`)(e)}}},Ane={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},Mne={ghost:SN,outline:Ene,solid:Tne,link:Lne,unstyled:Ane},Rne={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},One={baseStyle:kne,variants:Mne,sizes:Rne,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:th,defineMultiStyleConfig:Ine}=er(ute.keys),G5=Fn("card-bg"),L0=Fn("card-padding"),Dne=th({container:{[G5.variable]:"chakra-body-bg",backgroundColor:G5.reference,color:"chakra-body-text"},body:{padding:L0.reference,flex:"1 1 0%"},header:{padding:L0.reference},footer:{padding:L0.reference}}),Nne={sm:th({container:{borderRadius:"base",[L0.variable]:"space.3"}}),md:th({container:{borderRadius:"md",[L0.variable]:"space.5"}}),lg:th({container:{borderRadius:"xl",[L0.variable]:"space.7"}})},Bne={elevated:th({container:{boxShadow:"base",_dark:{[G5.variable]:"colors.gray.700"}}}),outline:th({container:{borderWidth:"1px",borderColor:"chakra-border-color"}}),filled:th({container:{[G5.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{padding:0},header:{padding:0},footer:{padding:0}}},zne=Ine({baseStyle:Dne,variants:Bne,sizes:Nne,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:G3,defineMultiStyleConfig:Fne}=er(Vee.keys),Gm=Fn("checkbox-size"),$ne=e=>{const{colorScheme:t}=e;return{w:Gm.reference,h:Gm.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:St(`${t}.500`,`${t}.200`)(e),borderColor:St(`${t}.500`,`${t}.200`)(e),color:St("white","gray.900")(e),_hover:{bg:St(`${t}.600`,`${t}.300`)(e),borderColor:St(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:St("gray.200","transparent")(e),bg:St("gray.200","whiteAlpha.300")(e),color:St("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:St(`${t}.500`,`${t}.200`)(e),borderColor:St(`${t}.500`,`${t}.200`)(e),color:St("white","gray.900")(e)},_disabled:{bg:St("gray.100","whiteAlpha.100")(e),borderColor:St("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:St("red.500","red.300")(e)}}},Hne={_disabled:{cursor:"not-allowed"}},Wne={userSelect:"none",_disabled:{opacity:.4}},Vne={transitionProperty:"transform",transitionDuration:"normal"},Une=G3(e=>({icon:Vne,container:Hne,control:uo($ne,e),label:Wne})),Gne={sm:G3({control:{[Gm.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:G3({control:{[Gm.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:G3({control:{[Gm.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},j5=Fne({baseStyle:Une,sizes:Gne,defaultProps:{size:"md",colorScheme:"blue"}}),jm=li("close-button-size"),Zg=li("close-button-bg"),jne={w:[jm.reference],h:[jm.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[Zg.variable]:"colors.blackAlpha.100",_dark:{[Zg.variable]:"colors.whiteAlpha.100"}},_active:{[Zg.variable]:"colors.blackAlpha.200",_dark:{[Zg.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:Zg.reference},Yne={lg:{[jm.variable]:"sizes.10",fontSize:"md"},md:{[jm.variable]:"sizes.8",fontSize:"xs"},sm:{[jm.variable]:"sizes.6",fontSize:"2xs"}},qne={baseStyle:jne,sizes:Yne,defaultProps:{size:"md"}},{variants:Kne,defaultProps:Xne}=Um,Zne={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Qne={baseStyle:Zne,variants:Kne,defaultProps:Xne},Jne={w:"100%",mx:"auto",maxW:"prose",px:"4"},ere={baseStyle:Jne},tre={opacity:.6,borderColor:"inherit"},nre={borderStyle:"solid"},rre={borderStyle:"dashed"},ire={solid:nre,dashed:rre},ore={baseStyle:tre,variants:ire,defaultProps:{variant:"solid"}},{definePartsStyle:gC,defineMultiStyleConfig:are}=er(Uee.keys),Hx=Fn("drawer-bg"),Wx=Fn("drawer-box-shadow");function Ip(e){return gC(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var sre={bg:"blackAlpha.600",zIndex:"overlay"},lre={display:"flex",zIndex:"modal",justifyContent:"center"},ure=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[Hx.variable]:"colors.white",[Wx.variable]:"shadows.lg",_dark:{[Hx.variable]:"colors.gray.700",[Wx.variable]:"shadows.dark-lg"},bg:Hx.reference,boxShadow:Wx.reference}},cre={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},dre={position:"absolute",top:"2",insetEnd:"3"},fre={px:"6",py:"2",flex:"1",overflow:"auto"},hre={px:"6",py:"4"},pre=gC(e=>({overlay:sre,dialogContainer:lre,dialog:uo(ure,e),header:cre,closeButton:dre,body:fre,footer:hre})),gre={xs:Ip("xs"),sm:Ip("md"),md:Ip("lg"),lg:Ip("2xl"),xl:Ip("4xl"),full:Ip("full")},mre=are({baseStyle:pre,sizes:gre,defaultProps:{size:"xs"}}),{definePartsStyle:vre,defineMultiStyleConfig:yre}=er(Gee.keys),Sre={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},bre={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},xre={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},wre=vre({preview:Sre,input:bre,textarea:xre}),Cre=yre({baseStyle:wre}),{definePartsStyle:_re,defineMultiStyleConfig:kre}=er(jee.keys),A0=Fn("form-control-color"),Ere={marginStart:"1",[A0.variable]:"colors.red.500",_dark:{[A0.variable]:"colors.red.300"},color:A0.reference},Pre={mt:"2",[A0.variable]:"colors.gray.600",_dark:{[A0.variable]:"colors.whiteAlpha.600"},color:A0.reference,lineHeight:"normal",fontSize:"sm"},Tre=_re({container:{width:"100%",position:"relative"},requiredIndicator:Ere,helperText:Pre}),Lre=kre({baseStyle:Tre}),{definePartsStyle:Are,defineMultiStyleConfig:Mre}=er(Yee.keys),M0=Fn("form-error-color"),Rre={[M0.variable]:"colors.red.500",_dark:{[M0.variable]:"colors.red.300"},color:M0.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},Ore={marginEnd:"0.5em",[M0.variable]:"colors.red.500",_dark:{[M0.variable]:"colors.red.300"},color:M0.reference},Ire=Are({text:Rre,icon:Ore}),Dre=Mre({baseStyle:Ire}),Nre={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},Bre={baseStyle:Nre},zre={fontFamily:"heading",fontWeight:"bold"},Fre={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},$re={baseStyle:zre,sizes:Fre,defaultProps:{size:"xl"}},{definePartsStyle:xu,defineMultiStyleConfig:Hre}=er(qee.keys),Wre=xu({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),Nc={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},Vre={lg:xu({field:Nc.lg,addon:Nc.lg}),md:xu({field:Nc.md,addon:Nc.md}),sm:xu({field:Nc.sm,addon:Nc.sm}),xs:xu({field:Nc.xs,addon:Nc.xs})};function h8(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||St("blue.500","blue.300")(e),errorBorderColor:n||St("red.500","red.300")(e)}}var Ure=xu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=h8(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:St("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ao(t,r),boxShadow:`0 0 0 1px ${ao(t,r)}`},_focusVisible:{zIndex:1,borderColor:ao(t,n),boxShadow:`0 0 0 1px ${ao(t,n)}`}},addon:{border:"1px solid",borderColor:St("inherit","whiteAlpha.50")(e),bg:St("gray.100","whiteAlpha.300")(e)}}}),Gre=xu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=h8(e);return{field:{border:"2px solid",borderColor:"transparent",bg:St("gray.100","whiteAlpha.50")(e),_hover:{bg:St("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ao(t,r)},_focusVisible:{bg:"transparent",borderColor:ao(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:St("gray.100","whiteAlpha.50")(e)}}}),jre=xu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=h8(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ao(t,r),boxShadow:`0px 1px 0px 0px ${ao(t,r)}`},_focusVisible:{borderColor:ao(t,n),boxShadow:`0px 1px 0px 0px ${ao(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),Yre=xu({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),qre={outline:Ure,filled:Gre,flushed:jre,unstyled:Yre},Sn=Hre({baseStyle:Wre,sizes:Vre,variants:qre,defaultProps:{size:"md",variant:"outline"}}),Vx=Fn("kbd-bg"),Kre={[Vx.variable]:"colors.gray.100",_dark:{[Vx.variable]:"colors.whiteAlpha.100"},bg:Vx.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Xre={baseStyle:Kre},Zre={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Qre={baseStyle:Zre},{defineMultiStyleConfig:Jre,definePartsStyle:eie}=er(Kee.keys),tie={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},nie=eie({icon:tie}),rie=Jre({baseStyle:nie}),{defineMultiStyleConfig:iie,definePartsStyle:oie}=er(Xee.keys),ml=Fn("menu-bg"),Ux=Fn("menu-shadow"),aie={[ml.variable]:"#fff",[Ux.variable]:"shadows.sm",_dark:{[ml.variable]:"colors.gray.700",[Ux.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:ml.reference,boxShadow:Ux.reference},sie={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[ml.variable]:"colors.gray.100",_dark:{[ml.variable]:"colors.whiteAlpha.100"}},_active:{[ml.variable]:"colors.gray.200",_dark:{[ml.variable]:"colors.whiteAlpha.200"}},_expanded:{[ml.variable]:"colors.gray.100",_dark:{[ml.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:ml.reference},lie={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},uie={opacity:.6},cie={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},die={transitionProperty:"common",transitionDuration:"normal"},fie=oie({button:die,list:aie,item:sie,groupTitle:lie,command:uie,divider:cie}),hie=iie({baseStyle:fie}),{defineMultiStyleConfig:pie,definePartsStyle:mC}=er(Zee.keys),gie={bg:"blackAlpha.600",zIndex:"modal"},mie=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto"}},vie=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:St("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:St("lg","dark-lg")(e)}},yie={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Sie={position:"absolute",top:"2",insetEnd:"3"},bie=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},xie={px:"6",py:"4"},wie=mC(e=>({overlay:gie,dialogContainer:uo(mie,e),dialog:uo(vie,e),header:yie,closeButton:Sie,body:uo(bie,e),footer:xie}));function ms(e){return mC(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var Cie={xs:ms("xs"),sm:ms("sm"),md:ms("md"),lg:ms("lg"),xl:ms("xl"),"2xl":ms("2xl"),"3xl":ms("3xl"),"4xl":ms("4xl"),"5xl":ms("5xl"),"6xl":ms("6xl"),full:ms("full")},_ie=pie({baseStyle:wie,sizes:Cie,defaultProps:{size:"md"}}),kie={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},bN=kie,{defineMultiStyleConfig:Eie,definePartsStyle:xN}=er(Qee.keys),p8=li("number-input-stepper-width"),wN=li("number-input-input-padding"),Pie=yu(p8).add("0.5rem").toString(),Gx=li("number-input-bg"),jx=li("number-input-color"),Yx=li("number-input-border-color"),Tie={[p8.variable]:"sizes.6",[wN.variable]:Pie},Lie=e=>{var n;var t;return(n=(t=uo(Sn.baseStyle,e))==null?void 0:t.field)!=null?n:{}},Aie={width:p8.reference},Mie={borderStart:"1px solid",borderStartColor:Yx.reference,color:jx.reference,bg:Gx.reference,[jx.variable]:"colors.chakra-body-text",[Yx.variable]:"colors.chakra-border-color",_dark:{[jx.variable]:"colors.whiteAlpha.800",[Yx.variable]:"colors.whiteAlpha.300"},_active:{[Gx.variable]:"colors.gray.200",_dark:{[Gx.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},Rie=xN(e=>{var t;return{root:Tie,field:(t=uo(Lie,e))!=null?t:{},stepperGroup:Aie,stepper:Mie}});function $y(e){var s;var t,n;const r=(t=Sn.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},o=(s=(n=r.field)==null?void 0:n.fontSize)!=null?s:"md",a=bN.fontSizes[o];return xN({field:{...r.field,paddingInlineEnd:wN.reference,verticalAlign:"top"},stepper:{fontSize:yu(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var Oie={xs:$y("xs"),sm:$y("sm"),md:$y("md"),lg:$y("lg")},Iie=Eie({baseStyle:Rie,sizes:Oie,variants:Sn.variants,defaultProps:Sn.defaultProps}),LT,Die={...(LT=Sn.baseStyle)==null?void 0:LT.field,textAlign:"center"},Nie={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},AT,hO,Bie={outline:e=>{var r;var t,n;return(r=(n=uo((t=Sn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var r;var t,n;return(r=(n=uo((t=Sn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var r;var t,n;return(r=(n=uo((t=Sn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(hO=(AT=Sn.variants)==null?void 0:AT.unstyled.field)!=null?hO:{}},zie={baseStyle:Die,sizes:Nie,variants:Bie,defaultProps:Sn.defaultProps},{defineMultiStyleConfig:Fie,definePartsStyle:$ie}=er(Jee.keys),Hy=li("popper-bg"),Hie=li("popper-arrow-bg"),MT=li("popper-arrow-shadow-color"),Wie={zIndex:10},Vie={[Hy.variable]:"colors.white",bg:Hy.reference,[Hie.variable]:Hy.reference,[MT.variable]:"colors.gray.200",_dark:{[Hy.variable]:"colors.gray.700",[MT.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},Uie={px:3,py:2,borderBottomWidth:"1px"},Gie={px:3,py:2},jie={px:3,py:2,borderTopWidth:"1px"},Yie={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},qie=$ie({popper:Wie,content:Vie,header:Uie,body:Gie,footer:jie,closeButton:Yie}),Kie=Fie({baseStyle:qie}),{defineMultiStyleConfig:Xie,definePartsStyle:Sm}=er(ete.keys),Zie=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=St(CT(),CT("1rem","rgba(0,0,0,0.1)"))(e),a=St(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( to right, transparent 0%, ${ao(n,a)} 50%, transparent 100% )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},Qie={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Jie=e=>({bg:St("gray.100","whiteAlpha.300")(e)}),eoe=e=>({transitionProperty:"common",transitionDuration:"slow",...Zie(e)}),toe=Sm(e=>({label:Qie,filledTrack:eoe(e),track:Jie(e)})),noe={xs:Sm({track:{h:"1"}}),sm:Sm({track:{h:"2"}}),md:Sm({track:{h:"3"}}),lg:Sm({track:{h:"4"}})},roe=Xie({sizes:noe,baseStyle:toe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:ioe,definePartsStyle:j3}=er(tte.keys),ooe=e=>{var t;const n=(t=uo(j5.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},aoe=j3(e=>{var t,n,r,i;return{label:(n=(t=j5).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=j5).baseStyle)==null?void 0:i.call(r,e).container,control:ooe(e)}}),soe={md:j3({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:j3({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:j3({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},loe=ioe({baseStyle:aoe,sizes:soe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:uoe,definePartsStyle:coe}=er(nte.keys),Wy=Fn("select-bg"),RT,doe={...(RT=Sn.baseStyle)==null?void 0:RT.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Wy.reference,[Wy.variable]:"colors.white",_dark:{[Wy.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Wy.reference}},foe={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},hoe=coe({field:doe,icon:foe}),Vy={paddingInlineEnd:"8"},OT,IT,DT,NT,BT,zT,FT,$T,poe={lg:{...(OT=Sn.sizes)==null?void 0:OT.lg,field:{...(IT=Sn.sizes)==null?void 0:IT.lg.field,...Vy}},md:{...(DT=Sn.sizes)==null?void 0:DT.md,field:{...(NT=Sn.sizes)==null?void 0:NT.md.field,...Vy}},sm:{...(BT=Sn.sizes)==null?void 0:BT.sm,field:{...(zT=Sn.sizes)==null?void 0:zT.sm.field,...Vy}},xs:{...(FT=Sn.sizes)==null?void 0:FT.xs,field:{...($T=Sn.sizes)==null?void 0:$T.xs.field,...Vy},icon:{insetEnd:"1"}}},goe=uoe({baseStyle:hoe,sizes:poe,variants:Sn.variants,defaultProps:Sn.defaultProps}),qx=Fn("skeleton-start-color"),Kx=Fn("skeleton-end-color"),moe={[qx.variable]:"colors.gray.100",[Kx.variable]:"colors.gray.400",_dark:{[qx.variable]:"colors.gray.800",[Kx.variable]:"colors.gray.600"},background:qx.reference,borderColor:Kx.reference,opacity:.7,borderRadius:"sm"},voe={baseStyle:moe},Xx=Fn("skip-link-bg"),yoe={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[Xx.variable]:"colors.white",_dark:{[Xx.variable]:"colors.gray.700"},bg:Xx.reference}},Soe={baseStyle:yoe},{defineMultiStyleConfig:boe,definePartsStyle:SS}=er(rte.keys),Rv=Fn("slider-thumb-size"),Ov=Fn("slider-track-size"),jc=Fn("slider-bg"),xoe=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...d8({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},woe=e=>({...d8({orientation:e.orientation,horizontal:{h:Ov.reference},vertical:{w:Ov.reference}}),overflow:"hidden",borderRadius:"sm",[jc.variable]:"colors.gray.200",_dark:{[jc.variable]:"colors.whiteAlpha.200"},_disabled:{[jc.variable]:"colors.gray.300",_dark:{[jc.variable]:"colors.whiteAlpha.300"}},bg:jc.reference}),Coe=e=>{const{orientation:t}=e;return{...d8({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:Rv.reference,h:Rv.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},_oe=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[jc.variable]:`colors.${t}.500`,_dark:{[jc.variable]:`colors.${t}.200`},bg:jc.reference}},koe=SS(e=>({container:xoe(e),track:woe(e),thumb:Coe(e),filledTrack:_oe(e)})),Eoe=SS({container:{[Rv.variable]:"sizes.4",[Ov.variable]:"sizes.1"}}),Poe=SS({container:{[Rv.variable]:"sizes.3.5",[Ov.variable]:"sizes.1"}}),Toe=SS({container:{[Rv.variable]:"sizes.2.5",[Ov.variable]:"sizes.0.5"}}),Loe={lg:Eoe,md:Poe,sm:Toe},Aoe=boe({baseStyle:koe,sizes:Loe,defaultProps:{size:"md",colorScheme:"blue"}}),$f=li("spinner-size"),Moe={width:[$f.reference],height:[$f.reference]},Roe={xs:{[$f.variable]:"sizes.3"},sm:{[$f.variable]:"sizes.4"},md:{[$f.variable]:"sizes.6"},lg:{[$f.variable]:"sizes.8"},xl:{[$f.variable]:"sizes.12"}},Ooe={baseStyle:Moe,sizes:Roe,defaultProps:{size:"md"}},{defineMultiStyleConfig:Ioe,definePartsStyle:CN}=er(ite.keys),Doe={fontWeight:"medium"},Noe={opacity:.8,marginBottom:"2"},Boe={verticalAlign:"baseline",fontWeight:"semibold"},zoe={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},Foe=CN({container:{},label:Doe,helpText:Noe,number:Boe,icon:zoe}),$oe={md:CN({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},Hoe=Ioe({baseStyle:Foe,sizes:$oe,defaultProps:{size:"md"}}),{defineMultiStyleConfig:Woe,definePartsStyle:Y3}=er(ote.keys),Ym=li("switch-track-width"),nh=li("switch-track-height"),Zx=li("switch-track-diff"),Voe=yu.subtract(Ym,nh),vC=li("switch-thumb-x"),Qg=li("switch-bg"),Uoe=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Ym.reference],height:[nh.reference],transitionProperty:"common",transitionDuration:"fast",[Qg.variable]:"colors.gray.300",_dark:{[Qg.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[Qg.variable]:`colors.${t}.500`,_dark:{[Qg.variable]:`colors.${t}.200`}},bg:Qg.reference}},Goe={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[nh.reference],height:[nh.reference],_checked:{transform:`translateX(${vC.reference})`}},joe=Y3(e=>({container:{[Zx.variable]:Voe,[vC.variable]:Zx.reference,_rtl:{[vC.variable]:yu(Zx).negate().toString()}},track:Uoe(e),thumb:Goe})),Yoe={sm:Y3({container:{[Ym.variable]:"1.375rem",[nh.variable]:"sizes.3"}}),md:Y3({container:{[Ym.variable]:"1.875rem",[nh.variable]:"sizes.4"}}),lg:Y3({container:{[Ym.variable]:"2.875rem",[nh.variable]:"sizes.6"}})},qoe=Woe({baseStyle:joe,sizes:Yoe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Koe,definePartsStyle:R0}=er(ate.keys),Xoe=R0({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Y5={"&[data-is-numeric=true]":{textAlign:"end"}},Zoe=R0(e=>{const{colorScheme:t}=e;return{th:{color:St("gray.600","gray.400")(e),borderBottom:"1px",borderColor:St(`${t}.100`,`${t}.700`)(e),...Y5},td:{borderBottom:"1px",borderColor:St(`${t}.100`,`${t}.700`)(e),...Y5},caption:{color:St("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Qoe=R0(e=>{const{colorScheme:t}=e;return{th:{color:St("gray.600","gray.400")(e),borderBottom:"1px",borderColor:St(`${t}.100`,`${t}.700`)(e),...Y5},td:{borderBottom:"1px",borderColor:St(`${t}.100`,`${t}.700`)(e),...Y5},caption:{color:St("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:St(`${t}.100`,`${t}.700`)(e)},td:{background:St(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Joe={simple:Zoe,striped:Qoe,unstyled:{}},eae={sm:R0({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:R0({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:R0({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},tae=Koe({baseStyle:Xoe,variants:Joe,sizes:eae,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Oo=Fn("tabs-color"),_s=Fn("tabs-bg"),Uy=Fn("tabs-border-color"),{defineMultiStyleConfig:nae,definePartsStyle:Ll}=er(ste.keys),rae=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},iae=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},oae=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},aae={p:4},sae=Ll(e=>({root:rae(e),tab:iae(e),tablist:oae(e),tabpanel:aae})),lae={sm:Ll({tab:{py:1,px:4,fontSize:"sm"}}),md:Ll({tab:{fontSize:"md",py:2,px:4}}),lg:Ll({tab:{fontSize:"lg",py:3,px:4}})},uae=Ll(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Oo.variable]:`colors.${t}.600`,_dark:{[Oo.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[_s.variable]:"colors.gray.200",_dark:{[_s.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Oo.reference,bg:_s.reference}}}),cae=Ll(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[Uy.reference]:"transparent",_selected:{[Oo.variable]:`colors.${t}.600`,[Uy.variable]:"colors.white",_dark:{[Oo.variable]:`colors.${t}.300`,[Uy.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:Uy.reference},color:Oo.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),dae=Ll(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[_s.variable]:"colors.gray.50",_dark:{[_s.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[_s.variable]:"colors.white",[Oo.variable]:`colors.${t}.600`,_dark:{[_s.variable]:"colors.gray.800",[Oo.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Oo.reference,bg:_s.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),fae=Ll(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:ao(n,`${t}.700`),bg:ao(n,`${t}.100`)}}}}),hae=Ll(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Oo.variable]:"colors.gray.600",_dark:{[Oo.variable]:"inherit"},_selected:{[Oo.variable]:"colors.white",[_s.variable]:`colors.${t}.600`,_dark:{[Oo.variable]:"colors.gray.800",[_s.variable]:`colors.${t}.300`}},color:Oo.reference,bg:_s.reference}}}),pae=Ll({}),gae={line:uae,enclosed:cae,"enclosed-colored":dae,"soft-rounded":fae,"solid-rounded":hae,unstyled:pae},mae=nae({baseStyle:sae,sizes:lae,variants:gae,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:vae,definePartsStyle:rh}=er(lte.keys),yae={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},Sae={lineHeight:1.2,overflow:"visible"},bae={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},xae=rh({container:yae,label:Sae,closeButton:bae}),wae={sm:rh({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:rh({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:rh({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},Cae={subtle:rh(e=>{var t;return{container:(t=Um.variants)==null?void 0:t.subtle(e)}}),solid:rh(e=>{var t;return{container:(t=Um.variants)==null?void 0:t.solid(e)}}),outline:rh(e=>{var t;return{container:(t=Um.variants)==null?void 0:t.outline(e)}})},_ae=vae({variants:Cae,baseStyle:xae,sizes:wae,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),HT,kae={...(HT=Sn.baseStyle)==null?void 0:HT.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},WT,pO,Eae={outline:e=>{var n;var t;return(n=(t=Sn.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var n;var t;return(n=(t=Sn.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var n;var t;return(n=(t=Sn.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(pO=(WT=Sn.variants)==null?void 0:WT.unstyled.field)!=null?pO:{}},VT,UT,GT,jT,gO,mO,vO,yO,Pae={xs:(gO=(VT=Sn.sizes)==null?void 0:VT.xs.field)!=null?gO:{},sm:(mO=(UT=Sn.sizes)==null?void 0:UT.sm.field)!=null?mO:{},md:(vO=(GT=Sn.sizes)==null?void 0:GT.md.field)!=null?vO:{},lg:(yO=(jT=Sn.sizes)==null?void 0:jT.lg.field)!=null?yO:{}},Tae={baseStyle:kae,sizes:Pae,variants:Eae,defaultProps:{size:"md",variant:"outline"}},Gy=li("tooltip-bg"),Qx=li("tooltip-fg"),Lae=li("popper-arrow-bg"),Aae={bg:Gy.reference,color:Qx.reference,[Gy.variable]:"colors.gray.700",[Qx.variable]:"colors.whiteAlpha.900",_dark:{[Gy.variable]:"colors.gray.300",[Qx.variable]:"colors.gray.900"},[Lae.variable]:Gy.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},Mae={baseStyle:Aae},Rae={Accordion:Kte,Alert:rne,Avatar:pne,Badge:Um,Breadcrumb:_ne,Button:One,Checkbox:j5,CloseButton:qne,Code:Qne,Container:ere,Divider:ore,Drawer:mre,Editable:Cre,Form:Lre,FormError:Dre,FormLabel:Bre,Heading:$re,Input:Sn,Kbd:Xre,Link:Qre,List:rie,Menu:hie,Modal:_ie,NumberInput:Iie,PinInput:zie,Popover:Kie,Progress:roe,Radio:loe,Select:goe,Skeleton:voe,SkipLink:Soe,Slider:Aoe,Spinner:Ooe,Stat:Hoe,Switch:qoe,Table:tae,Tabs:mae,Tag:_ae,Textarea:Tae,Tooltip:Mae,Card:zne},Oae={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},Iae=Oae,Dae={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},Nae=Dae,Bae={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},zae=Bae,Fae={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},$ae=Fae,Hae={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},Wae=Hae,Vae={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},Uae={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},Gae={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},jae={property:Vae,easing:Uae,duration:Gae},Yae=jae,qae={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Kae=qae,Xae={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Zae=Xae,Qae={breakpoints:Nae,zIndices:Kae,radii:$ae,blur:Zae,colors:zae,...bN,sizes:vN,shadows:Wae,space:mN,borders:Iae,transition:Yae},Jae={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},ese={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},tse="ltr",nse={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},rse={semanticTokens:Jae,direction:tse,...Qae,components:Rae,styles:ese,config:nse},ise=typeof Element<"u",ose=typeof Map=="function",ase=typeof Set=="function",sse=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function q3(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!q3(e[r],t[r]))return!1;return!0}var o;if(ose&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!q3(r.value[1],t.get(r.value[0])))return!1;return!0}if(ase&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(sse&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(ise&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!q3(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var lse=function(t,n){try{return q3(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function S1(){const e=C.exports.useContext(Av);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function _N(){const e=i2(),t=S1();return{...e,theme:t}}function use(e,t,n){var i,o;if(t==null)return t;const r=a=>{var s,l;return(l=(s=e.__breakpoints)==null?void 0:s.asArray)==null?void 0:l[a]};return(o=(i=r(t))!=null?i:r(n))!=null?o:n}function cse(e,t,n){var i,o;if(t==null)return t;const r=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.value};return(o=(i=r(t))!=null?i:r(n))!=null?o:n}function dse(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{var g,m;if(e==="breakpoints")return use(o,l,(g=a[u])!=null?g:l);const h=`${e}.${l}`;return cse(o,h,(m=a[u])!=null?m:l)});return Array.isArray(t)?s:s[0]}}function fse(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=C.exports.useMemo(()=>aJ(n),[n]);return X(gee,{theme:i,children:[S(hse,{root:t}),r]})}function hse({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return S(mS,{styles:n=>({[t]:n.__cssVars})})}Mee({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function pse(){const{colorMode:e}=i2();return S(mS,{styles:t=>{const n=oN(t,"styles.global"),r=lN(n,{theme:t,colorMode:e});return r?ND(r)(t):void 0}})}var gse=new Set([...uJ,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),mse=new Set(["htmlWidth","htmlHeight","htmlSize"]);function vse(e){return mse.has(e)||!gse.has(e)}var yse=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=aN(a,(g,m)=>dJ(m)),l=lN(e,t),u=Object.assign({},i,l,sN(s),o),h=ND(u)(t.theme);return r?[h,r]:h};function Jx(e,t){const{baseStyle:n,...r}=t!=null?t:{};r.shouldForwardProp||(r.shouldForwardProp=vse);const i=yse({baseStyle:n}),o=fC(e,r)(i);return se.forwardRef(function(l,u){const{colorMode:h,forced:g}=i2();return se.createElement(o,{ref:u,"data-theme":g?h:void 0,...l})})}function Pe(e){return C.exports.forwardRef(e)}function kN(e,t={}){var h;const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=_N(),a=e?oN(i,`components.${e}`):void 0,s=n||a,l=Cl({theme:i,colorMode:o},(h=s==null?void 0:s.defaultProps)!=null?h:{},sN(kee(r,["children"]))),u=C.exports.useRef({});if(s){const m=xJ(s)(l);lse(u.current,m)||(u.current=m)}return u.current}function ho(e,t={}){return kN(e,t)}function Bi(e,t={}){return kN(e,t)}function Sse(){const e=new Map;return new Proxy(Jx,{apply(t,n,r){return Jx(...r)},get(t,n){return e.has(n)||e.set(n,Jx(n)),e.get(n)}})}var xe=Sse();function bse(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Pn(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o}=e,a=C.exports.createContext(void 0);a.displayName=t;function s(){var l;const u=C.exports.useContext(a);if(!u&&n){const h=new Error(o!=null?o:bse(r,i));throw h.name="ContextError",(l=Error.captureStackTrace)==null||l.call(Error,h,s),h}return u}return[a.Provider,s,a]}function xse(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch(n){throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function Vn(...e){return t=>{e.forEach(n=>{xse(n,t)})}}function wse(...e){return C.exports.useMemo(()=>Vn(...e),e)}function YT(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var Cse=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function qT(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function KT(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var yC=typeof window<"u"?C.exports.useLayoutEffect:C.exports.useEffect,q5=e=>e,_se=class{constructor(){nn(this,"descendants",new Map);nn(this,"register",e=>{if(e!=null)return Cse(e)?this.registerNode(e):t=>{this.registerNode(t,e)}});nn(this,"unregister",e=>{this.descendants.delete(e);const t=YT(Array.from(this.descendants.keys()));this.assignIndex(t)});nn(this,"destroy",()=>{this.descendants.clear()});nn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})});nn(this,"count",()=>this.descendants.size);nn(this,"enabledCount",()=>this.enabledValues().length);nn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index));nn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled));nn(this,"item",e=>{if(this.count()!==0)return this.values()[e]});nn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]});nn(this,"first",()=>this.item(0));nn(this,"firstEnabled",()=>this.enabledItem(0));nn(this,"last",()=>this.item(this.descendants.size-1));nn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)});nn(this,"indexOf",e=>{var n;var t;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1});nn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e)));nn(this,"next",(e,t=!0)=>{const n=qT(e,this.count(),t);return this.item(n)});nn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=qT(r,this.enabledCount(),t);return this.enabledItem(i)});nn(this,"prev",(e,t=!0)=>{const n=KT(e,this.count()-1,t);return this.item(n)});nn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=KT(r,this.enabledCount()-1,t);return this.enabledItem(i)});nn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=YT(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function kse(){const e=C.exports.useRef(new _se);return yC(()=>()=>e.current.destroy()),e.current}var[Ese,EN]=Pn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function Pse(e){const t=EN(),[n,r]=C.exports.useState(-1),i=C.exports.useRef(null);yC(()=>()=>{!i.current||t.unregister(i.current)},[]),yC(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=q5(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:Vn(o,i)}}function PN(){return[q5(Ese),()=>q5(EN()),()=>kse(),i=>Pse(i)]}var Fr=(...e)=>e.filter(Boolean).join(" "),XT={path:X("g",{stroke:"currentColor",strokeWidth:"1.5",children:[S("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),S("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),S("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},wa=Pe((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,h=Fr("chakra-icon",s),g={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l},m={ref:t,focusable:o,className:h,__css:g},v=r!=null?r:XT.viewBox;if(n&&typeof n!="string")return se.createElement(xe.svg,{as:n,...m,...u});const b=a!=null?a:XT.path;return se.createElement(xe.svg,{verticalAlign:"middle",viewBox:v,...m,...u},b)});wa.displayName="Icon";function ut(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=C.exports.Children.toArray(e.path),a=Pe((s,l)=>S(wa,{ref:l,viewBox:t,...i,...s,children:o.length?o:S("path",{fill:"currentColor",d:n})}));return a.displayName=r,a}function hr(e,t=[]){const n=C.exports.useRef(e);return C.exports.useEffect(()=>{n.current=e}),C.exports.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function bS(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(m,v)=>m!==v}=e,o=hr(r),a=hr(i),[s,l]=C.exports.useState(n),u=t!==void 0,h=u?t:s,g=hr(m=>{const b=typeof m=="function"?m(h):m;!a(h,b)||(u||l(b),o(b))},[u,o,h,a]);return[h,g]}const g8=C.exports.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),xS=C.exports.createContext({});function Tse(){return C.exports.useContext(xS).visualElement}const b1=C.exports.createContext(null),wh=typeof document<"u",K5=wh?C.exports.useLayoutEffect:C.exports.useEffect,TN=C.exports.createContext({strict:!1});function Lse(e,t,n,r){const i=Tse(),o=C.exports.useContext(TN),a=C.exports.useContext(b1),s=C.exports.useContext(g8).reducedMotion,l=C.exports.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return K5(()=>{u&&u.render()}),C.exports.useEffect(()=>{u&&u.animationState&&u.animationState.animateChanges()}),K5(()=>()=>u&&u.notify("Unmount"),[]),u}function c0(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ase(e,t,n){return C.exports.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):c0(n)&&(n.current=r))},[t])}function Iv(e){return typeof e=="string"||Array.isArray(e)}function wS(e){return typeof e=="object"&&typeof e.start=="function"}const Mse=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function CS(e){return wS(e.animate)||Mse.some(t=>Iv(e[t]))}function LN(e){return Boolean(CS(e)||e.variants)}function Rse(e,t){if(CS(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Iv(n)?n:void 0,animate:Iv(r)?r:void 0}}return e.inherit!==!1?t:{}}function Ose(e){const{initial:t,animate:n}=Rse(e,C.exports.useContext(xS));return C.exports.useMemo(()=>({initial:t,animate:n}),[ZT(t),ZT(n)])}function ZT(e){return Array.isArray(e)?e.join(" "):e}const hu=e=>({isEnabled:t=>e.some(n=>!!t[n])}),Dv={measureLayout:hu(["layout","layoutId","drag"]),animation:hu(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:hu(["exit"]),drag:hu(["drag","dragControls"]),focus:hu(["whileFocus"]),hover:hu(["whileHover","onHoverStart","onHoverEnd"]),tap:hu(["whileTap","onTap","onTapStart","onTapCancel"]),pan:hu(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:hu(["whileInView","onViewportEnter","onViewportLeave"])};function Ise(e){for(const t in e)t==="projectionNodeConstructor"?Dv.projectionNodeConstructor=e[t]:Dv[t].Component=e[t]}function _S(e){const t=C.exports.useRef(null);return t.current===null&&(t.current=e()),t.current}const qm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Dse=1;function Nse(){return _S(()=>{if(qm.hasEverUpdated)return Dse++})}const m8=C.exports.createContext({});class Bse extends se.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const AN=C.exports.createContext({}),zse=Symbol.for("motionComponentSymbol");function Fse({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:i,Component:o}){e&&Ise(e);function a(l,u){const h={...C.exports.useContext(g8),...l,layoutId:$se(l)},{isStatic:g}=h;let m=null;const v=Ose(l),b=g?void 0:Nse(),w=i(l,g);if(!g&&wh){v.visualElement=Lse(o,w,h,t);const P=C.exports.useContext(TN).strict,E=C.exports.useContext(AN);v.visualElement&&(m=v.visualElement.loadFeatures(h,P,e,b,n||Dv.projectionNodeConstructor,E))}return X(Bse,{visualElement:v.visualElement,props:h,children:[m,S(xS.Provider,{value:v,children:r(o,l,b,Ase(w,v.visualElement,u),w,g,v.visualElement)})]})}const s=C.exports.forwardRef(a);return s[zse]=o,s}function $se({layoutId:e}){const t=C.exports.useContext(m8).id;return t&&e!==void 0?t+"-"+e:e}function Hse(e){function t(r,i={}){return Fse(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const Wse=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function v8(e){return typeof e!="string"||e.includes("-")?!1:!!(Wse.indexOf(e)>-1||/[A-Z]/.test(e))}const X5={};function Vse(e){Object.assign(X5,e)}const Z5=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],x1=new Set(Z5);function MN(e,{layout:t,layoutId:n}){return x1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!X5[e]||e==="opacity")}const Bl=e=>!!(e!=null&&e.getVelocity),Use={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Gse=(e,t)=>Z5.indexOf(e)-Z5.indexOf(t);function jse({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},i,o){let a="";t.sort(Gse);for(const s of t)a+=`${Use[s]||s}(${e[s]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(e,i?"":a):r&&i&&(a="none"),a}function RN(e){return e.startsWith("--")}const Yse=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ON=(e,t)=>n=>Math.max(Math.min(n,t),e),Km=e=>e%1?Number(e.toFixed(5)):e,Nv=/(-)?([\d]*\.?[\d])+/g,SC=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,qse=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function l2(e){return typeof e=="string"}const Ch={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Xm=Object.assign(Object.assign({},Ch),{transform:ON(0,1)}),jy=Object.assign(Object.assign({},Ch),{default:1}),u2=e=>({test:t=>l2(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),zc=u2("deg"),Al=u2("%"),_t=u2("px"),Kse=u2("vh"),Xse=u2("vw"),QT=Object.assign(Object.assign({},Al),{parse:e=>Al.parse(e)/100,transform:e=>Al.transform(e*100)}),y8=(e,t)=>n=>Boolean(l2(n)&&qse.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),IN=(e,t,n)=>r=>{if(!l2(r))return r;const[i,o,a,s]=r.match(Nv);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},Yf={test:y8("hsl","hue"),parse:IN("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Al.transform(Km(t))+", "+Al.transform(Km(n))+", "+Km(Xm.transform(r))+")"},Zse=ON(0,255),ew=Object.assign(Object.assign({},Ch),{transform:e=>Math.round(Zse(e))}),Qc={test:y8("rgb","red"),parse:IN("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ew.transform(e)+", "+ew.transform(t)+", "+ew.transform(n)+", "+Km(Xm.transform(r))+")"};function Qse(e){let t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const bC={test:y8("#"),parse:Qse,transform:Qc.transform},io={test:e=>Qc.test(e)||bC.test(e)||Yf.test(e),parse:e=>Qc.test(e)?Qc.parse(e):Yf.test(e)?Yf.parse(e):bC.parse(e),transform:e=>l2(e)?e:e.hasOwnProperty("red")?Qc.transform(e):Yf.transform(e)},DN="${c}",NN="${n}";function Jse(e){var t,n,r,i;return isNaN(e)&&l2(e)&&((n=(t=e.match(Nv))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((i=(r=e.match(SC))===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0)>0}function BN(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(SC);r&&(n=r.length,e=e.replace(SC,DN),t.push(...r.map(io.parse)));const i=e.match(Nv);return i&&(e=e.replace(Nv,NN),t.push(...i.map(Ch.parse))),{values:t,numColors:n,tokenised:e}}function zN(e){return BN(e).values}function FN(e){const{values:t,numColors:n,tokenised:r}=BN(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function tle(e){const t=zN(e);return FN(e)(t.map(ele))}const Mu={test:Jse,parse:zN,createTransformer:FN,getAnimatableNone:tle},nle=new Set(["brightness","contrast","saturate","opacity"]);function rle(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Nv)||[];if(!r)return e;const i=n.replace(r,"");let o=nle.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const ile=/([a-z-]*)\(.*?\)/g,xC=Object.assign(Object.assign({},Mu),{getAnimatableNone:e=>{const t=e.match(ile);return t?t.map(rle).join(" "):e}}),JT={...Ch,transform:Math.round},$N={borderWidth:_t,borderTopWidth:_t,borderRightWidth:_t,borderBottomWidth:_t,borderLeftWidth:_t,borderRadius:_t,radius:_t,borderTopLeftRadius:_t,borderTopRightRadius:_t,borderBottomRightRadius:_t,borderBottomLeftRadius:_t,width:_t,maxWidth:_t,height:_t,maxHeight:_t,size:_t,top:_t,right:_t,bottom:_t,left:_t,padding:_t,paddingTop:_t,paddingRight:_t,paddingBottom:_t,paddingLeft:_t,margin:_t,marginTop:_t,marginRight:_t,marginBottom:_t,marginLeft:_t,rotate:zc,rotateX:zc,rotateY:zc,rotateZ:zc,scale:jy,scaleX:jy,scaleY:jy,scaleZ:jy,skew:zc,skewX:zc,skewY:zc,distance:_t,translateX:_t,translateY:_t,translateZ:_t,x:_t,y:_t,z:_t,perspective:_t,transformPerspective:_t,opacity:Xm,originX:QT,originY:QT,originZ:_t,zIndex:JT,fillOpacity:Xm,strokeOpacity:Xm,numOctaves:JT};function S8(e,t,n,r){const{style:i,vars:o,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let u=!1,h=!1,g=!0;for(const m in t){const v=t[m];if(RN(m)){o[m]=v;continue}const b=$N[m],w=Yse(v,b);if(x1.has(m)){if(u=!0,a[m]=w,s.push(m),!g)continue;v!==(b.default||0)&&(g=!1)}else m.startsWith("origin")?(h=!0,l[m]=w):i[m]=w}if(t.transform||(u||r?i.transform=jse(e,n,g,r):i.transform&&(i.transform="none")),h){const{originX:m="50%",originY:v="50%",originZ:b=0}=l;i.transformOrigin=`${m} ${v} ${b}`}}const b8=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function HN(e,t,n){for(const r in t)!Bl(t[r])&&!MN(r,n)&&(e[r]=t[r])}function ole({transformTemplate:e},t,n){return C.exports.useMemo(()=>{const r=b8();return S8(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function ale(e,t,n){const r=e.style||{},i={};return HN(i,r,e),Object.assign(i,ole(e,t,n)),e.transformValues?e.transformValues(i):i}function sle(e,t,n){const r={},i=ale(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),r.style=i,r}const lle=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],ule=["whileTap","onTap","onTapStart","onTapCancel"],cle=["onPan","onPanStart","onPanSessionStart","onPanEnd"],dle=["whileInView","onViewportEnter","onViewportLeave","viewport"],fle=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...dle,...ule,...lle,...cle]);function Q5(e){return fle.has(e)}let WN=e=>!Q5(e);function hle(e){!e||(WN=t=>t.startsWith("on")?!Q5(t):e(t))}try{hle(require("@emotion/is-prop-valid").default)}catch(e){}function ple(e,t,n){const r={};for(const i in e)(WN(i)||n===!0&&Q5(i)||!t&&!Q5(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function eL(e,t,n){return typeof e=="string"?e:_t.transform(t+n*e)}function gle(e,t,n){const r=eL(t,e.x,e.width),i=eL(n,e.y,e.height);return`${r} ${i}`}const mle={offset:"stroke-dashoffset",array:"stroke-dasharray"},vle={offset:"strokeDashoffset",array:"strokeDasharray"};function yle(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?mle:vle;e[o.offset]=_t.transform(-r);const a=_t.transform(t),s=_t.transform(n);e[o.array]=`${a} ${s}`}function x8(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,h){S8(e,l,u,h),e.attrs=e.style,e.style={};const{attrs:g,style:m,dimensions:v}=e;g.transform&&(v&&(m.transform=g.transform),delete g.transform),v&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=gle(v,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),o!==void 0&&yle(g,o,a,s,!1)}const VN=()=>({...b8(),attrs:{}});function Sle(e,t){const n=C.exports.useMemo(()=>{const r=VN();return x8(r,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};HN(r,e.style,e),n.style={...r,...n.style}}return n}function ble(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const u=(v8(n)?Sle:sle)(r,a,s),g={...ple(r,typeof n=="string",e),...u,ref:o};return i&&(g["data-projection-id"]=i),C.exports.createElement(n,g)}}const UN=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function GN(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const jN=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function YN(e,t,n,r){GN(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(jN.has(i)?i:UN(i),t.attrs[i])}function w8(e){const{style:t}=e,n={};for(const r in t)(Bl(t[r])||MN(r,e))&&(n[r]=t[r]);return n}function qN(e){const t=w8(e);for(const n in e)if(Bl(e[n])){const r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function C8(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}const Bv=e=>Array.isArray(e),xle=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),KN=e=>Bv(e)?e[e.length-1]||0:e;function K3(e){const t=Bl(e)?e.get():e;return xle(t)?t.toValue():t}function wle({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:Cle(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const XN=e=>(t,n)=>{const r=C.exports.useContext(xS),i=C.exports.useContext(b1),o=()=>wle(e,t,r,i);return n?o():_S(o)};function Cle(e,t,n,r){const i={},o=r(e);for(const m in o)i[m]=K3(o[m]);let{initial:a,animate:s}=e;const l=CS(e),u=LN(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let h=n?n.initial===!1:!1;h=h||a===!1;const g=h?s:a;return g&&typeof g!="boolean"&&!wS(g)&&(Array.isArray(g)?g:[g]).forEach(v=>{const b=C8(e,v);if(!b)return;const{transitionEnd:w,transition:P,...E}=b;for(const _ in E){let T=E[_];if(Array.isArray(T)){const M=h?T.length-1:0;T=T[M]}T!==null&&(i[_]=T)}for(const _ in w)i[_]=w[_]}),i}const _le={useVisualState:XN({scrapeMotionValuesFromProps:qN,createRenderState:VN,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch(i){n.dimensions={x:0,y:0,width:0,height:0}}x8(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),YN(t,n)}})},kle={useVisualState:XN({scrapeMotionValuesFromProps:w8,createRenderState:b8})};function Ele(e,{forwardMotionProps:t=!1},n,r,i){return{...v8(e)?_le:kle,preloadedFeatures:n,useRender:ble(t),createVisualElement:r,projectionNodeConstructor:i,Component:e}}var qn;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(qn||(qn={}));function kS(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function wC(e,t,n,r){C.exports.useEffect(()=>{const i=e.current;if(n&&i)return kS(i,t,n,r)},[e,t,n,r])}function Ple({whileFocus:e,visualElement:t}){const{animationState:n}=t,r=()=>{n&&n.setActive(qn.Focus,!0)},i=()=>{n&&n.setActive(qn.Focus,!1)};wC(t,"focus",e?r:void 0),wC(t,"blur",e?i:void 0)}function ZN(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function QN(e){return!!e.touches}function Tle(e){return t=>{const n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}const Lle={pageX:0,pageY:0};function Ale(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||Lle;return{x:r[t+"X"],y:r[t+"Y"]}}function Mle(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function _8(e,t="page"){return{point:QN(e)?Ale(e,t):Mle(e,t)}}const JN=(e,t=!1)=>{const n=r=>e(r,_8(r));return t?Tle(n):n},Rle=()=>wh&&window.onpointerdown===null,Ole=()=>wh&&window.ontouchstart===null,Ile=()=>wh&&window.onmousedown===null,Dle={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},Nle={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function eB(e){return Rle()?e:Ole()?Nle[e]:Ile()?Dle[e]:e}function O0(e,t,n,r){return kS(e,eB(t),JN(n,t==="pointerdown"),r)}function J5(e,t,n,r){return wC(e,eB(t),n&&JN(n,t==="pointerdown"),r)}function tB(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const tL=tB("dragHorizontal"),nL=tB("dragVertical");function nB(e){let t=!1;if(e==="y")t=nL();else if(e==="x")t=tL();else{const n=tL(),r=nL();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function rB(){const e=nB(!0);return e?(e(),!1):!0}function rL(e,t,n){return(r,i)=>{!ZN(r)||rB()||(e.animationState&&e.animationState.setActive(qn.Hover,t),n&&n(r,i))}}function Ble({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){J5(r,"pointerenter",e||n?rL(r,!0,e):void 0,{passive:!e}),J5(r,"pointerleave",t||n?rL(r,!1,t):void 0,{passive:!t})}const iB=(e,t)=>t?e===t?!0:iB(e,t.parentElement):!1;function k8(e){return C.exports.useEffect(()=>()=>e(),[])}function oB(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),tw=.001,Fle=.01,iL=10,$le=.05,Hle=1;function Wle({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;zle(e<=iL*1e3);let a=1-t;a=t4($le,Hle,a),e=t4(Fle,iL,e/1e3),a<1?(i=u=>{const h=u*a,g=h*e,m=h-n,v=CC(u,a),b=Math.exp(-g);return tw-m/v*b},o=u=>{const g=u*a*e,m=g*n+n,v=Math.pow(a,2)*Math.pow(u,2)*e,b=Math.exp(-g),w=CC(Math.pow(u,2),a);return(-i(u)+tw>0?-1:1)*((m-v)*b)/w}):(i=u=>{const h=Math.exp(-u*e),g=(u-n)*e+1;return-tw+h*g},o=u=>{const h=Math.exp(-u*e),g=(n-u)*(e*e);return h*g});const s=5/e,l=Ule(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const Vle=12;function Ule(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function Yle(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!oL(e,jle)&&oL(e,Gle)){const n=Wle(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function E8(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,o=oB(e,["from","to","restSpeed","restDelta"]);const a={done:!1,value:t};let{stiffness:s,damping:l,mass:u,velocity:h,duration:g,isResolvedFromDuration:m}=Yle(o),v=aL,b=aL;function w(){const P=h?-(h/1e3):0,E=n-t,_=l/(2*Math.sqrt(s*u)),T=Math.sqrt(s/u)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),_<1){const M=CC(T,_);v=O=>{const I=Math.exp(-_*T*O);return n-I*((P+_*T*E)/M*Math.sin(M*O)+E*Math.cos(M*O))},b=O=>{const I=Math.exp(-_*T*O);return _*T*I*(Math.sin(M*O)*(P+_*T*E)/M+E*Math.cos(M*O))-I*(Math.cos(M*O)*(P+_*T*E)-M*E*Math.sin(M*O))}}else if(_===1)v=M=>n-Math.exp(-T*M)*(E+(P+T*E)*M);else{const M=T*Math.sqrt(_*_-1);v=O=>{const I=Math.exp(-_*T*O),D=Math.min(M*O,300);return n-I*((P+_*T*E)*Math.sinh(D)+M*E*Math.cosh(D))/M}}}return w(),{next:P=>{const E=v(P);if(m)a.done=P>=g;else{const _=b(P)*1e3,T=Math.abs(_)<=r,M=Math.abs(n-E)<=i;a.done=T&&M}return a.value=a.done?n:E,a},flipTarget:()=>{h=-h,[t,n]=[n,t],w()}}}E8.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const aL=e=>0,zv=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Pr=(e,t,n)=>-n*e+n*t+e;function nw(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function sL({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=nw(l,s,e+1/3),o=nw(l,s,e),a=nw(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const qle=(e,t,n)=>{const r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},Kle=[bC,Qc,Yf],lL=e=>Kle.find(t=>t.test(e)),aB=(e,t)=>{let n=lL(e),r=lL(t),i=n.parse(e),o=r.parse(t);n===Yf&&(i=sL(i),n=Qc),r===Yf&&(o=sL(o),r=Qc);const a=Object.assign({},i);return s=>{for(const l in a)l!=="alpha"&&(a[l]=qle(i[l],o[l],s));return a.alpha=Pr(i.alpha,o.alpha,s),n.transform(a)}},_C=e=>typeof e=="number",Xle=(e,t)=>n=>t(e(n)),ES=(...e)=>e.reduce(Xle);function sB(e,t){return _C(e)?n=>Pr(e,t,n):io.test(e)?aB(e,t):uB(e,t)}const lB=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>sB(o,t[a]));return o=>{for(let a=0;a{const n=Object.assign(Object.assign({},e),t),r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=sB(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}};function uL(e){const t=Mu.parse(e),n=t.length;let r=0,i=0,o=0;for(let a=0;a{const n=Mu.createTransformer(t),r=uL(e),i=uL(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?ES(lB(r.parsed,i.parsed),n):a=>`${a>0?t:e}`},Qle=(e,t)=>n=>Pr(e,t,n);function Jle(e){if(typeof e=="number")return Qle;if(typeof e=="string")return io.test(e)?aB:uB;if(Array.isArray(e))return lB;if(typeof e=="object")return Zle}function eue(e,t,n){const r=[],i=n||Jle(e[0]),o=e.length-1;for(let a=0;an(zv(e,t,r))}function nue(e,t){const n=e.length,r=n-1;return i=>{let o=0,a=!1;if(i<=e[0]?a=!0:i>=e[r]&&(o=r-1,a=!0),!a){let l=1;for(;li||l===r);l++);o=l-1}const s=zv(e[o],e[o+1],i);return t[o](s)}}function cB(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;e4(o===t.length),e4(!r||!Array.isArray(r)||r.length===o-1),e[0]>e[o-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const a=eue(t,r,i),s=o===2?tue(e,a):nue(e,a);return n?l=>s(t4(e[0],e[o-1],l)):s}const PS=e=>t=>1-e(1-t),P8=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,rue=e=>t=>Math.pow(t,e),dB=e=>t=>t*t*((e+1)*t-e),iue=e=>{const t=dB(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},fB=1.525,oue=4/11,aue=8/11,sue=9/10,T8=e=>e,L8=rue(2),lue=PS(L8),hB=P8(L8),pB=e=>1-Math.sin(Math.acos(e)),A8=PS(pB),uue=P8(A8),M8=dB(fB),cue=PS(M8),due=P8(M8),fue=iue(fB),hue=4356/361,pue=35442/1805,gue=16061/1805,n4=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-n4(1-e*2)):.5*n4(e*2-1)+.5;function yue(e,t){return e.map(()=>t||hB).splice(0,e.length-1)}function Sue(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function bue(e,t){return e.map(n=>n*t)}function X3({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){const o={done:!1,value:e},a=Array.isArray(t)?t:[e,t],s=bue(r&&r.length===a.length?r:Sue(a),i);function l(){return cB(s,a,{ease:Array.isArray(n)?n:yue(a,n)})}let u=l();return{next:h=>(o.value=u(h),o.done=h>=i,o),flipTarget:()=>{a.reverse(),u=l()}}}function xue({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a={done:!1,value:t};let s=n*e;const l=t+s,u=o===void 0?l:o(l);return u!==l&&(s=u-t),{next:h=>{const g=-s*Math.exp(-h/r);return a.done=!(g>i||g<-i),a.value=a.done?u:u+g,a},flipTarget:()=>{}}}const cL={keyframes:X3,spring:E8,decay:xue};function wue(e){if(Array.isArray(e.to))return X3;if(cL[e.type])return cL[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?X3:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?E8:X3}const gB=1/60*1e3,Cue=typeof performance<"u"?()=>performance.now():()=>Date.now(),mB=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(Cue()),gB);function _ue(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,h=!1)=>{const g=h&&i,m=g?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),g&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=_ue(()=>Fv=!0),e),{}),Eue=c2.reduce((e,t)=>{const n=TS[t];return e[t]=(r,i=!1,o=!1)=>(Fv||Lue(),n.schedule(r,i,o)),e},{}),Pue=c2.reduce((e,t)=>(e[t]=TS[t].cancel,e),{});c2.reduce((e,t)=>(e[t]=()=>TS[t].process(I0),e),{});const Tue=e=>TS[e].process(I0),vB=e=>{Fv=!1,I0.delta=kC?gB:Math.max(Math.min(e-I0.timestamp,kue),1),I0.timestamp=e,EC=!0,c2.forEach(Tue),EC=!1,Fv&&(kC=!1,mB(vB))},Lue=()=>{Fv=!0,kC=!0,EC||mB(vB)},Aue=()=>I0;function yB(e,t,n=0){return e-t-n}function Mue(e,t,n=0,r=!0){return r?yB(t+-e,t,n):t-(e-t)+n}function Rue(e,t,n,r){return r?e>=t+n:e<=-n}const Oue=e=>{const t=({delta:n})=>e(n);return{start:()=>Eue.update(t,!0),stop:()=>Pue.update(t)}};function SB(e){var t,n,{from:r,autoplay:i=!0,driver:o=Oue,elapsed:a=0,repeat:s=0,repeatType:l="loop",repeatDelay:u=0,onPlay:h,onStop:g,onComplete:m,onRepeat:v,onUpdate:b}=e,w=oB(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:P}=w,E,_=0,T=w.duration,M,O=!1,I=!0,D;const B=wue(w);!((n=(t=B).needsInterpolation)===null||n===void 0)&&n.call(t,r,P)&&(D=cB([0,100],[r,P],{clamp:!1}),r=0,P=100);const $=B(Object.assign(Object.assign({},w),{from:r,to:P}));function H(){_++,l==="reverse"?(I=_%2===0,a=Mue(a,T,u,I)):(a=yB(a,T,u),l==="mirror"&&$.flipTarget()),O=!1,v&&v()}function j(){E.stop(),m&&m()}function ne(q){if(I||(q=-q),a+=q,!O){const te=$.next(Math.max(0,a));M=te.value,D&&(M=D(M)),O=I?te.done:a<=0}b==null||b(M),O&&(_===0&&(T!=null||(T=a)),_{g==null||g(),E.stop()}}}function bB(e,t){return t?e*(1e3/t):0}function Iue({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:h,onUpdate:g,onComplete:m,onStop:v}){let b;function w(T){return n!==void 0&&Tr}function P(T){return n===void 0?r:r===void 0||Math.abs(n-T){var O;g==null||g(M),(O=T.onUpdate)===null||O===void 0||O.call(T,M)},onComplete:m,onStop:v}))}function _(T){E(Object.assign({type:"spring",stiffness:a,damping:s,restDelta:l},T))}if(w(e))_({from:e,velocity:t,to:P(e)});else{let T=i*t+e;typeof u<"u"&&(T=u(T));const M=P(T),O=M===n?-1:1;let I,D;const B=$=>{I=D,D=$,t=bB($-I,Aue().delta),(O===1&&$>M||O===-1&&$b==null?void 0:b.stop()}}const PC=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),dL=e=>PC(e)&&e.hasOwnProperty("z"),Yy=(e,t)=>Math.abs(e-t);function R8(e,t){if(_C(e)&&_C(t))return Yy(e,t);if(PC(e)&&PC(t)){const n=Yy(e.x,t.x),r=Yy(e.y,t.y),i=dL(e)&&dL(t)?Yy(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(i,2))}}const xB=(e,t)=>1-3*t+3*e,wB=(e,t)=>3*t-6*e,CB=e=>3*e,r4=(e,t,n)=>((xB(t,n)*e+wB(t,n))*e+CB(t))*e,_B=(e,t,n)=>3*xB(t,n)*e*e+2*wB(t,n)*e+CB(t),Due=1e-7,Nue=10;function Bue(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=r4(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>Due&&++s=Fue?$ue(a,g,e,n):m===0?g:Bue(a,s,s+qy,e,n)}return a=>a===0||a===1?a:r4(o(a),t,r)}function Wue({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:i}){const o=e||t||n||r,a=C.exports.useRef(!1),s=C.exports.useRef(null),l={passive:!(t||e||n||v)};function u(){s.current&&s.current(),s.current=null}function h(){return u(),a.current=!1,i.animationState&&i.animationState.setActive(qn.Tap,!1),!rB()}function g(b,w){!h()||(iB(i.current,b.target)?e&&e(b,w):n&&n(b,w))}function m(b,w){!h()||n&&n(b,w)}function v(b,w){u(),!a.current&&(a.current=!0,s.current=ES(O0(window,"pointerup",g,l),O0(window,"pointercancel",m,l)),i.animationState&&i.animationState.setActive(qn.Tap,!0),t&&t(b,w))}J5(i,"pointerdown",o?v:void 0,l),k8(u)}const Vue="production",kB=typeof process>"u"||process.env===void 0?Vue:"production",fL=new Set;function EB(e,t,n){e||fL.has(t)||(console.warn(t),n&&console.warn(n),fL.add(t))}const TC=new WeakMap,rw=new WeakMap,Uue=e=>{const t=TC.get(e.target);t&&t(e)},Gue=e=>{e.forEach(Uue)};function jue({root:e,...t}){const n=e||document;rw.has(n)||rw.set(n,{});const r=rw.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Gue,{root:e,...t})),r[i]}function Yue(e,t,n){const r=jue(t);return TC.set(e,n),r.observe(e),()=>{TC.delete(e),r.unobserve(e)}}function que({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:i={}}){const o=C.exports.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);i.once&&o.current.hasEnteredView&&(a=!1),(typeof IntersectionObserver>"u"?Zue:Xue)(a,o.current,e,i)}const Kue={some:0,all:1};function Xue(e,t,n,{root:r,margin:i,amount:o="some",once:a}){C.exports.useEffect(()=>{if(!e||!n.current)return;const s={root:r==null?void 0:r.current,rootMargin:i,threshold:typeof o=="number"?o:Kue[o]},l=u=>{const{isIntersecting:h}=u;if(t.isInView===h||(t.isInView=h,a&&!h&&t.hasEnteredView))return;h&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(qn.InView,h);const g=n.getProps(),m=h?g.onViewportEnter:g.onViewportLeave;m&&m(u)};return Yue(n.current,s,l)},[e,r,i,o])}function Zue(e,t,n,{fallback:r=!0}){C.exports.useEffect(()=>{!e||!r||(kB!=="production"&&EB(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:i}=n.getProps();i&&i(null),n.animationState&&n.animationState.setActive(qn.InView,!0)}))},[e])}const Jc=e=>t=>(e(t),null),Que={inView:Jc(que),tap:Jc(Wue),focus:Jc(Ple),hover:Jc(Ble)};function O8(){const e=C.exports.useContext(b1);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=C.exports.useId();return C.exports.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function Jue(){return ece(C.exports.useContext(b1))}function ece(e){return e===null?!0:e.isPresent}function PB(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;re*1e3,tce={linear:T8,easeIn:L8,easeInOut:hB,easeOut:lue,circIn:pB,circInOut:uue,circOut:A8,backIn:M8,backInOut:due,backOut:cue,anticipate:fue,bounceIn:mue,bounceInOut:vue,bounceOut:n4},hL=e=>{if(Array.isArray(e)){e4(e.length===4);const[t,n,r,i]=e;return Hue(t,n,r,i)}else if(typeof e=="string")return tce[e];return e},nce=e=>Array.isArray(e)&&typeof e[0]!="number",pL=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&Mu.test(t)&&!t.startsWith("url(")),Ef=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Ky=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),iw=()=>({type:"keyframes",ease:"linear",duration:.3}),rce=e=>({type:"keyframes",duration:.8,values:e}),gL={x:Ef,y:Ef,z:Ef,rotate:Ef,rotateX:Ef,rotateY:Ef,rotateZ:Ef,scaleX:Ky,scaleY:Ky,scale:Ky,opacity:iw,backgroundColor:iw,color:iw,default:Ky},ice=(e,t)=>{let n;return Bv(t)?n=rce:n=gL[e]||gL.default,{to:t,...n(t)}},oce={...$N,color:io,backgroundColor:io,outlineColor:io,fill:io,stroke:io,borderColor:io,borderTopColor:io,borderRightColor:io,borderBottomColor:io,borderLeftColor:io,filter:xC,WebkitFilter:xC},I8=e=>oce[e];function D8(e,t){var n;let r=I8(e);return r!==xC&&(r=Mu),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}const ace={current:!1},TB=1/60*1e3,sce=typeof performance<"u"?()=>performance.now():()=>Date.now(),LB=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(sce()),TB);function lce(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,h=!1)=>{const g=h&&i,m=g?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),g&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=lce(()=>$v=!0),e),{}),As=d2.reduce((e,t)=>{const n=LS[t];return e[t]=(r,i=!1,o=!1)=>($v||dce(),n.schedule(r,i,o)),e},{}),gh=d2.reduce((e,t)=>(e[t]=LS[t].cancel,e),{}),ow=d2.reduce((e,t)=>(e[t]=()=>LS[t].process(D0),e),{}),cce=e=>LS[e].process(D0),AB=e=>{$v=!1,D0.delta=LC?TB:Math.max(Math.min(e-D0.timestamp,uce),1),D0.timestamp=e,AC=!0,d2.forEach(cce),AC=!1,$v&&(LC=!1,LB(AB))},dce=()=>{$v=!0,LC=!0,AC||LB(AB)},MC=()=>D0;function MB(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(gh.read(r),e(o-t))};return As.read(r,!0),()=>gh.read(r)}function fce({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,...u}){return!!Object.keys(u).length}function hce({ease:e,times:t,yoyo:n,flip:r,loop:i,...o}){const a={...o};return t&&(a.offset=t),o.duration&&(a.duration=i4(o.duration)),o.repeatDelay&&(a.repeatDelay=i4(o.repeatDelay)),e&&(a.ease=nce(e)?e.map(hL):hL(e)),o.type==="tween"&&(a.type="keyframes"),(n||i||r)&&(n?a.repeatType="reverse":i?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=i||n||r||o.repeat),o.type!=="spring"&&(a.type="keyframes"),a}function pce(e,t){var n,r;return(r=(n=(N8(e,t)||{}).delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function gce(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function mce(e,t,n){return Array.isArray(t.to)&&e.duration===void 0&&(e.duration=.8),gce(t),fce(e)||(e={...e,...ice(n,t.to)}),{...t,...hce(e)}}function vce(e,t,n,r,i){const o=N8(r,e)||{};let a=o.from!==void 0?o.from:t.get();const s=pL(e,n);a==="none"&&s&&typeof n=="string"?a=D8(e,n):mL(a)&&typeof n=="string"?a=vL(n):!Array.isArray(n)&&mL(n)&&typeof a=="string"&&(n=vL(a));const l=pL(e,a);function u(){const g={from:a,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:m=>t.set(m)};return o.type==="inertia"||o.type==="decay"?Iue({...g,...o}):SB({...mce(o,g,e),onUpdate:m=>{g.onUpdate(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{g.onComplete(),o.onComplete&&o.onComplete()}})}function h(){const g=KN(n);return t.set(g),i(),o.onUpdate&&o.onUpdate(g),o.onComplete&&o.onComplete(),{stop:()=>{}}}return!l||!s||o.type===!1?h:u}function mL(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function vL(e){return typeof e=="number"?0:D8("",e)}function N8(e,t){return e[t]||e.default||e}function B8(e,t,n,r={}){return ace.current&&(r={type:!1}),t.start(i=>{let o;const a=vce(e,t,n,r,i),s=pce(r,e),l=()=>o=a();let u;return s?u=MB(l,i4(s)):l(),()=>{u&&u(),o&&o.stop()}})}const yce=e=>/^\-?\d*\.?\d+$/.test(e),Sce=e=>/^0[^.\s]+$/.test(e);function z8(e,t){e.indexOf(t)===-1&&e.push(t)}function F8(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Zm{constructor(){this.subscriptions=[]}add(t){return z8(this.subscriptions,t),()=>F8(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(!!i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class xce{constructor(t){this.version="7.6.9",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Zm,this.velocityUpdateSubscribers=new Zm,this.renderSubscribers=new Zm,this.canTrackVelocity=!1,this.updateAndNotify=(n,r=!0)=>{this.prev=this.current,this.current=n;const{delta:i,timestamp:o}=MC();this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,As.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),r&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>As.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=bce(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?bB(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=t(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function n1(e){return new xce(e)}const RB=e=>t=>t.test(e),wce={test:e=>e==="auto",parse:e=>e},OB=[Ch,_t,Al,zc,Xse,Kse,wce],Jg=e=>OB.find(RB(e)),Cce=[...OB,io,Mu],_ce=e=>Cce.find(RB(e));function kce(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function Ece(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function AS(e,t,n){const r=e.getProps();return C8(r,t,n!==void 0?n:r.custom,kce(e),Ece(e))}function Pce(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,n1(n))}function Tce(e,t){const n=AS(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=KN(o[a]);Pce(e,a,s)}}function Lce(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(!!a)for(let s=0;sRC(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=RC(e,t,n);else{const i=typeof t=="function"?AS(e,t,n.custom):t;r=IB(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))}function RC(e,t,n={}){var r;const i=AS(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const a=i?()=>IB(e,i,n):()=>Promise.resolve(),s=!((r=e.variantChildren)===null||r===void 0)&&r.size?(u=0)=>{const{delayChildren:h=0,staggerChildren:g,staggerDirection:m}=o;return Oce(e,t,h+u,g,m,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,h]=l==="beforeChildren"?[a,s]:[s,a];return u().then(h)}else return Promise.all([a(),s(n.delay)])}function IB(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const u=e.getValue("willChange");r&&(a=r);const h=[],g=i&&((o=e.animationState)===null||o===void 0?void 0:o.getState()[i]);for(const m in l){const v=e.getValue(m),b=l[m];if(!v||b===void 0||g&&Dce(g,m))continue;let w={delay:n,...a};e.shouldReduceMotion&&x1.has(m)&&(w={...w,type:!1,delay:0});let P=B8(m,v,b,w);o4(u)&&(u.add(m),P=P.then(()=>u.remove(m))),h.push(P)}return Promise.all(h).then(()=>{s&&Tce(e,s)})}function Oce(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(Ice).forEach((u,h)=>{a.push(RC(u,t,{...o,delay:n+l(h)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function Ice(e,t){return e.sortNodePosition(t)}function Dce({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const $8=[qn.Animate,qn.InView,qn.Focus,qn.Hover,qn.Tap,qn.Drag,qn.Exit],Nce=[...$8].reverse(),Bce=$8.length;function zce(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Rce(e,n,r)))}function Fce(e){let t=zce(e);const n=Hce();let r=!0;const i=(l,u)=>{const h=AS(e,u);if(h){const{transition:g,transitionEnd:m,...v}=h;l={...l,...v,...m}}return l};function o(l){t=l(e)}function a(l,u){var h;const g=e.getProps(),m=e.getVariantContext(!0)||{},v=[],b=new Set;let w={},P=1/0;for(let _=0;_P&&I;const j=Array.isArray(O)?O:[O];let ne=j.reduce(i,{});D===!1&&(ne={});const{prevResolvedValues:V={}}=M,q={...V,...ne},te=J=>{H=!0,b.delete(J),M.needsAnimating[J]=!0};for(const J in q){const Z=ne[J],G=V[J];w.hasOwnProperty(J)||(Z!==G?Bv(Z)&&Bv(G)?!PB(Z,G)||$?te(J):M.protectedKeys[J]=!0:Z!==void 0?te(J):b.add(J):Z!==void 0&&b.has(J)?te(J):M.protectedKeys[J]=!0)}M.prevProp=O,M.prevResolvedValues=ne,M.isActive&&(w={...w,...ne}),r&&e.blockInitialAnimation&&(H=!1),H&&!B&&v.push(...j.map(J=>({animation:J,options:{type:T,...l}})))}if(b.size){const _={};b.forEach(T=>{const M=e.getBaseTarget(T);M!==void 0&&(_[T]=M)}),v.push({animation:_})}let E=Boolean(v.length);return r&&g.initial===!1&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,E?t(v):Promise.resolve()}function s(l,u,h){var g;if(n[l].isActive===u)return Promise.resolve();(g=e.variantChildren)===null||g===void 0||g.forEach(v=>{var b;return(b=v.animationState)===null||b===void 0?void 0:b.setActive(l,u)}),n[l].isActive=u;const m=a(h,l);for(const v in n)n[v].protectedKeys={};return m}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function $ce(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!PB(t,e):!1}function Pf(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hce(){return{[qn.Animate]:Pf(!0),[qn.InView]:Pf(),[qn.Hover]:Pf(),[qn.Tap]:Pf(),[qn.Drag]:Pf(),[qn.Focus]:Pf(),[qn.Exit]:Pf()}}const Wce={animation:Jc(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=Fce(e)),wS(t)&&C.exports.useEffect(()=>t.subscribe(e),[t])}),exit:Jc(e=>{const{custom:t,visualElement:n}=e,[r,i]=O8(),o=C.exports.useContext(b1);C.exports.useEffect(()=>{n.isPresent=r;const a=n.animationState&&n.animationState.setActive(qn.Exit,!r,{custom:o&&o.custom||t});a&&!r&&a.then(i)},[r])})};class DB{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=sw(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,g=R8(u.offset,{x:0,y:0})>=3;if(!h&&!g)return;const{point:m}=u,{timestamp:v}=MC();this.history.push({...m,timestamp:v});const{onStart:b,onMove:w}=this.handlers;h||(b&&b(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,u)},this.handlePointerMove=(u,h)=>{if(this.lastMoveEvent=u,this.lastMoveEventInfo=aw(h,this.transformPagePoint),ZN(u)&&u.buttons===0){this.handlePointerUp(u,h);return}As.update(this.updatePoint,!0)},this.handlePointerUp=(u,h)=>{this.end();const{onEnd:g,onSessionEnd:m}=this.handlers,v=sw(aw(h,this.transformPagePoint),this.history);this.startEvent&&g&&g(u,v),m&&m(u,v)},QN(t)&&t.touches.length>1)return;this.handlers=n,this.transformPagePoint=r;const i=_8(t),o=aw(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=MC();this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,sw(o,this.history)),this.removeListeners=ES(O0(window,"pointermove",this.handlePointerMove),O0(window,"pointerup",this.handlePointerUp),O0(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),gh.update(this.updatePoint)}}function aw(e,t){return t?{point:t(e.point)}:e}function yL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sw({point:e},t){return{point:e,delta:yL(e,NB(t)),offset:yL(e,Vce(t)),velocity:Uce(t,.1)}}function Vce(e){return e[0]}function NB(e){return e[e.length-1]}function Uce(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=NB(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>i4(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function va(e){return e.max-e.min}function SL(e,t=0,n=.01){return R8(e,t)n&&(e=r?Pr(n,e,r.max):Math.min(e,n)),e}function CL(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Yce(e,{top:t,left:n,bottom:r,right:i}){return{x:CL(e.x,n,i),y:CL(e.y,t,r)}}function _L(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=zv(t.min,t.max-r,e.min):r>i&&(n=zv(e.min,e.max-i,t.min)),t4(0,1,n)}function Xce(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const OC=.35;function Zce(e=OC){return e===!1?e=0:e===!0&&(e=OC),{x:kL(e,"left","right"),y:kL(e,"top","bottom")}}function kL(e,t,n){return{min:EL(e,t),max:EL(e,n)}}function EL(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}const PL=()=>({translate:0,scale:1,origin:0,originPoint:0}),ev=()=>({x:PL(),y:PL()}),TL=()=>({min:0,max:0}),ni=()=>({x:TL(),y:TL()});function pl(e){return[e("x"),e("y")]}function BB({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Qce({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Jce(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function lw(e){return e===void 0||e===1}function IC({scale:e,scaleX:t,scaleY:n}){return!lw(e)||!lw(t)||!lw(n)}function If(e){return IC(e)||zB(e)||e.z||e.rotate||e.rotateX||e.rotateY}function zB(e){return LL(e.x)||LL(e.y)}function LL(e){return e&&e!=="0%"}function a4(e,t,n){const r=e-n,i=t*r;return n+i}function AL(e,t,n,r,i){return i!==void 0&&(e=a4(e,i,r)),a4(e,n,r)+t}function DC(e,t=0,n=1,r,i){e.min=AL(e.min,t,n,r,i),e.max=AL(e.max,t,n,r,i)}function FB(e,{x:t,y:n}){DC(e.x,t.translate,t.scale,t.originPoint),DC(e.y,n.translate,n.scale,n.originPoint)}function ede(e,t,n,r=!1){var i,o;const a=n.length;if(!a)return;t.x=t.y=1;let s,l;for(let u=0;u{this.stopAnimation(),n&&this.snapToCursor(_8(s,"page").point)},i=(s,l)=>{var u;const{drag:h,dragPropagation:g,onDragStart:m}=this.getProps();h&&!g&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=nB(h),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pl(v=>{var b,w;let P=this.getAxisMotionValue(v).get()||0;if(Al.test(P)){const E=(w=(b=this.visualElement.projection)===null||b===void 0?void 0:b.layout)===null||w===void 0?void 0:w.layoutBox[v];E&&(P=va(E)*(parseFloat(P)/100))}this.originPoint[v]=P}),m==null||m(s,l),(u=this.visualElement.animationState)===null||u===void 0||u.setActive(qn.Drag,!0))},o=(s,l)=>{const{dragPropagation:u,dragDirectionLock:h,onDirectionLock:g,onDrag:m}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:v}=l;if(h&&this.currentDirection===null){this.currentDirection=ade(v),this.currentDirection!==null&&(g==null||g(this.currentDirection));return}this.updateAxis("x",l.point,v),this.updateAxis("y",l.point,v),this.visualElement.render(),m==null||m(s,l)},a=(s,l)=>this.stop(s,l);this.panSession=new DB(t,{onSessionStart:r,onStart:i,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o==null||o(t,n)}cancel(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(qn.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Xy(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=jce(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&c0(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Yce(r.layoutBox,t):this.constraints=!1,this.elastic=Zce(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&pl(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Xce(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!c0(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=rde(r,i.root,this.visualElement.getTransformPagePoint());let a=qce(i.layout.layoutBox,o);if(n){const s=n(Qce(a));this.hasMutatedConstraints=!!s,s&&(a=BB(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=pl(h=>{var g;if(!Xy(h,n,this.currentDirection))return;let m=(g=l==null?void 0:l[h])!==null&&g!==void 0?g:{};a&&(m={min:0,max:0});const v=i?200:1e6,b=i?40:1e7,w={type:"inertia",velocity:r?t[h]:0,bounceStiffness:v,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(h,w)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return B8(t,r,0,n)}stopAnimation(){pl(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var n,r;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)}snapToCursor(t){pl(n=>{const{drag:r}=this.getProps();if(!Xy(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-Pr(a,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:n,dragConstraints:r}=this.getProps(),{projection:i}=this.visualElement;if(!c0(r)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};pl(s=>{const l=this.getAxisMotionValue(s);if(l){const u=l.get();o[s]=Kce({min:u,max:u},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",(t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),pl(s=>{if(!Xy(s,n,null))return;const l=this.getAxisMotionValue(s),{min:u,max:h}=this.constraints[s];l.set(Pr(u,h,o[s]))})}addListeners(){var t;if(!this.visualElement.current)return;ide.set(this.visualElement,this);const n=this.visualElement.current,r=O0(n,"pointerdown",u=>{const{drag:h,dragListener:g=!0}=this.getProps();h&&g&&this.start(u)}),i=()=>{const{dragConstraints:u}=this.getProps();c0(u)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",i);o&&!o.layout&&((t=o.root)===null||t===void 0||t.updateScroll(),o.updateLayout()),i();const s=kS(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h})=>{this.isDragging&&h&&(pl(g=>{const m=this.getAxisMotionValue(g);!m||(this.originPoint[g]+=u[g].translate,m.set(m.get()+u[g].translate))}),this.visualElement.render())});return()=>{s(),r(),a(),l==null||l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=OC,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function Xy(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ade(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function sde(e){const{dragControls:t,visualElement:n}=e,r=_S(()=>new ode(n));C.exports.useEffect(()=>t&&t.subscribe(r),[r,t]),C.exports.useEffect(()=>r.addListeners(),[r])}function lde({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:i}){const o=e||t||n||r,a=C.exports.useRef(null),{transformPagePoint:s}=C.exports.useContext(g8),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(h,g)=>{a.current=null,n&&n(h,g)}};C.exports.useEffect(()=>{a.current!==null&&a.current.updateHandlers(l)});function u(h){a.current=new DB(h,l,{transformPagePoint:s})}J5(i,"pointerdown",o&&u),k8(()=>a.current&&a.current.end())}const ude={pan:Jc(lde),drag:Jc(sde)};function NC(e){return typeof e=="string"&&e.startsWith("var(--")}const HB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function cde(e){const t=HB.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function BC(e,t,n=1){const[r,i]=cde(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():NC(i)?BC(i,t,n+1):i}function dde(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!NC(o))return;const a=BC(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!NC(o))continue;const a=BC(o,r);!a||(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const fde=new Set(["width","height","top","left","right","bottom","x","y"]),WB=e=>fde.has(e),hde=e=>Object.keys(e).some(WB),VB=(e,t)=>{e.set(t,!1),e.set(t)},RL=e=>e===Ch||e===_t;var OL;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(OL||(OL={}));const IL=(e,t)=>parseFloat(e.split(", ")[t]),DL=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return IL(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?IL(o[1],e):0}},pde=new Set(["x","y","z"]),gde=Z5.filter(e=>!pde.has(e));function mde(e){const t=[];return gde.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const NL={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:DL(4,13),y:DL(5,14)},vde=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=NL[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const h=t.getValue(u);VB(h,s[u]),e[u]=NL[u](l,o)}),e},yde=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(WB);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let h=n[l],g=Jg(h);const m=t[l];let v;if(Bv(m)){const b=m.length,w=m[0]===null?1:0;h=m[w],g=Jg(h);for(let P=w;P=0?window.pageYOffset:null,u=vde(t,e,s);return o.length&&o.forEach(([h,g])=>{e.getValue(h).set(g)}),e.render(),wh&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function Sde(e,t,n,r){return hde(t)?yde(e,t,n,r):{target:t,transitionEnd:r}}const bde=(e,t,n,r)=>{const i=dde(e,t,r);return t=i.target,r=i.transitionEnd,Sde(e,t,n,r)},zC={current:null},UB={current:!1};function xde(){if(UB.current=!0,!!wh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zC.current=e.matches;e.addListener(t),t()}else zC.current=!1}function wde(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(Bl(o))e.addValue(i,o),o4(r)&&r.add(i);else if(Bl(a))e.addValue(i,n1(o)),o4(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,n1(s!==void 0?s:o))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const GB=Object.keys(Dv),Cde=GB.length,BL=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _de{constructor({parent:t,props:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{!this.current||(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>As.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=s,this.parent=t,this.props=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=CS(n),this.isVariantNode=LN(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n);for(const h in u){const g=u[h];a[h]!==void 0&&Bl(g)&&(g.set(a[h],!1),o4(l)&&l.add(h))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var n;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(n=this.parent)===null||n===void 0?void 0:n.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),UB.current||xde(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zC.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,n,r;(t=this.projection)===null||t===void 0||t.unmount(),gh.update(this.notifyUpdate),gh.render(this.render),this.valueSubscriptions.forEach(i=>i()),(n=this.removeFromVariantTree)===null||n===void 0||n.call(this),(r=this.parent)===null||r===void 0||r.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(t,n){const r=x1.has(t),i=n.onChange(a=>{this.latestValues[t]=a,this.props.onUpdate&&As.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isProjectionDirty=!0)}),o=n.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures(t,n,r,i,o,a){const s=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:m})}return s}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ni()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let n=0;nr.variantChildren.delete(t)}addValue(t,n){this.hasValue(t)&&this.removeValue(t),this.values.set(t,n),this.latestValues[t]=n.get(),this.bindToMotionValue(t,n)}removeValue(t){var n;this.values.delete(t),(n=this.valueSubscriptions.get(t))===null||n===void 0||n(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=n1(n),this.addValue(t,r)),r}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=C8(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Bl(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Zm),this.events[t].add(n)}notify(t,...n){var r;(r=this.events[t])===null||r===void 0||r.notify(...n)}}const jB=["initial",...$8],kde=jB.length;class YB extends _de{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){var r;return(r=t.style)===null||r===void 0?void 0:r[n]}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=Mce(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){Lce(this,r,a);const s=bde(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function Ede(e){return window.getComputedStyle(e)}class Pde extends YB{readValueFromInstance(t,n){if(x1.has(n)){const r=I8(n);return r&&r.default||0}else{const r=Ede(t),i=(RN(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return $B(t,n)}build(t,n,r,i){S8(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t){return w8(t)}renderInstance(t,n,r,i){GN(t,n,r,i)}}class Tde extends YB{getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){var r;return x1.has(n)?((r=I8(n))===null||r===void 0?void 0:r.default)||0:(n=jN.has(n)?n:UN(n),t.getAttribute(n))}measureInstanceViewportBox(){return ni()}scrapeMotionValuesFromProps(t){return qN(t)}build(t,n,r,i){x8(t,n,r,i.transformTemplate)}renderInstance(t,n,r,i){YN(t,n,r,i)}}const Lde=(e,t)=>v8(e)?new Tde(t,{enableHardwareAcceleration:!1}):new Pde(t,{enableHardwareAcceleration:!0});function zL(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const em={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_t.test(e))e=parseFloat(e);else return e;const n=zL(e,t.target.x),r=zL(e,t.target.y);return`${n}% ${r}%`}},FL="_$css",Ade={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(HB,v=>(o.push(v),FL)));const a=Mu.parse(e);if(a.length>5)return r;const s=Mu.createTransformer(e),l=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,h=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=h;const g=Pr(u,h,.5);typeof a[2+l]=="number"&&(a[2+l]/=g),typeof a[3+l]=="number"&&(a[3+l]/=g);let m=s(a);if(i){let v=0;m=m.replace(FL,()=>{const b=o[v];return v++,b})}return m}};class Mde extends se.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;Vse(Ode),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),qm.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||As.postRender(()=>{var s;!((s=a.getStack())===null||s===void 0)&&s.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(i),r!=null&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t==null||t()}render(){return null}}function Rde(e){const[t,n]=O8(),r=C.exports.useContext(m8);return S(Mde,{...e,layoutGroup:r,switchLayoutGroup:C.exports.useContext(AN),isPresent:t,safeToRemove:n})}const Ode={borderRadius:{...em,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:em,borderTopRightRadius:em,borderBottomLeftRadius:em,borderBottomRightRadius:em,boxShadow:Ade},Ide={measureLayout:Rde};function Dde(e,t,n={}){const r=Bl(e)?e:n1(e);return B8("",r,t,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const qB=["TopLeft","TopRight","BottomLeft","BottomRight"],Nde=qB.length,$L=e=>typeof e=="string"?parseFloat(e):e,HL=e=>typeof e=="number"||_t.test(e);function Bde(e,t,n,r,i,o){var a,s,l,u;i?(e.opacity=Pr(0,(a=n.opacity)!==null&&a!==void 0?a:1,zde(r)),e.opacityExit=Pr((s=t.opacity)!==null&&s!==void 0?s:1,0,Fde(r))):o&&(e.opacity=Pr((l=t.opacity)!==null&&l!==void 0?l:1,(u=n.opacity)!==null&&u!==void 0?u:1,r));for(let h=0;hrt?1:n(zv(e,t,r))}function VL(e,t){e.min=t.min,e.max=t.max}function vs(e,t){VL(e.x,t.x),VL(e.y,t.y)}function UL(e,t,n,r,i){return e-=t,e=a4(e,1/n,r),i!==void 0&&(e=a4(e,1/i,r)),e}function $de(e,t=0,n=1,r=.5,i,o=e,a=e){if(Al.test(t)&&(t=parseFloat(t),t=Pr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=Pr(o.min,o.max,r);e===o&&(s-=t),e.min=UL(e.min,t,n,s,i),e.max=UL(e.max,t,n,s,i)}function GL(e,t,[n,r,i],o,a){$de(e,t[n],t[r],t[i],t.scale,o,a)}const Hde=["x","scaleX","originX"],Wde=["y","scaleY","originY"];function jL(e,t,n,r){GL(e.x,t,Hde,n==null?void 0:n.x,r==null?void 0:r.x),GL(e.y,t,Wde,n==null?void 0:n.y,r==null?void 0:r.y)}function YL(e){return e.translate===0&&e.scale===1}function XB(e){return YL(e.x)&&YL(e.y)}function ZB(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function qL(e){return va(e.x)/va(e.y)}function Vde(e,t,n=.1){return R8(e,t)<=n}class Ude{constructor(){this.members=[]}add(t){z8(this.members,t),t.scheduleRender()}remove(t){if(F8(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){var r;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,o,a;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(a=(i=t.resumingFrom)===null||i===void 0?void 0:(o=i.options).onExitComplete)===null||a===void 0||a.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function KL(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:h}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),h&&(r+=`rotateY(${h}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const Gde=(e,t)=>e.depth-t.depth;class jde{constructor(){this.children=[],this.isDirty=!1}add(t){z8(this.children,t),this.isDirty=!0}remove(t){F8(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Gde),this.isDirty=!1,this.children.forEach(t)}}const XL=["","X","Y","Z"],ZL=1e3;let Yde=0;function QB({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t==null?void 0:t()){this.id=Yde++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Qde),this.nodes.forEach(Jde)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let u=0;uthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=MB(v,250),qm.hasAnimatedSinceResize&&(qm.hasAnimatedSinceResize=!1,this.nodes.forEach(JL))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&g&&(u||h)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:v,hasRelativeTargetChanged:b,layout:w})=>{var P,E,_,T,M;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const O=(E=(P=this.options.transition)!==null&&P!==void 0?P:g.getDefaultTransition())!==null&&E!==void 0?E:ife,{onLayoutAnimationStart:I,onLayoutAnimationComplete:D}=g.getProps(),B=!this.targetLayout||!ZB(this.targetLayout,w)||b,$=!v&&b;if(((_=this.resumeFrom)===null||_===void 0?void 0:_.instance)||$||v&&(B||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,$);const H={...N8(O,"layout"),onPlay:I,onComplete:D};g.shouldReduceMotion&&(H.delay=0,H.type=!1),this.startAnimation(H)}else!v&&this.animationProgress===0&&JL(this),this.isLead()&&((M=(T=this.options).onExitComplete)===null||M===void 0||M.call(T));this.targetLayout=w})}unmount(){var a,s;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(s=this.parent)===null||s===void 0||s.children.delete(this),this.instance=void 0,gh.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1}startUpdate(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(efe),this.animationId++)}willUpdate(a=!0){var s,l,u;if(this.root.isUpdateBlocked()){(l=(s=this.options).onExitComplete)===null||l===void 0||l.call(s);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let v=0;v{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var a;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var T;const M=_/1e3;eA(v.x,a.x,M),eA(v.y,a.y,M),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&((T=this.relativeParent)===null||T===void 0?void 0:T.layout)&&(Jm(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),nfe(this.relativeTarget,this.relativeTargetOrigin,b,M)),w&&(this.animationValues=m,Bde(m,g,this.latestValues,M,E,P)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=M},this.mixTargetDelta(0)}startAnimation(a){var s,l;this.notifyListeners("animationStart"),(s=this.currentAnimation)===null||s===void 0||s.stop(),this.resumingFrom&&((l=this.resumingFrom.currentAnimation)===null||l===void 0||l.stop()),this.pendingAnimation&&(gh.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=As.update(()=>{qm.hasAnimatedSinceResize=!0,this.currentAnimation=Dde(0,ZL,{...a,onUpdate:u=>{var h;this.mixTargetDelta(u),(h=a.onUpdate)===null||h===void 0||h.call(a,u)},onComplete:()=>{var u;(u=a.onComplete)===null||u===void 0||u.call(a),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,ZL),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:h}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&JB(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ni();const g=va(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+g;const m=va(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+m}vs(s,l),d0(s,h),Qm(this.projectionDeltaWithTransform,this.layoutCorrected,s,h)}}registerSharedNode(a,s){var l,u,h;this.sharedNodes.has(a)||this.sharedNodes.set(a,new Ude),this.sharedNodes.get(a).add(s),s.promote({transition:(l=s.options.initialPromotionConfig)===null||l===void 0?void 0:l.transition,preserveFollowOpacity:(h=(u=s.options.initialPromotionConfig)===null||u===void 0?void 0:u.shouldPreserveFollowOpacity)===null||h===void 0?void 0:h.call(u,s)})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let h=0;h{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(QL),this.root.sharedNodes.clear()}}}function qde(e){e.updateLayout()}function Kde(e){var t,n,r;const i=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:a}=e.layout,{animationType:s}=e.options,l=i.source!==e.layout.source;s==="size"?pl(v=>{const b=l?i.measuredBox[v]:i.layoutBox[v],w=va(b);b.min=o[v].min,b.max=b.min+w}):JB(s,i.layoutBox,o)&&pl(v=>{const b=l?i.measuredBox[v]:i.layoutBox[v],w=va(o[v]);b.max=b.min+w});const u=ev();Qm(u,o,i.layoutBox);const h=ev();l?Qm(h,e.applyTransform(a,!0),i.measuredBox):Qm(h,o,i.layoutBox);const g=!XB(u);let m=!1;if(!e.resumeFrom){const v=e.getClosestProjectingParent();if(v&&!v.resumeFrom){const{snapshot:b,layout:w}=v;if(b&&w){const P=ni();Jm(P,i.layoutBox,b.layoutBox);const E=ni();Jm(E,o,w.layoutBox),ZB(P,E)||(m=!0)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:h,layoutDelta:u,hasLayoutChanged:g,hasRelativeTargetChanged:m})}else e.isLead()&&((r=(n=e.options).onExitComplete)===null||r===void 0||r.call(n));e.options.transition=void 0}function Xde(e){e.clearSnapshot()}function QL(e){e.clearMeasurements()}function Zde(e){const{visualElement:t}=e.options;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function JL(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Qde(e){e.resolveTargetDelta()}function Jde(e){e.calcProjection()}function efe(e){e.resetRotation()}function tfe(e){e.removeLeadSnapshot()}function eA(e,t,n){e.translate=Pr(t.translate,0,n),e.scale=Pr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function tA(e,t,n,r){e.min=Pr(t.min,n.min,r),e.max=Pr(t.max,n.max,r)}function nfe(e,t,n,r){tA(e.x,t.x,n.x,r),tA(e.y,t.y,n.y,r)}function rfe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const ife={duration:.45,ease:[.4,0,.1,1]};function ofe(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function nA(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function afe(e){nA(e.x),nA(e.y)}function JB(e,t,n){return e==="position"||e==="preserve-aspect"&&!Vde(qL(t),qL(n),.2)}const sfe=QB({attachResizeListener:(e,t)=>kS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),uw={current:void 0},lfe=QB({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!uw.current){const e=new sfe(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),uw.current=e}return uw.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),ufe={...Wce,...Que,...ude,...Ide},Vl=Hse((e,t)=>Ele(e,t,ufe,Lde,lfe));function ez(){const e=C.exports.useRef(!1);return K5(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function cfe(){const e=ez(),[t,n]=C.exports.useState(0),r=C.exports.useCallback(()=>{e.current&&n(t+1)},[t]);return[C.exports.useCallback(()=>As.postRender(r),[r]),t]}class dfe extends C.exports.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ffe({children:e,isPresent:t}){const n=C.exports.useId(),r=C.exports.useRef(null),i=C.exports.useRef({width:0,height:0,top:0,left:0});return C.exports.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${o}px !important; height: ${a}px !important; top: ${s}px !important; left: ${l}px !important; } `),()=>{document.head.removeChild(u)}},[t]),S(dfe,{isPresent:t,childRef:r,sizeRef:i,children:C.exports.cloneElement(e,{ref:r})})}const cw=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=_S(hfe),l=C.exports.useId(),u=C.exports.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:h=>{s.set(h,!0);for(const g of s.values())if(!g)return;r&&r()},register:h=>(s.set(h,!1),()=>s.delete(h))}),o?void 0:[n]);return C.exports.useMemo(()=>{s.forEach((h,g)=>s.set(g,!1))},[n]),C.exports.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=S(ffe,{isPresent:n,children:e})),S(b1.Provider,{value:u,children:e})};function hfe(){return new Map}const qp=e=>e.key||"";function pfe(e,t){e.forEach(n=>{const r=qp(n);t.set(r,n)})}function gfe(e){const t=[];return C.exports.Children.forEach(e,n=>{C.exports.isValidElement(n)&&t.push(n)}),t}const Pd=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",EB(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=cfe();const l=C.exports.useContext(m8).forceRender;l&&(s=l);const u=ez(),h=gfe(e);let g=h;const m=new Set,v=C.exports.useRef(g),b=C.exports.useRef(new Map).current,w=C.exports.useRef(!0);if(K5(()=>{w.current=!1,pfe(h,b),v.current=g}),k8(()=>{w.current=!0,b.clear(),m.clear()}),w.current)return S(Rn,{children:g.map(T=>S(cw,{isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a,children:T},qp(T)))});g=[...g];const P=v.current.map(qp),E=h.map(qp),_=P.length;for(let T=0;T<_;T++){const M=P[T];E.indexOf(M)===-1&&m.add(M)}return a==="wait"&&m.size&&(g=[]),m.forEach(T=>{if(E.indexOf(T)!==-1)return;const M=b.get(T);if(!M)return;const O=P.indexOf(T),I=()=>{b.delete(T),m.delete(T);const D=v.current.findIndex(B=>B.key===T);if(v.current.splice(D,1),!m.size){if(v.current=h,u.current===!1)return;s(),r&&r()}};g.splice(O,0,S(cw,{isPresent:!1,onExitComplete:I,custom:t,presenceAffectsLayout:o,mode:a,children:M},qp(M)))}),g=g.map(T=>{const M=T.key;return m.has(M)?T:S(cw,{isPresent:!0,presenceAffectsLayout:o,mode:a,children:T},qp(T))}),kB!=="production"&&a==="wait"&&g.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),S(Rn,{children:m.size?g:g.map(T=>C.exports.cloneElement(T))})};var bl=function(){return bl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function FC(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;re.filter(Boolean).join(" ");function mfe(){return!1}var vfe=e=>{const{condition:t,message:n}=e;t&&mfe()&&console.warn(n)},qf={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},tm={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function $C(e){var n;switch((n=e==null?void 0:e.direction)!=null?n:"right"){case"right":return tm.slideRight;case"left":return tm.slideLeft;case"bottom":return tm.slideDown;case"top":return tm.slideUp;default:return tm.slideRight}}var ih={enter:{duration:.2,ease:qf.easeOut},exit:{duration:.1,ease:qf.easeIn}},Ms={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},yfe=e=>e!=null&&parseInt(e.toString(),10)>0,iA={exit:{height:{duration:.2,ease:qf.ease},opacity:{duration:.3,ease:qf.ease}},enter:{height:{duration:.3,ease:qf.ease},opacity:{duration:.4,ease:qf.ease}}},Sfe={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:yfe(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(o=n==null?void 0:n.exit)!=null?o:Ms.exit(iA.exit,i)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(o=n==null?void 0:n.enter)!=null?o:Ms.enter(iA.enter,i)}}},nz=C.exports.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:h,...g}=e,[m,v]=C.exports.useState(!1);C.exports.useEffect(()=>{const _=setTimeout(()=>{v(!0)});return()=>clearTimeout(_)},[]),vfe({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,w={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:h==null?void 0:h.enter,exit:r?h==null?void 0:h.exit:{...h==null?void 0:h.exit,display:b?"block":"none"}}},P=r?n:!0,E=n||r?"enter":"exit";return S(Pd,{initial:!1,custom:w,children:P&&se.createElement(Vl.div,{ref:t,...g,className:f2("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:w,variants:Sfe,initial:r?"exit":!1,animate:E,exit:"exit"})})});nz.displayName="Collapse";var bfe={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Ms.enter(ih.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:Ms.exit(ih.exit,n),transitionEnd:t==null?void 0:t.exit}}},rz={initial:"exit",animate:"enter",exit:"exit",variants:bfe},xfe=C.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,h=i||r?"enter":"exit",g=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return S(Pd,{custom:m,children:g&&se.createElement(Vl.div,{ref:n,className:f2("chakra-fade",o),custom:m,...rz,animate:h,...u})})});xfe.displayName="Fade";var wfe={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(o=n==null?void 0:n.exit)!=null?o:Ms.exit(ih.exit,i)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Ms.enter(ih.enter,n),transitionEnd:e==null?void 0:e.enter}}},iz={initial:"exit",animate:"enter",exit:"exit",variants:wfe},Cfe=C.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:h,...g}=t,m=r?i&&r:!0,v=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:h};return S(Pd,{custom:b,children:m&&se.createElement(Vl.div,{ref:n,className:f2("chakra-offset-slide",s),...iz,animate:v,custom:b,...g})})});Cfe.displayName="ScaleFade";var oA={exit:{duration:.15,ease:qf.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},_fe={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{var o;const{exit:i}=$C({direction:e});return{...i,transition:(o=t==null?void 0:t.exit)!=null?o:Ms.exit(oA.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{var o;const{enter:i}=$C({direction:e});return{...i,transition:(o=n==null?void 0:n.enter)!=null?o:Ms.enter(oA.enter,r),transitionEnd:t==null?void 0:t.enter}}},oz=C.exports.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:u,delay:h,motionProps:g,...m}=t,v=$C({direction:r}),b=Object.assign({position:"fixed"},v.position,i),w=o?a&&o:!0,P=a||o?"enter":"exit",E={transitionEnd:u,transition:l,direction:r,delay:h};return S(Pd,{custom:E,children:w&&se.createElement(Vl.div,{...m,ref:n,initial:"exit",className:f2("chakra-slide",s),animate:P,exit:"exit",custom:E,variants:_fe,style:b,...g})})});oz.displayName="Slide";var kfe={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,x:e,y:t,transition:(o=n==null?void 0:n.exit)!=null?o:Ms.exit(ih.exit,i),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Ms.enter(ih.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{var s;const a={x:t,y:e};return{opacity:0,transition:(s=n==null?void 0:n.exit)!=null?s:Ms.exit(ih.exit,o),...i?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},HC={initial:"initial",animate:"enter",exit:"exit",variants:kfe},Efe=C.exports.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:h,delay:g,...m}=t,v=r?i&&r:!0,b=i||r?"enter":"exit",w={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:h,delay:g};return S(Pd,{custom:w,children:v&&se.createElement(Vl.div,{ref:n,className:f2("chakra-offset-slide",a),custom:w,...HC,animate:b,...m})})});Efe.displayName="SlideFade";var h2=(...e)=>e.filter(Boolean).join(" ");function Pfe(){return!1}var MS=e=>{const{condition:t,message:n}=e;t&&Pfe()&&console.warn(n)};function dw(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[Tfe,RS]=Pn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[Lfe,H8]=Pn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[Afe,wLe,Mfe,Rfe]=PN(),Kf=Pe(function(t,n){const{getButtonProps:r}=H8(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...RS().button};return se.createElement(xe.button,{...i,className:h2("chakra-accordion__button",t.className),__css:a})});Kf.displayName="AccordionButton";function Ofe(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;Nfe(e),Bfe(e);const s=Mfe(),[l,u]=C.exports.useState(-1);C.exports.useEffect(()=>()=>{u(-1)},[]);const[h,g]=bS({value:r,defaultValue(){return i?n!=null?n:[]:n!=null?n:-1},onChange:t});return{index:h,setIndex:g,htmlProps:a,getAccordionItemProps:v=>{let b=!1;return v!==null&&(b=Array.isArray(h)?h.includes(v):h===v),{isOpen:b,onChange:P=>{if(v!==null)if(i&&Array.isArray(h)){const E=P?h.concat(v):h.filter(_=>_!==v);g(E)}else P?g(v):o&&g(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[Ife,W8]=Pn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function Dfe(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=W8(),s=C.exports.useRef(null),l=C.exports.useId(),u=r!=null?r:l,h=`accordion-button-${u}`,g=`accordion-panel-${u}`;zfe(e);const{register:m,index:v,descendants:b}=Rfe({disabled:t&&!n}),{isOpen:w,onChange:P}=o(v===-1?null:v);Ffe({isOpen:w,isDisabled:t});const E=()=>{P==null||P(!0)},_=()=>{P==null||P(!1)},T=C.exports.useCallback(()=>{P==null||P(!w),a(v)},[v,a,w,P]),M=C.exports.useCallback(B=>{const H={ArrowDown:()=>{const j=b.nextEnabled(v);j==null||j.node.focus()},ArrowUp:()=>{const j=b.prevEnabled(v);j==null||j.node.focus()},Home:()=>{const j=b.firstEnabled();j==null||j.node.focus()},End:()=>{const j=b.lastEnabled();j==null||j.node.focus()}}[B.key];H&&(B.preventDefault(),H(B))},[b,v]),O=C.exports.useCallback(()=>{a(v)},[a,v]),I=C.exports.useCallback(function($={},H=null){return{...$,type:"button",ref:Vn(m,s,H),id:h,disabled:!!t,"aria-expanded":!!w,"aria-controls":g,onClick:dw($.onClick,T),onFocus:dw($.onFocus,O),onKeyDown:dw($.onKeyDown,M)}},[h,t,w,T,O,M,g,m]),D=C.exports.useCallback(function($={},H=null){return{...$,ref:H,role:"region",id:g,"aria-labelledby":h,hidden:!w}},[h,w,g]);return{isOpen:w,isDisabled:t,isFocusable:n,onOpen:E,onClose:_,getButtonProps:I,getPanelProps:D,htmlProps:i}}function Nfe(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;MS({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function Bfe(e){MS({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function zfe(e){MS({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. `})}function Ffe(e){MS({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Xf(e){const{isOpen:t,isDisabled:n}=H8(),{reduceMotion:r}=W8(),i=h2("chakra-accordion__icon",e.className),o=RS(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return S(wa,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e,children:S("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Xf.displayName="AccordionIcon";var Zf=Pe(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=Dfe(t),l={...RS().container,overflowAnchor:"none"},u=C.exports.useMemo(()=>a,[a]);return se.createElement(Lfe,{value:u},se.createElement(xe.div,{ref:n,...o,className:h2("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});Zf.displayName="AccordionItem";var Qf=Pe(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=W8(),{getPanelProps:s,isOpen:l}=H8(),u=s(o,n),h=h2("chakra-accordion__panel",r),g=RS();a||delete u.hidden;const m=se.createElement(xe.div,{...u,__css:g.panel,className:h});return a?m:S(nz,{in:l,...i,children:m})});Qf.displayName="AccordionPanel";var OS=Pe(function({children:t,reduceMotion:n,...r},i){const o=Bi("Accordion",r),a=bn(r),{htmlProps:s,descendants:l,...u}=Ofe(a),h=C.exports.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return se.createElement(Afe,{value:l},se.createElement(Ife,{value:h},se.createElement(Tfe,{value:o},se.createElement(xe.div,{ref:i,...s,className:h2("chakra-accordion",r.className),__css:o.root},t))))});OS.displayName="Accordion";var $fe=(...e)=>e.filter(Boolean).join(" "),Hfe=Ed({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),p2=Pe((e,t)=>{const n=ho("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=bn(e),u=$fe("chakra-spinner",s),h={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${Hfe} ${o} linear infinite`,...n};return se.createElement(xe.div,{ref:t,__css:h,className:u,...l},r&&se.createElement(xe.span,{srOnly:!0},r))});p2.displayName="Spinner";var IS=(...e)=>e.filter(Boolean).join(" ");function Wfe(e){return S(wa,{viewBox:"0 0 24 24",...e,children:S("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function Vfe(e){return S(wa,{viewBox:"0 0 24 24",...e,children:S("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function aA(e){return S(wa,{viewBox:"0 0 24 24",...e,children:S("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var[Ufe,Gfe]=Pn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[jfe,V8]=Pn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),az={info:{icon:Vfe,colorScheme:"blue"},warning:{icon:aA,colorScheme:"orange"},success:{icon:Wfe,colorScheme:"green"},error:{icon:aA,colorScheme:"red"},loading:{icon:p2,colorScheme:"blue"}};function Yfe(e){return az[e].colorScheme}function qfe(e){return az[e].icon}var sz=Pe(function(t,n){var u;const{status:r="info",addRole:i=!0,...o}=bn(t),a=(u=t.colorScheme)!=null?u:Yfe(r),s=Bi("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return se.createElement(Ufe,{value:{status:r}},se.createElement(jfe,{value:s},se.createElement(xe.div,{role:i?"alert":void 0,ref:n,...o,className:IS("chakra-alert",t.className),__css:l})))});sz.displayName="Alert";var lz=Pe(function(t,n){const i={display:"inline",...V8().description};return se.createElement(xe.div,{ref:n,...t,className:IS("chakra-alert__desc",t.className),__css:i})});lz.displayName="AlertDescription";function uz(e){const{status:t}=Gfe(),n=qfe(t),r=V8(),i=t==="loading"?r.spinner:r.icon;return se.createElement(xe.span,{display:"inherit",...e,className:IS("chakra-alert__icon",e.className),__css:i},e.children||S(n,{h:"100%",w:"100%"}))}uz.displayName="AlertIcon";var cz=Pe(function(t,n){const r=V8();return se.createElement(xe.div,{ref:n,...t,className:IS("chakra-alert__title",t.className),__css:r.title})});cz.displayName="AlertTitle";function Kfe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Xfe(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,h]=C.exports.useState("pending");C.exports.useEffect(()=>{h(n?"loading":"pending")},[n]);const g=C.exports.useRef(),m=C.exports.useCallback(()=>{if(!n)return;v();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=w=>{v(),h("loaded"),i==null||i(w)},b.onerror=w=>{v(),h("failed"),o==null||o(w)},g.current=b},[n,a,r,s,i,o,t]),v=()=>{g.current&&(g.current.onload=null,g.current.onerror=null,g.current=null)};return Ts(()=>{if(!l)return u==="loading"&&m(),()=>{v()}},[u,m,l]),l?"loaded":u}var Zfe=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",s4=Pe(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return S("img",{width:r,height:i,ref:n,alt:o,...a})});s4.displayName="NativeImage";var DS=Pe(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:h,crossOrigin:g,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:v,...b}=t,w=r!==void 0||i!==void 0,P=u!=null||h||!w,E=Xfe({...t,ignoreFallback:P}),_=Zfe(E,m),T={ref:n,objectFit:l,objectPosition:s,...P?b:Kfe(b,["onError","onLoad"])};return _?i||se.createElement(xe.img,{as:s4,className:"chakra-image__placeholder",src:r,...T}):se.createElement(xe.img,{as:s4,src:o,srcSet:a,crossOrigin:g,loading:u,referrerPolicy:v,className:"chakra-image",...T})});DS.displayName="Image";Pe((e,t)=>se.createElement(xe.img,{ref:t,as:s4,className:"chakra-image",...e}));function NS(e){return C.exports.Children.toArray(e).filter(t=>C.exports.isValidElement(t))}var BS=(...e)=>e.filter(Boolean).join(" "),sA=e=>e?"":void 0,[Qfe,Jfe]=Pn({strict:!1,name:"ButtonGroupContext"});function WC(e){const{children:t,className:n,...r}=e,i=C.exports.isValidElement(t)?C.exports.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=BS("chakra-button__icon",n);return se.createElement(xe.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}WC.displayName="ButtonIcon";function VC(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=S(p2,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=BS("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",h=C.exports.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return se.createElement(xe.div,{className:l,...s,__css:h},i)}VC.displayName="ButtonSpinner";function ehe(e){const[t,n]=C.exports.useState(!e);return{ref:C.exports.useCallback(o=>{!o||n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var ja=Pe((e,t)=>{const n=Jfe(),r=ho("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:h,iconSpacing:g="0.5rem",type:m,spinner:v,spinnerPlacement:b="start",className:w,as:P,...E}=bn(e),_=C.exports.useMemo(()=>{const I={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:I}}},[r,n]),{ref:T,type:M}=ehe(P),O={rightIcon:u,leftIcon:l,iconSpacing:g,children:s};return se.createElement(xe.button,{disabled:i||o,ref:wse(t,T),as:P,type:m!=null?m:M,"data-active":sA(a),"data-loading":sA(o),__css:_,className:BS("chakra-button",w),...E},o&&b==="start"&&S(VC,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:g,children:v}),o?h||se.createElement(xe.span,{opacity:0},S(lA,{...O})):S(lA,{...O}),o&&b==="end"&&S(VC,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:g,children:v}))});ja.displayName="Button";function lA(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return X(Rn,{children:[t&&S(WC,{marginEnd:i,children:t}),r,n&&S(WC,{marginStart:i,children:n})]})}var ji=Pe(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,...h}=t,g=BS("chakra-button__group",a),m=C.exports.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let v={display:"inline-flex"};return l?v={...v,"> *:first-of-type:not(:last-of-type)":{borderEndRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderStartRadius:0}}:v={...v,"& > *:not(style) ~ *:not(style)":{marginStart:s}},se.createElement(Qfe,{value:m},se.createElement(xe.div,{ref:n,role:"group",__css:v,className:g,"data-attached":l?"":void 0,...h}))});ji.displayName="ButtonGroup";var Ya=Pe((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=C.exports.isValidElement(s)?C.exports.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return S(ja,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a,children:l})});Ya.displayName="IconButton";var _1=(...e)=>e.filter(Boolean).join(" "),Zy=e=>e?"":void 0,fw=e=>e?!0:void 0;function uA(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[the,dz]=Pn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[nhe,k1]=Pn({strict:!1,name:"FormControlContext"});function rhe(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=C.exports.useId(),l=t||`field-${s}`,u=`${l}-label`,h=`${l}-feedback`,g=`${l}-helptext`,[m,v]=C.exports.useState(!1),[b,w]=C.exports.useState(!1),[P,E]=C.exports.useState(!1),_=C.exports.useCallback((D={},B=null)=>({id:g,...D,ref:Vn(B,$=>{!$||w(!0)})}),[g]),T=C.exports.useCallback((D={},B=null)=>{var $,H;return{...D,ref:B,"data-focus":Zy(P),"data-disabled":Zy(i),"data-invalid":Zy(r),"data-readonly":Zy(o),id:($=D.id)!=null?$:u,htmlFor:(H=D.htmlFor)!=null?H:l}},[l,i,P,r,o,u]),M=C.exports.useCallback((D={},B=null)=>({id:h,...D,ref:Vn(B,$=>{!$||v(!0)}),"aria-live":"polite"}),[h]),O=C.exports.useCallback((D={},B=null)=>({...D,...a,ref:B,role:"group"}),[a]),I=C.exports.useCallback((D={},B=null)=>({...D,ref:B,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!P,onFocus:()=>E(!0),onBlur:()=>E(!1),hasFeedbackText:m,setHasFeedbackText:v,hasHelpText:b,setHasHelpText:w,id:l,labelId:u,feedbackId:h,helpTextId:g,htmlProps:a,getHelpTextProps:_,getErrorMessageProps:M,getRootProps:O,getLabelProps:T,getRequiredIndicatorProps:I}}var Td=Pe(function(t,n){const r=Bi("Form",t),i=bn(t),{getRootProps:o,htmlProps:a,...s}=rhe(i),l=_1("chakra-form-control",t.className);return se.createElement(nhe,{value:s},se.createElement(the,{value:r},se.createElement(xe.div,{...o({},n),className:l,__css:r.container})))});Td.displayName="FormControl";var ihe=Pe(function(t,n){const r=k1(),i=dz(),o=_1("chakra-form__helper-text",t.className);return se.createElement(xe.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});ihe.displayName="FormHelperText";function U8(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=G8(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":fw(n),"aria-required":fw(i),"aria-readonly":fw(r)}}function G8(e){var b,w,P;const t=k1(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:u,onFocus:h,onBlur:g,...m}=e,v=e["aria-describedby"]?[e["aria-describedby"]]:[];return(t==null?void 0:t.hasFeedbackText)&&(t==null?void 0:t.isInvalid)&&v.push(t.feedbackId),t!=null&&t.hasHelpText&&v.push(t.helpTextId),{...m,"aria-describedby":v.join(" ")||void 0,id:n!=null?n:t==null?void 0:t.id,isDisabled:(b=r!=null?r:u)!=null?b:t==null?void 0:t.isDisabled,isReadOnly:(w=i!=null?i:l)!=null?w:t==null?void 0:t.isReadOnly,isRequired:(P=o!=null?o:a)!=null?P:t==null?void 0:t.isRequired,isInvalid:s!=null?s:t==null?void 0:t.isInvalid,onFocus:uA(t==null?void 0:t.onFocus,h),onBlur:uA(t==null?void 0:t.onBlur,g)}}var[ohe,ahe]=Pn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),she=Pe((e,t)=>{const n=Bi("FormError",e),r=bn(e),i=k1();return i!=null&&i.isInvalid?se.createElement(ohe,{value:n},se.createElement(xe.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:_1("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});she.displayName="FormErrorMessage";var lhe=Pe((e,t)=>{const n=ahe(),r=k1();if(!(r!=null&&r.isInvalid))return null;const i=_1("chakra-form__error-icon",e.className);return S(wa,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i,children:S("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})});lhe.displayName="FormErrorIcon";var _h=Pe(function(t,n){var m;const r=ho("FormLabel",t),i=bn(t),{className:o,children:a,requiredIndicator:s=S(fz,{}),optionalIndicator:l=null,...u}=i,h=k1(),g=(m=h==null?void 0:h.getLabelProps(u,n))!=null?m:{ref:n,...u};return se.createElement(xe.label,{...g,className:_1("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,h!=null&&h.isRequired?s:l)});_h.displayName="FormLabel";var fz=Pe(function(t,n){const r=k1(),i=dz();if(!(r!=null&&r.isRequired))return null;const o=_1("chakra-form__required-indicator",t.className);return se.createElement(xe.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});fz.displayName="RequiredIndicator";function vd(e,t){const n=C.exports.useRef(!1),r=C.exports.useRef(!1);C.exports.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),C.exports.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var j8={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},uhe=xe("span",{baseStyle:j8});uhe.displayName="VisuallyHidden";var che=xe("input",{baseStyle:j8});che.displayName="VisuallyHiddenInput";var cA=!1,zS=null,r1=!1,UC=new Set,dhe=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function fhe(e){return!(e.metaKey||!dhe&&e.altKey||e.ctrlKey)}function Y8(e,t){UC.forEach(n=>n(e,t))}function dA(e){r1=!0,fhe(e)&&(zS="keyboard",Y8("keyboard",e))}function Dp(e){zS="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(r1=!0,Y8("pointer",e))}function hhe(e){e.target===window||e.target===document||(r1||(zS="keyboard",Y8("keyboard",e)),r1=!1)}function phe(){r1=!1}function fA(){return zS!=="pointer"}function ghe(){if(typeof window>"u"||cA)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){r1=!0,e.apply(this,n)},document.addEventListener("keydown",dA,!0),document.addEventListener("keyup",dA,!0),window.addEventListener("focus",hhe,!0),window.addEventListener("blur",phe,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Dp,!0),document.addEventListener("pointermove",Dp,!0),document.addEventListener("pointerup",Dp,!0)):(document.addEventListener("mousedown",Dp,!0),document.addEventListener("mousemove",Dp,!0),document.addEventListener("mouseup",Dp,!0)),cA=!0}function mhe(e){ghe(),e(fA());const t=()=>e(fA());return UC.add(t),()=>{UC.delete(t)}}var[CLe,vhe]=Pn({name:"CheckboxGroupContext",strict:!1}),yhe=(...e)=>e.filter(Boolean).join(" "),ro=e=>e?"":void 0;function Oa(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function She(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function bhe(e){return se.createElement(xe.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e},S("polyline",{points:"1.5 6 4.5 9 10.5 1"}))}function xhe(e){return se.createElement(xe.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e},S("line",{x1:"21",x2:"3",y1:"12",y2:"12"}))}function whe(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?xhe:bhe;return n||t?se.createElement(xe.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},S(i,{...r})):null}function Che(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function hz(e={}){const t=G8(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:h,isChecked:g,isFocusable:m,onChange:v,isIndeterminate:b,name:w,value:P,tabIndex:E=void 0,"aria-label":_,"aria-labelledby":T,"aria-invalid":M,...O}=e,I=Che(O,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=hr(v),B=hr(s),$=hr(l),[H,j]=C.exports.useState(!1),[ne,V]=C.exports.useState(!1),[q,te]=C.exports.useState(!1),[J,Z]=C.exports.useState(!1);C.exports.useEffect(()=>mhe(j),[]);const G=C.exports.useRef(null),[ee,le]=C.exports.useState(!0),[me,Me]=C.exports.useState(!!h),Ce=g!==void 0,be=Ce?g:me,we=C.exports.useCallback(Te=>{if(r||n){Te.preventDefault();return}Ce||Me(be?Te.target.checked:b?!0:Te.target.checked),D==null||D(Te)},[r,n,be,Ce,b,D]);Ts(()=>{G.current&&(G.current.indeterminate=Boolean(b))},[b]),vd(()=>{n&&V(!1)},[n,V]),Ts(()=>{const Te=G.current;!(Te!=null&&Te.form)||(Te.form.onreset=()=>{Me(!!h)})},[]);const Ve=n&&!m,Ze=C.exports.useCallback(Te=>{Te.key===" "&&Z(!0)},[Z]),it=C.exports.useCallback(Te=>{Te.key===" "&&Z(!1)},[Z]);Ts(()=>{if(!G.current)return;G.current.checked!==be&&Me(G.current.checked)},[G.current]);const pt=C.exports.useCallback((Te={},ot=null)=>{const Mt=Je=>{ne&&Je.preventDefault(),Z(!0)};return{...Te,ref:ot,"data-active":ro(J),"data-hover":ro(q),"data-checked":ro(be),"data-focus":ro(ne),"data-focus-visible":ro(ne&&H),"data-indeterminate":ro(b),"data-disabled":ro(n),"data-invalid":ro(o),"data-readonly":ro(r),"aria-hidden":!0,onMouseDown:Oa(Te.onMouseDown,Mt),onMouseUp:Oa(Te.onMouseUp,()=>Z(!1)),onMouseEnter:Oa(Te.onMouseEnter,()=>te(!0)),onMouseLeave:Oa(Te.onMouseLeave,()=>te(!1))}},[J,be,n,ne,H,q,b,o,r]),kt=C.exports.useCallback((Te={},ot=null)=>({...I,...Te,ref:Vn(ot,Mt=>{!Mt||le(Mt.tagName==="LABEL")}),onClick:Oa(Te.onClick,()=>{var Mt;ee||((Mt=G.current)==null||Mt.click(),requestAnimationFrame(()=>{var Je;(Je=G.current)==null||Je.focus()}))}),"data-disabled":ro(n),"data-checked":ro(be),"data-invalid":ro(o)}),[I,n,be,o,ee]),gt=C.exports.useCallback((Te={},ot=null)=>({...Te,ref:Vn(G,ot),type:"checkbox",name:w,value:P,id:a,tabIndex:E,onChange:Oa(Te.onChange,we),onBlur:Oa(Te.onBlur,B,()=>V(!1)),onFocus:Oa(Te.onFocus,$,()=>V(!0)),onKeyDown:Oa(Te.onKeyDown,Ze),onKeyUp:Oa(Te.onKeyUp,it),required:i,checked:be,disabled:Ve,readOnly:r,"aria-label":_,"aria-labelledby":T,"aria-invalid":M?Boolean(M):o,"aria-describedby":u,"aria-disabled":n,style:j8}),[w,P,a,we,B,$,Ze,it,i,be,Ve,r,_,T,M,o,u,n,E]),ht=C.exports.useCallback((Te={},ot=null)=>({...Te,ref:ot,onMouseDown:Oa(Te.onMouseDown,hA),onTouchStart:Oa(Te.onTouchStart,hA),"data-disabled":ro(n),"data-checked":ro(be),"data-invalid":ro(o)}),[be,n,o]);return{state:{isInvalid:o,isFocused:ne,isChecked:be,isActive:J,isHovered:q,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:kt,getCheckboxProps:pt,getInputProps:gt,getLabelProps:ht,htmlProps:I}}function hA(e){e.preventDefault(),e.stopPropagation()}var _he={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},khe={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},Ehe=Ed({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),Phe=Ed({from:{opacity:0},to:{opacity:1}}),The=Ed({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),pz=Pe(function(t,n){const r=vhe(),i={...r,...t},o=Bi("Checkbox",i),a=bn(t),{spacing:s="0.5rem",className:l,children:u,iconColor:h,iconSize:g,icon:m=S(whe,{}),isChecked:v,isDisabled:b=r==null?void 0:r.isDisabled,onChange:w,inputProps:P,...E}=a;let _=v;(r==null?void 0:r.value)&&a.value&&(_=r.value.includes(a.value));let T=w;(r==null?void 0:r.onChange)&&a.value&&(T=She(r.onChange,w));const{state:M,getInputProps:O,getCheckboxProps:I,getLabelProps:D,getRootProps:B}=hz({...E,isDisabled:b,isChecked:_,onChange:T}),$=C.exports.useMemo(()=>({animation:M.isIndeterminate?`${Phe} 20ms linear, ${The} 200ms linear`:`${Ehe} 200ms linear`,fontSize:g,color:h,...o.icon}),[h,g,,M.isIndeterminate,o.icon]),H=C.exports.cloneElement(m,{__css:$,isIndeterminate:M.isIndeterminate,isChecked:M.isChecked});return se.createElement(xe.label,{__css:{...khe,...o.container},className:yhe("chakra-checkbox",l),...B()},S("input",{className:"chakra-checkbox__input",...O(P,n)}),se.createElement(xe.span,{__css:{..._he,...o.control},className:"chakra-checkbox__control",...I()},H),u&&se.createElement(xe.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:s,...o.label}},u))});pz.displayName="Checkbox";function Lhe(e){return S(wa,{focusable:"false","aria-hidden":!0,...e,children:S("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var FS=Pe(function(t,n){const r=ho("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=bn(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return se.createElement(xe.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||S(Lhe,{width:"1em",height:"1em"}))});FS.displayName="CloseButton";function Ahe(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function q8(e,t){let n=Ahe(e);const r=10**(t!=null?t:10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function GC(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function l4(e,t,n){return(e-t)*100/(n-t)}function gz(e,t,n){return(n-t)*e+t}function jC(e,t,n){const r=Math.round((e-t)/n)*n+t,i=GC(n);return q8(r,i)}function N0(e,t,n){return e==null?e:(n{var H;return r==null?"":(H=hw(r,o,n))!=null?H:""}),m=typeof i<"u",v=m?i:h,b=mz(Fc(v),o),w=n!=null?n:b,P=C.exports.useCallback(H=>{H!==v&&(m||g(H.toString()),u==null||u(H.toString(),Fc(H)))},[u,m,v]),E=C.exports.useCallback(H=>{let j=H;return l&&(j=N0(j,a,s)),q8(j,w)},[w,l,s,a]),_=C.exports.useCallback((H=o)=>{let j;v===""?j=Fc(H):j=Fc(v)+H,j=E(j),P(j)},[E,o,P,v]),T=C.exports.useCallback((H=o)=>{let j;v===""?j=Fc(-H):j=Fc(v)-H,j=E(j),P(j)},[E,o,P,v]),M=C.exports.useCallback(()=>{var j;let H;r==null?H="":H=(j=hw(r,o,n))!=null?j:a,P(H)},[r,n,o,P,a]),O=C.exports.useCallback(H=>{var ne;const j=(ne=hw(H,o,w))!=null?ne:a;P(j)},[w,o,P,a]),I=Fc(v);return{isOutOfRange:I>s||IS(mS,{styles:vz}),Ohe=()=>S(mS,{styles:` html { line-height: 1.5; -webkit-text-size-adjust: 100%; font-family: system-ui, sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -moz-osx-font-smoothing: grayscale; touch-action: manipulation; } body { position: relative; min-height: 100%; font-feature-settings: 'kern'; } *, *::before, *::after { border-width: 0; border-style: solid; box-sizing: border-box; } main { display: block; } hr { border-top-width: 1px; box-sizing: content-box; height: 0; overflow: visible; } pre, code, kbd, samp { font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 1em; } a { background-color: transparent; color: inherit; text-decoration: inherit; } abbr[title] { border-bottom: none; text-decoration: underline; -webkit-text-decoration: underline dotted; text-decoration: underline dotted; } b, strong { font-weight: bold; } small { font-size: 80%; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sub { bottom: -0.25em; } sup { top: -0.5em; } img { border-style: none; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, input { overflow: visible; } button, select { text-transform: none; } button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner { border-style: none; padding: 0; } fieldset { padding: 0.35em 0.75em 0.625em; } legend { box-sizing: border-box; color: inherit; display: table; max-width: 100%; padding: 0; white-space: normal; } progress { vertical-align: baseline; } textarea { overflow: auto; } [type="checkbox"], [type="radio"] { box-sizing: border-box; padding: 0; } [type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button { -webkit-appearance: none !important; } input[type="number"] { -moz-appearance: textfield; } [type="search"] { -webkit-appearance: textfield; outline-offset: -2px; } [type="search"]::-webkit-search-decoration { -webkit-appearance: none !important; } ::-webkit-file-upload-button { -webkit-appearance: button; font: inherit; } details { display: block; } summary { display: list-item; } template { display: none; } [hidden] { display: none !important; } body, blockquote, dl, dd, h1, h2, h3, h4, h5, h6, hr, figure, p, pre { margin: 0; } button { background: transparent; padding: 0; } fieldset { margin: 0; padding: 0; } ol, ul { margin: 0; padding: 0; } textarea { resize: vertical; } button, [role="button"] { cursor: pointer; } button::-moz-focus-inner { border: 0 !important; } table { border-collapse: collapse; } h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; } button, input, optgroup, select, textarea { padding: 0; line-height: inherit; color: inherit; } img, svg, video, canvas, audio, iframe, embed, object { display: block; } img, video { max-width: 100%; height: auto; } [data-js-focus-visible] :focus:not([data-focus-visible-added]):not([data-focus-visible-disabled]) { outline: none; box-shadow: none; } select::-ms-expand { display: none; } ${vz} `});function oh(e,t,n,r){const i=hr(n);return C.exports.useEffect(()=>{const o=typeof e=="function"?e():e!=null?e:document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e!=null?e:document;o==null||o.removeEventListener(t,i,r)}}function Ihe(e){return"current"in e}var yz=()=>typeof window<"u";function Dhe(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}var Nhe=e=>yz()&&e.test(navigator.vendor),Bhe=e=>yz()&&e.test(Dhe()),zhe=()=>Bhe(/mac|iphone|ipad|ipod/i),Fhe=()=>zhe()&&Nhe(/apple/i);function $he(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var a;var o;return(a=(o=t.current)==null?void 0:o.ownerDocument)!=null?a:document};oh(i,"pointerdown",o=>{if(!Fhe()||!r)return;const a=o.target,l=(n!=null?n:[t]).some(u=>{const h=Ihe(u)?u.current:u;return(h==null?void 0:h.contains(a))||h===a});i().activeElement!==a&&l&&(o.preventDefault(),a.focus())})}var Hhe=Lee?C.exports.useLayoutEffect:C.exports.useEffect;function pA(e,t=[]){const n=C.exports.useRef(e);return Hhe(()=>{n.current=e}),C.exports.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Whe(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Vhe(e,t){const n=C.exports.useId();return C.exports.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function Hv(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=pA(n),a=pA(t),[s,l]=C.exports.useState(e.defaultIsOpen||!1),[u,h]=Whe(r,s),g=Vhe(i,"disclosure"),m=C.exports.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),v=C.exports.useCallback(()=>{u||l(!0),o==null||o()},[u,o]),b=C.exports.useCallback(()=>{(h?m:v)()},[h,v,m]);return{isOpen:!!h,onOpen:v,onClose:m,onToggle:b,isControlled:u,getButtonProps:(w={})=>({...w,"aria-expanded":h,"aria-controls":g,onClick:Aee(w.onClick,b)}),getDisclosureProps:(w={})=>({...w,hidden:!h,id:g})}}function K8(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var X8=Pe(function(t,n){const{htmlSize:r,...i}=t,o=Bi("Input",i),a=bn(i),s=U8(a),l=Fr("chakra-input",t.className);return se.createElement(xe.input,{size:r,...s,__css:o.field,ref:n,className:l})});X8.displayName="Input";X8.id="Input";var[Uhe,Sz]=Pn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Ghe=Pe(function(t,n){const r=Bi("Input",t),{children:i,className:o,...a}=bn(t),s=Fr("chakra-input__group",o),l={},u=NS(i),h=r.field;u.forEach(m=>{var v,b;!r||(h&&m.type.id==="InputLeftElement"&&(l.paddingStart=(v=h.height)!=null?v:h.h),h&&m.type.id==="InputRightElement"&&(l.paddingEnd=(b=h.height)!=null?b:h.h),m.type.id==="InputRightAddon"&&(l.borderEndRadius=0),m.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const g=u.map(m=>{var v,b;const w=K8({size:((v=m.props)==null?void 0:v.size)||t.size,variant:((b=m.props)==null?void 0:b.variant)||t.variant});return m.type.id!=="Input"?C.exports.cloneElement(m,w):C.exports.cloneElement(m,Object.assign(w,l,m.props))});return se.createElement(xe.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative"},...a},S(Uhe,{value:r,children:g}))});Ghe.displayName="InputGroup";var jhe={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},Yhe=xe("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),Z8=Pe(function(t,n){var s;const{placement:r="left",...i}=t,o=(s=jhe[r])!=null?s:{},a=Sz();return S(Yhe,{ref:n,...i,__css:{...a.addon,...o}})});Z8.displayName="InputAddon";var bz=Pe(function(t,n){return S(Z8,{ref:n,placement:"left",...t,className:Fr("chakra-input__left-addon",t.className)})});bz.displayName="InputLeftAddon";bz.id="InputLeftAddon";var xz=Pe(function(t,n){return S(Z8,{ref:n,placement:"right",...t,className:Fr("chakra-input__right-addon",t.className)})});xz.displayName="InputRightAddon";xz.id="InputRightAddon";var qhe=xe("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),$S=Pe(function(t,n){var u,h;const{placement:r="left",...i}=t,o=Sz(),a=o.field,l={[r==="left"?"insetStart":"insetEnd"]:"0",width:(u=a==null?void 0:a.height)!=null?u:a==null?void 0:a.h,height:(h=a==null?void 0:a.height)!=null?h:a==null?void 0:a.h,fontSize:a==null?void 0:a.fontSize,...o.element};return S(qhe,{ref:n,__css:l,...i})});$S.id="InputElement";$S.displayName="InputElement";var wz=Pe(function(t,n){const{className:r,...i}=t,o=Fr("chakra-input__left-element",r);return S($S,{ref:n,placement:"left",className:o,...i})});wz.id="InputLeftElement";wz.displayName="InputLeftElement";var Cz=Pe(function(t,n){const{className:r,...i}=t,o=Fr("chakra-input__right-element",r);return S($S,{ref:n,placement:"right",className:o,...i})});Cz.id="InputRightElement";Cz.displayName="InputRightElement";function Khe(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}Object.freeze(["base","sm","md","lg","xl","2xl"]);function yd(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Khe(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Xhe=Pe(function(e,t){const{ratio:n=4/3,children:r,className:i,...o}=e,a=C.exports.Children.only(r),s=Fr("chakra-aspect-ratio",i);return se.createElement(xe.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:yd(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...o},a)});Xhe.displayName="AspectRatio";var Zhe=Pe(function(t,n){const r=ho("Badge",t),{className:i,...o}=bn(t);return se.createElement(xe.span,{ref:n,className:Fr("chakra-badge",t.className),...o,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Zhe.displayName="Badge";var Ld=xe("div");Ld.displayName="Box";var _z=Pe(function(t,n){const{size:r,centerContent:i=!0,...o}=t;return S(Ld,{ref:n,boxSize:r,__css:{...i?{display:"flex",alignItems:"center",justifyContent:"center"}:{},flexShrink:0,flexGrow:0},...o})});_z.displayName="Square";var Qhe=Pe(function(t,n){const{size:r,...i}=t;return S(_z,{size:r,ref:n,borderRadius:"9999px",...i})});Qhe.displayName="Circle";var kz=xe("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});kz.displayName="Center";var Jhe={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Pe(function(t,n){const{axis:r="both",...i}=t;return se.createElement(xe.div,{ref:n,__css:Jhe[r],...i,position:"absolute"})});var epe=Pe(function(t,n){const r=ho("Code",t),{className:i,...o}=bn(t);return se.createElement(xe.code,{ref:n,className:Fr("chakra-code",t.className),...o,__css:{display:"inline-block",...r}})});epe.displayName="Code";var tpe=Pe(function(t,n){const{className:r,centerContent:i,...o}=bn(t),a=ho("Container",t);return se.createElement(xe.div,{ref:n,className:Fr("chakra-container",r),...o,__css:{...a,...i&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});tpe.displayName="Container";var npe=Pe(function(t,n){const{borderLeftWidth:r,borderBottomWidth:i,borderTopWidth:o,borderRightWidth:a,borderWidth:s,borderStyle:l,borderColor:u,...h}=ho("Divider",t),{className:g,orientation:m="horizontal",__css:v,...b}=bn(t),w={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:i||o||s||"1px",width:"100%"}};return se.createElement(xe.hr,{ref:n,"aria-orientation":m,...b,__css:{...h,border:"0",borderColor:u,borderStyle:l,...w[m],...v},className:Fr("chakra-divider",g)})});npe.displayName="Divider";var bt=Pe(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...h}=t,g={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return se.createElement(xe.div,{ref:n,__css:g,...h})});bt.displayName="Flex";var Ez=Pe(function(t,n){const{templateAreas:r,gap:i,rowGap:o,columnGap:a,column:s,row:l,autoFlow:u,autoRows:h,templateRows:g,autoColumns:m,templateColumns:v,...b}=t,w={display:"grid",gridTemplateAreas:r,gridGap:i,gridRowGap:o,gridColumnGap:a,gridAutoColumns:m,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:h,gridTemplateRows:g,gridTemplateColumns:v};return se.createElement(xe.div,{ref:n,__css:w,...b})});Ez.displayName="Grid";function gA(e){return yd(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var rpe=Pe(function(t,n){const{area:r,colSpan:i,colStart:o,colEnd:a,rowEnd:s,rowSpan:l,rowStart:u,...h}=t,g=K8({gridArea:r,gridColumn:gA(i),gridRow:gA(l),gridColumnStart:o,gridColumnEnd:a,gridRowStart:u,gridRowEnd:s});return se.createElement(xe.div,{ref:n,__css:g,...h})});rpe.displayName="GridItem";var ah=Pe(function(t,n){const r=ho("Heading",t),{className:i,...o}=bn(t);return se.createElement(xe.h2,{ref:n,className:Fr("chakra-heading",t.className),...o,__css:r})});ah.displayName="Heading";Pe(function(t,n){const r=ho("Mark",t),i=bn(t);return S(Ld,{ref:n,...i,as:"mark",__css:{bg:"transparent",whiteSpace:"nowrap",...r}})});var ipe=Pe(function(t,n){const r=ho("Kbd",t),{className:i,...o}=bn(t);return se.createElement(xe.kbd,{ref:n,className:Fr("chakra-kbd",i),...o,__css:{fontFamily:"mono",...r}})});ipe.displayName="Kbd";var sh=Pe(function(t,n){const r=ho("Link",t),{className:i,isExternal:o,...a}=bn(t);return se.createElement(xe.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:Fr("chakra-link",i),...a,__css:r})});sh.displayName="Link";Pe(function(t,n){const{isExternal:r,target:i,rel:o,className:a,...s}=t;return se.createElement(xe.a,{...s,ref:n,className:Fr("chakra-linkbox__overlay",a),rel:r?"noopener noreferrer":o,target:r?"_blank":i,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});Pe(function(t,n){const{className:r,...i}=t;return se.createElement(xe.div,{ref:n,position:"relative",...i,className:Fr("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});var[ope,Pz]=Pn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Q8=Pe(function(t,n){const r=Bi("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=bn(t),u=NS(i),g=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return se.createElement(ope,{value:r},se.createElement(xe.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...g},...l},u))});Q8.displayName="List";var ape=Pe((e,t)=>{const{as:n,...r}=e;return S(Q8,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});ape.displayName="OrderedList";var spe=Pe(function(t,n){const{as:r,...i}=t;return S(Q8,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});spe.displayName="UnorderedList";var lpe=Pe(function(t,n){const r=Pz();return se.createElement(xe.li,{ref:n,...t,__css:r.item})});lpe.displayName="ListItem";var upe=Pe(function(t,n){const r=Pz();return S(wa,{ref:n,role:"presentation",...t,__css:r.icon})});upe.displayName="ListIcon";var cpe=Pe(function(t,n){const{columns:r,spacingX:i,spacingY:o,spacing:a,minChildWidth:s,...l}=t,u=S1(),h=s?fpe(s,u):hpe(r);return S(Ez,{ref:n,gap:a,columnGap:i,rowGap:o,templateColumns:h,...l})});cpe.displayName="SimpleGrid";function dpe(e){return typeof e=="number"?`${e}px`:e}function fpe(e,t){return yd(e,n=>{const r=dse("sizes",n,dpe(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function hpe(e){return yd(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}var Tz=xe("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});Tz.displayName="Spacer";var YC="& > *:not(style) ~ *:not(style)";function ppe(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[YC]:yd(n,i=>r[i])}}function gpe(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":yd(n,i=>r[i])}}var Lz=e=>se.createElement(xe.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});Lz.displayName="StackItem";var J8=Pe((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:h,shouldWrapChildren:g,...m}=e,v=n?"row":r!=null?r:"column",b=C.exports.useMemo(()=>ppe({direction:v,spacing:a}),[v,a]),w=C.exports.useMemo(()=>gpe({spacing:a,direction:v}),[a,v]),P=!!u,E=!g&&!P,_=C.exports.useMemo(()=>{const M=NS(l);return E?M:M.map((O,I)=>{const D=typeof O.key<"u"?O.key:I,B=I+1===M.length,H=g?S(Lz,{children:O},D):O;if(!P)return H;const j=C.exports.cloneElement(u,{__css:w}),ne=B?null:j;return X(C.exports.Fragment,{children:[H,ne]},D)})},[u,w,P,E,g,l]),T=Fr("chakra-stack",h);return se.createElement(xe.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:b.flexDirection,flexWrap:s,className:T,__css:P?{}:{[YC]:b[YC]},...m},_)});J8.displayName="Stack";var Az=Pe((e,t)=>S(J8,{align:"center",...e,direction:"row",ref:t}));Az.displayName="HStack";var Mz=Pe((e,t)=>S(J8,{align:"center",...e,direction:"column",ref:t}));Mz.displayName="VStack";var Mo=Pe(function(t,n){const r=ho("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=bn(t),u=K8({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return se.createElement(xe.p,{ref:n,className:Fr("chakra-text",t.className),...u,...l,__css:r})});Mo.displayName="Text";function mA(e){return typeof e=="number"?`${e}px`:e}var mpe=Pe(function(t,n){const{spacing:r="0.5rem",spacingX:i,spacingY:o,children:a,justify:s,direction:l,align:u,className:h,shouldWrapChildren:g,...m}=t,v=C.exports.useMemo(()=>{const{spacingX:w=r,spacingY:P=r}={spacingX:i,spacingY:o};return{"--chakra-wrap-x-spacing":E=>yd(w,_=>mA(nC("space",_)(E))),"--chakra-wrap-y-spacing":E=>yd(P,_=>mA(nC("space",_)(E))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:u,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[r,i,o,s,u,l]),b=C.exports.useMemo(()=>g?C.exports.Children.map(a,(w,P)=>S(Rz,{children:w},P)):a,[a,g]);return se.createElement(xe.div,{ref:n,className:Fr("chakra-wrap",h),overflow:"hidden",...m},se.createElement(xe.ul,{className:"chakra-wrap__list",__css:v},b))});mpe.displayName="Wrap";var Rz=Pe(function(t,n){const{className:r,...i}=t;return se.createElement(xe.li,{ref:n,__css:{display:"flex",alignItems:"flex-start"},className:Fr("chakra-wrap__listitem",r),...i})});Rz.displayName="WrapItem";var vpe={body:{classList:{add(){},remove(){}}},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}}},Oz=vpe,Np=()=>{},ype={document:Oz,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:Np,removeEventListener:Np,getComputedStyle(){return{getPropertyValue(){return""}}},matchMedia(){return{matches:!1,addListener:Np,removeListener:Np}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)},setTimeout:()=>0,clearTimeout:Np,setInterval:()=>0,clearInterval:Np},Spe=ype,bpe={window:Spe,document:Oz},Iz=typeof window<"u"?{window,document}:bpe,Dz=C.exports.createContext(Iz);Dz.displayName="EnvironmentContext";function Nz(e){const{children:t,environment:n}=e,[r,i]=C.exports.useState(null),[o,a]=C.exports.useState(!1);C.exports.useEffect(()=>a(!0),[]);const s=C.exports.useMemo(()=>{if(n)return n;const l=r==null?void 0:r.ownerDocument,u=r==null?void 0:r.ownerDocument.defaultView;return l?{document:l,window:u}:Iz},[r,n]);return X(Dz.Provider,{value:s,children:[t,!n&&o&&S("span",{id:"__chakra_env",hidden:!0,ref:l=>{C.exports.startTransition(()=>{l&&i(l)})}})]})}Nz.displayName="EnvironmentProvider";var xpe=e=>e?"":void 0;function wpe(){const e=C.exports.useRef(new Map),t=e.current,n=C.exports.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=C.exports.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return C.exports.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function pw(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function Cpe(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:h,tabIndex:g,onMouseOver:m,onMouseLeave:v,...b}=e,[w,P]=C.exports.useState(!0),[E,_]=C.exports.useState(!1),T=wpe(),M=Z=>{!Z||Z.tagName!=="BUTTON"&&P(!1)},O=w?g:g||0,I=n&&!r,D=C.exports.useCallback(Z=>{if(n){Z.stopPropagation(),Z.preventDefault();return}Z.currentTarget.focus(),l==null||l(Z)},[n,l]),B=C.exports.useCallback(Z=>{E&&pw(Z)&&(Z.preventDefault(),Z.stopPropagation(),_(!1),T.remove(document,"keyup",B,!1))},[E,T]),$=C.exports.useCallback(Z=>{if(u==null||u(Z),n||Z.defaultPrevented||Z.metaKey||!pw(Z.nativeEvent)||w)return;const G=i&&Z.key==="Enter";o&&Z.key===" "&&(Z.preventDefault(),_(!0)),G&&(Z.preventDefault(),Z.currentTarget.click()),T.add(document,"keyup",B,!1)},[n,w,u,i,o,T,B]),H=C.exports.useCallback(Z=>{if(h==null||h(Z),n||Z.defaultPrevented||Z.metaKey||!pw(Z.nativeEvent)||w)return;o&&Z.key===" "&&(Z.preventDefault(),_(!1),Z.currentTarget.click())},[o,w,n,h]),j=C.exports.useCallback(Z=>{Z.button===0&&(_(!1),T.remove(document,"mouseup",j,!1))},[T]),ne=C.exports.useCallback(Z=>{if(Z.button!==0)return;if(n){Z.stopPropagation(),Z.preventDefault();return}w||_(!0),Z.currentTarget.focus({preventScroll:!0}),T.add(document,"mouseup",j,!1),a==null||a(Z)},[n,w,a,T,j]),V=C.exports.useCallback(Z=>{Z.button===0&&(w||_(!1),s==null||s(Z))},[s,w]),q=C.exports.useCallback(Z=>{if(n){Z.preventDefault();return}m==null||m(Z)},[n,m]),te=C.exports.useCallback(Z=>{E&&(Z.preventDefault(),_(!1)),v==null||v(Z)},[E,v]),J=Vn(t,M);return w?{...b,ref:J,type:"button","aria-disabled":I?void 0:n,disabled:I,onClick:D,onMouseDown:a,onMouseUp:s,onKeyUp:h,onKeyDown:u,onMouseOver:m,onMouseLeave:v}:{...b,ref:J,role:"button","data-active":xpe(E),"aria-disabled":n?"true":void 0,tabIndex:I?void 0:O,onClick:D,onMouseDown:ne,onMouseUp:V,onKeyUp:H,onKeyDown:$,onMouseOver:q,onMouseLeave:te}}function Bz(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function zz(e){var n;if(!Bz(e))return!1;const t=(n=e.ownerDocument.defaultView)!=null?n:window;return e instanceof t.HTMLElement}function _pe(e){var n;var t;return(n=(t=Fz(e))==null?void 0:t.defaultView)!=null?n:window}function Fz(e){return Bz(e)?e.ownerDocument:document}function kpe(e){return Fz(e).activeElement}var $z=e=>e.hasAttribute("tabindex"),Epe=e=>$z(e)&&e.tabIndex===-1;function Ppe(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function Hz(e){return e.parentElement&&Hz(e.parentElement)?!0:e.hidden}function Tpe(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function Wz(e){if(!zz(e)||Hz(e)||Ppe(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():Tpe(e)?!0:$z(e)}function Lpe(e){return e?zz(e)&&Wz(e)&&!Epe(e):!1}var Ape=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],Mpe=Ape.join(),Rpe=e=>e.offsetWidth>0&&e.offsetHeight>0;function Vz(e){const t=Array.from(e.querySelectorAll(Mpe));return t.unshift(e),t.filter(n=>Wz(n)&&Rpe(n))}function Ope(e){const t=e.current;if(!t)return!1;const n=kpe(t);return!n||t.contains(n)?!1:!!Lpe(n)}function Ipe(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;vd(()=>{if(!o||Ope(e))return;const a=(i==null?void 0:i.current)||e.current;a&&requestAnimationFrame(()=>{a.focus()})},[o,e,i])}var Dpe={preventScroll:!0,shouldFocus:!1};function Npe(e,t=Dpe){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=Bpe(e)?e.current:e,s=i&&o,l=C.exports.useRef(s),u=C.exports.useRef(o);Ts(()=>{!u.current&&o&&(l.current=s),u.current=o},[o,s]);const h=C.exports.useCallback(()=>{if(!(!o||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var g;(g=n.current)==null||g.focus({preventScroll:r})});else{const g=Vz(a);g.length>0&&requestAnimationFrame(()=>{g[0].focus({preventScroll:r})})}},[o,r,a,n]);vd(()=>{h()},[h]),oh(a,"transitionend",h)}function Bpe(e){return"current"in e}var Fo="top",qa="bottom",Ka="right",$o="left",e_="auto",g2=[Fo,qa,Ka,$o],i1="start",Wv="end",zpe="clippingParents",Uz="viewport",nm="popper",Fpe="reference",vA=g2.reduce(function(e,t){return e.concat([t+"-"+i1,t+"-"+Wv])},[]),Gz=[].concat(g2,[e_]).reduce(function(e,t){return e.concat([t,t+"-"+i1,t+"-"+Wv])},[]),$pe="beforeRead",Hpe="read",Wpe="afterRead",Vpe="beforeMain",Upe="main",Gpe="afterMain",jpe="beforeWrite",Ype="write",qpe="afterWrite",Kpe=[$pe,Hpe,Wpe,Vpe,Upe,Gpe,jpe,Ype,qpe];function zl(e){return e?(e.nodeName||"").toLowerCase():null}function Za(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function mh(e){var t=Za(e).Element;return e instanceof t||e instanceof Element}function Va(e){var t=Za(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function t_(e){if(typeof ShadowRoot>"u")return!1;var t=Za(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Xpe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Va(o)||!zl(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function Zpe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!Va(i)||!zl(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Qpe={name:"applyStyles",enabled:!0,phase:"write",fn:Xpe,effect:Zpe,requires:["computeStyles"]};function Ml(e){return e.split("-")[0]}var lh=Math.max,u4=Math.min,o1=Math.round;function qC(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function jz(){return!/^((?!chrome|android).)*safari/i.test(qC())}function a1(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Va(e)&&(i=e.offsetWidth>0&&o1(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&o1(r.height)/e.offsetHeight||1);var a=mh(e)?Za(e):window,s=a.visualViewport,l=!jz()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,h=(r.top+(l&&s?s.offsetTop:0))/o,g=r.width/i,m=r.height/o;return{width:g,height:m,top:h,right:u+g,bottom:h+m,left:u,x:u,y:h}}function n_(e){var t=a1(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Yz(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&t_(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ru(e){return Za(e).getComputedStyle(e)}function Jpe(e){return["table","td","th"].indexOf(zl(e))>=0}function Ad(e){return((mh(e)?e.ownerDocument:e.document)||window.document).documentElement}function HS(e){return zl(e)==="html"?e:e.assignedSlot||e.parentNode||(t_(e)?e.host:null)||Ad(e)}function yA(e){return!Va(e)||Ru(e).position==="fixed"?null:e.offsetParent}function e0e(e){var t=/firefox/i.test(qC()),n=/Trident/i.test(qC());if(n&&Va(e)){var r=Ru(e);if(r.position==="fixed")return null}var i=HS(e);for(t_(i)&&(i=i.host);Va(i)&&["html","body"].indexOf(zl(i))<0;){var o=Ru(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function m2(e){for(var t=Za(e),n=yA(e);n&&Jpe(n)&&Ru(n).position==="static";)n=yA(n);return n&&(zl(n)==="html"||zl(n)==="body"&&Ru(n).position==="static")?t:n||e0e(e)||t}function r_(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function tv(e,t,n){return lh(e,u4(t,n))}function t0e(e,t,n){var r=tv(e,t,n);return r>n?n:r}function qz(){return{top:0,right:0,bottom:0,left:0}}function Kz(e){return Object.assign({},qz(),e)}function Xz(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var n0e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Kz(typeof t!="number"?t:Xz(t,g2))};function r0e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Ml(n.placement),l=r_(s),u=[$o,Ka].indexOf(s)>=0,h=u?"height":"width";if(!(!o||!a)){var g=n0e(i.padding,n),m=n_(o),v=l==="y"?Fo:$o,b=l==="y"?qa:Ka,w=n.rects.reference[h]+n.rects.reference[l]-a[l]-n.rects.popper[h],P=a[l]-n.rects.reference[l],E=m2(o),_=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,T=w/2-P/2,M=g[v],O=_-m[h]-g[b],I=_/2-m[h]/2+T,D=tv(M,I,O),B=l;n.modifiersData[r]=(t={},t[B]=D,t.centerOffset=D-I,t)}}function i0e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||!Yz(t.elements.popper,i)||(t.elements.arrow=i))}const o0e={name:"arrow",enabled:!0,phase:"main",fn:r0e,effect:i0e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function s1(e){return e.split("-")[1]}var a0e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function s0e(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:o1(t*i)/i||0,y:o1(n*i)/i||0}}function SA(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,h=e.roundOffsets,g=e.isFixed,m=a.x,v=m===void 0?0:m,b=a.y,w=b===void 0?0:b,P=typeof h=="function"?h({x:v,y:w}):{x:v,y:w};v=P.x,w=P.y;var E=a.hasOwnProperty("x"),_=a.hasOwnProperty("y"),T=$o,M=Fo,O=window;if(u){var I=m2(n),D="clientHeight",B="clientWidth";if(I===Za(n)&&(I=Ad(n),Ru(I).position!=="static"&&s==="absolute"&&(D="scrollHeight",B="scrollWidth")),I=I,i===Fo||(i===$o||i===Ka)&&o===Wv){M=qa;var $=g&&I===O&&O.visualViewport?O.visualViewport.height:I[D];w-=$-r.height,w*=l?1:-1}if(i===$o||(i===Fo||i===qa)&&o===Wv){T=Ka;var H=g&&I===O&&O.visualViewport?O.visualViewport.width:I[B];v-=H-r.width,v*=l?1:-1}}var j=Object.assign({position:s},u&&a0e),ne=h===!0?s0e({x:v,y:w}):{x:v,y:w};if(v=ne.x,w=ne.y,l){var V;return Object.assign({},j,(V={},V[M]=_?"0":"",V[T]=E?"0":"",V.transform=(O.devicePixelRatio||1)<=1?"translate("+v+"px, "+w+"px)":"translate3d("+v+"px, "+w+"px, 0)",V))}return Object.assign({},j,(t={},t[M]=_?w+"px":"",t[T]=E?v+"px":"",t.transform="",t))}function l0e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Ml(t.placement),variation:s1(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,SA(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,SA(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const u0e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:l0e,data:{}};var Qy={passive:!0};function c0e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=Za(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(h){h.addEventListener("scroll",n.update,Qy)}),s&&l.addEventListener("resize",n.update,Qy),function(){o&&u.forEach(function(h){h.removeEventListener("scroll",n.update,Qy)}),s&&l.removeEventListener("resize",n.update,Qy)}}const d0e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:c0e,data:{}};var f0e={left:"right",right:"left",bottom:"top",top:"bottom"};function Q3(e){return e.replace(/left|right|bottom|top/g,function(t){return f0e[t]})}var h0e={start:"end",end:"start"};function bA(e){return e.replace(/start|end/g,function(t){return h0e[t]})}function i_(e){var t=Za(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function o_(e){return a1(Ad(e)).left+i_(e).scrollLeft}function p0e(e,t){var n=Za(e),r=Ad(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=jz();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+o_(e),y:l}}function g0e(e){var t,n=Ad(e),r=i_(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=lh(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=lh(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+o_(e),l=-r.scrollTop;return Ru(i||n).direction==="rtl"&&(s+=lh(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function a_(e){var t=Ru(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Zz(e){return["html","body","#document"].indexOf(zl(e))>=0?e.ownerDocument.body:Va(e)&&a_(e)?e:Zz(HS(e))}function nv(e,t){var n;t===void 0&&(t=[]);var r=Zz(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Za(r),a=i?[o].concat(o.visualViewport||[],a_(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(nv(HS(a)))}function KC(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function m0e(e,t){var n=a1(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function xA(e,t,n){return t===Uz?KC(p0e(e,n)):mh(t)?m0e(t,n):KC(g0e(Ad(e)))}function v0e(e){var t=nv(HS(e)),n=["absolute","fixed"].indexOf(Ru(e).position)>=0,r=n&&Va(e)?m2(e):e;return mh(r)?t.filter(function(i){return mh(i)&&Yz(i,r)&&zl(i)!=="body"}):[]}function y0e(e,t,n,r){var i=t==="clippingParents"?v0e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var h=xA(e,u,r);return l.top=lh(h.top,l.top),l.right=u4(h.right,l.right),l.bottom=u4(h.bottom,l.bottom),l.left=lh(h.left,l.left),l},xA(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Qz(e){var t=e.reference,n=e.element,r=e.placement,i=r?Ml(r):null,o=r?s1(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Fo:l={x:a,y:t.y-n.height};break;case qa:l={x:a,y:t.y+t.height};break;case Ka:l={x:t.x+t.width,y:s};break;case $o:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?r_(i):null;if(u!=null){var h=u==="y"?"height":"width";switch(o){case i1:l[u]=l[u]-(t[h]/2-n[h]/2);break;case Wv:l[u]=l[u]+(t[h]/2-n[h]/2);break}}return l}function Vv(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?zpe:s,u=n.rootBoundary,h=u===void 0?Uz:u,g=n.elementContext,m=g===void 0?nm:g,v=n.altBoundary,b=v===void 0?!1:v,w=n.padding,P=w===void 0?0:w,E=Kz(typeof P!="number"?P:Xz(P,g2)),_=m===nm?Fpe:nm,T=e.rects.popper,M=e.elements[b?_:m],O=y0e(mh(M)?M:M.contextElement||Ad(e.elements.popper),l,h,a),I=a1(e.elements.reference),D=Qz({reference:I,element:T,strategy:"absolute",placement:i}),B=KC(Object.assign({},T,D)),$=m===nm?B:I,H={top:O.top-$.top+E.top,bottom:$.bottom-O.bottom+E.bottom,left:O.left-$.left+E.left,right:$.right-O.right+E.right},j=e.modifiersData.offset;if(m===nm&&j){var ne=j[i];Object.keys(H).forEach(function(V){var q=[Ka,qa].indexOf(V)>=0?1:-1,te=[Fo,qa].indexOf(V)>=0?"y":"x";H[V]+=ne[te]*q})}return H}function S0e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?Gz:l,h=s1(r),g=h?s?vA:vA.filter(function(b){return s1(b)===h}):g2,m=g.filter(function(b){return u.indexOf(b)>=0});m.length===0&&(m=g);var v=m.reduce(function(b,w){return b[w]=Vv(e,{placement:w,boundary:i,rootBoundary:o,padding:a})[Ml(w)],b},{});return Object.keys(v).sort(function(b,w){return v[b]-v[w]})}function b0e(e){if(Ml(e)===e_)return[];var t=Q3(e);return[bA(e),t,bA(t)]}function x0e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,h=n.boundary,g=n.rootBoundary,m=n.altBoundary,v=n.flipVariations,b=v===void 0?!0:v,w=n.allowedAutoPlacements,P=t.options.placement,E=Ml(P),_=E===P,T=l||(_||!b?[Q3(P)]:b0e(P)),M=[P].concat(T).reduce(function(be,we){return be.concat(Ml(we)===e_?S0e(t,{placement:we,boundary:h,rootBoundary:g,padding:u,flipVariations:b,allowedAutoPlacements:w}):we)},[]),O=t.rects.reference,I=t.rects.popper,D=new Map,B=!0,$=M[0],H=0;H=0,te=q?"width":"height",J=Vv(t,{placement:j,boundary:h,rootBoundary:g,altBoundary:m,padding:u}),Z=q?V?Ka:$o:V?qa:Fo;O[te]>I[te]&&(Z=Q3(Z));var G=Q3(Z),ee=[];if(o&&ee.push(J[ne]<=0),s&&ee.push(J[Z]<=0,J[G]<=0),ee.every(function(be){return be})){$=j,B=!1;break}D.set(j,ee)}if(B)for(var le=b?3:1,me=function(we){var Ve=M.find(function(Ze){var it=D.get(Ze);if(it)return it.slice(0,we).every(function(pt){return pt})});if(Ve)return $=Ve,"break"},Me=le;Me>0;Me--){var Ce=me(Me);if(Ce==="break")break}t.placement!==$&&(t.modifiersData[r]._skip=!0,t.placement=$,t.reset=!0)}}const w0e={name:"flip",enabled:!0,phase:"main",fn:x0e,requiresIfExists:["offset"],data:{_skip:!1}};function wA(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function CA(e){return[Fo,Ka,qa,$o].some(function(t){return e[t]>=0})}function C0e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Vv(t,{elementContext:"reference"}),s=Vv(t,{altBoundary:!0}),l=wA(a,r),u=wA(s,i,o),h=CA(l),g=CA(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:h,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":g})}const _0e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:C0e};function k0e(e,t,n){var r=Ml(e),i=[$o,Fo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[$o,Ka].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function E0e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=Gz.reduce(function(h,g){return h[g]=k0e(g,t.rects,o),h},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const P0e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:E0e};function T0e(e){var t=e.state,n=e.name;t.modifiersData[n]=Qz({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const L0e={name:"popperOffsets",enabled:!0,phase:"read",fn:T0e,data:{}};function A0e(e){return e==="x"?"y":"x"}function M0e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,h=n.altBoundary,g=n.padding,m=n.tether,v=m===void 0?!0:m,b=n.tetherOffset,w=b===void 0?0:b,P=Vv(t,{boundary:l,rootBoundary:u,padding:g,altBoundary:h}),E=Ml(t.placement),_=s1(t.placement),T=!_,M=r_(E),O=A0e(M),I=t.modifiersData.popperOffsets,D=t.rects.reference,B=t.rects.popper,$=typeof w=="function"?w(Object.assign({},t.rects,{placement:t.placement})):w,H=typeof $=="number"?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,ne={x:0,y:0};if(!!I){if(o){var V,q=M==="y"?Fo:$o,te=M==="y"?qa:Ka,J=M==="y"?"height":"width",Z=I[M],G=Z+P[q],ee=Z-P[te],le=v?-B[J]/2:0,me=_===i1?D[J]:B[J],Me=_===i1?-B[J]:-D[J],Ce=t.elements.arrow,be=v&&Ce?n_(Ce):{width:0,height:0},we=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:qz(),Ve=we[q],Ze=we[te],it=tv(0,D[J],be[J]),pt=T?D[J]/2-le-it-Ve-H.mainAxis:me-it-Ve-H.mainAxis,kt=T?-D[J]/2+le+it+Ze+H.mainAxis:Me+it+Ze+H.mainAxis,gt=t.elements.arrow&&m2(t.elements.arrow),ht=gt?M==="y"?gt.clientTop||0:gt.clientLeft||0:0,vt=(V=j==null?void 0:j[M])!=null?V:0,Te=Z+pt-vt-ht,ot=Z+kt-vt,Mt=tv(v?u4(G,Te):G,Z,v?lh(ee,ot):ee);I[M]=Mt,ne[M]=Mt-Z}if(s){var Je,mt=M==="x"?Fo:$o,un=M==="x"?qa:Ka,Et=I[O],jt=O==="y"?"height":"width",cn=Et+P[mt],xn=Et-P[un],Oe=[Fo,$o].indexOf(E)!==-1,et=(Je=j==null?void 0:j[O])!=null?Je:0,Jt=Oe?cn:Et-D[jt]-B[jt]-et+H.altAxis,Kt=Oe?Et+D[jt]+B[jt]-et-H.altAxis:xn,Ee=v&&Oe?t0e(Jt,Et,Kt):tv(v?Jt:cn,Et,v?Kt:xn);I[O]=Ee,ne[O]=Ee-Et}t.modifiersData[r]=ne}}const R0e={name:"preventOverflow",enabled:!0,phase:"main",fn:M0e,requiresIfExists:["offset"]};function O0e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function I0e(e){return e===Za(e)||!Va(e)?i_(e):O0e(e)}function D0e(e){var t=e.getBoundingClientRect(),n=o1(t.width)/e.offsetWidth||1,r=o1(t.height)/e.offsetHeight||1;return n!==1||r!==1}function N0e(e,t,n){n===void 0&&(n=!1);var r=Va(t),i=Va(t)&&D0e(t),o=Ad(t),a=a1(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((zl(t)!=="body"||a_(o))&&(s=I0e(t)),Va(t)?(l=a1(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=o_(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function B0e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function z0e(e){var t=B0e(e);return Kpe.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function F0e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function $0e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var _A={placement:"bottom",modifiers:[],strategy:"absolute"};function kA(){for(var e=arguments.length,t=new Array(e),n=0;n({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),Yr={arrowShadowColor:Bp("--popper-arrow-shadow-color"),arrowSize:Bp("--popper-arrow-size","8px"),arrowSizeHalf:Bp("--popper-arrow-size-half"),arrowBg:Bp("--popper-arrow-bg"),transformOrigin:Bp("--popper-transform-origin"),arrowOffset:Bp("--popper-arrow-offset")};function U0e(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var G0e={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},j0e=e=>G0e[e],EA={scroll:!0,resize:!0};function Y0e(e){let t;return typeof e=="object"?t={enabled:!0,options:{...EA,...e}}:t={enabled:e,options:EA},t}var q0e={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},K0e={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{PA(e)},effect:({state:e})=>()=>{PA(e)}},PA=e=>{e.elements.popper.style.setProperty(Yr.transformOrigin.var,j0e(e.placement))},X0e={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{Z0e(e)}},Z0e=e=>{var t;if(!e.placement)return;const n=Q0e(e.placement);if(((t=e.elements)==null?void 0:t.arrow)&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:Yr.arrowSize.varRef,height:Yr.arrowSize.varRef,zIndex:-1});const r={[Yr.arrowSizeHalf.var]:`calc(${Yr.arrowSize.varRef} / 2)`,[Yr.arrowOffset.var]:`calc(${Yr.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},Q0e=e=>{if(e.startsWith("top"))return{property:"bottom",value:Yr.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:Yr.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:Yr.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:Yr.arrowOffset.varRef}},J0e={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{TA(e)},effect:({state:e})=>()=>{TA(e)}},TA=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");!t||Object.assign(t.style,{transform:"rotate(45deg)",background:Yr.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:U0e(e.placement)})},e1e={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},t1e={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function n1e(e,t="ltr"){var i;var n;const r=((n=e1e[e])==null?void 0:n[t])||e;return t==="ltr"?r:(i=t1e[e])!=null?i:r}function Jz(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:i="absolute",arrowPadding:o=8,eventListeners:a=!0,offset:s,gutter:l=8,flip:u=!0,boundary:h="clippingParents",preventOverflow:g=!0,matchWidth:m,direction:v="ltr"}=e,b=C.exports.useRef(null),w=C.exports.useRef(null),P=C.exports.useRef(null),E=n1e(r,v),_=C.exports.useRef(()=>{}),T=C.exports.useCallback(()=>{var H;!t||!b.current||!w.current||((H=_.current)==null||H.call(_),P.current=V0e(b.current,w.current,{placement:E,modifiers:[J0e,X0e,K0e,{...q0e,enabled:!!m},{name:"eventListeners",...Y0e(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s!=null?s:[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!g,options:{boundary:h}},...n!=null?n:[]],strategy:i}),P.current.forceUpdate(),_.current=P.current.destroy)},[E,t,n,m,a,o,s,l,u,g,h,i]);C.exports.useEffect(()=>()=>{var H;!b.current&&!w.current&&((H=P.current)==null||H.destroy(),P.current=null)},[]);const M=C.exports.useCallback(H=>{b.current=H,T()},[T]),O=C.exports.useCallback((H={},j=null)=>({...H,ref:Vn(M,j)}),[M]),I=C.exports.useCallback(H=>{w.current=H,T()},[T]),D=C.exports.useCallback((H={},j=null)=>({...H,ref:Vn(I,j),style:{...H.style,position:i,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[i,I,m]),B=C.exports.useCallback((H={},j=null)=>{const{size:ne,shadowColor:V,bg:q,style:te,...J}=H;return{...J,ref:j,"data-popper-arrow":"",style:r1e(H)}},[]),$=C.exports.useCallback((H={},j=null)=>({...H,ref:j,"data-popper-arrow-inner":""}),[]);return{update(){var H;(H=P.current)==null||H.update()},forceUpdate(){var H;(H=P.current)==null||H.forceUpdate()},transformOrigin:Yr.transformOrigin.varRef,referenceRef:M,popperRef:I,getPopperProps:D,getArrowProps:B,getArrowInnerProps:$,getReferenceProps:O}}function r1e(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function eF(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=hr(n),a=hr(t),[s,l]=C.exports.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,h=r!==void 0,g=C.exports.useId(),m=i!=null?i:`disclosure-${g}`,v=C.exports.useCallback(()=>{h||l(!1),a==null||a()},[h,a]),b=C.exports.useCallback(()=>{h||l(!0),o==null||o()},[h,o]),w=C.exports.useCallback(()=>{u?v():b()},[u,b,v]);function P(_={}){return{..._,"aria-expanded":u,"aria-controls":m,onClick(T){var M;(M=_.onClick)==null||M.call(_,T),w()}}}function E(_={}){return{..._,hidden:!u,id:m}}return{isOpen:u,onOpen:b,onClose:v,onToggle:w,isControlled:h,getButtonProps:P,getDisclosureProps:E}}function i1e(e){const{isOpen:t,ref:n}=e,[r,i]=C.exports.useState(t),[o,a]=C.exports.useState(!1);return C.exports.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),oh(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=_pe(n.current),h=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(h)}}}function tF(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var[o1e,a1e]=Pn({strict:!1,name:"PortalManagerContext"});function nF(e){const{children:t,zIndex:n}=e;return S(o1e,{value:{zIndex:n},children:t})}nF.displayName="PortalManager";var[rF,s1e]=Pn({strict:!1,name:"PortalContext"}),s_="chakra-portal",l1e=".chakra-portal",u1e=e=>S("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),c1e=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=C.exports.useState(null),o=C.exports.useRef(null),[,a]=C.exports.useState({});C.exports.useEffect(()=>a({}),[]);const s=s1e(),l=a1e();Ts(()=>{if(!r)return;const h=r.ownerDocument,g=t&&s!=null?s:h.body;if(!g)return;o.current=h.createElement("div"),o.current.className=s_,g.appendChild(o.current),a({});const m=o.current;return()=>{g.contains(m)&&g.removeChild(m)}},[r]);const u=l!=null&&l.zIndex?S(u1e,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return o.current?Wl.exports.createPortal(S(rF,{value:o.current,children:u}),o.current):S("span",{ref:h=>{h&&i(h)}})},d1e=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i!=null?i:typeof window<"u"?document.body:void 0,a=C.exports.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=s_),l},[i]),[,s]=C.exports.useState({});return Ts(()=>s({}),[]),Ts(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?Wl.exports.createPortal(S(rF,{value:r?a:null,children:t}),a):null};function kh(e){const{containerRef:t,...n}=e;return t?S(d1e,{containerRef:t,...n}):S(c1e,{...n})}kh.defaultProps={appendToParentPortal:!0};kh.className=s_;kh.selector=l1e;kh.displayName="Portal";var f1e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},zp=new WeakMap,Jy=new WeakMap,e3={},gw=0,iF=function(e){return e&&(e.host||iF(e.parentNode))},h1e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=iF(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},p1e=function(e,t,n,r){var i=h1e(t,Array.isArray(e)?e:[e]);e3[n]||(e3[n]=new WeakMap);var o=e3[n],a=[],s=new Set,l=new Set(i),u=function(g){!g||s.has(g)||(s.add(g),u(g.parentNode))};i.forEach(u);var h=function(g){!g||l.has(g)||Array.prototype.forEach.call(g.children,function(m){if(s.has(m))h(m);else{var v=m.getAttribute(r),b=v!==null&&v!=="false",w=(zp.get(m)||0)+1,P=(o.get(m)||0)+1;zp.set(m,w),o.set(m,P),a.push(m),w===1&&b&&Jy.set(m,!0),P===1&&m.setAttribute(n,"true"),b||m.setAttribute(r,"true")}})};return h(t),s.clear(),gw++,function(){a.forEach(function(g){var m=zp.get(g)-1,v=o.get(g)-1;zp.set(g,m),o.set(g,v),m||(Jy.has(g)||g.removeAttribute(r),Jy.delete(g)),v||g.removeAttribute(n)}),gw--,gw||(zp=new WeakMap,zp=new WeakMap,Jy=new WeakMap,e3={})}},oF=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||f1e(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),p1e(r,i,n,"aria-hidden")):function(){return null}};function l_(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var Bn={exports:{}},g1e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",m1e=g1e,v1e=m1e;function aF(){}function sF(){}sF.resetWarningCache=aF;var y1e=function(){function e(r,i,o,a,s,l){if(l!==v1e){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:sF,resetWarningCache:aF};return n.PropTypes=n,n};Bn.exports=y1e();var XC="data-focus-lock",lF="data-focus-lock-disabled",S1e="data-no-focus-lock",b1e="data-autofocus-inside",x1e="data-no-autofocus";function w1e(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function C1e(e,t){var n=C.exports.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function uF(e,t){return C1e(t||null,function(n){return e.forEach(function(r){return w1e(r,n)})})}var mw={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function cF(e){return e}function dF(e,t){t===void 0&&(t=cF);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var h=a;a=[],h.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(h){a.push(h),u()},filter:function(h){return a=a.filter(h),n}}}};return i}function u_(e,t){return t===void 0&&(t=cF),dF(e,t)}function fF(e){e===void 0&&(e={});var t=dF(null);return t.options=bl({async:!0,ssr:!1},e),t}var hF=function(e){var t=e.sideCar,n=tz(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return S(r,{...bl({},n)})};hF.isSideCarExport=!0;function _1e(e,t){return e.useMedium(t),hF}var pF=u_({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),gF=u_(),k1e=u_(),E1e=fF({async:!0}),P1e=[],c_=C.exports.forwardRef(function(t,n){var r,i=C.exports.useState(),o=i[0],a=i[1],s=C.exports.useRef(),l=C.exports.useRef(!1),u=C.exports.useRef(null),h=t.children,g=t.disabled,m=t.noFocusGuards,v=t.persistentFocus,b=t.crossFrame,w=t.autoFocus;t.allowTextSelection;var P=t.group,E=t.className,_=t.whiteList,T=t.hasPositiveIndices,M=t.shards,O=M===void 0?P1e:M,I=t.as,D=I===void 0?"div":I,B=t.lockProps,$=B===void 0?{}:B,H=t.sideCar,j=t.returnFocus,ne=t.focusOptions,V=t.onActivation,q=t.onDeactivation,te=C.exports.useState({}),J=te[0],Z=C.exports.useCallback(function(){u.current=u.current||document&&document.activeElement,s.current&&V&&V(s.current),l.current=!0},[V]),G=C.exports.useCallback(function(){l.current=!1,q&&q(s.current)},[q]);C.exports.useEffect(function(){g||(u.current=null)},[]);var ee=C.exports.useCallback(function(Ze){var it=u.current;if(it&&it.focus){var pt=typeof j=="function"?j(it):j;if(pt){var kt=typeof pt=="object"?pt:void 0;u.current=null,Ze?Promise.resolve().then(function(){return it.focus(kt)}):it.focus(kt)}}},[j]),le=C.exports.useCallback(function(Ze){l.current&&pF.useMedium(Ze)},[]),me=gF.useMedium,Me=C.exports.useCallback(function(Ze){s.current!==Ze&&(s.current=Ze,a(Ze))},[]),Ce=On((r={},r[lF]=g&&"disabled",r[XC]=P,r),$),be=m!==!0,we=be&&m!=="tail",Ve=uF([n,Me]);return X(Rn,{children:[be&&[S("div",{"data-focus-guard":!0,tabIndex:g?-1:0,style:mw},"guard-first"),T?S("div",{"data-focus-guard":!0,tabIndex:g?-1:1,style:mw},"guard-nearest"):null],!g&&S(H,{id:J,sideCar:E1e,observed:o,disabled:g,persistentFocus:v,crossFrame:b,autoFocus:w,whiteList:_,shards:O,onActivation:Z,onDeactivation:G,returnFocus:ee,focusOptions:ne}),S(D,{ref:Ve,...Ce,className:E,onBlur:me,onFocus:le,children:h}),we&&S("div",{"data-focus-guard":!0,tabIndex:g?-1:0,style:mw})]})});c_.propTypes={};c_.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const mF=c_;function ZC(e,t){return ZC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ZC(e,t)}function d_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ZC(e,t)}function vF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T1e(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var o=[],a;function s(){a=e(o.map(function(u){return u.props})),t(a)}var l=function(u){d_(h,u);function h(){return u.apply(this,arguments)||this}h.peek=function(){return a};var g=h.prototype;return g.componentDidMount=function(){o.push(this),s()},g.componentDidUpdate=function(){s()},g.componentWillUnmount=function(){var v=o.indexOf(this);o.splice(v,1),s()},g.render=function(){return S(i,{...this.props})},h}(C.exports.PureComponent);return vF(l,"displayName","SideEffect("+n(i)+")"),l}}var Ul=function(e){for(var t=Array(e.length),n=0;n=0}).sort(N1e)},B1e=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],h_=B1e.join(","),z1e="".concat(h_,", [data-focus-guard]"),EF=function(e,t){var n;return Ul(((n=e.shadowRoot)===null||n===void 0?void 0:n.children)||e.children).reduce(function(r,i){return r.concat(i.matches(t?z1e:h_)?[i]:[],EF(i))},[])},p_=function(e,t){return e.reduce(function(n,r){return n.concat(EF(r,t),r.parentNode?Ul(r.parentNode.querySelectorAll(h_)).filter(function(i){return i===r}):[])},[])},F1e=function(e){var t=e.querySelectorAll("[".concat(b1e,"]"));return Ul(t).map(function(n){return p_([n])}).reduce(function(n,r){return n.concat(r)},[])},g_=function(e,t){return Ul(e).filter(function(n){return bF(t,n)}).filter(function(n){return O1e(n)})},LA=function(e,t){return t===void 0&&(t=new Map),Ul(e).filter(function(n){return xF(t,n)})},JC=function(e,t,n){return kF(g_(p_(e,n),t),!0,n)},AA=function(e,t){return kF(g_(p_(e),t),!1)},$1e=function(e,t){return g_(F1e(e),t)},Uv=function(e,t){return e.shadowRoot?Uv(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Ul(e.children).some(function(n){return Uv(n,t)})},H1e=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},PF=function(e){return e.parentNode?PF(e.parentNode):e},m_=function(e){var t=QC(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(XC);return n.push.apply(n,i?H1e(Ul(PF(r).querySelectorAll("[".concat(XC,'="').concat(i,'"]:not([').concat(lF,'="disabled"])')))):[r]),n},[])},TF=function(e){return e.activeElement?e.activeElement.shadowRoot?TF(e.activeElement.shadowRoot):e.activeElement:void 0},v_=function(){return document.activeElement?document.activeElement.shadowRoot?TF(document.activeElement.shadowRoot):document.activeElement:void 0},W1e=function(e){return e===document.activeElement},V1e=function(e){return Boolean(Ul(e.querySelectorAll("iframe")).some(function(t){return W1e(t)}))},LF=function(e){var t=document&&v_();return!t||t.dataset&&t.dataset.focusGuard?!1:m_(e).some(function(n){return Uv(n,t)||V1e(n)})},U1e=function(){var e=document&&v_();return e?Ul(document.querySelectorAll("[".concat(S1e,"]"))).some(function(t){return Uv(t,e)}):!1},G1e=function(e,t){return t.filter(_F).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},y_=function(e,t){return _F(e)&&e.name?G1e(e,t):e},j1e=function(e){var t=new Set;return e.forEach(function(n){return t.add(y_(n,e))}),e.filter(function(n){return t.has(n)})},MA=function(e){return e[0]&&e.length>1?y_(e[0],e):e[0]},RA=function(e,t){return e.length>1?e.indexOf(y_(e[t],e)):t},AF="NEW_FOCUS",Y1e=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=f_(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,h=r?e.indexOf(r):-1,g=l-u,m=t.indexOf(o),v=t.indexOf(a),b=j1e(t),w=n!==void 0?b.indexOf(n):-1,P=w-(r?b.indexOf(r):l),E=RA(e,0),_=RA(e,i-1);if(l===-1||h===-1)return AF;if(!g&&h>=0)return h;if(l<=m&&s&&Math.abs(g)>1)return _;if(l>=v&&s&&Math.abs(g)>1)return E;if(g&&Math.abs(P)>1)return h;if(l<=m)return _;if(l>v)return E;if(g)return Math.abs(g)>1?h:(i+h+g)%i}},q1e=function(e){return function(t){var n,r=(n=wF(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},K1e=function(e,t,n){var r=e.map(function(o){var a=o.node;return a}),i=LA(r.filter(q1e(n)));return i&&i.length?MA(i):MA(LA(t))},e7=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&e7(e.parentNode.host||e.parentNode,t),t},vw=function(e,t){for(var n=e7(e),r=e7(t),i=0;i=0)return o}return!1},MF=function(e,t,n){var r=QC(e),i=QC(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=vw(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=vw(o,l);u&&(!a||Uv(u,a)?a=u:a=vw(u,a))})}),a},X1e=function(e,t){return e.reduce(function(n,r){return n.concat($1e(r,t))},[])},Z1e=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(D1e)},Q1e=function(e,t){var n=document&&v_(),r=m_(e).filter(c4),i=MF(n||e,e,r),o=new Map,a=AA(r,o),s=JC(r,o).filter(function(m){var v=m.node;return c4(v)});if(!(!s[0]&&(s=a,!s[0]))){var l=AA([i],o).map(function(m){var v=m.node;return v}),u=Z1e(l,s),h=u.map(function(m){var v=m.node;return v}),g=Y1e(h,l,n,t);return g===AF?{node:K1e(a,h,X1e(r,o))}:g===void 0?g:u[g]}},J1e=function(e){var t=m_(e).filter(c4),n=MF(e,e,t),r=new Map,i=JC([n],r,!0),o=JC(t,r).filter(function(a){var s=a.node;return c4(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:f_(s)}})},ege=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},yw=0,Sw=!1,tge=function(e,t,n){n===void 0&&(n={});var r=Q1e(e,t);if(!Sw&&r){if(yw>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Sw=!0,setTimeout(function(){Sw=!1},1);return}yw++,ege(r.node,n.focusOptions),yw--}};const RF=tge;function OF(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var nge=function(){return document&&document.activeElement===document.body},rge=function(){return nge()||U1e()},B0=null,f0=null,z0=null,Gv=!1,ige=function(){return!0},oge=function(t){return(B0.whiteList||ige)(t)},age=function(t,n){z0={observerNode:t,portaledElement:n}},sge=function(t){return z0&&z0.portaledElement===t};function OA(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var lge=function(t){return t&&"current"in t?t.current:t},uge=function(t){return t?Boolean(Gv):Gv==="meanwhile"},cge=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},dge=function(t,n){return n.some(function(r){return cge(t,r,r)})},d4=function(){var t=!1;if(B0){var n=B0,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||z0&&z0.portaledElement,h=document&&document.activeElement;if(u){var g=[u].concat(a.map(lge).filter(Boolean));if((!h||oge(h))&&(i||uge(s)||!rge()||!f0&&o)&&(u&&!(LF(g)||h&&dge(h,g)||sge(h))&&(document&&!f0&&h&&!o?(h.blur&&h.blur(),document.body.focus()):(t=RF(g,f0,{focusOptions:l}),z0={})),Gv=!1,f0=document&&document.activeElement),document){var m=document&&document.activeElement,v=J1e(g),b=v.map(function(w){var P=w.node;return P}).indexOf(m);b>-1&&(v.filter(function(w){var P=w.guard,E=w.node;return P&&E.dataset.focusAutoGuard}).forEach(function(w){var P=w.node;return P.removeAttribute("tabIndex")}),OA(b,v.length,1,v),OA(b,-1,-1,v))}}}return t},IF=function(t){d4()&&t&&(t.stopPropagation(),t.preventDefault())},S_=function(){return OF(d4)},fge=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||age(r,n)},hge=function(){return null},DF=function(){Gv="just",setTimeout(function(){Gv="meanwhile"},0)},pge=function(){document.addEventListener("focusin",IF),document.addEventListener("focusout",S_),window.addEventListener("blur",DF)},gge=function(){document.removeEventListener("focusin",IF),document.removeEventListener("focusout",S_),window.removeEventListener("blur",DF)};function mge(e){return e.filter(function(t){var n=t.disabled;return!n})}function vge(e){var t=e.slice(-1)[0];t&&!B0&&pge();var n=B0,r=n&&t&&t.id===n.id;B0=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(f0=null,(!r||n.observed!==t.observed)&&t.onActivation(),d4(),OF(d4)):(gge(),f0=null)}pF.assignSyncMedium(fge);gF.assignMedium(S_);k1e.assignMedium(function(e){return e({moveFocusInside:RF,focusInside:LF})});const yge=T1e(mge,vge)(hge);var NF=C.exports.forwardRef(function(t,n){return S(mF,{sideCar:yge,ref:n,...t})}),BF=mF.propTypes||{};BF.sideCar;l_(BF,["sideCar"]);NF.propTypes={};const Sge=NF;var zF=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,h=C.exports.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&Vz(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),g=C.exports.useCallback(()=>{var v;(v=n==null?void 0:n.current)==null||v.focus()},[n]);return S(Sge,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:h,onDeactivation:g,returnFocus:i&&!n,children:o})};zF.displayName="FocusLock";var J3="right-scroll-bar-position",e5="width-before-scroll-bar",bge="with-scroll-bars-hidden",xge="--removed-body-scroll-bar-size",FF=fF(),bw=function(){},WS=C.exports.forwardRef(function(e,t){var n=C.exports.useRef(null),r=C.exports.useState({onScrollCapture:bw,onWheelCapture:bw,onTouchMoveCapture:bw}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,h=e.enabled,g=e.shards,m=e.sideCar,v=e.noIsolation,b=e.inert,w=e.allowPinchZoom,P=e.as,E=P===void 0?"div":P,_=tz(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),T=m,M=uF([n,t]),O=bl(bl({},_),i);return X(Rn,{children:[h&&S(T,{sideCar:FF,removeScrollBar:u,shards:g,noIsolation:v,inert:b,setCallbacks:o,allowPinchZoom:!!w,lockRef:n}),a?C.exports.cloneElement(C.exports.Children.only(s),bl(bl({},O),{ref:M})):S(E,{...bl({},O,{className:l,ref:M}),children:s})]})});WS.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};WS.classNames={fullWidth:e5,zeroRight:J3};var wge=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Cge(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wge();return t&&e.setAttribute("nonce",t),e}function _ge(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kge(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ege=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Cge())&&(_ge(t,n),kge(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Pge=function(){var e=Ege();return function(t,n){C.exports.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},$F=function(){var e=Pge(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Tge={left:0,top:0,right:0,gap:0},xw=function(e){return parseInt(e||"",10)||0},Lge=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[xw(n),xw(r),xw(i)]},Age=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Tge;var t=Lge(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Mge=$F(),Rge=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` .`.concat(bge,` { overflow: hidden `).concat(r,`; padding-right: `).concat(s,"px ").concat(r,`; } body { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(i,`px; padding-top: `).concat(o,`px; padding-right: `).concat(a,`px; margin-left:0; margin-top:0; margin-right: `).concat(s,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(J3,` { right: `).concat(s,"px ").concat(r,`; } .`).concat(e5,` { margin-right: `).concat(s,"px ").concat(r,`; } .`).concat(J3," .").concat(J3,` { right: 0 `).concat(r,`; } .`).concat(e5," .").concat(e5,` { margin-right: 0 `).concat(r,`; } body { `).concat(xge,": ").concat(s,`px; } `)},Oge=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=C.exports.useMemo(function(){return Age(i)},[i]);return S(Mge,{styles:Rge(o,!t,i,n?"":"!important")})},t7=!1;if(typeof window<"u")try{var t3=Object.defineProperty({},"passive",{get:function(){return t7=!0,!0}});window.addEventListener("test",t3,t3),window.removeEventListener("test",t3,t3)}catch(e){t7=!1}var Fp=t7?{passive:!1}:!1,Ige=function(e){return e.tagName==="TEXTAREA"},HF=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ige(e)&&n[t]==="visible")},Dge=function(e){return HF(e,"overflowY")},Nge=function(e){return HF(e,"overflowX")},IA=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=WF(e,n);if(r){var i=VF(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Bge=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},zge=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},WF=function(e,t){return e==="v"?Dge(t):Nge(t)},VF=function(e,t){return e==="v"?Bge(t):zge(t)},Fge=function(e,t){return e==="h"&&t==="rtl"?-1:1},$ge=function(e,t,n,r,i){var o=Fge(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,h=a>0,g=0,m=0;do{var v=VF(e,s),b=v[0],w=v[1],P=v[2],E=w-P-o*b;(b||E)&&WF(e,s)&&(g+=E,m+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(h&&(i&&g===0||!i&&a>g)||!h&&(i&&m===0||!i&&-a>m))&&(u=!0),u},n3=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},DA=function(e){return[e.deltaX,e.deltaY]},NA=function(e){return e&&"current"in e?e.current:e},Hge=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Wge=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},Vge=0,$p=[];function Uge(e){var t=C.exports.useRef([]),n=C.exports.useRef([0,0]),r=C.exports.useRef(),i=C.exports.useState(Vge++)[0],o=C.exports.useState(function(){return $F()})[0],a=C.exports.useRef(e);C.exports.useEffect(function(){a.current=e},[e]),C.exports.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=FC([e.lockRef.current],(e.shards||[]).map(NA),!0).filter(Boolean);return w.forEach(function(P){return P.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(P){return P.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=C.exports.useCallback(function(w,P){if("touches"in w&&w.touches.length===2)return!a.current.allowPinchZoom;var E=n3(w),_=n.current,T="deltaX"in w?w.deltaX:_[0]-E[0],M="deltaY"in w?w.deltaY:_[1]-E[1],O,I=w.target,D=Math.abs(T)>Math.abs(M)?"h":"v";if("touches"in w&&D==="h"&&I.type==="range")return!1;var B=IA(D,I);if(!B)return!0;if(B?O=D:(O=D==="v"?"h":"v",B=IA(D,I)),!B)return!1;if(!r.current&&"changedTouches"in w&&(T||M)&&(r.current=O),!O)return!0;var $=r.current||O;return $ge($,P,w,$==="h"?T:M,!0)},[]),l=C.exports.useCallback(function(w){var P=w;if(!(!$p.length||$p[$p.length-1]!==o)){var E="deltaY"in P?DA(P):n3(P),_=t.current.filter(function(O){return O.name===P.type&&O.target===P.target&&Hge(O.delta,E)})[0];if(_&&_.should){P.cancelable&&P.preventDefault();return}if(!_){var T=(a.current.shards||[]).map(NA).filter(Boolean).filter(function(O){return O.contains(P.target)}),M=T.length>0?s(P,T[0]):!a.current.noIsolation;M&&P.cancelable&&P.preventDefault()}}},[]),u=C.exports.useCallback(function(w,P,E,_){var T={name:w,delta:P,target:E,should:_};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(M){return M!==T})},1)},[]),h=C.exports.useCallback(function(w){n.current=n3(w),r.current=void 0},[]),g=C.exports.useCallback(function(w){u(w.type,DA(w),w.target,s(w,e.lockRef.current))},[]),m=C.exports.useCallback(function(w){u(w.type,n3(w),w.target,s(w,e.lockRef.current))},[]);C.exports.useEffect(function(){return $p.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Fp),document.addEventListener("touchmove",l,Fp),document.addEventListener("touchstart",h,Fp),function(){$p=$p.filter(function(w){return w!==o}),document.removeEventListener("wheel",l,Fp),document.removeEventListener("touchmove",l,Fp),document.removeEventListener("touchstart",h,Fp)}},[]);var v=e.removeScrollBar,b=e.inert;return X(Rn,{children:[b?S(o,{styles:Wge(i)}):null,v?S(Oge,{gapMode:"margin"}):null]})}const Gge=_1e(FF,Uge);var UF=C.exports.forwardRef(function(e,t){return S(WS,{...bl({},e,{ref:t,sideCar:Gge})})});UF.classNames=WS.classNames;const GF=UF;var Eh=(...e)=>e.filter(Boolean).join(" ");function bm(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var jge=class{constructor(){nn(this,"modals");this.modals=[]}add(e){this.modals.push(e)}remove(e){this.modals=this.modals.filter(t=>t!==e)}isTopModal(e){return this.modals[this.modals.length-1]===e}},n7=new jge;function Yge(e,t){C.exports.useEffect(()=>(t&&n7.add(e),()=>{n7.remove(e)}),[t,e])}function qge(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=C.exports.useRef(null),h=C.exports.useRef(null),[g,m,v]=Xge(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Kge(u,t&&a),Yge(u,t);const b=C.exports.useRef(null),w=C.exports.useCallback(B=>{b.current=B.target},[]),P=C.exports.useCallback(B=>{B.key==="Escape"&&(B.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[E,_]=C.exports.useState(!1),[T,M]=C.exports.useState(!1),O=C.exports.useCallback((B={},$=null)=>({role:"dialog",...B,ref:Vn($,u),id:g,tabIndex:-1,"aria-modal":!0,"aria-labelledby":E?m:void 0,"aria-describedby":T?v:void 0,onClick:bm(B.onClick,H=>H.stopPropagation())}),[v,T,g,m,E]),I=C.exports.useCallback(B=>{B.stopPropagation(),b.current===B.target&&(!n7.isTopModal(u)||(i&&(n==null||n()),s==null||s()))},[n,i,s]),D=C.exports.useCallback((B={},$=null)=>({...B,ref:Vn($,h),onClick:bm(B.onClick,I),onKeyDown:bm(B.onKeyDown,P),onMouseDown:bm(B.onMouseDown,w)}),[P,w,I]);return{isOpen:t,onClose:n,headerId:m,bodyId:v,setBodyMounted:M,setHeaderMounted:_,dialogRef:u,overlayRef:h,getDialogProps:O,getDialogContainerProps:D}}function Kge(e,t){const n=e.current;C.exports.useEffect(()=>{if(!(!e.current||!t))return oF(e.current)},[t,e,n])}function Xge(e,...t){const n=C.exports.useId(),r=e||n;return C.exports.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[Zge,Ph]=Pn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Qge,Sd]=Pn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),l1=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:h,motionPreset:g,lockFocusAcrossFrames:m,onCloseComplete:v}=e,b=Bi("Modal",e),P={...qge(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:h,motionPreset:g,lockFocusAcrossFrames:m};return S(Qge,{value:P,children:S(Zge,{value:b,children:S(Pd,{onExitComplete:v,children:P.isOpen&&S(kh,{...t,children:n})})})})};l1.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};l1.displayName="Modal";var jv=Pe((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=Sd();C.exports.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=Eh("chakra-modal__body",n),s=Ph();return se.createElement(xe.div,{ref:t,className:a,id:i,...r,__css:s.body})});jv.displayName="ModalBody";var b_=Pe((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=Sd(),a=Eh("chakra-modal__close-btn",r),s=Ph();return S(FS,{ref:t,__css:s.closeButton,className:a,onClick:bm(n,l=>{l.stopPropagation(),o()}),...i})});b_.displayName="ModalCloseButton";function jF(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:h}=Sd(),[g,m]=O8();return C.exports.useEffect(()=>{!g&&m&&setTimeout(m)},[g,m]),S(zF,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:h,children:S(GF,{removeScrollBar:!u,allowPinchZoom:a,enabled:o,forwardProps:!0,children:e.children})})}var Jge={slideInBottom:{...HC,custom:{offsetY:16,reverse:!0}},slideInRight:{...HC,custom:{offsetX:16,reverse:!0}},scale:{...iz,custom:{initialScale:.95,reverse:!0}},none:{}},eme=xe(Vl.section),tme=e=>Jge[e||"none"],YF=C.exports.forwardRef((e,t)=>{const{preset:n,motionProps:r=tme(n),...i}=e;return S(eme,{ref:t,...r,...i})});YF.displayName="ModalTransition";var Yv=Pe((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=Sd(),u=s(a,t),h=l(i),g=Eh("chakra-modal__content",n),m=Ph(),v={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:w}=Sd();return se.createElement(jF,null,se.createElement(xe.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:b},S(YF,{preset:w,motionProps:o,className:g,...u,__css:v,children:r})))});Yv.displayName="ModalContent";var VS=Pe((e,t)=>{const{className:n,...r}=e,i=Eh("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...Ph().footer};return se.createElement(xe.footer,{ref:t,...r,__css:a,className:i})});VS.displayName="ModalFooter";var US=Pe((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=Sd();C.exports.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=Eh("chakra-modal__header",n),l={flex:0,...Ph().header};return se.createElement(xe.header,{ref:t,className:a,id:i,...r,__css:l})});US.displayName="ModalHeader";var nme=xe(Vl.div),u1=Pe((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=Eh("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Ph().overlay},{motionPreset:u}=Sd();return S(nme,{...i||(u==="none"?{}:rz),__css:l,ref:t,className:a,...o})});u1.displayName="ModalOverlay";function qF(e){const{leastDestructiveRef:t,...n}=e;return S(l1,{...n,initialFocusRef:t})}var KF=Pe((e,t)=>S(Yv,{ref:t,role:"alertdialog",...e})),[_Le,rme]=Pn(),ime=xe(oz),ome=Pe((e,t)=>{const{className:n,children:r,motionProps:i,containerProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=Sd(),h=s(a,t),g=l(o),m=Eh("chakra-modal__content",n),v=Ph(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},w={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{placement:P}=rme();return se.createElement(jF,null,se.createElement(xe.div,{...g,className:"chakra-modal__content-container",__css:w},S(ime,{motionProps:i,direction:P,in:u,className:m,...h,__css:b,children:r})))});ome.displayName="DrawerContent";function ame(e,t){const n=hr(e);C.exports.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var XF=(...e)=>e.filter(Boolean).join(" "),ww=e=>e?!0:void 0;function cl(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var sme=e=>S(wa,{viewBox:"0 0 24 24",...e,children:S("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})}),lme=e=>S(wa,{viewBox:"0 0 24 24",...e,children:S("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"})});function BA(e,t,n,r){C.exports.useEffect(()=>{var s;if(!e.current||!r)return;const i=(s=e.current.ownerDocument.defaultView)!=null?s:window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(l=>{for(const u of l)u.type==="attributes"&&u.attributeName&&o.includes(u.attributeName)&&n(u)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var ume=50,zA=300;function cme(e,t){const[n,r]=C.exports.useState(!1),[i,o]=C.exports.useState(null),[a,s]=C.exports.useState(!0),l=C.exports.useRef(null),u=()=>clearTimeout(l.current);ame(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?ume:null);const h=C.exports.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},zA)},[e,a]),g=C.exports.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},zA)},[t,a]),m=C.exports.useCallback(()=>{s(!0),r(!1),u()},[]);return C.exports.useEffect(()=>()=>u(),[]),{up:h,down:g,stop:m,isSpinning:n}}var dme=/^[Ee0-9+\-.]$/;function fme(e){return dme.test(e)}function hme(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function pme(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:u,isInvalid:h,pattern:g="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:v,id:b,onChange:w,precision:P,name:E,"aria-describedby":_,"aria-label":T,"aria-labelledby":M,onFocus:O,onBlur:I,onInvalid:D,getAriaValueText:B,isValidCharacter:$,format:H,parse:j,...ne}=e,V=hr(O),q=hr(I),te=hr(D),J=hr($!=null?$:fme),Z=hr(B),G=Mhe(e),{update:ee,increment:le,decrement:me}=G,[Me,Ce]=C.exports.useState(!1),be=!(s||l),we=C.exports.useRef(null),Ve=C.exports.useRef(null),Ze=C.exports.useRef(null),it=C.exports.useRef(null),pt=C.exports.useCallback(Ee=>Ee.split("").filter(J).join(""),[J]),kt=C.exports.useCallback(Ee=>{var xt;return(xt=j==null?void 0:j(Ee))!=null?xt:Ee},[j]),gt=C.exports.useCallback(Ee=>{var xt;return((xt=H==null?void 0:H(Ee))!=null?xt:Ee).toString()},[H]);vd(()=>{(G.valueAsNumber>o||G.valueAsNumber{if(!we.current)return;if(we.current.value!=G.value){const xt=kt(we.current.value);G.setValue(pt(xt))}},[kt,pt]);const ht=C.exports.useCallback((Ee=a)=>{be&&le(Ee)},[le,be,a]),vt=C.exports.useCallback((Ee=a)=>{be&&me(Ee)},[me,be,a]),Te=cme(ht,vt);BA(Ze,"disabled",Te.stop,Te.isSpinning),BA(it,"disabled",Te.stop,Te.isSpinning);const ot=C.exports.useCallback(Ee=>{if(Ee.nativeEvent.isComposing)return;const Wt=kt(Ee.currentTarget.value);ee(pt(Wt)),Ve.current={start:Ee.currentTarget.selectionStart,end:Ee.currentTarget.selectionEnd}},[ee,pt,kt]),Mt=C.exports.useCallback(Ee=>{var Wt,ze;var xt;V==null||V(Ee),Ve.current&&(Ee.target.selectionStart=(Wt=Ve.current.start)!=null?Wt:(xt=Ee.currentTarget.value)==null?void 0:xt.length,Ee.currentTarget.selectionEnd=(ze=Ve.current.end)!=null?ze:Ee.currentTarget.selectionStart)},[V]),Je=C.exports.useCallback(Ee=>{if(Ee.nativeEvent.isComposing)return;hme(Ee,J)||Ee.preventDefault();const xt=mt(Ee)*a,Wt=Ee.key,lt={ArrowUp:()=>ht(xt),ArrowDown:()=>vt(xt),Home:()=>ee(i),End:()=>ee(o)}[Wt];lt&&(Ee.preventDefault(),lt(Ee))},[J,a,ht,vt,ee,i,o]),mt=Ee=>{let xt=1;return(Ee.metaKey||Ee.ctrlKey)&&(xt=.1),Ee.shiftKey&&(xt=10),xt},un=C.exports.useMemo(()=>{const Ee=Z==null?void 0:Z(G.value);if(Ee!=null)return Ee;const xt=G.value.toString();return xt||void 0},[G.value,Z]),Et=C.exports.useCallback(()=>{let Ee=G.value;if(G.value==="")return;/^[eE]/.test(G.value.toString())?G.setValue(""):(G.valueAsNumbero&&(Ee=o),G.cast(Ee))},[G,o,i]),jt=C.exports.useCallback(()=>{Ce(!1),n&&Et()},[n,Ce,Et]),cn=C.exports.useCallback(()=>{t&&requestAnimationFrame(()=>{var Ee;(Ee=we.current)==null||Ee.focus()})},[t]),xn=C.exports.useCallback(Ee=>{Ee.preventDefault(),Te.up(),cn()},[cn,Te]),Oe=C.exports.useCallback(Ee=>{Ee.preventDefault(),Te.down(),cn()},[cn,Te]);oh(()=>we.current,"wheel",Ee=>{var Ne;var xt;const ze=((Ne=(xt=we.current)==null?void 0:xt.ownerDocument)!=null?Ne:document).activeElement===we.current;if(!v||!ze)return;Ee.preventDefault();const lt=mt(Ee)*a,dn=Math.sign(Ee.deltaY);dn===-1?ht(lt):dn===1&&vt(lt)},{passive:!1});const et=C.exports.useCallback((Ee={},xt=null)=>{const Wt=l||r&&G.isAtMax;return{...Ee,ref:Vn(xt,Ze),role:"button",tabIndex:-1,onPointerDown:cl(Ee.onPointerDown,ze=>{ze.button!==0||Wt||xn(ze)}),onPointerLeave:cl(Ee.onPointerLeave,Te.stop),onPointerUp:cl(Ee.onPointerUp,Te.stop),disabled:Wt,"aria-disabled":ww(Wt)}},[G.isAtMax,r,xn,Te.stop,l]),Jt=C.exports.useCallback((Ee={},xt=null)=>{const Wt=l||r&&G.isAtMin;return{...Ee,ref:Vn(xt,it),role:"button",tabIndex:-1,onPointerDown:cl(Ee.onPointerDown,ze=>{ze.button!==0||Wt||Oe(ze)}),onPointerLeave:cl(Ee.onPointerLeave,Te.stop),onPointerUp:cl(Ee.onPointerUp,Te.stop),disabled:Wt,"aria-disabled":ww(Wt)}},[G.isAtMin,r,Oe,Te.stop,l]),Kt=C.exports.useCallback((Ee={},xt=null)=>{var Wt,ze,lt,dn;return{name:E,inputMode:m,type:"text",pattern:g,"aria-labelledby":M,"aria-label":T,"aria-describedby":_,id:b,disabled:l,...Ee,readOnly:(Wt=Ee.readOnly)!=null?Wt:s,"aria-readonly":(ze=Ee.readOnly)!=null?ze:s,"aria-required":(lt=Ee.required)!=null?lt:u,required:(dn=Ee.required)!=null?dn:u,ref:Vn(we,xt),value:gt(G.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(G.valueAsNumber)?void 0:G.valueAsNumber,"aria-invalid":ww(h!=null?h:G.isOutOfRange),"aria-valuetext":un,autoComplete:"off",autoCorrect:"off",onChange:cl(Ee.onChange,ot),onKeyDown:cl(Ee.onKeyDown,Je),onFocus:cl(Ee.onFocus,Mt,()=>Ce(!0)),onBlur:cl(Ee.onBlur,q,jt)}},[E,m,g,M,T,gt,_,b,l,u,s,h,G.value,G.valueAsNumber,G.isOutOfRange,i,o,un,ot,Je,Mt,q,jt]);return{value:gt(G.value),valueAsNumber:G.valueAsNumber,isFocused:Me,isDisabled:l,isReadOnly:s,getIncrementButtonProps:et,getDecrementButtonProps:Jt,getInputProps:Kt,htmlProps:ne}}var[gme,GS]=Pn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[mme,x_]=Pn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),w_=Pe(function(t,n){const r=Bi("NumberInput",t),i=bn(t),o=G8(i),{htmlProps:a,...s}=pme(o),l=C.exports.useMemo(()=>s,[s]);return se.createElement(mme,{value:l},se.createElement(gme,{value:r},se.createElement(xe.div,{...a,ref:n,className:XF("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});w_.displayName="NumberInput";var ZF=Pe(function(t,n){const r=GS();return se.createElement(xe.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});ZF.displayName="NumberInputStepper";var C_=Pe(function(t,n){const{getInputProps:r}=x_(),i=r(t,n),o=GS();return se.createElement(xe.input,{...i,className:XF("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});C_.displayName="NumberInputField";var QF=xe("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),__=Pe(function(t,n){var a;const r=GS(),{getDecrementButtonProps:i}=x_(),o=i(t,n);return S(QF,{...o,__css:r.stepper,children:(a=t.children)!=null?a:S(sme,{})})});__.displayName="NumberDecrementStepper";var k_=Pe(function(t,n){var a;const{getIncrementButtonProps:r}=x_(),i=r(t,n),o=GS();return S(QF,{...i,__css:o.stepper,children:(a=t.children)!=null?a:S(lme,{})})});k_.displayName="NumberIncrementStepper";var v2=(...e)=>e.filter(Boolean).join(" ");function vme(e,...t){return yme(e)?e(...t):e}var yme=e=>typeof e=="function";function dl(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Sme(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var[bme,Th]=Pn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[xme,y2]=Pn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Hp={click:"click",hover:"hover"};function wme(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=Hp.click,openDelay:h=200,closeDelay:g=200,isLazy:m,lazyBehavior:v="unmount",computePositionOnMount:b,...w}=e,{isOpen:P,onClose:E,onOpen:_,onToggle:T}=eF(e),M=C.exports.useRef(null),O=C.exports.useRef(null),I=C.exports.useRef(null),D=C.exports.useRef(!1),B=C.exports.useRef(!1);P&&(B.current=!0);const[$,H]=C.exports.useState(!1),[j,ne]=C.exports.useState(!1),V=C.exports.useId(),q=i!=null?i:V,[te,J,Z,G]=["popover-trigger","popover-content","popover-header","popover-body"].map(ot=>`${ot}-${q}`),{referenceRef:ee,getArrowProps:le,getPopperProps:me,getArrowInnerProps:Me,forceUpdate:Ce}=Jz({...w,enabled:P||!!b}),be=i1e({isOpen:P,ref:I});$he({enabled:P,ref:O}),Ipe(I,{focusRef:O,visible:P,shouldFocus:o&&u===Hp.click}),Npe(I,{focusRef:r,visible:P,shouldFocus:a&&u===Hp.click});const we=tF({wasSelected:B.current,enabled:m,mode:v,isSelected:be.present}),Ve=C.exports.useCallback((ot={},Mt=null)=>{const Je={...ot,style:{...ot.style,transformOrigin:Yr.transformOrigin.varRef,[Yr.arrowSize.var]:s?`${s}px`:void 0,[Yr.arrowShadowColor.var]:l},ref:Vn(I,Mt),children:we?ot.children:null,id:J,tabIndex:-1,role:"dialog",onKeyDown:dl(ot.onKeyDown,mt=>{n&&mt.key==="Escape"&&E()}),onBlur:dl(ot.onBlur,mt=>{const un=FA(mt),Et=Cw(I.current,un),jt=Cw(O.current,un);P&&t&&(!Et&&!jt)&&E()}),"aria-labelledby":$?Z:void 0,"aria-describedby":j?G:void 0};return u===Hp.hover&&(Je.role="tooltip",Je.onMouseEnter=dl(ot.onMouseEnter,()=>{D.current=!0}),Je.onMouseLeave=dl(ot.onMouseLeave,mt=>{mt.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>E(),g))})),Je},[we,J,$,Z,j,G,u,n,E,P,t,g,l,s]),Ze=C.exports.useCallback((ot={},Mt=null)=>me({...ot,style:{visibility:P?"visible":"hidden",...ot.style}},Mt),[P,me]),it=C.exports.useCallback((ot,Mt=null)=>({...ot,ref:Vn(Mt,M,ee)}),[M,ee]),pt=C.exports.useRef(),kt=C.exports.useRef(),gt=C.exports.useCallback(ot=>{M.current==null&&ee(ot)},[ee]),ht=C.exports.useCallback((ot={},Mt=null)=>{const Je={...ot,ref:Vn(O,Mt,gt),id:te,"aria-haspopup":"dialog","aria-expanded":P,"aria-controls":J};return u===Hp.click&&(Je.onClick=dl(ot.onClick,T)),u===Hp.hover&&(Je.onFocus=dl(ot.onFocus,()=>{pt.current===void 0&&_()}),Je.onBlur=dl(ot.onBlur,mt=>{const un=FA(mt),Et=!Cw(I.current,un);P&&t&&Et&&E()}),Je.onKeyDown=dl(ot.onKeyDown,mt=>{mt.key==="Escape"&&E()}),Je.onMouseEnter=dl(ot.onMouseEnter,()=>{D.current=!0,pt.current=window.setTimeout(()=>_(),h)}),Je.onMouseLeave=dl(ot.onMouseLeave,()=>{D.current=!1,pt.current&&(clearTimeout(pt.current),pt.current=void 0),kt.current=window.setTimeout(()=>{D.current===!1&&E()},g)})),Je},[te,P,J,u,gt,T,_,t,E,h,g]);C.exports.useEffect(()=>()=>{pt.current&&clearTimeout(pt.current),kt.current&&clearTimeout(kt.current)},[]);const vt=C.exports.useCallback((ot={},Mt=null)=>({...ot,id:Z,ref:Vn(Mt,Je=>{H(!!Je)})}),[Z]),Te=C.exports.useCallback((ot={},Mt=null)=>({...ot,id:G,ref:Vn(Mt,Je=>{ne(!!Je)})}),[G]);return{forceUpdate:Ce,isOpen:P,onAnimationComplete:be.onComplete,onClose:E,getAnchorProps:it,getArrowProps:le,getArrowInnerProps:Me,getPopoverPositionerProps:Ze,getPopoverProps:Ve,getTriggerProps:ht,getHeaderProps:vt,getBodyProps:Te}}function Cw(e,t){return e===t||(e==null?void 0:e.contains(t))}function FA(e){var n;const t=e.currentTarget.ownerDocument.activeElement;return(n=e.relatedTarget)!=null?n:t}function E_(e){const t=Bi("Popover",e),{children:n,...r}=bn(e),i=S1(),o=wme({...r,direction:i.direction});return S(bme,{value:o,children:S(xme,{value:t,children:vme(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})})})}E_.displayName="Popover";function P_(e){var l;const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=Th(),a=y2(),s=(l=t!=null?t:n)!=null?l:r;return se.createElement(xe.div,{...i(),className:"chakra-popover__arrow-positioner"},se.createElement(xe.div,{className:v2("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}P_.displayName="PopoverArrow";var Cme=Pe(function(t,n){const{getBodyProps:r}=Th(),i=y2();return se.createElement(xe.div,{...r(t,n),className:v2("chakra-popover__body",t.className),__css:i.body})});Cme.displayName="PopoverBody";var _me=Pe(function(t,n){const{onClose:r}=Th(),i=y2();return S(FS,{size:"sm",onClick:r,className:v2("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});_me.displayName="PopoverCloseButton";function kme(e){if(!!e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var Eme={exit:{opacity:0,scale:.95,transition:{duration:.1,ease:[.4,0,1,1]}},enter:{scale:1,opacity:1,transition:{duration:.15,ease:[0,0,.2,1]}}},Pme=xe(Vl.section),JF=Pe(function(t,n){const{variants:r=Eme,...i}=t,{isOpen:o}=Th();return se.createElement(Pme,{ref:n,variants:kme(r),initial:!1,animate:o?"enter":"exit",...i})});JF.displayName="PopoverTransition";var T_=Pe(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=Th(),u=y2(),h={position:"relative",display:"flex",flexDirection:"column",...u.content};return se.createElement(xe.div,{...s(r),__css:u.popper,className:"chakra-popover__popper"},S(JF,{...i,...a(o,n),onAnimationComplete:Sme(l,o.onAnimationComplete),className:v2("chakra-popover__content",t.className),__css:h}))});T_.displayName="PopoverContent";var Tme=Pe(function(t,n){const{getHeaderProps:r}=Th(),i=y2();return se.createElement(xe.header,{...r(t,n),className:v2("chakra-popover__header",t.className),__css:i.header})});Tme.displayName="PopoverHeader";function L_(e){const t=C.exports.Children.only(e.children),{getTriggerProps:n}=Th();return C.exports.cloneElement(t,n(t.props,t.ref))}L_.displayName="PopoverTrigger";function Lme(e,t,n){return(e-t)*100/(n-t)}var Ame=Ed({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),Mme=Ed({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Rme=Ed({"0%":{left:"-40%"},"100%":{left:"100%"}}),Ome=Ed({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function e$(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=Lme(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof o=="function"?o(t,l):i})(),role:s},percent:l,value:t}}var t$=e=>{const{size:t,isIndeterminate:n,...r}=e;return se.createElement(xe.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${Mme} 2s linear infinite`:void 0},...r})};t$.displayName="Shape";var r7=e=>se.createElement(xe.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});r7.displayName="Circle";var Ime=Pe((e,t)=>{var M;const{size:n="48px",max:r=100,min:i=0,valueText:o,getValueText:a,value:s,capIsRound:l,children:u,thickness:h="10px",color:g="#0078d4",trackColor:m="#edebe9",isIndeterminate:v,...b}=e,w=e$({min:i,max:r,value:s,valueText:o,getValueText:a,isIndeterminate:v}),P=v?void 0:((M=w.percent)!=null?M:0)*2.64,E=P==null?void 0:`${P} ${264-P}`,_=v?{css:{animation:`${Ame} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:E,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},T={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:n};return se.createElement(xe.div,{ref:t,className:"chakra-progress",...w.bind,...b,__css:T},X(t$,{size:n,isIndeterminate:v,children:[S(r7,{stroke:m,strokeWidth:h,className:"chakra-progress__track"}),S(r7,{stroke:g,strokeWidth:h,className:"chakra-progress__indicator",strokeLinecap:l?"round":void 0,opacity:w.value===0&&!v?0:void 0,..._})]}),u)});Ime.displayName="CircularProgress";var[Dme,Nme]=Pn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Bme=Pe((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=e$({value:i,min:n,max:r,isIndeterminate:o,role:a}),h={height:"100%",...Nme().filledTrack};return se.createElement(xe.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:h})}),n$=Pe((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:h,"aria-label":g,"aria-labelledby":m,title:v,role:b,...w}=bn(e),P=Bi("Progress",e),E=u!=null?u:(n=P.track)==null?void 0:n.borderRadius,_={animation:`${Ome} 1s linear infinite`},O={...!h&&a&&s&&_,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${Rme} 1s ease infinite normal none running`}},I={overflow:"hidden",position:"relative",...P.track};return se.createElement(xe.div,{ref:t,borderRadius:E,__css:I,...w},X(Dme,{value:P,children:[S(Bme,{"aria-label":g,"aria-labelledby":m,min:i,max:o,value:r,isIndeterminate:h,css:O,borderRadius:E,title:v,role:b}),l]}))});n$.displayName="Progress";var zme=xe("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});zme.displayName="CircularProgressLabel";var Fme=(...e)=>e.filter(Boolean).join(" "),$me=e=>e?"":void 0;function Hme(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var r$=Pe(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return se.createElement(xe.select,{...a,ref:n,className:Fme("chakra-select",o)},i&&S("option",{value:"",children:i}),r)});r$.displayName="SelectField";var i$=Pe((e,t)=>{var n;const r=Bi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:h,minHeight:g,iconColor:m,iconSize:v,...b}=bn(e),[w,P]=Hme(b,lJ),E=U8(P),_={width:"100%",height:"fit-content",position:"relative",color:s},T={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return se.createElement(xe.div,{className:"chakra-select__wrapper",__css:_,...w,...i},S(r$,{ref:t,height:u!=null?u:l,minH:h!=null?h:g,placeholder:o,...E,__css:T,children:e.children}),S(o$,{"data-disabled":$me(E.disabled),...(m||s)&&{color:m||s},__css:r.icon,...v&&{fontSize:v},children:a}))});i$.displayName="Select";var Wme=e=>S("svg",{viewBox:"0 0 24 24",...e,children:S("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),Vme=xe("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),o$=e=>{const{children:t=S(Wme,{}),...n}=e,r=C.exports.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return S(Vme,{...n,className:"chakra-select__icon-wrapper",children:C.exports.isValidElement(t)?r:null})};o$.displayName="SelectIcon";function Ume(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Gme(e){const t=Yme(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function a$(e){return!!e.touches}function jme(e){return a$(e)&&e.touches.length>1}function Yme(e){var t;return(t=e.view)!=null?t:window}function qme(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function Kme(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function s$(e,t="page"){return a$(e)?qme(e,t):Kme(e,t)}function Xme(e){return t=>{const n=Gme(t);(!n||n&&t.button===0)&&e(t)}}function Zme(e,t=!1){function n(i){e(i,{point:s$(i)})}return t?Xme(n):n}function t5(e,t,n,r){return Ume(e,t,Zme(n,t==="pointerdown"),r)}function l$(e){const t=C.exports.useRef(null);return t.current=e,t}var Qme=class{constructor(e,t,n){nn(this,"history",[]);nn(this,"startEvent",null);nn(this,"lastEvent",null);nn(this,"lastEventInfo",null);nn(this,"handlers",{});nn(this,"removeListeners",()=>{});nn(this,"threshold",3);nn(this,"win");nn(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=_w(this.lastEventInfo,this.history),t=this.startEvent!==null,n=nve(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=mT();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i==null||i(this.lastEvent,e),this.startEvent=this.lastEvent),o==null||o(this.lastEvent,e)});nn(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,bee.update(this.updatePoint,!0)});nn(this,"onPointerUp",(e,t)=>{const n=_w(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i==null||i(e,n),this.end(),!(!r||!this.startEvent)&&(r==null||r(e,n))});var a;if(this.win=(a=e.view)!=null?a:window,jme(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:s$(e)},{timestamp:i}=mT();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o==null||o(e,_w(r,this.history)),this.removeListeners=tve(t5(this.win,"pointermove",this.onPointerMove),t5(this.win,"pointerup",this.onPointerUp),t5(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),xee.update(this.updatePoint)}};function $A(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _w(e,t){return{point:e.point,delta:$A(e.point,t[t.length-1]),offset:$A(e.point,t[0]),velocity:eve(t,.1)}}var Jme=e=>e*1e3;function eve(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Jme(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function tve(...e){return t=>e.reduce((n,r)=>r(n),t)}function kw(e,t){return Math.abs(e-t)}function HA(e){return"x"in e&&"y"in e}function nve(e,t){if(typeof e=="number"&&typeof t=="number")return kw(e,t);if(HA(e)&&HA(t)){const n=kw(e.x,t.x),r=kw(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function u$(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=C.exports.useRef(null),h=l$({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(g,m){u.current=null,i==null||i(g,m)}});C.exports.useEffect(()=>{var g;(g=u.current)==null||g.updateHandlers(h.current)}),C.exports.useEffect(()=>{const g=e.current;if(!g||!l)return;function m(v){u.current=new Qme(v,h.current,s)}return t5(g,"pointerdown",m)},[e,l,h,s]),C.exports.useEffect(()=>()=>{var g;(g=u.current)==null||g.end(),u.current=null},[])}function rve(e,t){var i;if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=(i=e.ownerDocument.defaultView)!=null?i:window,r=new n.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[a]=o;let s,l;if("borderBoxSize"in a){const u=a.borderBoxSize,h=Array.isArray(u)?u[0]:u;s=h.inlineSize,l=h.blockSize}else s=e.offsetWidth,l=e.offsetHeight;t({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var ive=Boolean(globalThis==null?void 0:globalThis.document)?C.exports.useLayoutEffect:C.exports.useEffect;function ove(e,t){var o;var n;if(!e||!e.parentElement)return;const r=(o=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?o:window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function c$({getNodes:e,observeMutation:t=!0}){const[n,r]=C.exports.useState([]),[i,o]=C.exports.useState(0);return ive(()=>{const a=e(),s=a.map((l,u)=>rve(l,h=>{r(g=>[...g.slice(0,u),h,...g.slice(u+1)])}));if(t){const l=a[0];s.push(ove(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function ave(e){return typeof e=="object"&&e!==null&&"current"in e}function sve(e){const[t]=c$({observeMutation:!1,getNodes(){return[ave(e)?e.current:e]}});return t}var lve=Object.getOwnPropertyNames,uve=(e,t)=>function(){return e&&(t=(0,e[lve(e)[0]])(e=0)),t},Md=uve({"../../../react-shim.js"(){}});Md();Md();Md();var Ba=e=>e?"":void 0,F0=e=>e?!0:void 0,Rd=(...e)=>e.filter(Boolean).join(" ");Md();function $0(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}Md();Md();function cve(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function xm(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var n5={width:0,height:0},r3=e=>e||n5;function d$(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=w=>{var E;const P=(E=r[w])!=null?E:n5;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...xm({orientation:t,vertical:{bottom:`calc(${n[w]}% - ${P.height/2}px)`},horizontal:{left:`calc(${n[w]}% - ${P.width/2}px)`}})}},a=t==="vertical"?r.reduce((w,P)=>r3(w).height>r3(P).height?w:P,n5):r.reduce((w,P)=>r3(w).width>r3(P).width?w:P,n5),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...xm({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...xm({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,h=[0,i?100-n[0]:n[0]],g=u?h:n;let m=g[0];!u&&i&&(m=100-m);const v=Math.abs(g[g.length-1]-g[0]),b={...l,...xm({orientation:t,vertical:i?{height:`${v}%`,top:`${m}%`}:{height:`${v}%`,bottom:`${m}%`},horizontal:i?{width:`${v}%`,right:`${m}%`}:{width:`${v}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function f$(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function dve(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:h,isReadOnly:g,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:w,"aria-valuetext":P,"aria-label":E,"aria-labelledby":_,name:T,focusThumbOnChange:M=!0,minStepsBetweenThumbs:O=0,...I}=e,D=hr(m),B=hr(v),$=hr(w),H=f$({isReversed:a,direction:s,orientation:l}),[j,ne]=bS({value:i,defaultValue:o!=null?o:[25,75],onChange:r});if(!Array.isArray(j))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof j}\``);const[V,q]=C.exports.useState(!1),[te,J]=C.exports.useState(!1),[Z,G]=C.exports.useState(-1),ee=!(h||g),le=C.exports.useRef(j),me=j.map(Ne=>N0(Ne,t,n)),Me=O*b,Ce=fve(me,t,n,Me),be=C.exports.useRef({eventSource:null,value:[],valueBounds:[]});be.current.value=me,be.current.valueBounds=Ce;const we=me.map(Ne=>n-Ne+t),Ze=(H?we:me).map(Ne=>l4(Ne,t,n)),it=l==="vertical",pt=C.exports.useRef(null),kt=C.exports.useRef(null),gt=c$({getNodes(){const Ne=kt.current,ct=Ne==null?void 0:Ne.querySelectorAll("[role=slider]");return ct?Array.from(ct):[]}}),ht=C.exports.useId(),vt=u!=null?u:ht,Te=cve(vt),ot=C.exports.useCallback(Ne=>{var Wo;var ct;if(!pt.current)return;be.current.eventSource="pointer";const tt=pt.current.getBoundingClientRect(),{clientX:Nt,clientY:an}=(Wo=(ct=Ne.touches)==null?void 0:ct[0])!=null?Wo:Ne,Sr=it?tt.bottom-an:Nt-tt.left,or=it?tt.height:tt.width;let $r=Sr/or;return H&&($r=1-$r),gz($r,t,n)},[it,H,n,t]),Mt=(n-t)/10,Je=b||(n-t)/100,mt=C.exports.useMemo(()=>({setValueAtIndex(Ne,ct){if(!ee)return;const tt=be.current.valueBounds[Ne];ct=parseFloat(jC(ct,tt.min,Je)),ct=N0(ct,tt.min,tt.max);const Nt=[...be.current.value];Nt[Ne]=ct,ne(Nt)},setActiveIndex:G,stepUp(Ne,ct=Je){const tt=be.current.value[Ne],Nt=H?tt-ct:tt+ct;mt.setValueAtIndex(Ne,Nt)},stepDown(Ne,ct=Je){const tt=be.current.value[Ne],Nt=H?tt+ct:tt-ct;mt.setValueAtIndex(Ne,Nt)},reset(){ne(le.current)}}),[Je,H,ne,ee]),un=C.exports.useCallback(Ne=>{const ct=Ne.key,Nt={ArrowRight:()=>mt.stepUp(Z),ArrowUp:()=>mt.stepUp(Z),ArrowLeft:()=>mt.stepDown(Z),ArrowDown:()=>mt.stepDown(Z),PageUp:()=>mt.stepUp(Z,Mt),PageDown:()=>mt.stepDown(Z,Mt),Home:()=>{const{min:an}=Ce[Z];mt.setValueAtIndex(Z,an)},End:()=>{const{max:an}=Ce[Z];mt.setValueAtIndex(Z,an)}}[ct];Nt&&(Ne.preventDefault(),Ne.stopPropagation(),Nt(Ne),be.current.eventSource="keyboard")},[mt,Z,Mt,Ce]),{getThumbStyle:Et,rootStyle:jt,trackStyle:cn,innerTrackStyle:xn}=C.exports.useMemo(()=>d$({isReversed:H,orientation:l,thumbRects:gt,thumbPercents:Ze}),[H,l,Ze,gt]),Oe=C.exports.useCallback(Ne=>{var ct;const tt=Ne!=null?Ne:Z;if(tt!==-1&&M){const Nt=Te.getThumb(tt),an=(ct=kt.current)==null?void 0:ct.ownerDocument.getElementById(Nt);an&&setTimeout(()=>an.focus())}},[M,Z,Te]);vd(()=>{be.current.eventSource==="keyboard"&&(B==null||B(be.current.value))},[me,B]);const et=Ne=>{const ct=ot(Ne)||0,tt=be.current.value.map($r=>Math.abs($r-ct)),Nt=Math.min(...tt);let an=tt.indexOf(Nt);const Sr=tt.filter($r=>$r===Nt);Sr.length>1&&ct>be.current.value[an]&&(an=an+Sr.length-1),G(an),mt.setValueAtIndex(an,ct),Oe(an)},Jt=Ne=>{if(Z==-1)return;const ct=ot(Ne)||0;G(Z),mt.setValueAtIndex(Z,ct),Oe(Z)};u$(kt,{onPanSessionStart(Ne){!ee||(q(!0),et(Ne),D==null||D(be.current.value))},onPanSessionEnd(){!ee||(q(!1),B==null||B(be.current.value))},onPan(Ne){!ee||Jt(Ne)}});const Kt=C.exports.useCallback((Ne={},ct=null)=>({...Ne,...I,id:Te.root,ref:Vn(ct,kt),tabIndex:-1,"aria-disabled":F0(h),"data-focused":Ba(te),style:{...Ne.style,...jt}}),[I,h,te,jt,Te]),Ee=C.exports.useCallback((Ne={},ct=null)=>({...Ne,ref:Vn(ct,pt),id:Te.track,"data-disabled":Ba(h),style:{...Ne.style,...cn}}),[h,cn,Te]),xt=C.exports.useCallback((Ne={},ct=null)=>({...Ne,ref:ct,id:Te.innerTrack,style:{...Ne.style,...xn}}),[xn,Te]),Wt=C.exports.useCallback((Ne,ct=null)=>{var or;const{index:tt,...Nt}=Ne,an=me[tt];if(an==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${tt}\`. The \`value\` or \`defaultValue\` length is : ${me.length}`);const Sr=Ce[tt];return{...Nt,ref:ct,role:"slider",tabIndex:ee?0:void 0,id:Te.getThumb(tt),"data-active":Ba(V&&Z===tt),"aria-valuetext":(or=$==null?void 0:$(an))!=null?or:P==null?void 0:P[tt],"aria-valuemin":Sr.min,"aria-valuemax":Sr.max,"aria-valuenow":an,"aria-orientation":l,"aria-disabled":F0(h),"aria-readonly":F0(g),"aria-label":E==null?void 0:E[tt],"aria-labelledby":E!=null&&E[tt]||_==null?void 0:_[tt],style:{...Ne.style,...Et(tt)},onKeyDown:$0(Ne.onKeyDown,un),onFocus:$0(Ne.onFocus,()=>{J(!0),G(tt)}),onBlur:$0(Ne.onBlur,()=>{J(!1),G(-1)})}},[Te,me,Ce,ee,V,Z,$,P,l,h,g,E,_,Et,un,J]),ze=C.exports.useCallback((Ne={},ct=null)=>({...Ne,ref:ct,id:Te.output,htmlFor:me.map((tt,Nt)=>Te.getThumb(Nt)).join(" "),"aria-live":"off"}),[Te,me]),lt=C.exports.useCallback((Ne,ct=null)=>{const{value:tt,...Nt}=Ne,an=!(ttn),Sr=tt>=me[0]&&tt<=me[me.length-1];let or=l4(tt,t,n);or=H?100-or:or;const $r={position:"absolute",pointerEvents:"none",...xm({orientation:l,vertical:{bottom:`${or}%`},horizontal:{left:`${or}%`}})};return{...Nt,ref:ct,id:Te.getMarker(Ne.value),role:"presentation","aria-hidden":!0,"data-disabled":Ba(h),"data-invalid":Ba(!an),"data-highlighted":Ba(Sr),style:{...Ne.style,...$r}}},[h,H,n,t,l,me,Te]),dn=C.exports.useCallback((Ne,ct=null)=>{const{index:tt,...Nt}=Ne;return{...Nt,ref:ct,id:Te.getInput(tt),type:"hidden",value:me[tt],name:Array.isArray(T)?T[tt]:`${T}-${tt}`}},[T,me,Te]);return{state:{value:me,isFocused:te,isDragging:V,getThumbPercent:Ne=>Ze[Ne],getThumbMinValue:Ne=>Ce[Ne].min,getThumbMaxValue:Ne=>Ce[Ne].max},actions:mt,getRootProps:Kt,getTrackProps:Ee,getInnerTrackProps:xt,getThumbProps:Wt,getMarkerProps:lt,getInputProps:dn,getOutputProps:ze}}function fve(e,t,n,r){return e.map((i,o)=>{const a=o===0?t:e[o-1]+r,s=o===e.length-1?n:e[o+1]-r;return{min:a,max:s}})}var[hve,jS]=Pn({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[pve,A_]=Pn({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),h$=Pe(function(t,n){const r=Bi("Slider",t),i=bn(t),{direction:o}=S1();i.direction=o;const{getRootProps:a,...s}=dve(i),l=C.exports.useMemo(()=>({...s,name:t.name}),[s,t.name]);return se.createElement(hve,{value:l},se.createElement(pve,{value:r},se.createElement(xe.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});h$.defaultProps={orientation:"horizontal"};h$.displayName="RangeSlider";var gve=Pe(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=jS(),a=A_(),s=r(t,n);return se.createElement(xe.div,{...s,className:Rd("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&S("input",{...i({index:t.index})}))});gve.displayName="RangeSliderThumb";var mve=Pe(function(t,n){const{getTrackProps:r}=jS(),i=A_(),o=r(t,n);return se.createElement(xe.div,{...o,className:Rd("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});mve.displayName="RangeSliderTrack";var vve=Pe(function(t,n){const{getInnerTrackProps:r}=jS(),i=A_(),o=r(t,n);return se.createElement(xe.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});vve.displayName="RangeSliderFilledTrack";var yve=Pe(function(t,n){const{getMarkerProps:r}=jS(),i=r(t,n);return se.createElement(xe.div,{...i,className:Rd("chakra-slider__marker",t.className)})});yve.displayName="RangeSliderMark";Md();Md();function Sve(e){var Wt;const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:h,isReadOnly:g,onChangeStart:m,onChangeEnd:v,step:b=1,getAriaValueText:w,"aria-valuetext":P,"aria-label":E,"aria-labelledby":_,name:T,focusThumbOnChange:M=!0,...O}=e,I=hr(m),D=hr(v),B=hr(w),$=f$({isReversed:a,direction:s,orientation:l}),[H,j]=bS({value:i,defaultValue:o!=null?o:xve(t,n),onChange:r}),[ne,V]=C.exports.useState(!1),[q,te]=C.exports.useState(!1),J=!(h||g),Z=(n-t)/10,G=b||(n-t)/100,ee=N0(H,t,n),le=n-ee+t,Me=l4($?le:ee,t,n),Ce=l==="vertical",be=l$({min:t,max:n,step:b,isDisabled:h,value:ee,isInteractive:J,isReversed:$,isVertical:Ce,eventSource:null,focusThumbOnChange:M,orientation:l}),we=C.exports.useRef(null),Ve=C.exports.useRef(null),Ze=C.exports.useRef(null),it=C.exports.useId(),pt=u!=null?u:it,[kt,gt]=[`slider-thumb-${pt}`,`slider-track-${pt}`],ht=C.exports.useCallback(ze=>{var $r;var lt;if(!we.current)return;const dn=be.current;dn.eventSource="pointer";const Ne=we.current.getBoundingClientRect(),{clientX:ct,clientY:tt}=($r=(lt=ze.touches)==null?void 0:lt[0])!=null?$r:ze,Nt=Ce?Ne.bottom-tt:ct-Ne.left,an=Ce?Ne.height:Ne.width;let Sr=Nt/an;$&&(Sr=1-Sr);let or=gz(Sr,dn.min,dn.max);return dn.step&&(or=parseFloat(jC(or,dn.min,dn.step))),or=N0(or,dn.min,dn.max),or},[Ce,$,be]),vt=C.exports.useCallback(ze=>{const lt=be.current;!lt.isInteractive||(ze=parseFloat(jC(ze,lt.min,G)),ze=N0(ze,lt.min,lt.max),j(ze))},[G,j,be]),Te=C.exports.useMemo(()=>({stepUp(ze=G){const lt=$?ee-ze:ee+ze;vt(lt)},stepDown(ze=G){const lt=$?ee+ze:ee-ze;vt(lt)},reset(){vt(o||0)},stepTo(ze){vt(ze)}}),[vt,$,ee,G,o]),ot=C.exports.useCallback(ze=>{const lt=be.current,Ne={ArrowRight:()=>Te.stepUp(),ArrowUp:()=>Te.stepUp(),ArrowLeft:()=>Te.stepDown(),ArrowDown:()=>Te.stepDown(),PageUp:()=>Te.stepUp(Z),PageDown:()=>Te.stepDown(Z),Home:()=>vt(lt.min),End:()=>vt(lt.max)}[ze.key];Ne&&(ze.preventDefault(),ze.stopPropagation(),Ne(ze),lt.eventSource="keyboard")},[Te,vt,Z,be]),Mt=(Wt=B==null?void 0:B(ee))!=null?Wt:P,Je=sve(Ve),{getThumbStyle:mt,rootStyle:un,trackStyle:Et,innerTrackStyle:jt}=C.exports.useMemo(()=>{const ze=be.current,lt=Je!=null?Je:{width:0,height:0};return d$({isReversed:$,orientation:ze.orientation,thumbRects:[lt],thumbPercents:[Me]})},[$,Je,Me,be]),cn=C.exports.useCallback(()=>{be.current.focusThumbOnChange&&setTimeout(()=>{var lt;return(lt=Ve.current)==null?void 0:lt.focus()})},[be]);vd(()=>{const ze=be.current;cn(),ze.eventSource==="keyboard"&&(D==null||D(ze.value))},[ee,D]);function xn(ze){const lt=ht(ze);lt!=null&<!==be.current.value&&j(lt)}u$(Ze,{onPanSessionStart(ze){const lt=be.current;!lt.isInteractive||(V(!0),cn(),xn(ze),I==null||I(lt.value))},onPanSessionEnd(){const ze=be.current;!ze.isInteractive||(V(!1),D==null||D(ze.value))},onPan(ze){!be.current.isInteractive||xn(ze)}});const Oe=C.exports.useCallback((ze={},lt=null)=>({...ze,...O,ref:Vn(lt,Ze),tabIndex:-1,"aria-disabled":F0(h),"data-focused":Ba(q),style:{...ze.style,...un}}),[O,h,q,un]),et=C.exports.useCallback((ze={},lt=null)=>({...ze,ref:Vn(lt,we),id:gt,"data-disabled":Ba(h),style:{...ze.style,...Et}}),[h,gt,Et]),Jt=C.exports.useCallback((ze={},lt=null)=>({...ze,ref:lt,style:{...ze.style,...jt}}),[jt]),Kt=C.exports.useCallback((ze={},lt=null)=>({...ze,ref:Vn(lt,Ve),role:"slider",tabIndex:J?0:void 0,id:kt,"data-active":Ba(ne),"aria-valuetext":Mt,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":ee,"aria-orientation":l,"aria-disabled":F0(h),"aria-readonly":F0(g),"aria-label":E,"aria-labelledby":E?void 0:_,style:{...ze.style,...mt(0)},onKeyDown:$0(ze.onKeyDown,ot),onFocus:$0(ze.onFocus,()=>te(!0)),onBlur:$0(ze.onBlur,()=>te(!1))}),[J,kt,ne,Mt,t,n,ee,l,h,g,E,_,mt,ot]),Ee=C.exports.useCallback((ze,lt=null)=>{const dn=!(ze.valuen),Ne=ee>=ze.value,ct=l4(ze.value,t,n),tt={position:"absolute",pointerEvents:"none",...bve({orientation:l,vertical:{bottom:$?`${100-ct}%`:`${ct}%`},horizontal:{left:$?`${100-ct}%`:`${ct}%`}})};return{...ze,ref:lt,role:"presentation","aria-hidden":!0,"data-disabled":Ba(h),"data-invalid":Ba(!dn),"data-highlighted":Ba(Ne),style:{...ze.style,...tt}}},[h,$,n,t,l,ee]),xt=C.exports.useCallback((ze={},lt=null)=>({...ze,ref:lt,type:"hidden",value:ee,name:T}),[T,ee]);return{state:{value:ee,isFocused:q,isDragging:ne},actions:Te,getRootProps:Oe,getTrackProps:et,getInnerTrackProps:Jt,getThumbProps:Kt,getMarkerProps:Ee,getInputProps:xt}}function bve(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function xve(e,t){return t"}),[Cve,qS]=Pn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),M_=Pe((e,t)=>{const n=Bi("Slider",e),r=bn(e),{direction:i}=S1();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=Sve(r),l=a(),u=o({},t);return se.createElement(wve,{value:s},se.createElement(Cve,{value:n},se.createElement(xe.div,{...l,className:Rd("chakra-slider",e.className),__css:n.container},e.children,S("input",{...u}))))});M_.defaultProps={orientation:"horizontal"};M_.displayName="Slider";var p$=Pe((e,t)=>{const{getThumbProps:n}=YS(),r=qS(),i=n(e,t);return se.createElement(xe.div,{...i,className:Rd("chakra-slider__thumb",e.className),__css:r.thumb})});p$.displayName="SliderThumb";var g$=Pe((e,t)=>{const{getTrackProps:n}=YS(),r=qS(),i=n(e,t);return se.createElement(xe.div,{...i,className:Rd("chakra-slider__track",e.className),__css:r.track})});g$.displayName="SliderTrack";var m$=Pe((e,t)=>{const{getInnerTrackProps:n}=YS(),r=qS(),i=n(e,t);return se.createElement(xe.div,{...i,className:Rd("chakra-slider__filled-track",e.className),__css:r.filledTrack})});m$.displayName="SliderFilledTrack";var i7=Pe((e,t)=>{const{getMarkerProps:n}=YS(),r=qS(),i=n(e,t);return se.createElement(xe.div,{...i,className:Rd("chakra-slider__marker",e.className),__css:r.mark})});i7.displayName="SliderMark";var _ve=(...e)=>e.filter(Boolean).join(" "),WA=e=>e?"":void 0,R_=Pe(function(t,n){const r=Bi("Switch",t),{spacing:i="0.5rem",children:o,...a}=bn(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:h,getLabelProps:g}=hz(a),m=C.exports.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),v=C.exports.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=C.exports.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return se.createElement(xe.label,{...h(),className:_ve("chakra-switch",t.className),__css:m},S("input",{className:"chakra-switch__input",...l({},n)}),se.createElement(xe.span,{...u(),className:"chakra-switch__track",__css:v},se.createElement(xe.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":WA(s.isChecked),"data-hover":WA(s.isHovered)})),o&&se.createElement(xe.span,{className:"chakra-switch__label",...g(),__css:b},o))});R_.displayName="Switch";var E1=(...e)=>e.filter(Boolean).join(" ");function o7(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[kve,v$,Eve,Pve]=PN();function Tve(e){var _;const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...u}=e,[h,g]=C.exports.useState(t!=null?t:0),[m,v]=bS({defaultValue:t!=null?t:0,value:r,onChange:n});C.exports.useEffect(()=>{r!=null&&g(r)},[r]);const b=Eve(),w=C.exports.useId();return{id:`tabs-${(_=e.id)!=null?_:w}`,selectedIndex:m,focusedIndex:h,setSelectedIndex:v,setFocusedIndex:g,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:b,direction:l,htmlProps:u}}var[Lve,S2]=Pn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function Ave(e){const{focusedIndex:t,orientation:n,direction:r}=S2(),i=v$(),o=C.exports.useCallback(a=>{const s=()=>{var _;const T=i.nextEnabled(t);T&&((_=T.node)==null||_.focus())},l=()=>{var _;const T=i.prevEnabled(t);T&&((_=T.node)==null||_.focus())},u=()=>{var _;const T=i.firstEnabled();T&&((_=T.node)==null||_.focus())},h=()=>{var _;const T=i.lastEnabled();T&&((_=T.node)==null||_.focus())},g=n==="horizontal",m=n==="vertical",v=a.key,b=r==="ltr"?"ArrowLeft":"ArrowRight",w=r==="ltr"?"ArrowRight":"ArrowLeft",E={[b]:()=>g&&l(),[w]:()=>g&&s(),ArrowDown:()=>m&&s(),ArrowUp:()=>m&&l(),Home:u,End:h}[v];E&&(a.preventDefault(),E(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:o7(e.onKeyDown,o)}}function Mve(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=S2(),{index:u,register:h}=Pve({disabled:t&&!n}),g=u===l,m=()=>{i(u)},v=()=>{s(u),!o&&!(t&&n)&&i(u)},b=Cpe({...r,ref:Vn(h,e.ref),isDisabled:t,isFocusable:n,onClick:o7(e.onClick,m)}),w="button";return{...b,id:y$(a,u),role:"tab",tabIndex:g?0:-1,type:w,"aria-selected":g,"aria-controls":S$(a,u),onFocus:t?void 0:o7(e.onFocus,v)}}var[Rve,Ove]=Pn({});function Ive(e){const t=S2(),{id:n,selectedIndex:r}=t,o=NS(e.children).map((a,s)=>C.exports.createElement(Rve,{key:s,value:{isSelected:s===r,id:S$(n,s),tabId:y$(n,s),selectedIndex:r}},a));return{...e,children:o}}function Dve(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=S2(),{isSelected:o,id:a,tabId:s}=Ove(),l=C.exports.useRef(!1);o&&(l.current=!0);const u=tF({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function Nve(){const e=S2(),t=v$(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=C.exports.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,u]=C.exports.useState(!1);return Ts(()=>{if(n==null)return;const h=t.item(n);if(h==null)return;i&&s({left:h.node.offsetLeft,width:h.node.offsetWidth}),o&&s({top:h.node.offsetTop,height:h.node.offsetHeight});const g=requestAnimationFrame(()=>{u(!0)});return()=>{g&&cancelAnimationFrame(g)}},[n,i,o,t]),{position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:l?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",...a}}function y$(e,t){return`${e}--tab-${t}`}function S$(e,t){return`${e}--tabpanel-${t}`}var[Bve,b2]=Pn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),b$=Pe(function(t,n){const r=Bi("Tabs",t),{children:i,className:o,...a}=bn(t),{htmlProps:s,descendants:l,...u}=Tve(a),h=C.exports.useMemo(()=>u,[u]),{isFitted:g,...m}=s;return se.createElement(kve,{value:l},se.createElement(Lve,{value:h},se.createElement(Bve,{value:r},se.createElement(xe.div,{className:E1("chakra-tabs",o),ref:n,...m,__css:r.root},i))))});b$.displayName="Tabs";var zve=Pe(function(t,n){const r=Nve(),i={...t.style,...r},o=b2();return se.createElement(xe.div,{ref:n,...t,className:E1("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});zve.displayName="TabIndicator";var Fve=Pe(function(t,n){const r=Ave({...t,ref:n}),o={display:"flex",...b2().tablist};return se.createElement(xe.div,{...r,className:E1("chakra-tabs__tablist",t.className),__css:o})});Fve.displayName="TabList";var x$=Pe(function(t,n){const r=Dve({...t,ref:n}),i=b2();return se.createElement(xe.div,{outline:"0",...r,className:E1("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});x$.displayName="TabPanel";var w$=Pe(function(t,n){const r=Ive(t),i=b2();return se.createElement(xe.div,{...r,width:"100%",ref:n,className:E1("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});w$.displayName="TabPanels";var C$=Pe(function(t,n){const r=b2(),i=Mve({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return se.createElement(xe.button,{...i,className:E1("chakra-tabs__tab",t.className),__css:o})});C$.displayName="Tab";var $ve=(...e)=>e.filter(Boolean).join(" ");function Hve(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var Wve=["h","minH","height","minHeight"],_$=Pe((e,t)=>{const n=ho("Textarea",e),{className:r,rows:i,...o}=bn(e),a=U8(o),s=i?Hve(n,Wve):n;return se.createElement(xe.textarea,{ref:t,rows:i,...a,className:$ve("chakra-textarea",r),__css:s})});_$.displayName="Textarea";function Vve(e,t){const n=hr(e);C.exports.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function a7(e,...t){return Uve(e)?e(...t):e}var Uve=e=>typeof e=="function";function Gve(e,t){var o;const n=e!=null?e:"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(o=i==null?void 0:i[t])!=null?o:n}var jve=(e,t)=>e.find(n=>n.id===t);function VA(e,t){const n=k$(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function k$(e,t){for(const[n,r]of Object.entries(e))if(jve(r,t))return n}function Yve(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function qve(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}var Kve={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},xl=Xve(Kve);function Xve(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=Zve(i,o),{position:s,id:l}=a;return r(u=>{var m,v;const g=s.includes("top")?[a,...(m=u[s])!=null?m:[]]:[...(v=u[s])!=null?v:[],a];return{...u,[s]:g}}),l},update:(i,o)=>{!i||r(a=>{const s={...a},{position:l,index:u}=VA(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:E$(o)}),s})},closeAll:({positions:i}={})=>{r(o=>{const a=["bottom","bottom-right","bottom-left","top","top-left","top-right"];return(i!=null?i:a).reduce((l,u)=>(l[u]=o[u].map(h=>({...h,requestClose:!0})),l),{...o})})},close:i=>{r(o=>{const a=k$(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(VA(xl.getState(),i).position)}}var UA=0;function Zve(e,t={}){var i,o;UA+=1;const n=(i=t.id)!=null?i:UA,r=(o=t.position)!=null?o:"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>xl.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var Qve=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return se.createElement(sz,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},S(uz,{children:l}),se.createElement(xe.div,{flex:"1",maxWidth:"100%"},i&&S(cz,{id:u==null?void 0:u.title,children:i}),s&&S(lz,{id:u==null?void 0:u.description,display:"block",children:s})),o&&S(FS,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function E$(e={}){const{render:t,toastComponent:n=Qve}=e;return i=>typeof t=="function"?t({...i,...e}):S(n,{...i,...e})}function Jve(e,t){const n=i=>{var o;return{...t,...i,position:Gve((o=i==null?void 0:i.position)!=null?o:t==null?void 0:t.position,e)}},r=i=>{const o=n(i),a=E$(o);return xl.notify(a,o)};return r.update=(i,o)=>{xl.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...a7(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...a7(o.error,s)}))},r.closeAll=xl.closeAll,r.close=xl.close,r.isActive=xl.isActive,r}function x2(e){const{theme:t}=_N();return C.exports.useMemo(()=>Jve(t.direction,e),[e,t.direction])}var e2e={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},P$=C.exports.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=e2e,toastSpacing:h="0.5rem"}=e,[g,m]=C.exports.useState(s),v=Jue();vd(()=>{v||r==null||r()},[v]),vd(()=>{m(s)},[s]);const b=()=>m(null),w=()=>m(s),P=()=>{v&&i()};C.exports.useEffect(()=>{v&&o&&i()},[v,o,i]),Vve(P,g);const E=C.exports.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:h,...l}),[l,h]),_=C.exports.useMemo(()=>Yve(a),[a]);return se.createElement(Vl.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:w,custom:{position:a},style:_},se.createElement(xe.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:E},a7(n,{id:t,onClose:P})))});P$.displayName="ToastComponent";var t2e=e=>{const t=C.exports.useSyncExternalStore(xl.subscribe,xl.getState,xl.getState),{children:n,motionVariants:r,component:i=P$,portalProps:o}=e,s=Object.keys(t).map(l=>{const u=t[l];return S("ul",{role:"region","aria-live":"polite",id:`chakra-toast-manager-${l}`,style:qve(l),children:S(Pd,{initial:!1,children:u.map(h=>S(i,{motionVariants:r,...h},h.id))})},l)});return X(Rn,{children:[n,S(kh,{...o,children:s})]})};function n2e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function r2e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var i2e={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}};function rm(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var f4=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},s7=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function o2e(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:h,id:g,isOpen:m,defaultIsOpen:v,arrowSize:b=10,arrowShadowColor:w,arrowPadding:P,modifiers:E,isDisabled:_,gutter:T,offset:M,direction:O,...I}=e,{isOpen:D,onOpen:B,onClose:$}=eF({isOpen:m,defaultIsOpen:v,onOpen:l,onClose:u}),{referenceRef:H,getPopperProps:j,getArrowInnerProps:ne,getArrowProps:V}=Jz({enabled:D,placement:h,arrowPadding:P,modifiers:E,gutter:T,offset:M,direction:O}),q=C.exports.useId(),J=`tooltip-${g!=null?g:q}`,Z=C.exports.useRef(null),G=C.exports.useRef(),ee=C.exports.useCallback(()=>{G.current&&(clearTimeout(G.current),G.current=void 0)},[]),le=C.exports.useRef(),me=C.exports.useCallback(()=>{le.current&&(clearTimeout(le.current),le.current=void 0)},[]),Me=C.exports.useCallback(()=>{me(),$()},[$,me]),Ce=a2e(Z,Me),be=C.exports.useCallback(()=>{if(!_&&!G.current){Ce();const ht=s7(Z);G.current=ht.setTimeout(B,t)}},[Ce,_,B,t]),we=C.exports.useCallback(()=>{ee();const ht=s7(Z);le.current=ht.setTimeout(Me,n)},[n,Me,ee]),Ve=C.exports.useCallback(()=>{D&&r&&we()},[r,we,D]),Ze=C.exports.useCallback(()=>{D&&a&&we()},[a,we,D]),it=C.exports.useCallback(ht=>{D&&ht.key==="Escape"&&we()},[D,we]);oh(()=>f4(Z),"keydown",s?it:void 0),oh(()=>f4(Z),"scroll",()=>{D&&o&&Me()}),C.exports.useEffect(()=>{!_||(ee(),D&&$())},[_,D,$,ee]),C.exports.useEffect(()=>()=>{ee(),me()},[ee,me]),oh(()=>Z.current,"pointerleave",we);const pt=C.exports.useCallback((ht={},vt=null)=>({...ht,ref:Vn(Z,vt,H),onPointerEnter:rm(ht.onPointerEnter,ot=>{ot.pointerType!=="touch"&&be()}),onClick:rm(ht.onClick,Ve),onPointerDown:rm(ht.onPointerDown,Ze),onFocus:rm(ht.onFocus,be),onBlur:rm(ht.onBlur,we),"aria-describedby":D?J:void 0}),[be,we,Ze,D,J,Ve,H]),kt=C.exports.useCallback((ht={},vt=null)=>j({...ht,style:{...ht.style,[Yr.arrowSize.var]:b?`${b}px`:void 0,[Yr.arrowShadowColor.var]:w}},vt),[j,b,w]),gt=C.exports.useCallback((ht={},vt=null)=>{const Te={...ht.style,position:"relative",transformOrigin:Yr.transformOrigin.varRef};return{ref:vt,...I,...ht,id:J,role:"tooltip",style:Te}},[I,J]);return{isOpen:D,show:be,hide:we,getTriggerProps:pt,getTooltipProps:gt,getTooltipPositionerProps:kt,getArrowProps:V,getArrowInnerProps:ne}}var Ew="chakra-ui:close-tooltip";function a2e(e,t){return C.exports.useEffect(()=>{const n=f4(e);return n.addEventListener(Ew,t),()=>n.removeEventListener(Ew,t)},[t,e]),()=>{const n=f4(e),r=s7(e);n.dispatchEvent(new r.CustomEvent(Ew))}}var s2e=xe(Vl.div),bi=Pe((e,t)=>{var $,H;const n=ho("Tooltip",e),r=bn(e),i=S1(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:u,bg:h,portalProps:g,background:m,backgroundColor:v,bgColor:b,motionProps:w,...P}=r,E=(H=($=m!=null?m:v)!=null?$:h)!=null?H:b;if(E){n.bg=E;const j=wJ(i,"colors",E);n[Yr.arrowBg.var]=j}const _=o2e({...P,direction:i.direction}),T=typeof o=="string"||s;let M;if(T)M=se.createElement(xe.span,{display:"inline-block",tabIndex:0,..._.getTriggerProps()},o);else{const j=C.exports.Children.only(o);M=C.exports.cloneElement(j,_.getTriggerProps(j.props,j.ref))}const O=!!l,I=_.getTooltipProps({},t),D=O?n2e(I,["role","id"]):I,B=r2e(I,["role","id"]);return a?X(Rn,{children:[M,S(Pd,{children:_.isOpen&&se.createElement(kh,{...g},se.createElement(xe.div,{..._.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},X(s2e,{variants:i2e,initial:"exit",animate:"enter",exit:"exit",...w,...D,__css:n,children:[a,O&&se.createElement(xe.span,{srOnly:!0,...B},l),u&&se.createElement(xe.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},se.createElement(xe.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))]})))})]}):S(Rn,{children:o})});bi.displayName="Tooltip";var l2e=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=S(Nz,{environment:a,children:t});return S(fse,{theme:o,cssVarsRoot:s,children:X(PD,{colorModeManager:n,options:o.config,children:[i?S(Ohe,{}):S(Rhe,{}),S(pse,{}),r?S(nF,{zIndex:r,children:l}):l]})})};function u2e({children:e,theme:t=rse,toastOptions:n,...r}){return X(l2e,{theme:t,...r,children:[e,S(t2e,{...n})]})}function ks(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:O_(e)?2:I_(e)?3:0}function H0(e,t){return P1(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function c2e(e,t){return P1(e)===2?e.get(t):e[t]}function T$(e,t,n){var r=P1(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function L$(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function O_(e){return m2e&&e instanceof Map}function I_(e){return v2e&&e instanceof Set}function Df(e){return e.o||e.t}function D_(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=M$(e);delete t[rr];for(var n=W0(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=d2e),Object.freeze(e),t&&vh(e,function(n,r){return N_(r,!0)},!0)),e}function d2e(){ks(2)}function B_(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Rl(e){var t=d7[e];return t||ks(18,e),t}function f2e(e,t){d7[e]||(d7[e]=t)}function l7(){return qv}function Pw(e,t){t&&(Rl("Patches"),e.u=[],e.s=[],e.v=t)}function h4(e){u7(e),e.p.forEach(h2e),e.p=null}function u7(e){e===qv&&(qv=e.l)}function GA(e){return qv={p:[],l:qv,h:e,m:!0,_:0}}function h2e(e){var t=e[rr];t.i===0||t.i===1?t.j():t.O=!0}function Tw(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||Rl("ES5").S(t,e,r),r?(n[rr].P&&(h4(t),ks(4)),Ou(e)&&(e=p4(t,e),t.l||g4(t,e)),t.u&&Rl("Patches").M(n[rr].t,e,t.u,t.s)):e=p4(t,n,[]),h4(t),t.u&&t.v(t.u,t.s),e!==A$?e:void 0}function p4(e,t,n){if(B_(t))return t;var r=t[rr];if(!r)return vh(t,function(o,a){return jA(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return g4(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=D_(r.k):r.o;vh(r.i===3?new Set(i):i,function(o,a){return jA(e,r,i,o,a,n)}),g4(e,i,!1),n&&e.u&&Rl("Patches").R(r,n,e.u,e.s)}return r.o}function jA(e,t,n,r,i,o){if(bd(i)){var a=p4(e,i,o&&t&&t.i!==3&&!H0(t.D,r)?o.concat(r):void 0);if(T$(n,r,a),!bd(a))return;e.m=!1}if(Ou(i)&&!B_(i)){if(!e.h.F&&e._<1)return;p4(e,i),t&&t.A.l||g4(e,i)}}function g4(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&N_(t,n)}function Lw(e,t){var n=e[rr];return(n?Df(n):e)[t]}function YA(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Yc(e){e.P||(e.P=!0,e.l&&Yc(e.l))}function Aw(e){e.o||(e.o=D_(e.t))}function c7(e,t,n){var r=O_(t)?Rl("MapSet").N(t,n):I_(t)?Rl("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:l7(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=Kv;a&&(l=[s],u=wm);var h=Proxy.revocable(l,u),g=h.revoke,m=h.proxy;return s.k=m,s.j=g,m}(t,n):Rl("ES5").J(t,n);return(n?n.A:l7()).p.push(r),r}function p2e(e){return bd(e)||ks(22,e),function t(n){if(!Ou(n))return n;var r,i=n[rr],o=P1(n);if(i){if(!i.P&&(i.i<4||!Rl("ES5").K(i)))return i.t;i.I=!0,r=qA(n,o),i.I=!1}else r=qA(n,o);return vh(r,function(a,s){i&&c2e(i.t,a)===s||T$(r,a,t(s))}),o===3?new Set(r):r}(e)}function qA(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return D_(e)}function g2e(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[rr];return Kv.get(l,o)},set:function(l){var u=this[rr];Kv.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][rr];if(!s.P)switch(s.i){case 5:r(s)&&Yc(s);break;case 4:n(s)&&Yc(s)}}}function n(o){for(var a=o.t,s=o.k,l=W0(s),u=l.length-1;u>=0;u--){var h=l[u];if(h!==rr){var g=a[h];if(g===void 0&&!H0(a,h))return!0;var m=s[h],v=m&&m[rr];if(v?v.t!==g:!L$(m,g))return!0}}var b=!!a[rr];return l.length!==W0(a).length+(b?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l1?E-1:0),T=1;T1?h-1:0),m=1;m=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=Rl("Patches").$;return bd(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),ya=new S2e,R$=ya.produce;ya.produceWithPatches.bind(ya);ya.setAutoFreeze.bind(ya);ya.setUseProxies.bind(ya);ya.applyPatches.bind(ya);ya.createDraft.bind(ya);ya.finishDraft.bind(ya);function QA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function JA(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ui(1));return n(F_)(e,t)}if(typeof e!="function")throw new Error(Ui(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function h(){if(l)throw new Error(Ui(3));return o}function g(w){if(typeof w!="function")throw new Error(Ui(4));if(l)throw new Error(Ui(5));var P=!0;return u(),s.push(w),function(){if(!!P){if(l)throw new Error(Ui(6));P=!1,u();var _=s.indexOf(w);s.splice(_,1),a=null}}}function m(w){if(!b2e(w))throw new Error(Ui(7));if(typeof w.type>"u")throw new Error(Ui(8));if(l)throw new Error(Ui(9));try{l=!0,o=i(o,w)}finally{l=!1}for(var P=a=s,E=0;E"u")throw new Error(Ui(12));if(typeof n(void 0,{type:m4.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ui(13))})}function O$(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(Ui(14));g[v]=P,h=h||P!==w}return h=h||o.length!==Object.keys(l).length,h?g:l}}function v4(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return y4}function i(s,l){r(s)===y4&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var k2e=function(t,n){return t===n};function E2e(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(I).forEach(function(D){!T(D)||h[D]!==I[D]&&m.indexOf(D)===-1&&m.push(D)}),Object.keys(h).forEach(function(D){I[D]===void 0&&T(D)&&m.indexOf(D)===-1&&h[D]!==void 0&&m.push(D)}),v===null&&(v=setInterval(E,i)),h=I},o)}function E(){if(m.length===0){v&&clearInterval(v),v=null;return}var I=m.shift(),D=r.reduce(function(B,$){return $.in(B,I,h)},h[I]);if(D!==void 0)try{g[I]=l(D)}catch(B){console.error("redux-persist/createPersistoid: error serializing state",B)}else delete g[I];m.length===0&&_()}function _(){Object.keys(g).forEach(function(I){h[I]===void 0&&delete g[I]}),b=s.setItem(a,l(g)).catch(M)}function T(I){return!(n&&n.indexOf(I)===-1&&I!=="_persist"||t&&t.indexOf(I)!==-1)}function M(I){u&&u(I)}var O=function(){for(;m.length!==0;)E();return b||Promise.resolve()};return{update:P,flush:O}}function aye(e){return JSON.stringify(e)}function sye(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:H_).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=lye,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,h){return h.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function lye(e){return JSON.parse(e)}function uye(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:H_).concat(e.key);return t.removeItem(n,cye)}function cye(e){}function sM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pu(e){for(var t=1;t=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function hye(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var pye=5e3;function gye(e,t){var n=e.version!==void 0?e.version:tye;e.debug;var r=e.stateReconciler===void 0?iye:e.stateReconciler,i=e.getStoredState||sye,o=e.timeout!==void 0?e.timeout:pye,a=null,s=!1,l=!0,u=function(g){return g._persist.rehydrated&&a&&!l&&a.update(g),g};return function(h,g){var m=h||{},v=m._persist,b=fye(m,["_persist"]),w=b;if(g.type===F$){var P=!1,E=function(B,$){P||(g.rehydrate(e.key,B,$),P=!0)};if(o&&setTimeout(function(){!P&&E(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=oye(e)),v)return pu({},t(w,g),{_persist:v});if(typeof g.rehydrate!="function"||typeof g.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return g.register(e.key),i(e).then(function(D){var B=e.migrate||function($,H){return Promise.resolve($)};B(D,n).then(function($){E($)},function($){E(void 0,$)})},function(D){E(void 0,D)}),pu({},t(w,g),{_persist:{version:n,rehydrated:!1}})}else{if(g.type===$$)return s=!0,g.result(uye(e)),pu({},t(w,g),{_persist:v});if(g.type===B$)return g.result(a&&a.flush()),pu({},t(w,g),{_persist:v});if(g.type===z$)l=!0;else if(g.type===W_){if(s)return pu({},w,{_persist:pu({},v,{rehydrated:!0})});if(g.key===e.key){var _=t(w,g),T=g.payload,M=r!==!1&&T!==void 0?r(T,h,_,e):_,O=pu({},M,{_persist:pu({},v,{rehydrated:!0})});return u(O)}}}if(!v)return t(h,g);var I=t(w,g);return I===w?h:u(pu({},I,{_persist:v}))}}function lM(e){return yye(e)||vye(e)||mye()}function mye(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function vye(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function yye(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:W$,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case H$:return h7({},t,{registry:[].concat(lM(t.registry),[n.key])});case W_:var r=t.registry.indexOf(n.key),i=lM(t.registry);return i.splice(r,1),h7({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function xye(e,t,n){var r=n||!1,i=F_(bye,W$,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:H$,key:u})},a=function(u,h,g){var m={type:W_,payload:h,err:g,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=h7({},i,{purge:function(){var u=[];return e.dispatch({type:$$,result:function(g){u.push(g)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:B$,result:function(g){u.push(g)}}),Promise.all(u)},pause:function(){e.dispatch({type:z$})},persist:function(){e.dispatch({type:F$,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var V_={},U_={};U_.__esModule=!0;U_.default=_ye;function i5(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?i5=function(n){return typeof n}:i5=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},i5(e)}function Iw(){}var wye={getItem:Iw,setItem:Iw,removeItem:Iw};function Cye(e){if((typeof self>"u"?"undefined":i5(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch(r){return!1}return!0}function _ye(e){var t="".concat(e,"Storage");return Cye(t)?self[t]:wye}V_.__esModule=!0;V_.default=Pye;var kye=Eye(U_);function Eye(e){return e&&e.__esModule?e:{default:e}}function Pye(e){var t=(0,kye.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var V$=void 0,Tye=Lye(V_);function Lye(e){return e&&e.__esModule?e:{default:e}}var Aye=(0,Tye.default)("local");V$=Aye;var U$={},G$={},yh={};Object.defineProperty(yh,"__esModule",{value:!0});yh.PLACEHOLDER_UNDEFINED=yh.PACKAGE_NAME=void 0;yh.PACKAGE_NAME="redux-deep-persist";yh.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var G_={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})(G_);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=yh,n=G_,r=function(V){return typeof V=="object"&&V!==null};e.isObjectLike=r;const i=function(V){return typeof V=="number"&&V>-1&&V%1==0&&V<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(V){return(0,e.isLength)(V&&V.length)&&Object.prototype.toString.call(V)==="[object Array]"};const o=function(V){return!!V&&typeof V=="object"&&!(0,e.isArray)(V)};e.isPlainObject=o;const a=function(V){return String(~~V)===V&&Number(V)>=0};e.isIntegerString=a;const s=function(V){return Object.prototype.toString.call(V)==="[object String]"};e.isString=s;const l=function(V){return Object.prototype.toString.call(V)==="[object Date]"};e.isDate=l;const u=function(V){return Object.keys(V).length===0};e.isEmpty=u;const h=Object.prototype.hasOwnProperty,g=function(V,q,te){te||(te=new Set([V])),q||(q="");for(const J in V){const Z=q?`${q}.${J}`:J,G=V[J];if((0,e.isObjectLike)(G))return te.has(G)?`${q}.${J}:`:(te.add(G),(0,e.getCircularPath)(G,Z,te))}return null};e.getCircularPath=g;const m=function(V){if(!(0,e.isObjectLike)(V))return V;if((0,e.isDate)(V))return new Date(+V);const q=(0,e.isArray)(V)?[]:{};for(const te in V){const J=V[te];q[te]=(0,e._cloneDeep)(J)}return q};e._cloneDeep=m;const v=function(V){const q=(0,e.getCircularPath)(V);if(q)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${q}' of object you're trying to persist: ${V}`);return(0,e._cloneDeep)(V)};e.cloneDeep=v;const b=function(V,q){if(V===q)return{};if(!(0,e.isObjectLike)(V)||!(0,e.isObjectLike)(q))return q;const te=(0,e.cloneDeep)(V),J=(0,e.cloneDeep)(q),Z=Object.keys(te).reduce((ee,le)=>(h.call(J,le)||(ee[le]=void 0),ee),{});if((0,e.isDate)(te)||(0,e.isDate)(J))return te.valueOf()===J.valueOf()?{}:J;const G=Object.keys(J).reduce((ee,le)=>{if(!h.call(te,le))return ee[le]=J[le],ee;const me=(0,e.difference)(te[le],J[le]);return(0,e.isObjectLike)(me)&&(0,e.isEmpty)(me)&&!(0,e.isDate)(me)?(0,e.isArray)(te)&&!(0,e.isArray)(J)||!(0,e.isArray)(te)&&(0,e.isArray)(J)?J:ee:(ee[le]=me,ee)},Z);return delete G._persist,G};e.difference=b;const w=function(V,q){return q.reduce((te,J)=>{if(te){const Z=parseInt(J,10),G=(0,e.isIntegerString)(J)&&Z<0?te.length+Z:J;return(0,e.isString)(te)?te.charAt(G):te[G]}},V)};e.path=w;const P=function(V,q){return[...V].reverse().reduce((Z,G,ee)=>{const le=(0,e.isIntegerString)(G)?[]:{};return le[G]=ee===0?q:Z,le},{})};e.assocPath=P;const E=function(V,q){const te=(0,e.cloneDeep)(V);return q.reduce((J,Z,G)=>(G===q.length-1&&J&&(0,e.isObjectLike)(J)&&delete J[Z],J&&J[Z]),te),te};e.dissocPath=E;const _=function(V,q,...te){if(!te||!te.length)return q;const J=te.shift(),{preservePlaceholder:Z,preserveUndefined:G}=V;if((0,e.isObjectLike)(q)&&(0,e.isObjectLike)(J))for(const ee in J)if((0,e.isObjectLike)(J[ee])&&(0,e.isObjectLike)(q[ee]))q[ee]||(q[ee]={}),_(V,q[ee],J[ee]);else if((0,e.isArray)(q)){let le=J[ee];const me=Z?t.PLACEHOLDER_UNDEFINED:void 0;G||(le=typeof le<"u"?le:q[parseInt(ee,10)]),le=le!==t.PLACEHOLDER_UNDEFINED?le:me,q[parseInt(ee,10)]=le}else{const le=J[ee]!==t.PLACEHOLDER_UNDEFINED?J[ee]:void 0;q[ee]=le}return _(V,q,...te)},T=function(V,q,te){return _({preservePlaceholder:te==null?void 0:te.preservePlaceholder,preserveUndefined:te==null?void 0:te.preserveUndefined},(0,e.cloneDeep)(V),(0,e.cloneDeep)(q))};e.mergeDeep=T;const M=function(V,q=[],te,J,Z){if(!(0,e.isObjectLike)(V))return V;for(const G in V){const ee=V[G],le=(0,e.isArray)(V),me=J?J+"."+G:G;ee===null&&(te===n.ConfigType.WHITELIST&&q.indexOf(me)===-1||te===n.ConfigType.BLACKLIST&&q.indexOf(me)!==-1)&&le&&(V[parseInt(G,10)]=void 0),ee===void 0&&Z&&te===n.ConfigType.BLACKLIST&&q.indexOf(me)===-1&&le&&(V[parseInt(G,10)]=t.PLACEHOLDER_UNDEFINED),M(ee,q,te,me,Z)}},O=function(V,q,te,J){const Z=(0,e.cloneDeep)(V);return M(Z,q,te,"",J),Z};e.preserveUndefined=O;const I=function(V,q,te){return te.indexOf(V)===q};e.unique=I;const D=function(V){return V.reduce((q,te)=>{const J=V.filter(Me=>Me===te),Z=V.filter(Me=>(te+".").indexOf(Me+".")===0),{duplicates:G,subsets:ee}=q,le=J.length>1&&G.indexOf(te)===-1,me=Z.length>1;return{duplicates:[...G,...le?J:[]],subsets:[...ee,...me?Z:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=D;const B=function(V,q,te){const J=te===n.ConfigType.WHITELIST?"whitelist":"blacklist",Z=`${t.PACKAGE_NAME}: incorrect ${J} configuration.`,G=`Check your create${te===n.ConfigType.WHITELIST?"White":"Black"}list arguments. `;if(!(0,e.isString)(q)||q.length<1)throw new Error(`${Z} Name (key) of reducer is required. ${G}`);if(!V||!V.length)return;const{duplicates:ee,subsets:le}=(0,e.findDuplicatesAndSubsets)(V);if(ee.length>1)throw new Error(`${Z} Duplicated paths. ${JSON.stringify(ee)} ${G}`);if(le.length>1)throw new Error(`${Z} You are trying to persist an entire property and also some of its subset. ${JSON.stringify(le)} ${G}`)};e.singleTransformValidator=B;const $=function(V){if(!(0,e.isArray)(V))return;const q=(V==null?void 0:V.map(te=>te.deepPersistKey).filter(te=>te))||[];if(q.length){const te=q.filter((J,Z)=>q.indexOf(J)!==Z);if(te.length)throw new Error(`${t.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed. Duplicates: ${JSON.stringify(te)}`)}};e.transformsValidator=$;const H=function({whitelist:V,blacklist:q}){if(V&&V.length&&q&&q.length)throw new Error(`${t.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(V){const{duplicates:te,subsets:J}=(0,e.findDuplicatesAndSubsets)(V);(0,e.throwError)({duplicates:te,subsets:J},"whitelist")}if(q){const{duplicates:te,subsets:J}=(0,e.findDuplicatesAndSubsets)(q);(0,e.throwError)({duplicates:te,subsets:J},"blacklist")}};e.configValidator=H;const j=function({duplicates:V,subsets:q},te){if(V.length)throw new Error(`${t.PACKAGE_NAME}: duplicates of paths found in your ${te}. ${JSON.stringify(V)}`);if(q.length)throw new Error(`${t.PACKAGE_NAME}: subsets of some parent keys found in your ${te}. You must decide if you want to persist an entire path or its specific subset. ${JSON.stringify(q)}`)};e.throwError=j;const ne=function(V){return(0,e.isArray)(V)?V.filter(e.unique).reduce((q,te)=>{const J=te.split("."),Z=J[0],G=J.slice(1).join(".")||void 0,ee=q.filter(me=>Object.keys(me)[0]===Z)[0],le=ee?Object.values(ee)[0]:void 0;return ee||q.push({[Z]:G?[G]:void 0}),ee&&!le&&G&&(ee[Z]=[G]),ee&&le&&G&&le.push(G),q},[]):[]};e.getRootKeysGroup=ne})(G$);(function(e){var t=Cs&&Cs.__rest||function(g,m){var v={};for(var b in g)Object.prototype.hasOwnProperty.call(g,b)&&m.indexOf(b)<0&&(v[b]=g[b]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function")for(var w=0,b=Object.getOwnPropertySymbols(g);w!P(_)&&g?g(E,_,T):E,out:(E,_,T)=>!P(_)&&m?m(E,_,T):E,deepPersistKey:b&&b[0]}},a=(g,m,v,{debug:b,whitelist:w,blacklist:P,transforms:E})=>{if(w||P)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(E);const _=(0,n.cloneDeep)(v);let T=g;if(T&&(0,n.isObjectLike)(T)){const M=(0,n.difference)(m,v);(0,n.isEmpty)(M)||(T=(0,n.mergeDeep)(g,M,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(M)}`)),Object.keys(T).forEach(O=>{if(O!=="_persist"){if((0,n.isObjectLike)(_[O])){_[O]=(0,n.mergeDeep)(_[O],T[O]);return}_[O]=T[O]}})}return b&&T&&(0,n.isObjectLike)(T)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(T)}`),_};e.autoMergeDeep=a;const s=(g,m)=>((0,n.singleTransformValidator)(m,g,i.ConfigType.WHITELIST),o(v=>{if(!m||!m.length)return v;let b=null,w;return m.forEach(P=>{const E=P.split(".");w=(0,n.path)(v,E),typeof w>"u"&&(0,n.isIntegerString)(E[E.length-1])&&(w=r.PLACEHOLDER_UNDEFINED);const _=(0,n.assocPath)(E,w),T=(0,n.isArray)(_)?[]:{};b=(0,n.mergeDeep)(b||T,_,{preservePlaceholder:!0})}),b||v},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.WHITELIST),{whitelist:[g]}));e.createWhitelist=s;const l=(g,m)=>((0,n.singleTransformValidator)(m,g,i.ConfigType.BLACKLIST),o(v=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST,!0);return m.map(P=>P.split(".")).reduce((P,E)=>(0,n.dissocPath)(P,E),b)},v=>(0,n.preserveUndefined)(v,m,i.ConfigType.BLACKLIST),{whitelist:[g]}));e.createBlacklist=l;const u=function(g,m){return m.map(v=>{const b=Object.keys(v)[0],w=v[b];return g===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,w):(0,e.createBlacklist)(b,w)})};e.getTransforms=u;const h=g=>{var{key:m,whitelist:v,blacklist:b,storage:w,transforms:P,rootReducer:E}=g,_=t(g,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:v,blacklist:b});const T=(0,n.getRootKeysGroup)(v),M=(0,n.getRootKeysGroup)(b),O=Object.keys(E(void 0,{type:""})),I=T.map(ne=>Object.keys(ne)[0]),D=M.map(ne=>Object.keys(ne)[0]),B=O.filter(ne=>I.indexOf(ne)===-1&&D.indexOf(ne)===-1),$=(0,e.getTransforms)(i.ConfigType.WHITELIST,T),H=(0,e.getTransforms)(i.ConfigType.BLACKLIST,M),j=(0,n.isArray)(v)?B.map(ne=>(0,e.createBlacklist)(ne)):[];return Object.assign(Object.assign({},_),{key:m,storage:w,transforms:[...$,...H,...j,...P||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=h})(U$);const o5=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" "),Mye=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return j_(r)?r:!1},j_=e=>Boolean(typeof e=="string"?Mye(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),b4=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),Rye=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0]),parseFloat(r[1])]),Y_=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],j$={activeTab:0,cfgScale:7.5,codeformerFidelity:.75,currentTheme:"dark",facetoolStrength:.8,facetoolType:"gfpgan",height:512,hiresFix:!1,img2imgStrength:.75,infillMethod:"patchmatch",isLightBoxOpen:!1,iterations:1,maskPath:"",optionsPanelScrollPosition:0,perlin:0,prompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:10,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldHoldOptionsPanelOpen:!1,shouldLoopback:!1,shouldPinOptionsPanel:!0,shouldRandomizeSeed:!0,shouldRunESRGAN:!1,shouldRunFacetool:!1,shouldShowImageDetails:!1,shouldShowOptionsPanel:!0,showAdvancedOptions:!0,showDualDisplay:!0,steps:50,threshold:0,tileSize:32,upscalingLevel:4,upscalingStrength:.75,variationAmount:.1,width:512,shouldUseCanvasBetaLayout:!1},Oye=j$,Y$=KS({name:"options",initialState:Oye,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=o5(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:h,hires_fix:g,width:m,height:v}=t.payload.image;o&&o.length>0?(e.seedWeights=b4(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=o5(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,u&&(e.perlin=u),typeof u>"u"&&(e.perlin=0),typeof h=="boolean"&&(e.seamless=h),typeof g=="boolean"&&(e.hiresFix=g),m&&(e.width=m),v&&(e.height=v)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:h,seamless:g,hires_fix:m,width:v,height:b,strength:w,fit:P,init_image_path:E,mask_image_path:_}=t.payload.image;n==="img2img"&&(E&&(e.initialImage=E),_&&(e.maskPath=_),w&&(e.img2imgStrength=w),typeof P=="boolean"&&(e.shouldFitToWidthHeight=P)),a&&a.length>0?(e.seedWeights=b4(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i&&(e.prompt=o5(i)),r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),u&&(e.threshold=u),typeof u>"u"&&(e.threshold=0),h&&(e.perlin=h),typeof h>"u"&&(e.perlin=0),typeof g=="boolean"&&(e.seamless=g),typeof m=="boolean"&&(e.hiresFix=m),v&&(e.width=v),b&&(e.height=b),e.shouldRunESRGAN=!1,e.shouldRunFacetool=!1},resetOptionsState:e=>({...e,...j$}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setShowAdvancedOptions:(e,t)=>{e.showAdvancedOptions=t.payload},setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=Y_.indexOf(t.payload)},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShowDualDisplay:(e,t)=>{e.showDualDisplay=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setShouldPinOptionsPanel:(e,t)=>{e.shouldPinOptionsPanel=t.payload},setShouldShowOptionsPanel:(e,t)=>{e.shouldShowOptionsPanel=t.payload},setOptionsPanelScrollPosition:(e,t)=>{e.optionsPanelScrollPosition=t.payload},setShouldHoldOptionsPanelOpen:(e,t)=>{e.shouldHoldOptionsPanelOpen=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setIsLightBoxOpen:(e,t)=>{e.isLightBoxOpen=t.payload},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload}}}),{clearInitialImage:q$,resetOptionsState:kLe,resetSeed:ELe,setActiveTab:Lo,setAllImageToImageParameters:Iye,setAllParameters:Dye,setAllTextToImageParameters:Nye,setCfgScale:K$,setCodeformerFidelity:X$,setCurrentTheme:Bye,setFacetoolStrength:a5,setFacetoolType:s5,setHeight:Z$,setHiresFix:Q$,setImg2imgStrength:p7,setInfillMethod:J$,setInitialImage:T1,setIsLightBoxOpen:Cu,setIterations:zye,setMaskPath:eH,setOptionsPanelScrollPosition:Fye,setParameter:PLe,setPerlin:tH,setPrompt:XS,setSampler:nH,setSeamBlur:cM,setSeamless:rH,setSeamSize:dM,setSeamSteps:fM,setSeamStrength:hM,setSeed:w2,setSeedWeights:iH,setShouldFitToWidthHeight:oH,setShouldGenerateVariations:$ye,setShouldHoldOptionsPanelOpen:Hye,setShouldLoopback:Wye,setShouldPinOptionsPanel:Vye,setShouldRandomizeSeed:Uye,setShouldRunESRGAN:Gye,setShouldRunFacetool:jye,setShouldShowImageDetails:aH,setShouldShowOptionsPanel:_u,setShowAdvancedOptions:TLe,setShowDualDisplay:Yye,setSteps:sH,setThreshold:lH,setTileSize:pM,setUpscalingLevel:g7,setUpscalingStrength:m7,setVariationAmount:qye,setWidth:uH,setShouldUseCanvasBetaLayout:Kye}=Y$.actions,Xye=Y$.reducer;var ii={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,h="__lodash_placeholder__",g=1,m=2,v=4,b=1,w=2,P=1,E=2,_=4,T=8,M=16,O=32,I=64,D=128,B=256,$=512,H=30,j="...",ne=800,V=16,q=1,te=2,J=3,Z=1/0,G=9007199254740991,ee=17976931348623157e292,le=0/0,me=4294967295,Me=me-1,Ce=me>>>1,be=[["ary",D],["bind",P],["bindKey",E],["curry",T],["curryRight",M],["flip",$],["partial",O],["partialRight",I],["rearg",B]],we="[object Arguments]",Ve="[object Array]",Ze="[object AsyncFunction]",it="[object Boolean]",pt="[object Date]",kt="[object DOMException]",gt="[object Error]",ht="[object Function]",vt="[object GeneratorFunction]",Te="[object Map]",ot="[object Number]",Mt="[object Null]",Je="[object Object]",mt="[object Promise]",un="[object Proxy]",Et="[object RegExp]",jt="[object Set]",cn="[object String]",xn="[object Symbol]",Oe="[object Undefined]",et="[object WeakMap]",Jt="[object WeakSet]",Kt="[object ArrayBuffer]",Ee="[object DataView]",xt="[object Float32Array]",Wt="[object Float64Array]",ze="[object Int8Array]",lt="[object Int16Array]",dn="[object Int32Array]",Ne="[object Uint8Array]",ct="[object Uint8ClampedArray]",tt="[object Uint16Array]",Nt="[object Uint32Array]",an=/\b__p \+= '';/g,Sr=/\b(__p \+=) '' \+/g,or=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$r=/&(?:amp|lt|gt|quot|#39);/g,Wo=/[&<>"']/g,D1=RegExp($r.source),Ca=RegExp(Wo.source),Bh=/<%-([\s\S]+?)%>/g,N1=/<%([\s\S]+?)%>/g,Yu=/<%=([\s\S]+?)%>/g,zh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fh=/^\w*$/,Vo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fd=/[\\^$.*+?()[\]{}|]/g,B1=RegExp(Fd.source),qu=/^\s+/,$d=/\s/,z1=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,zs=/\{\n\/\* \[wrapped with (.+)\] \*/,Ku=/,? & /,F1=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,$1=/[()=,{}\[\]\/\s]/,H1=/\\(\\)?/g,W1=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ja=/\w*$/,V1=/^[-+]0x[0-9a-f]+$/i,U1=/^0b[01]+$/i,G1=/^\[object .+?Constructor\]$/,j1=/^0o[0-7]+$/i,Y1=/^(?:0|[1-9]\d*)$/,q1=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Fs=/($^)/,K1=/['\n\r\u2028\u2029\\]/g,es="\\ud800-\\udfff",jl="\\u0300-\\u036f",Yl="\\ufe20-\\ufe2f",$s="\\u20d0-\\u20ff",ql=jl+Yl+$s,$h="\\u2700-\\u27bf",Xu="a-z\\xdf-\\xf6\\xf8-\\xff",Hs="\\xac\\xb1\\xd7\\xf7",Uo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ln="\\u2000-\\u206f",wn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Go="A-Z\\xc0-\\xd6\\xd8-\\xde",Lr="\\ufe0e\\ufe0f",Xr=Hs+Uo+Ln+wn,jo="['\u2019]",Ws="["+es+"]",Zr="["+Xr+"]",ts="["+ql+"]",Hd="\\d+",Kl="["+$h+"]",ns="["+Xu+"]",Wd="[^"+es+Xr+Hd+$h+Xu+Go+"]",wi="\\ud83c[\\udffb-\\udfff]",Hh="(?:"+ts+"|"+wi+")",Wh="[^"+es+"]",Vd="(?:\\ud83c[\\udde6-\\uddff]){2}",Vs="[\\ud800-\\udbff][\\udc00-\\udfff]",po="["+Go+"]",Us="\\u200d",Xl="(?:"+ns+"|"+Wd+")",X1="(?:"+po+"|"+Wd+")",Zu="(?:"+jo+"(?:d|ll|m|re|s|t|ve))?",Qu="(?:"+jo+"(?:D|LL|M|RE|S|T|VE))?",Ud=Hh+"?",Ju="["+Lr+"]?",_a="(?:"+Us+"(?:"+[Wh,Vd,Vs].join("|")+")"+Ju+Ud+")*",Gd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vt=Ju+Ud+_a,Vh="(?:"+[Kl,Vd,Vs].join("|")+")"+Vt,ec="(?:"+[Wh+ts+"?",ts,Vd,Vs,Ws].join("|")+")",tc=RegExp(jo,"g"),Uh=RegExp(ts,"g"),Yo=RegExp(wi+"(?="+wi+")|"+ec+Vt,"g"),Gn=RegExp([po+"?"+ns+"+"+Zu+"(?="+[Zr,po,"$"].join("|")+")",X1+"+"+Qu+"(?="+[Zr,po+Xl,"$"].join("|")+")",po+"?"+Xl+"+"+Zu,po+"+"+Qu,Zl,Gd,Hd,Vh].join("|"),"g"),jd=RegExp("["+Us+es+ql+Lr+"]"),Gh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Yd=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],jh=-1,fn={};fn[xt]=fn[Wt]=fn[ze]=fn[lt]=fn[dn]=fn[Ne]=fn[ct]=fn[tt]=fn[Nt]=!0,fn[we]=fn[Ve]=fn[Kt]=fn[it]=fn[Ee]=fn[pt]=fn[gt]=fn[ht]=fn[Te]=fn[ot]=fn[Je]=fn[Et]=fn[jt]=fn[cn]=fn[et]=!1;var Ut={};Ut[we]=Ut[Ve]=Ut[Kt]=Ut[Ee]=Ut[it]=Ut[pt]=Ut[xt]=Ut[Wt]=Ut[ze]=Ut[lt]=Ut[dn]=Ut[Te]=Ut[ot]=Ut[Je]=Ut[Et]=Ut[jt]=Ut[cn]=Ut[xn]=Ut[Ne]=Ut[ct]=Ut[tt]=Ut[Nt]=!0,Ut[gt]=Ut[ht]=Ut[et]=!1;var Yh={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Z1={"&":"&","<":"<",">":">",'"':""","'":"'"},U={"&":"&","<":"<",">":">",""":'"',"'":"'"},re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},he=parseFloat,Ke=parseInt,zt=typeof Cs=="object"&&Cs&&Cs.Object===Object&&Cs,gn=typeof self=="object"&&self&&self.Object===Object&&self,yt=zt||gn||Function("return this")(),At=t&&!t.nodeType&&t,Gt=At&&!0&&e&&!e.nodeType&&e,Hr=Gt&&Gt.exports===At,br=Hr&&zt.process,mn=function(){try{var ie=Gt&&Gt.require&&Gt.require("util").types;return ie||br&&br.binding&&br.binding("util")}catch(Se){}}(),Qr=mn&&mn.isArrayBuffer,go=mn&&mn.isDate,Ki=mn&&mn.isMap,ka=mn&&mn.isRegExp,Gs=mn&&mn.isSet,Q1=mn&&mn.isTypedArray;function Ci(ie,Se,ge){switch(ge.length){case 0:return ie.call(Se);case 1:return ie.call(Se,ge[0]);case 2:return ie.call(Se,ge[0],ge[1]);case 3:return ie.call(Se,ge[0],ge[1],ge[2])}return ie.apply(Se,ge)}function J1(ie,Se,ge,Ye){for(var Tt=-1,en=ie==null?0:ie.length;++Tt-1}function qh(ie,Se,ge){for(var Ye=-1,Tt=ie==null?0:ie.length;++Ye-1;);return ge}function rs(ie,Se){for(var ge=ie.length;ge--&&ic(Se,ie[ge],0)>-1;);return ge}function tg(ie,Se){for(var ge=ie.length,Ye=0;ge--;)ie[ge]===Se&&++Ye;return Ye}var I2=Zd(Yh),is=Zd(Z1);function Ys(ie){return"\\"+re[ie]}function Xh(ie,Se){return ie==null?n:ie[Se]}function Jl(ie){return jd.test(ie)}function Zh(ie){return Gh.test(ie)}function D2(ie){for(var Se,ge=[];!(Se=ie.next()).done;)ge.push(Se.value);return ge}function Qh(ie){var Se=-1,ge=Array(ie.size);return ie.forEach(function(Ye,Tt){ge[++Se]=[Tt,Ye]}),ge}function Jh(ie,Se){return function(ge){return ie(Se(ge))}}function Xo(ie,Se){for(var ge=-1,Ye=ie.length,Tt=0,en=[];++ge-1}function ey(c,p){var x=this.__data__,A=Mr(x,c);return A<0?(++this.size,x.push([c,p])):x[A][1]=p,this}Zo.prototype.clear=Q2,Zo.prototype.delete=J2,Zo.prototype.get=mg,Zo.prototype.has=vg,Zo.prototype.set=ey;function Qo(c){var p=-1,x=c==null?0:c.length;for(this.clear();++p=p?c:p)),c}function fi(c,p,x,A,N,F){var Y,Q=p&g,ce=p&m,_e=p&v;if(x&&(Y=N?x(c,A,N,F):x(c)),Y!==n)return Y;if(!ur(c))return c;var ke=Dt(c);if(ke){if(Y=oG(c),!Q)return Li(c,Y)}else{var Ae=gi(c),je=Ae==ht||Ae==vt;if(Rc(c))return il(c,Q);if(Ae==Je||Ae==we||je&&!N){if(Y=ce||je?{}:Jk(c),!Q)return ce?Dg(c,wc(Y,c)):wo(c,Qe(Y,c))}else{if(!Ut[Ae])return N?c:{};Y=aG(c,Ae,Q)}}F||(F=new wr);var ft=F.get(c);if(ft)return ft;F.set(c,Y),TE(c)?c.forEach(function(Ct){Y.add(fi(Ct,p,x,Ct,c,F))}):EE(c)&&c.forEach(function(Ct,qt){Y.set(qt,fi(Ct,p,x,qt,c,F))});var wt=_e?ce?pe:ra:ce?_o:mi,Ht=ke?n:wt(c);return jn(Ht||c,function(Ct,qt){Ht&&(qt=Ct,Ct=c[qt]),Xs(Y,qt,fi(Ct,p,x,qt,c,F))}),Y}function sp(c){var p=mi(c);return function(x){return lp(x,c,p)}}function lp(c,p,x){var A=x.length;if(c==null)return!A;for(c=hn(c);A--;){var N=x[A],F=p[N],Y=c[N];if(Y===n&&!(N in c)||!F(Y))return!1}return!0}function xg(c,p,x){if(typeof c!="function")throw new _i(a);return $g(function(){c.apply(n,x)},p)}function Cc(c,p,x,A){var N=-1,F=zi,Y=!0,Q=c.length,ce=[],_e=p.length;if(!Q)return ce;x&&(p=Hn(p,Ar(x))),A?(F=qh,Y=!1):p.length>=i&&(F=ac,Y=!1,p=new La(p));e:for(;++NN?0:N+x),A=A===n||A>N?N:Bt(A),A<0&&(A+=N),A=x>A?0:AE(A);x0&&x(Q)?p>1?Rr(Q,p-1,x,A,N):Ea(N,Q):A||(N[N.length]=Q)}return N}var cp=ol(),So=ol(!0);function na(c,p){return c&&cp(c,p,mi)}function bo(c,p){return c&&So(c,p,mi)}function dp(c,p){return vo(p,function(x){return lu(c[x])})}function Zs(c,p){p=rl(p,c);for(var x=0,A=p.length;c!=null&&xp}function hp(c,p){return c!=null&&rn.call(c,p)}function pp(c,p){return c!=null&&p in hn(c)}function gp(c,p,x){return c>=ei(p,x)&&c=120&&ke.length>=120)?new La(Y&&ke):n}ke=c[0];var Ae=-1,je=Q[0];e:for(;++Ae-1;)Q!==c&&af.call(Q,ce,1),af.call(c,ce,1);return c}function gf(c,p){for(var x=c?p.length:0,A=x-1;x--;){var N=p[x];if(x==A||N!==F){var F=N;su(N)?af.call(c,N,1):kp(c,N)}}return c}function mf(c,p){return c+tu(cg()*(p-c+1))}function tl(c,p,x,A){for(var N=-1,F=xr(uf((p-c)/(x||1)),0),Y=ge(F);F--;)Y[A?F:++N]=c,c+=x;return Y}function Lc(c,p){var x="";if(!c||p<1||p>G)return x;do p%2&&(x+=c),p=tu(p/2),p&&(c+=c);while(p);return x}function Pt(c,p){return Yb(nE(c,p,ko),c+"")}function bp(c){return xc(Rp(c))}function vf(c,p){var x=Rp(c);return ly(x,ru(p,0,x.length))}function ou(c,p,x,A){if(!ur(c))return c;p=rl(p,c);for(var N=-1,F=p.length,Y=F-1,Q=c;Q!=null&&++NN?0:N+p),x=x>N?N:x,x<0&&(x+=N),N=p>x?0:x-p>>>0,p>>>=0;for(var F=ge(N);++A>>1,Y=c[F];Y!==null&&!ia(Y)&&(x?Y<=p:Y=i){var _e=p?null:W(c);if(_e)return tf(_e);Y=!1,N=ac,ce=new La}else ce=p?[]:Q;e:for(;++A=A?c:Ir(c,p,x)}var Mg=$2||function(c){return yt.clearTimeout(c)};function il(c,p){if(p)return c.slice();var x=c.length,A=dc?dc(x):new c.constructor(x);return c.copy(A),A}function Rg(c){var p=new c.constructor(c.byteLength);return new ki(p).set(new ki(c)),p}function au(c,p){var x=p?Rg(c.buffer):c.buffer;return new c.constructor(x,c.byteOffset,c.byteLength)}function iy(c){var p=new c.constructor(c.source,Ja.exec(c));return p.lastIndex=c.lastIndex,p}function Yn(c){return df?hn(df.call(c)):{}}function oy(c,p){var x=p?Rg(c.buffer):c.buffer;return new c.constructor(x,c.byteOffset,c.length)}function Og(c,p){if(c!==p){var x=c!==n,A=c===null,N=c===c,F=ia(c),Y=p!==n,Q=p===null,ce=p===p,_e=ia(p);if(!Q&&!_e&&!F&&c>p||F&&Y&&ce&&!Q&&!_e||A&&Y&&ce||!x&&ce||!N)return 1;if(!A&&!F&&!_e&&c=Q)return ce;var _e=x[A];return ce*(_e=="desc"?-1:1)}}return c.index-p.index}function ay(c,p,x,A){for(var N=-1,F=c.length,Y=x.length,Q=-1,ce=p.length,_e=xr(F-Y,0),ke=ge(ce+_e),Ae=!A;++Q1?x[N-1]:n,Y=N>2?x[2]:n;for(F=c.length>3&&typeof F=="function"?(N--,F):n,Y&&to(x[0],x[1],Y)&&(F=N<3?n:F,N=1),p=hn(p);++A-1?N[F?p[Y]:Y]:n}}function Bg(c){return nr(function(p){var x=p.length,A=x,N=Zi.prototype.thru;for(c&&p.reverse();A--;){var F=p[A];if(typeof F!="function")throw new _i(a);if(N&&!Y&&ve(F)=="wrapper")var Y=new Zi([],!0)}for(A=Y?A:x;++A1&&tn.reverse(),ke&&ceQ))return!1;var _e=F.get(c),ke=F.get(p);if(_e&&ke)return _e==p&&ke==c;var Ae=-1,je=!0,ft=x&w?new La:n;for(F.set(c,p),F.set(p,c);++Ae1?"& ":"")+p[A],p=p.join(x>2?", ":" "),c.replace(z1,`{ /* [wrapped with `+p+`] */ `)}function lG(c){return Dt(c)||kf(c)||!!(lg&&c&&c[lg])}function su(c,p){var x=typeof c;return p=p==null?G:p,!!p&&(x=="number"||x!="symbol"&&Y1.test(c))&&c>-1&&c%1==0&&c0){if(++p>=ne)return arguments[0]}else p=0;return c.apply(n,arguments)}}function ly(c,p){var x=-1,A=c.length,N=A-1;for(p=p===n?A:p;++x1?c[p-1]:n;return x=typeof x=="function"?(c.pop(),x):n,pE(c,x)});function gE(c){var p=z(c);return p.__chain__=!0,p}function Sj(c,p){return p(c),c}function uy(c,p){return p(c)}var bj=nr(function(c){var p=c.length,x=p?c[0]:0,A=this.__wrapped__,N=function(F){return ap(F,c)};return p>1||this.__actions__.length||!(A instanceof Yt)||!su(x)?this.thru(N):(A=A.slice(x,+x+(p?1:0)),A.__actions__.push({func:uy,args:[N],thisArg:n}),new Zi(A,this.__chain__).thru(function(F){return p&&!F.length&&F.push(n),F}))});function xj(){return gE(this)}function wj(){return new Zi(this.value(),this.__chain__)}function Cj(){this.__values__===n&&(this.__values__=LE(this.value()));var c=this.__index__>=this.__values__.length,p=c?n:this.__values__[this.__index__++];return{done:c,value:p}}function _j(){return this}function kj(c){for(var p,x=this;x instanceof ff;){var A=lE(x);A.__index__=0,A.__values__=n,p?N.__wrapped__=A:p=A;var N=A;x=x.__wrapped__}return N.__wrapped__=c,p}function Ej(){var c=this.__wrapped__;if(c instanceof Yt){var p=c;return this.__actions__.length&&(p=new Yt(this)),p=p.reverse(),p.__actions__.push({func:uy,args:[qb],thisArg:n}),new Zi(p,this.__chain__)}return this.thru(qb)}function Pj(){return nl(this.__wrapped__,this.__actions__)}var Tj=Pp(function(c,p,x){rn.call(c,x)?++c[x]:Jo(c,x,1)});function Lj(c,p,x){var A=Dt(c)?$n:wg;return x&&to(c,p,x)&&(p=n),A(c,Le(p,3))}function Aj(c,p){var x=Dt(c)?vo:ta;return x(c,Le(p,3))}var Mj=Ng(uE),Rj=Ng(cE);function Oj(c,p){return Rr(cy(c,p),1)}function Ij(c,p){return Rr(cy(c,p),Z)}function Dj(c,p,x){return x=x===n?1:Bt(x),Rr(cy(c,p),x)}function mE(c,p){var x=Dt(c)?jn:ss;return x(c,Le(p,3))}function vE(c,p){var x=Dt(c)?mo:up;return x(c,Le(p,3))}var Nj=Pp(function(c,p,x){rn.call(c,x)?c[x].push(p):Jo(c,x,[p])});function Bj(c,p,x,A){c=Co(c)?c:Rp(c),x=x&&!A?Bt(x):0;var N=c.length;return x<0&&(x=xr(N+x,0)),gy(c)?x<=N&&c.indexOf(p,x)>-1:!!N&&ic(c,p,x)>-1}var zj=Pt(function(c,p,x){var A=-1,N=typeof p=="function",F=Co(c)?ge(c.length):[];return ss(c,function(Y){F[++A]=N?Ci(p,Y,x):ls(Y,p,x)}),F}),Fj=Pp(function(c,p,x){Jo(c,x,p)});function cy(c,p){var x=Dt(c)?Hn:_r;return x(c,Le(p,3))}function $j(c,p,x,A){return c==null?[]:(Dt(p)||(p=p==null?[]:[p]),x=A?n:x,Dt(x)||(x=x==null?[]:[x]),Pi(c,p,x))}var Hj=Pp(function(c,p,x){c[x?0:1].push(p)},function(){return[[],[]]});function Wj(c,p,x){var A=Dt(c)?qd:Kh,N=arguments.length<3;return A(c,Le(p,4),x,N,ss)}function Vj(c,p,x){var A=Dt(c)?A2:Kh,N=arguments.length<3;return A(c,Le(p,4),x,N,up)}function Uj(c,p){var x=Dt(c)?vo:ta;return x(c,hy(Le(p,3)))}function Gj(c){var p=Dt(c)?xc:bp;return p(c)}function jj(c,p,x){(x?to(c,p,x):p===n)?p=1:p=Bt(p);var A=Dt(c)?di:vf;return A(c,p)}function Yj(c){var p=Dt(c)?Fb:pi;return p(c)}function qj(c){if(c==null)return 0;if(Co(c))return gy(c)?Pa(c):c.length;var p=gi(c);return p==Te||p==jt?c.size:Or(c).length}function Kj(c,p,x){var A=Dt(c)?nc:xo;return x&&to(c,p,x)&&(p=n),A(c,Le(p,3))}var Xj=Pt(function(c,p){if(c==null)return[];var x=p.length;return x>1&&to(c,p[0],p[1])?p=[]:x>2&&to(p[0],p[1],p[2])&&(p=[p[0]]),Pi(c,Rr(p,1),[])}),dy=H2||function(){return yt.Date.now()};function Zj(c,p){if(typeof p!="function")throw new _i(a);return c=Bt(c),function(){if(--c<1)return p.apply(this,arguments)}}function yE(c,p,x){return p=x?n:p,p=c&&p==null?c.length:p,fe(c,D,n,n,n,n,p)}function SE(c,p){var x;if(typeof p!="function")throw new _i(a);return c=Bt(c),function(){return--c>0&&(x=p.apply(this,arguments)),c<=1&&(p=n),x}}var Xb=Pt(function(c,p,x){var A=P;if(x.length){var N=Xo(x,Ge(Xb));A|=O}return fe(c,A,p,x,N)}),bE=Pt(function(c,p,x){var A=P|E;if(x.length){var N=Xo(x,Ge(bE));A|=O}return fe(p,A,c,x,N)});function xE(c,p,x){p=x?n:p;var A=fe(c,T,n,n,n,n,n,p);return A.placeholder=xE.placeholder,A}function wE(c,p,x){p=x?n:p;var A=fe(c,M,n,n,n,n,n,p);return A.placeholder=wE.placeholder,A}function CE(c,p,x){var A,N,F,Y,Q,ce,_e=0,ke=!1,Ae=!1,je=!0;if(typeof c!="function")throw new _i(a);p=Ra(p)||0,ur(x)&&(ke=!!x.leading,Ae="maxWait"in x,F=Ae?xr(Ra(x.maxWait)||0,p):F,je="trailing"in x?!!x.trailing:je);function ft(Nr){var hs=A,cu=N;return A=N=n,_e=Nr,Y=c.apply(cu,hs),Y}function wt(Nr){return _e=Nr,Q=$g(qt,p),ke?ft(Nr):Y}function Ht(Nr){var hs=Nr-ce,cu=Nr-_e,WE=p-hs;return Ae?ei(WE,F-cu):WE}function Ct(Nr){var hs=Nr-ce,cu=Nr-_e;return ce===n||hs>=p||hs<0||Ae&&cu>=F}function qt(){var Nr=dy();if(Ct(Nr))return tn(Nr);Q=$g(qt,Ht(Nr))}function tn(Nr){return Q=n,je&&A?ft(Nr):(A=N=n,Y)}function oa(){Q!==n&&Mg(Q),_e=0,A=ce=N=Q=n}function no(){return Q===n?Y:tn(dy())}function aa(){var Nr=dy(),hs=Ct(Nr);if(A=arguments,N=this,ce=Nr,hs){if(Q===n)return wt(ce);if(Ae)return Mg(Q),Q=$g(qt,p),ft(ce)}return Q===n&&(Q=$g(qt,p)),Y}return aa.cancel=oa,aa.flush=no,aa}var Qj=Pt(function(c,p){return xg(c,1,p)}),Jj=Pt(function(c,p,x){return xg(c,Ra(p)||0,x)});function eY(c){return fe(c,$)}function fy(c,p){if(typeof c!="function"||p!=null&&typeof p!="function")throw new _i(a);var x=function(){var A=arguments,N=p?p.apply(this,A):A[0],F=x.cache;if(F.has(N))return F.get(N);var Y=c.apply(this,A);return x.cache=F.set(N,Y)||F,Y};return x.cache=new(fy.Cache||Qo),x}fy.Cache=Qo;function hy(c){if(typeof c!="function")throw new _i(a);return function(){var p=arguments;switch(p.length){case 0:return!c.call(this);case 1:return!c.call(this,p[0]);case 2:return!c.call(this,p[0],p[1]);case 3:return!c.call(this,p[0],p[1],p[2])}return!c.apply(this,p)}}function tY(c){return SE(2,c)}var nY=Wb(function(c,p){p=p.length==1&&Dt(p[0])?Hn(p[0],Ar(Le())):Hn(Rr(p,1),Ar(Le()));var x=p.length;return Pt(function(A){for(var N=-1,F=ei(A.length,x);++N=p}),kf=vp(function(){return arguments}())?vp:function(c){return kr(c)&&rn.call(c,"callee")&&!sg.call(c,"callee")},Dt=ge.isArray,vY=Qr?Ar(Qr):_g;function Co(c){return c!=null&&py(c.length)&&!lu(c)}function Dr(c){return kr(c)&&Co(c)}function yY(c){return c===!0||c===!1||kr(c)&&hi(c)==it}var Rc=W2||lx,SY=go?Ar(go):kg;function bY(c){return kr(c)&&c.nodeType===1&&!Hg(c)}function xY(c){if(c==null)return!0;if(Co(c)&&(Dt(c)||typeof c=="string"||typeof c.splice=="function"||Rc(c)||Mp(c)||kf(c)))return!c.length;var p=gi(c);if(p==Te||p==jt)return!c.size;if(Fg(c))return!Or(c).length;for(var x in c)if(rn.call(c,x))return!1;return!0}function wY(c,p){return kc(c,p)}function CY(c,p,x){x=typeof x=="function"?x:n;var A=x?x(c,p):n;return A===n?kc(c,p,n,x):!!A}function Qb(c){if(!kr(c))return!1;var p=hi(c);return p==gt||p==kt||typeof c.message=="string"&&typeof c.name=="string"&&!Hg(c)}function _Y(c){return typeof c=="number"&&np(c)}function lu(c){if(!ur(c))return!1;var p=hi(c);return p==ht||p==vt||p==Ze||p==un}function kE(c){return typeof c=="number"&&c==Bt(c)}function py(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=G}function ur(c){var p=typeof c;return c!=null&&(p=="object"||p=="function")}function kr(c){return c!=null&&typeof c=="object"}var EE=Ki?Ar(Ki):Hb;function kY(c,p){return c===p||Ec(c,p,Lt(p))}function EY(c,p,x){return x=typeof x=="function"?x:n,Ec(c,p,Lt(p),x)}function PY(c){return PE(c)&&c!=+c}function TY(c){if(dG(c))throw new Tt(o);return yp(c)}function LY(c){return c===null}function AY(c){return c==null}function PE(c){return typeof c=="number"||kr(c)&&hi(c)==ot}function Hg(c){if(!kr(c)||hi(c)!=Je)return!1;var p=fc(c);if(p===null)return!0;var x=rn.call(p,"constructor")&&p.constructor;return typeof x=="function"&&x instanceof x&&ar.call(x)==ci}var Jb=ka?Ar(ka):sr;function MY(c){return kE(c)&&c>=-G&&c<=G}var TE=Gs?Ar(Gs):Ft;function gy(c){return typeof c=="string"||!Dt(c)&&kr(c)&&hi(c)==cn}function ia(c){return typeof c=="symbol"||kr(c)&&hi(c)==xn}var Mp=Q1?Ar(Q1):Wr;function RY(c){return c===n}function OY(c){return kr(c)&&gi(c)==et}function IY(c){return kr(c)&&hi(c)==Jt}var DY=k(Qs),NY=k(function(c,p){return c<=p});function LE(c){if(!c)return[];if(Co(c))return gy(c)?Fi(c):Li(c);if(hc&&c[hc])return D2(c[hc]());var p=gi(c),x=p==Te?Qh:p==jt?tf:Rp;return x(c)}function uu(c){if(!c)return c===0?c:0;if(c=Ra(c),c===Z||c===-Z){var p=c<0?-1:1;return p*ee}return c===c?c:0}function Bt(c){var p=uu(c),x=p%1;return p===p?x?p-x:p:0}function AE(c){return c?ru(Bt(c),0,me):0}function Ra(c){if(typeof c=="number")return c;if(ia(c))return le;if(ur(c)){var p=typeof c.valueOf=="function"?c.valueOf():c;c=ur(p)?p+"":p}if(typeof c!="string")return c===0?c:+c;c=Xi(c);var x=U1.test(c);return x||j1.test(c)?Ke(c.slice(2),x?2:8):V1.test(c)?le:+c}function ME(c){return Aa(c,_o(c))}function BY(c){return c?ru(Bt(c),-G,G):c===0?c:0}function _n(c){return c==null?"":Ji(c)}var zY=eo(function(c,p){if(Fg(p)||Co(p)){Aa(p,mi(p),c);return}for(var x in p)rn.call(p,x)&&Xs(c,x,p[x])}),RE=eo(function(c,p){Aa(p,_o(p),c)}),my=eo(function(c,p,x,A){Aa(p,_o(p),c,A)}),FY=eo(function(c,p,x,A){Aa(p,mi(p),c,A)}),$Y=nr(ap);function HY(c,p){var x=nu(c);return p==null?x:Qe(x,p)}var WY=Pt(function(c,p){c=hn(c);var x=-1,A=p.length,N=A>2?p[2]:n;for(N&&to(p[0],p[1],N)&&(A=1);++x1),F}),Aa(c,pe(c),x),A&&(x=fi(x,g|m|v,Rt));for(var N=p.length;N--;)kp(x,p[N]);return x});function aq(c,p){return IE(c,hy(Le(p)))}var sq=nr(function(c,p){return c==null?{}:Tg(c,p)});function IE(c,p){if(c==null)return{};var x=Hn(pe(c),function(A){return[A]});return p=Le(p),Sp(c,x,function(A,N){return p(A,N[0])})}function lq(c,p,x){p=rl(p,c);var A=-1,N=p.length;for(N||(N=1,c=n);++Ap){var A=c;c=p,p=A}if(x||c%1||p%1){var N=cg();return ei(c+N*(p-c+he("1e-"+((N+"").length-1))),p)}return mf(c,p)}var Sq=al(function(c,p,x){return p=p.toLowerCase(),c+(x?BE(p):p)});function BE(c){return nx(_n(c).toLowerCase())}function zE(c){return c=_n(c),c&&c.replace(q1,I2).replace(Uh,"")}function bq(c,p,x){c=_n(c),p=Ji(p);var A=c.length;x=x===n?A:ru(Bt(x),0,A);var N=x;return x-=p.length,x>=0&&c.slice(x,N)==p}function xq(c){return c=_n(c),c&&Ca.test(c)?c.replace(Wo,is):c}function wq(c){return c=_n(c),c&&B1.test(c)?c.replace(Fd,"\\$&"):c}var Cq=al(function(c,p,x){return c+(x?"-":"")+p.toLowerCase()}),_q=al(function(c,p,x){return c+(x?" ":"")+p.toLowerCase()}),kq=Lp("toLowerCase");function Eq(c,p,x){c=_n(c),p=Bt(p);var A=p?Pa(c):0;if(!p||A>=p)return c;var N=(p-A)/2;return d(tu(N),x)+c+d(uf(N),x)}function Pq(c,p,x){c=_n(c),p=Bt(p);var A=p?Pa(c):0;return p&&A>>0,x?(c=_n(c),c&&(typeof p=="string"||p!=null&&!Jb(p))&&(p=Ji(p),!p&&Jl(c))?cs(Fi(c),0,x):c.split(p,x)):[]}var Iq=al(function(c,p,x){return c+(x?" ":"")+nx(p)});function Dq(c,p,x){return c=_n(c),x=x==null?0:ru(Bt(x),0,c.length),p=Ji(p),c.slice(x,x+p.length)==p}function Nq(c,p,x){var A=z.templateSettings;x&&to(c,p,x)&&(p=n),c=_n(c),p=my({},p,A,Be);var N=my({},p.imports,A.imports,Be),F=mi(N),Y=ef(N,F),Q,ce,_e=0,ke=p.interpolate||Fs,Ae="__p += '",je=rf((p.escape||Fs).source+"|"+ke.source+"|"+(ke===Yu?W1:Fs).source+"|"+(p.evaluate||Fs).source+"|$","g"),ft="//# sourceURL="+(rn.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++jh+"]")+` `;c.replace(je,function(Ct,qt,tn,oa,no,aa){return tn||(tn=oa),Ae+=c.slice(_e,aa).replace(K1,Ys),qt&&(Q=!0,Ae+=`' + __e(`+qt+`) + '`),no&&(ce=!0,Ae+=`'; `+no+`; __p += '`),tn&&(Ae+=`' + ((__t = (`+tn+`)) == null ? '' : __t) + '`),_e=aa+Ct.length,Ct}),Ae+=`'; `;var wt=rn.call(p,"variable")&&p.variable;if(!wt)Ae=`with (obj) { `+Ae+` } `;else if($1.test(wt))throw new Tt(s);Ae=(ce?Ae.replace(an,""):Ae).replace(Sr,"$1").replace(or,"$1;"),Ae="function("+(wt||"obj")+`) { `+(wt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(Q?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Ae+`return __p }`;var Ht=$E(function(){return en(F,ft+"return "+Ae).apply(n,Y)});if(Ht.source=Ae,Qb(Ht))throw Ht;return Ht}function Bq(c){return _n(c).toLowerCase()}function zq(c){return _n(c).toUpperCase()}function Fq(c,p,x){if(c=_n(c),c&&(x||p===n))return Xi(c);if(!c||!(p=Ji(p)))return c;var A=Fi(c),N=Fi(p),F=Ko(A,N),Y=rs(A,N)+1;return cs(A,F,Y).join("")}function $q(c,p,x){if(c=_n(c),c&&(x||p===n))return c.slice(0,rg(c)+1);if(!c||!(p=Ji(p)))return c;var A=Fi(c),N=rs(A,Fi(p))+1;return cs(A,0,N).join("")}function Hq(c,p,x){if(c=_n(c),c&&(x||p===n))return c.replace(qu,"");if(!c||!(p=Ji(p)))return c;var A=Fi(c),N=Ko(A,Fi(p));return cs(A,N).join("")}function Wq(c,p){var x=H,A=j;if(ur(p)){var N="separator"in p?p.separator:N;x="length"in p?Bt(p.length):x,A="omission"in p?Ji(p.omission):A}c=_n(c);var F=c.length;if(Jl(c)){var Y=Fi(c);F=Y.length}if(x>=F)return c;var Q=x-Pa(A);if(Q<1)return A;var ce=Y?cs(Y,0,Q).join(""):c.slice(0,Q);if(N===n)return ce+A;if(Y&&(Q+=ce.length-Q),Jb(N)){if(c.slice(Q).search(N)){var _e,ke=ce;for(N.global||(N=rf(N.source,_n(Ja.exec(N))+"g")),N.lastIndex=0;_e=N.exec(ke);)var Ae=_e.index;ce=ce.slice(0,Ae===n?Q:Ae)}}else if(c.indexOf(Ji(N),Q)!=Q){var je=ce.lastIndexOf(N);je>-1&&(ce=ce.slice(0,je))}return ce+A}function Vq(c){return c=_n(c),c&&D1.test(c)?c.replace($r,z2):c}var Uq=al(function(c,p,x){return c+(x?" ":"")+p.toUpperCase()}),nx=Lp("toUpperCase");function FE(c,p,x){return c=_n(c),p=x?n:p,p===n?Zh(c)?nf(c):eg(c):c.match(p)||[]}var $E=Pt(function(c,p){try{return Ci(c,n,p)}catch(x){return Qb(x)?x:new Tt(x)}}),Gq=nr(function(c,p){return jn(p,function(x){x=sl(x),Jo(c,x,Xb(c[x],c))}),c});function jq(c){var p=c==null?0:c.length,x=Le();return c=p?Hn(c,function(A){if(typeof A[1]!="function")throw new _i(a);return[x(A[0]),A[1]]}):[],Pt(function(A){for(var N=-1;++NG)return[];var x=me,A=ei(c,me);p=Le(p),c-=me;for(var N=Jd(A,p);++x0||p<0)?new Yt(x):(c<0?x=x.takeRight(-c):c&&(x=x.drop(c)),p!==n&&(p=Bt(p),x=p<0?x.dropRight(-p):x.take(p-c)),x)},Yt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Yt.prototype.toArray=function(){return this.take(me)},na(Yt.prototype,function(c,p){var x=/^(?:filter|find|map|reject)|While$/.test(p),A=/^(?:head|last)$/.test(p),N=z[A?"take"+(p=="last"?"Right":""):p],F=A||/^find/.test(p);!N||(z.prototype[p]=function(){var Y=this.__wrapped__,Q=A?[1]:arguments,ce=Y instanceof Yt,_e=Q[0],ke=ce||Dt(Y),Ae=function(qt){var tn=N.apply(z,Ea([qt],Q));return A&&je?tn[0]:tn};ke&&x&&typeof _e=="function"&&_e.length!=1&&(ce=ke=!1);var je=this.__chain__,ft=!!this.__actions__.length,wt=F&&!je,Ht=ce&&!ft;if(!F&&ke){Y=Ht?Y:new Yt(this);var Ct=c.apply(Y,Q);return Ct.__actions__.push({func:uy,args:[Ae],thisArg:n}),new Zi(Ct,je)}return wt&&Ht?c.apply(this,Q):(Ct=this.thru(Ae),wt?A?Ct.value()[0]:Ct.value():Ct)})}),jn(["pop","push","shift","sort","splice","unshift"],function(c){var p=lc[c],x=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",A=/^(?:pop|shift)$/.test(c);z.prototype[c]=function(){var N=arguments;if(A&&!this.__chain__){var F=this.value();return p.apply(Dt(F)?F:[],N)}return this[x](function(Y){return p.apply(Dt(Y)?Y:[],N)})}}),na(Yt.prototype,function(c,p){var x=z[p];if(x){var A=x.name+"";rn.call(os,A)||(os[A]=[]),os[A].push({name:p,func:x})}}),os[wf(n,E).name]=[{name:"wrapper",func:n}],Yt.prototype.clone=$i,Yt.prototype.reverse=Ei,Yt.prototype.value=Y2,z.prototype.at=bj,z.prototype.chain=xj,z.prototype.commit=wj,z.prototype.next=Cj,z.prototype.plant=kj,z.prototype.reverse=Ej,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=Pj,z.prototype.first=z.prototype.head,hc&&(z.prototype[hc]=_j),z},Ta=yo();Gt?((Gt.exports=Ta)._=Ta,At._=Ta):yt._=Ta}).call(Cs)})(ii,ii.exports);const We=ii.exports,Zye={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},cH=KS({name:"gallery",initialState:Zye,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=ii.exports.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:h0,clearIntermediateImage:Dw,removeImage:dH,setCurrentImage:gM,addGalleryImages:Qye,setIntermediateImage:Jye,selectNextImage:q_,selectPrevImage:K_,setShouldPinGallery:e3e,setShouldShowGallery:fd,setGalleryScrollPosition:t3e,setGalleryImageMinimumWidth:im,setGalleryImageObjectFit:n3e,setShouldHoldGalleryOpen:fH,setShouldAutoSwitchToNewImages:r3e,setCurrentCategory:i3,setGalleryWidth:i3e,setShouldUseSingleGalleryColumn:o3e}=cH.actions,a3e=cH.reducer,s3e={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[]},hH=KS({name:"system",initialState:s3e,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Error",e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?"Connected":"Disconnected"},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Processing canceled"},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus="Preparing"},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus="Loading Model",e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1}}}),{setShouldDisplayInProgressType:l3e,setIsProcessing:ku,addLogEntry:Po,setShouldShowLogViewer:Nw,setIsConnected:mM,setSocketId:LLe,setShouldConfirmOnDelete:pH,setOpenAccordions:u3e,setSystemStatus:c3e,setCurrentStatus:l5,setSystemConfig:d3e,setShouldDisplayGuides:f3e,processingCanceled:h3e,errorOccurred:vM,errorSeen:gH,setModelList:yM,setIsCancelable:p0,modelChangeRequested:p3e,setSaveIntermediatesInterval:g3e,setEnableImageDebugging:m3e,generationRequested:v3e,addToast:Cm,clearToastQueue:y3e,setProcessingIndeterminateTask:S3e}=hH.actions,b3e=hH.reducer,ed=(e,t)=>Math.floor(e/t)*t,kl=(e,t)=>Math.round(e/t)*t,Wp=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Vp=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},x3e=.999,w3e=.1,C3e=20,om=.95,SM=30,v7=10,bM=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),Tf=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=kl(s/o,64)):o<1&&(r.height=s,r.width=kl(s*o,64)),a=r.width*r.height;return r},_3e=e=>({width:kl(e.width,64),height:kl(e.height,64)}),mH=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],k3e=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],X_=e=>e.kind==="line"&&e.layer==="mask",E3e=e=>e.kind==="line"&&e.layer==="base",x4=e=>e.kind==="image"&&e.layer==="base",P3e=e=>e.kind==="fillRect"&&e.layer==="base",T3e=e=>e.kind==="eraseRect"&&e.layer==="base",L3e=e=>e.kind==="line",_m={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},A3e={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],inpaintReplace:.1,isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:_m,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,shouldUseInpaintReplace:!1,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},vH=KS({name:"canvas",initialState:A3e,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(We.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!X_(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:ed(We.clamp(n.width,64,512),64),height:ed(We.clamp(n.height,64,512),64)},o={x:kl(n.width/2-i.width/2,64),y:kl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=Tf(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(We.cloneDeep(e.layerState)),e.layerState={..._m,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Vp(r.width,r.height,n.width,n.height,om),s=Wp(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=_3e(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=Tf(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=bM(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldUseInpaintReplace:(e,t)=>{e.shouldUseInpaintReplace=t.payload},setInpaintReplace:(e,t)=>{e.inpaintReplace=t.payload},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(We.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(We.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={..._m.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(We.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(We.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(We.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(L3e);!n||n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();!t||(e.futureLayerStates.unshift(We.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();!t||(e.pastLayerStates.push(We.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(We.cloneDeep(e.layerState)),e.layerState=_m,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(x4),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const h=Vp(i.width,i.height,512,512,om),g=Wp(i.width,i.height,0,0,512,512,h),m={width:512,height:512};if(e.stageScale=h,e.stageCoordinates=g,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const v=Tf(m);e.scaledBoundingBoxDimensions=v}return}const{width:o,height:a}=r,l=Vp(t,n,o,a,.95),u=Wp(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=bM(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(x4)){const i=Vp(r.width,r.height,512,512,om),o=Wp(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=Tf(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n}=t.payload,{stageDimensions:{width:r,height:i}}=e,{x:o,y:a,width:s,height:l}=n;if(s!==0&&l!==0){const u=Vp(r,i,s,l,om),h=Wp(r,i,o,a,s,l,u);e.stageScale=u,e.stageCoordinates=h}else{const u=Vp(r,i,512,512,om),h=Wp(r,i,0,0,512,512,u),g={width:512,height:512};if(e.stageScale=u,e.stageCoordinates=h,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=g,e.boundingBoxScaleMethod==="auto"){const m=Tf(g);e.scaledBoundingBoxDimensions=m}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(We.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={..._m.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:ed(We.clamp(o,64,512),64),height:ed(We.clamp(a,64,512),64)},l={x:kl(o/2-s.width/2,64),y:kl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=Tf(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=Tf(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(We.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:yH,addFillRect:SH,addImageToStagingArea:M3e,addLine:R3e,addPointToCurrentLine:bH,clearCanvasHistory:xH,clearMask:Z_,commitColorPickerColor:O3e,commitStagingAreaImage:I3e,discardStagedImages:D3e,fitBoundingBoxToStage:ALe,mouseLeftCanvas:N3e,nextStagingAreaImage:B3e,prevStagingAreaImage:z3e,redo:F3e,resetCanvas:Q_,resetCanvasInteractionState:$3e,resetCanvasView:wH,resizeAndScaleCanvas:ZS,resizeCanvas:H3e,setBoundingBoxCoordinates:Bw,setBoundingBoxDimensions:km,setBoundingBoxPreviewFill:MLe,setBoundingBoxScaleMethod:W3e,setBrushColor:V0,setBrushSize:U0,setCanvasContainerDimensions:V3e,setColorPickerColor:U3e,setCursorPosition:G3e,setDoesCanvasNeedScaling:ai,setInitialCanvasImage:QS,setInpaintReplace:xM,setIsDrawing:CH,setIsMaskEnabled:C2,setIsMouseOverBoundingBox:o3,setIsMoveBoundingBoxKeyHeld:RLe,setIsMoveStageKeyHeld:OLe,setIsMovingBoundingBox:zw,setIsMovingStage:w4,setIsTransformingBoundingBox:Fw,setLayer:C4,setMaskColor:_H,setMergedCanvas:j3e,setShouldAutoSave:kH,setShouldCropToBoundingBoxOnSave:EH,setShouldDarkenOutsideBoundingBox:PH,setShouldLockBoundingBox:ILe,setShouldPreserveMaskedArea:TH,setShouldShowBoundingBox:Y3e,setShouldShowBrush:DLe,setShouldShowBrushPreview:NLe,setShouldShowCanvasDebugInfo:LH,setShouldShowCheckboardTransparency:BLe,setShouldShowGrid:AH,setShouldShowIntermediates:MH,setShouldShowStagingImage:q3e,setShouldShowStagingOutline:wM,setShouldSnapToGrid:_4,setShouldUseInpaintReplace:K3e,setStageCoordinates:RH,setStageScale:X3e,setTool:Ol,toggleShouldLockBoundingBox:zLe,toggleTool:FLe,undo:Z3e,setScaledBoundingBoxDimensions:a3,setShouldRestrictStrokesToBox:OH}=vH.actions,Q3e=vH.reducer,Fl=Object.create(null);Fl.open="0";Fl.close="1";Fl.ping="2";Fl.pong="3";Fl.message="4";Fl.upgrade="5";Fl.noop="6";const u5=Object.create(null);Object.keys(Fl).forEach(e=>{u5[Fl[e]]=e});const J3e={type:"error",data:"parser error"},e5e=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",t5e=typeof ArrayBuffer=="function",n5e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,IH=({type:e,data:t},n,r)=>e5e&&t instanceof Blob?n?r(t):CM(t,r):t5e&&(t instanceof ArrayBuffer||n5e(t))?n?r(t):CM(new Blob([t]),r):r(Fl[e]+(t||"")),CM=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},_M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Em=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<_M.length;e++)Em[_M.charCodeAt(e)]=e;const r5e=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),h=new Uint8Array(u);for(r=0;r>4,h[i++]=(a&15)<<4|s>>2,h[i++]=(s&3)<<6|l&63;return u},i5e=typeof ArrayBuffer=="function",DH=(e,t)=>{if(typeof e!="string")return{type:"message",data:NH(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:o5e(e.substring(1),t)}:u5[n]?e.length>1?{type:u5[n],data:e.substring(1)}:{type:u5[n]}:J3e},o5e=(e,t)=>{if(i5e){const n=r5e(e);return NH(n,t)}else return{base64:!0,data:e}},NH=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},BH=String.fromCharCode(30),a5e=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{IH(o,!1,s=>{r[a]=s,++i===n&&t(r.join(BH))})})},s5e=(e,t)=>{const n=e.split(BH),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function FH(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const u5e=setTimeout,c5e=clearTimeout;function JS(e,t){t.useNativeTimers?(e.setTimeoutFn=u5e.bind(td),e.clearTimeoutFn=c5e.bind(td)):(e.setTimeoutFn=setTimeout.bind(td),e.clearTimeoutFn=clearTimeout.bind(td))}const d5e=1.33;function f5e(e){return typeof e=="string"?h5e(e):Math.ceil((e.byteLength||e.size)*d5e)}function h5e(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class p5e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class $H extends Kr{constructor(t){super(),this.writable=!1,JS(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new p5e(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=DH(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const HH="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),y7=64,g5e={};let kM=0,s3=0,EM;function PM(e){let t="";do t=HH[e%y7]+t,e=Math.floor(e/y7);while(e>0);return t}function WH(){const e=PM(+new Date);return e!==EM?(kM=0,EM=e):e+"."+PM(kM++)}for(;s3{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};s5e(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,a5e(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=WH()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=VH(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new Il(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Il extends Kr{constructor(t,n){super(),JS(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=FH(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new GH(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch(r){}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(r){}try{n.setRequestHeader("Accept","*/*")}catch(r){}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=Il.requestsCount++,Il.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=y5e,t)try{this.xhr.abort()}catch(n){}typeof document<"u"&&delete Il.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Il.requestsCount=0;Il.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",TM);else if(typeof addEventListener=="function"){const e="onpagehide"in td?"pagehide":"unload";addEventListener(e,TM,!1)}}function TM(){for(let e in Il.requests)Il.requests.hasOwnProperty(e)&&Il.requests[e].abort()}const jH=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),l3=td.WebSocket||td.MozWebSocket,LM=!0,x5e="arraybuffer",AM=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class w5e extends $H{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=AM?{}:FH(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=LM&&!AM?n?new l3(t,n):new l3(t):new l3(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||x5e,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{LM&&this.ws.send(o)}catch(s){}i&&jH(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=WH()),this.supportsBinary||(t.b64=1);const i=VH(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!l3}}const C5e={websocket:w5e,polling:b5e},_5e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,k5e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function S7(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=_5e.exec(e||""),o={},a=14;for(;a--;)o[k5e[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=E5e(o,o.path),o.queryKey=P5e(o,o.query),o}function E5e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function P5e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}class qc extends Kr{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=S7(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=S7(n.host).host),JS(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=m5e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=zH,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new C5e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&qc.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(n){this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;qc.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",g=>{if(!r)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;qc.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,h(),n.close(),n=null)}const a=g=>{const m=new Error("probe error: "+g);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(g){n&&g.name!==n.name&&o()}const h=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",qc.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){qc.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,YH=Object.prototype.toString,M5e=typeof Blob=="function"||typeof Blob<"u"&&YH.call(Blob)==="[object BlobConstructor]",R5e=typeof File=="function"||typeof File<"u"&&YH.call(File)==="[object FileConstructor]";function J_(e){return L5e&&(e instanceof ArrayBuffer||A5e(e))||M5e&&e instanceof Blob||R5e&&e instanceof File}function c5(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case on.ACK:case on.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class B5e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=I5e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const z5e=Object.freeze(Object.defineProperty({__proto__:null,protocol:D5e,get PacketType(){return on},Encoder:N5e,Decoder:ek},Symbol.toStringTag,{value:"Module"}));function xs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const F5e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class qH extends Kr{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[xs(t,"open",this.onopen.bind(this)),xs(t,"packet",this.onpacket.bind(this)),xs(t,"error",this.onerror.bind(this)),xs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(F5e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:on.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:on.CONNECT,data:t})}):this.packet({type:on.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case on.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case on.EVENT:case on.BINARY_EVENT:this.onevent(t);break;case on.ACK:case on.BINARY_ACK:this.onack(t);break;case on.DISCONNECT:this.ondisconnect();break;case on.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:on.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:on.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}L1.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};L1.prototype.reset=function(){this.attempts=0};L1.prototype.setMin=function(e){this.ms=e};L1.prototype.setMax=function(e){this.max=e};L1.prototype.setJitter=function(e){this.jitter=e};class w7 extends Kr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,JS(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new L1({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||z5e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new qc(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=xs(n,"open",function(){r.onopen(),t&&t()}),o=xs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(xs(t,"ping",this.onping.bind(this)),xs(t,"data",this.ondata.bind(this)),xs(t,"error",this.onerror.bind(this)),xs(t,"close",this.onclose.bind(this)),xs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){jH(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new qH(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const am={};function d5(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=T5e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=am[i]&&o in am[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new w7(r,t):(am[i]||(am[i]=new w7(r,t)),l=am[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(d5,{Manager:w7,Socket:qH,io:d5,connect:d5});let u3;const $5e=new Uint8Array(16);function H5e(){if(!u3&&(u3=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!u3))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return u3($5e)}const Mi=[];for(let e=0;e<256;++e)Mi.push((e+256).toString(16).slice(1));function W5e(e,t=0){return(Mi[e[t+0]]+Mi[e[t+1]]+Mi[e[t+2]]+Mi[e[t+3]]+"-"+Mi[e[t+4]]+Mi[e[t+5]]+"-"+Mi[e[t+6]]+Mi[e[t+7]]+"-"+Mi[e[t+8]]+Mi[e[t+9]]+"-"+Mi[e[t+10]]+Mi[e[t+11]]+Mi[e[t+12]]+Mi[e[t+13]]+Mi[e[t+14]]+Mi[e[t+15]]).toLowerCase()}const V5e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),MM={randomUUID:V5e};function g0(e,t,n){if(MM.randomUUID&&!t&&!e)return MM.randomUUID();e=e||{};const r=e.random||(e.rng||H5e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return W5e(r)}var U5e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,G5e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,j5e=/[^-+\dA-Z]/g;function To(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(RM[t]||t||RM.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},h=function(){return e[o()+"Hours"]()},g=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},v=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},w=function(){return Y5e(e)},P=function(){return q5e(e)},E={d:function(){return a()},dd:function(){return sa(a())},ddd:function(){return Eo.dayNames[s()]},DDD:function(){return OM({y:u(),m:l(),d:a(),_:o(),dayName:Eo.dayNames[s()],short:!0})},dddd:function(){return Eo.dayNames[s()+7]},DDDD:function(){return OM({y:u(),m:l(),d:a(),_:o(),dayName:Eo.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return sa(l()+1)},mmm:function(){return Eo.monthNames[l()]},mmmm:function(){return Eo.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return sa(u(),4)},h:function(){return h()%12||12},hh:function(){return sa(h()%12||12)},H:function(){return h()},HH:function(){return sa(h())},M:function(){return g()},MM:function(){return sa(g())},s:function(){return m()},ss:function(){return sa(m())},l:function(){return sa(v(),3)},L:function(){return sa(Math.floor(v()/10))},t:function(){return h()<12?Eo.timeNames[0]:Eo.timeNames[1]},tt:function(){return h()<12?Eo.timeNames[2]:Eo.timeNames[3]},T:function(){return h()<12?Eo.timeNames[4]:Eo.timeNames[5]},TT:function(){return h()<12?Eo.timeNames[6]:Eo.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":K5e(e)},o:function(){return(b()>0?"-":"+")+sa(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+sa(Math.floor(Math.abs(b())/60),2)+":"+sa(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return w()},WW:function(){return sa(w())},N:function(){return P()}};return t.replace(U5e,function(_){return _ in E?E[_]():_.slice(1,_.length-1)})}var RM={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Eo={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},sa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},OM=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,h=new Date;h.setDate(h[o+"Date"]()-1);var g=new Date;g.setDate(g[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},v=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},w=function(){return h[o+"Date"]()},P=function(){return h[o+"Month"]()},E=function(){return h[o+"FullYear"]()},_=function(){return g[o+"Date"]()},T=function(){return g[o+"Month"]()},M=function(){return g[o+"FullYear"]()};return b()===n&&v()===r&&m()===i?l?"Tdy":"Today":E()===n&&P()===r&&w()===i?l?"Ysd":"Yesterday":M()===n&&T()===r&&_()===i?l?"Tmw":"Tomorrow":a},Y5e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},q5e=function(t){var n=t.getDay();return n===0&&(n=7),n},K5e=function(t){return(String(t).match(G5e)||[""]).pop().replace(j5e,"").replace(/GMT\+0000/g,"UTC")};const C7=si("socketio/generateImage"),X5e=si("socketio/runESRGAN"),Z5e=si("socketio/runFacetool"),Q5e=si("socketio/deleteImage"),_7=si("socketio/requestImages"),IM=si("socketio/requestNewImages"),J5e=si("socketio/cancelProcessing"),e4e=si("socketio/requestSystemConfig"),KH=si("socketio/requestModelChange"),t4e=si("socketio/saveStagingAreaImageToGallery"),n4e=si("socketio/requestEmptyTempFolder"),r4e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(mM(!0)),t(l5("Connected")),t(e4e());const r=n().gallery;r.categories.result.latest_mtime?t(IM("result")):t(_7("result")),r.categories.user.latest_mtime?t(IM("user")):t(_7("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(mM(!1)),t(l5("Disconnected")),t(Po({timestamp:To(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{shouldLoopback:o,activeTab:a}=i.options,{boundingBox:s,generationMode:l,...u}=r,h={uuid:g0(),...u};if(["txt2img","img2img"].includes(l)&&t(h0({category:"result",image:{...h,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:g}=r;t(M3e({image:{...h,category:"temp"},boundingBox:g})),i.canvas.shouldAutoSave&&t(h0({image:{...h,category:"result"},category:"result"}))}if(o)switch(Y_[a]){case"img2img":{t(T1(h));break}}t(Dw()),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(Jye({uuid:g0(),...r,category:"result"})),r.isBase64||t(Po({timestamp:To(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(h0({category:"result",image:{uuid:g0(),...r,category:"result"}})),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(ku(!0)),t(c3e(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(Po({timestamp:To(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(vM()),t(Dw())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:g0(),...l}));t(Qye({images:s,areMoreImagesAvailable:o,category:a})),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(h3e());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(h0({category:"result",image:r})),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(Dw())),t(Po({timestamp:To(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(dH(r));const{initialImage:o,maskPath:a}=n().options;(o===i||(o==null?void 0:o.url)===i)&&t(q$()),a===i&&t(eH("")),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(d3e(r)),r.infill_methods.includes("patchmatch")||t(J$(r.infill_methods[0]))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(yM(o)),t(l5("Model Changed")),t(ku(!1)),t(p0(!0)),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(yM(o)),t(ku(!1)),t(p0(!0)),t(vM()),t(Po({timestamp:To(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Cm({title:"Temp Folder Emptied",status:"success",duration:2500,isClosable:!0}))}}},i4e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],o4e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],a4e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],s4e=[{key:"2x",value:2},{key:"4x",value:4}],tk=0,nk=4294967295,l4e=["gfpgan","codeformer"],u4e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],XH=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);var c4e=Math.PI/180;function d4e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const G0=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},st={_global:G0,version:"8.3.14",isBrowser:d4e(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return st.angleDeg?e*c4e:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return st.DD.isDragging},isDragReady(){return!!st.DD.node},releaseCanvasOnDestroy:!0,document:G0.document,_injectGlobal(e){G0.Konva=e}},vr=e=>{st[e.prototype.getClassName()]=e};st._injectGlobal(st);class ca{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new ca(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var h=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/h):-Math.acos(r/h)),l.scaleX=s/h,l.scaleY=h,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=de._getRotation(l.rotation),l}}var f4e="[object Array]",h4e="[object Number]",p4e="[object String]",g4e="[object Boolean]",m4e=Math.PI/180,v4e=180/Math.PI,$w="#",y4e="",S4e="0",b4e="Konva warning: ",DM="Konva error: ",x4e="rgb(",Hw={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},w4e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,c3=[];const C4e=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},de={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===f4e},_isNumber(e){return Object.prototype.toString.call(e)===h4e&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===p4e},_isBoolean(e){return Object.prototype.toString.call(e)===g4e},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){c3.push(e),c3.length===1&&C4e(function(){const t=c3;c3=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(t){}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=de.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace($w,y4e);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=S4e+e;return $w+e},getRGB(e){var t;return e in Hw?(t=Hw[e],{r:t[0],g:t[1],b:t[2]}):e[0]===$w?this._hexToRgb(e.substring(1)):e.substr(0,4)===x4e?(t=w4e.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",de._namedColorToRBA(e)||de._hex3ColorToRGBA(e)||de._hex6ColorToRGBA(e)||de._rgbColorToRGBA(e)||de._rgbaColorToRGBA(e)||de._hslColorToRGBA(e)},_namedColorToRBA(e){var t=Hw[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const u=2*o-a,h=[0,0,0];for(let g=0;g<3;g++)s=r+1/3*-(g-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,h[g]=l*255;return{r:Math.round(h[0]),g:Math.round(h[1]),b:Math.round(h[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+h*(n-e),s=t+h*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=de.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=de._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],h=l[1],g=l[2];gt.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})}};function Od(e){return de._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||de._isBoolean(e)?e:Object.prototype.toString.call(e)}function ZH(e){return e>255?255:e<0?0:Math.round(e)}function $e(){if(st.isUnminified)return function(e,t){return de._isNumber(e)||de.warn(Od(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function QH(e){if(st.isUnminified)return function(t,n){let r=de._isNumber(t),i=de._isArray(t)&&t.length==e;return!r&&!i&&de.warn(Od(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function rk(){if(st.isUnminified)return function(e,t){var n=de._isNumber(e),r=e==="auto";return n||r||de.warn(Od(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function A1(){if(st.isUnminified)return function(e,t){return de._isString(e)||de.warn(Od(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function JH(){if(st.isUnminified)return function(e,t){const n=de._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||de.warn(Od(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function _4e(){if(st.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(de._isArray(e)?e.forEach(function(r){de._isNumber(r)||de.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):de.warn(Od(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function Ns(){if(st.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||de.warn(Od(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function k4e(e){if(st.isUnminified)return function(t,n){return t==null||de.isObject(t)||de.warn(Od(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var sm="get",lm="set";const K={addGetterSetter(e,t,n,r,i){K.addGetter(e,t,n),K.addSetter(e,t,r,i),K.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=sm+de._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=lm+de._capitalize(t);e.prototype[i]||K.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=lm+de._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=de._capitalize,s=sm+a(t),l=lm+a(t),u,h;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(w),void 0)}),this._fireChangeEvent(t,v,m),i&&i.call(this),this},K.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=de._capitalize(t),r=lm+n,i=sm+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){de.error("Adding deprecated "+t);var i=sm+de._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){de.error(o);var a=this.attrs[t];return a===void 0?n:a},K.addSetter(e,t,r,function(){de.error(o)}),K.addOverloadedGetterSetter(e,t)},backCompat(e,t){de.each(t,function(n,r){var i=e.prototype[r],o=sm+de._capitalize(n),a=lm+de._capitalize(n);function s(){i.apply(this,arguments),de.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function E4e(e){var t=[],n=e.length,r=de,i,o;for(i=0;itypeof h=="number"?Math.floor(h):h)),o+=P4e+u.join(NM)+T4e)):(o+=s.property,t||(o+=O4e+s.val)),o+=M4e;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=D4e&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var h=arguments,g=this._context;h.length===3?g.drawImage(t,n,r):h.length===5?g.drawImage(t,n,r,i,o):h.length===9&&g.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){return this._context.isPointInPath(t,n)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=BM.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=E4e(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return pn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];pn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=de._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.id===n.pointerId);if(!!a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];pn._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(pn.justDragged=!0,st._mouseListenClick=!1,st._touchListenClick=!1,st._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof st.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){pn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&pn._dragElements.delete(n)})}};st.isBrowser&&(window.addEventListener("mouseup",pn._endDragBefore,!0),window.addEventListener("touchend",pn._endDragBefore,!0),window.addEventListener("mousemove",pn._drag),window.addEventListener("touchmove",pn._drag),window.addEventListener("mouseup",pn._endDragAfter,!1),window.addEventListener("touchend",pn._endDragAfter,!1));var f5="absoluteOpacity",f3="allEventListeners",gu="absoluteTransform",zM="absoluteScale",Lf="canvas",F4e="Change",$4e="children",H4e="konva",k7="listening",FM="mouseenter",$M="mouseleave",HM="set",WM="Shape",h5=" ",VM="stage",$c="transform",W4e="Stage",E7="visible",V4e=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(h5);let U4e=1;class He{constructor(t){this._id=U4e++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===$c||t===gu)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===$c||t===gu,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(h5);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(Lf)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===gu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Lf)){const{scene:t,filter:n,hit:r}=this._cache.get(Lf);de.releaseCanvas(t,n,r),this._cache.delete(Lf)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,h=n.drawBorder||!1,g=n.hitCanvasPixelRatio||1;if(!i||!o){de.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new j0({pixelRatio:a,width:i,height:o}),v=new j0({pixelRatio:a,width:0,height:0}),b=new ik({pixelRatio:g,width:i,height:o}),w=m.getContext(),P=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(Lf),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,v.getContext()._context.imageSmoothingEnabled=!1),w.save(),P.save(),w.translate(-s,-l),P.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(f5),this._clearSelfAndDescendantCache(zM),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,w.restore(),P.restore(),h&&(w.save(),w.beginPath(),w.rect(0,0,i,o),w.closePath(),w.setAttr("strokeStyle","red"),w.setAttr("lineWidth",5),w.stroke(),w.restore()),this._cache.set(Lf,{scene:m,filter:v,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(Lf)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var h=l.point(u);i===void 0&&(i=a=h.x,o=s=h.y),i=Math.min(i,h.x),o=Math.min(o,h.y),a=Math.max(a,h.x),s=Math.max(s,h.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var h=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/h,r.getHeight()/h),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==$4e&&(r=HM+de._capitalize(n),de._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(k7,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(E7,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;pn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!st.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==W4e&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache($c),this._clearSelfAndDescendantCache(gu)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new ca,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache($c);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache($c),this._clearSelfAndDescendantCache(gu),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return de.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return de.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&de.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(f5,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=de.isObject(i)&&!de._isPlainObject(i)&&!de._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),de._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i{try{const i=t==null?void 0:t.callback;i&&delete t.callback,de._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():st.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(!!r&&!this.isDragging()){var i=!1;pn._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=pn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&pn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return de.haveIntersection(r,this.getClientRect())}static create(t,n){return de._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=He.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),st[r]||(de.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=st[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(arguments.length>1){for(var n=0;n0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(!!i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=He.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=He.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const h=r===this;if(u){o.save();var g=this.getAbsoluteTransform(r),m=g.getMatrix();if(o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath(),l)l.call(this,o,this);else{var v=this.clipX(),b=this.clipY();o.rect(v,b,a,s)}o.clip(),m=g.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var w=!h&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";w&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(P){P[t](n,r)}),w&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},h=this;(n=this.children)===null||n===void 0||n.forEach(function(w){if(!!w.visible()){var P=w.getClientRect({relativeTo:h,skipShadow:t.skipShadow,skipStroke:t.skipStroke});P.width===0&&P.height===0||(o===void 0?(o=P.x,a=P.y,s=P.x+P.width,l=P.y+P.height):(o=Math.min(o,P.x),a=Math.min(a,P.y),s=Math.max(s,P.x+P.width),l=Math.max(l,P.y+P.height)))}});for(var g=this.find("Shape"),m=!1,v=0;ve.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",Up=e=>{const t=Am(e);if(t==="pointer")return st.pointerEventsEnabled&&Vw.pointer;if(t==="touch")return Vw.touch;if(t==="mouse")return Vw.mouse};function GM(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&de.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const Z4e="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",p5=[];class nb extends ga{constructor(t){super(GM(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),p5.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{GM(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||de.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===j4e){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t=this.children,n=t.length,r;for(r=0;r-1&&p5.splice(n,1),de.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(de.warn(Z4e),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t=t||{},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var n=new j0({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(!!o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+UM,this.content.style.height=n+UM),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;rK4e&&de.warn("The stage has "+i+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),st.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return tW(t,this)}setPointerCapture(t){nW(t,this)}releaseCapture(t){rv(t)}getLayers(){return this.children}_bindContentEvents(){!st.isBrowser||X4e.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=Up(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=Up(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=Up(t.type),r=Am(t.type);if(!!n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!pn.isDragging||st.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=Up(t.type),r=Am(t.type);if(!!n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(pn.justDragged=!1,st["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;st.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=Up(t.type),r=Am(t.type);if(!n)return;pn.isDragging&&pn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!pn.isDragging||st.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=Ww(l.id)||this.getIntersection(l),h=l.id,g={evt:t,pointerId:h};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},g),u),s._fireAndBubble(n.pointerleave,Object.assign({},g),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},g),s),u._fireAndBubble(n.pointerenter,Object.assign({},g),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},g))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:h}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=Up(t.type),r=Am(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=Ww(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const h=l.id,g={evt:t,pointerId:h};let m=!1;st["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):pn.justDragged||(st["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){st["_"+r+"InDblClickWindow"]=!1},st.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},g)),st["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},g)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},g)))):(this[r+"ClickEndShape"]=null,st["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:h}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:h}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),st["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(P7,{evt:t}):this._fire(P7,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(T7,{evt:t}):this._fire(T7,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=Ww(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(m0,ok(t)),rv(t.pointerId)}_lostpointercapture(t){rv(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}])}_setPointerPosition(t){de.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new j0({width:this.width(),height:this.height()}),this.bufferHitCanvas=new ik({pixelRatio:1,width:this.width(),height:this.height()}),!!st.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}}cache(){return de.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}}nb.prototype.nodeType=G4e;vr(nb);K.addGetterSetter(nb,"container");var hW="hasShadow",pW="shadowRGBA",gW="patternImage",mW="linearGradient",vW="radialGradient";let v3;function Uw(){return v3||(v3=de.createCanvasElement().getContext("2d"),v3)}const iv={};function Q4e(e){e.fill()}function J4e(e){e.stroke()}function eSe(e){e.fill()}function tSe(e){e.stroke()}function nSe(){this._clearCache(hW)}function rSe(){this._clearCache(pW)}function iSe(){this._clearCache(gW)}function oSe(){this._clearCache(mW)}function aSe(){this._clearCache(vW)}class Re extends He{constructor(t){super(t);let n;for(;n=de.getRandomColor(),!(n&&!(n in iv)););this.colorKey=n,iv[n]=this}getContext(){return de.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return de.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(hW,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(gW,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=Uw();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new ca;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(st.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(mW,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=Uw(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return He.prototype.destroy.call(this),delete iv[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){de.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){const n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,u=!t.skipShadow&&this.hasShadow(),h=u?this.shadowOffsetX():0,g=u?this.shadowOffsetY():0,m=s+Math.abs(h),v=l+Math.abs(g),b=u&&this.shadowBlur()||0,w=m+b*2,P=v+b*2,E={width:w,height:P,x:-(a/2+b)+Math.min(h,0)+i.x,y:-(a/2+b)+Math.min(g,0)+i.y};return n?E:this._transformedRect(E,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,h,g,m=i.isCache,v=n===this;if(!this.isVisible()&&!v)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),h=u.bufferCanvas,g=h.getContext(),g.clear(),g.save(),g._applyLineJoin(this);var w=this.getAbsoluteTransform(n).getMatrix();g.transform(w[0],w[1],w[2],w[3],w[4],w[5]),s.call(this,g,this),g.restore();var P=h.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(h._canvas,0,0,h.width/P,h.height/P)}else{if(o._applyLineJoin(this),!v){var w=this.getAbsoluteTransform(n).getMatrix();o.transform(w[0],w[1],w[2],w[3],w[4],w[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||de.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),u){a.save();var h=this.getAbsoluteTransform(n).getMatrix();return a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var m=this.getAbsoluteTransform(n).getMatrix();a.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,u,h,g,m,v;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,h=u.length,g=de._hexToRgb(this.colorKey),m=0;mt?(u[m]=g.r,u[m+1]=g.g,u[m+2]=g.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){de.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return tW(t,this)}setPointerCapture(t){nW(t,this)}releaseCapture(t){rv(t)}}Re.prototype._fillFunc=Q4e;Re.prototype._strokeFunc=J4e;Re.prototype._fillFuncHit=eSe;Re.prototype._strokeFuncHit=tSe;Re.prototype._centroid=!1;Re.prototype.nodeType="Shape";vr(Re);Re.prototype.eventListeners={};Re.prototype.on.call(Re.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",nSe);Re.prototype.on.call(Re.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",rSe);Re.prototype.on.call(Re.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",iSe);Re.prototype.on.call(Re.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",oSe);Re.prototype.on.call(Re.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",aSe);K.addGetterSetter(Re,"stroke",void 0,JH());K.addGetterSetter(Re,"strokeWidth",2,$e());K.addGetterSetter(Re,"fillAfterStrokeEnabled",!1);K.addGetterSetter(Re,"hitStrokeWidth","auto",rk());K.addGetterSetter(Re,"strokeHitEnabled",!0,Ns());K.addGetterSetter(Re,"perfectDrawEnabled",!0,Ns());K.addGetterSetter(Re,"shadowForStrokeEnabled",!0,Ns());K.addGetterSetter(Re,"lineJoin");K.addGetterSetter(Re,"lineCap");K.addGetterSetter(Re,"sceneFunc");K.addGetterSetter(Re,"hitFunc");K.addGetterSetter(Re,"dash");K.addGetterSetter(Re,"dashOffset",0,$e());K.addGetterSetter(Re,"shadowColor",void 0,A1());K.addGetterSetter(Re,"shadowBlur",0,$e());K.addGetterSetter(Re,"shadowOpacity",1,$e());K.addComponentsGetterSetter(Re,"shadowOffset",["x","y"]);K.addGetterSetter(Re,"shadowOffsetX",0,$e());K.addGetterSetter(Re,"shadowOffsetY",0,$e());K.addGetterSetter(Re,"fillPatternImage");K.addGetterSetter(Re,"fill",void 0,JH());K.addGetterSetter(Re,"fillPatternX",0,$e());K.addGetterSetter(Re,"fillPatternY",0,$e());K.addGetterSetter(Re,"fillLinearGradientColorStops");K.addGetterSetter(Re,"strokeLinearGradientColorStops");K.addGetterSetter(Re,"fillRadialGradientStartRadius",0);K.addGetterSetter(Re,"fillRadialGradientEndRadius",0);K.addGetterSetter(Re,"fillRadialGradientColorStops");K.addGetterSetter(Re,"fillPatternRepeat","repeat");K.addGetterSetter(Re,"fillEnabled",!0);K.addGetterSetter(Re,"strokeEnabled",!0);K.addGetterSetter(Re,"shadowEnabled",!0);K.addGetterSetter(Re,"dashEnabled",!0);K.addGetterSetter(Re,"strokeScaleEnabled",!0);K.addGetterSetter(Re,"fillPriority","color");K.addComponentsGetterSetter(Re,"fillPatternOffset",["x","y"]);K.addGetterSetter(Re,"fillPatternOffsetX",0,$e());K.addGetterSetter(Re,"fillPatternOffsetY",0,$e());K.addComponentsGetterSetter(Re,"fillPatternScale",["x","y"]);K.addGetterSetter(Re,"fillPatternScaleX",1,$e());K.addGetterSetter(Re,"fillPatternScaleY",1,$e());K.addComponentsGetterSetter(Re,"fillLinearGradientStartPoint",["x","y"]);K.addComponentsGetterSetter(Re,"strokeLinearGradientStartPoint",["x","y"]);K.addGetterSetter(Re,"fillLinearGradientStartPointX",0);K.addGetterSetter(Re,"strokeLinearGradientStartPointX",0);K.addGetterSetter(Re,"fillLinearGradientStartPointY",0);K.addGetterSetter(Re,"strokeLinearGradientStartPointY",0);K.addComponentsGetterSetter(Re,"fillLinearGradientEndPoint",["x","y"]);K.addComponentsGetterSetter(Re,"strokeLinearGradientEndPoint",["x","y"]);K.addGetterSetter(Re,"fillLinearGradientEndPointX",0);K.addGetterSetter(Re,"strokeLinearGradientEndPointX",0);K.addGetterSetter(Re,"fillLinearGradientEndPointY",0);K.addGetterSetter(Re,"strokeLinearGradientEndPointY",0);K.addComponentsGetterSetter(Re,"fillRadialGradientStartPoint",["x","y"]);K.addGetterSetter(Re,"fillRadialGradientStartPointX",0);K.addGetterSetter(Re,"fillRadialGradientStartPointY",0);K.addComponentsGetterSetter(Re,"fillRadialGradientEndPoint",["x","y"]);K.addGetterSetter(Re,"fillRadialGradientEndPointX",0);K.addGetterSetter(Re,"fillRadialGradientEndPointY",0);K.addGetterSetter(Re,"fillPatternRotation",0);K.backCompat(Re,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var sSe="#",lSe="beforeDraw",uSe="draw",yW=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],cSe=yW.length;class Lh extends ga{constructor(t){super(t),this.canvas=new j0,this.hitCanvas=new ik({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(lSe,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),ga.prototype.drawScene.call(this,i,n),this._fire(uSe,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),ga.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return de.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}Lh.prototype.nodeType="Layer";vr(Lh);K.addGetterSetter(Lh,"imageSmoothingEnabled",!0);K.addGetterSetter(Lh,"clearBeforeDraw",!0);K.addGetterSetter(Lh,"hitGraphEnabled",!0,Ns());class ak extends Lh{constructor(t){super(t),this.listening(!1),de.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}ak.prototype.nodeType="FastLayer";vr(ak);class c1 extends ga{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&de.throw("You may only add groups and shapes to groups.")}}c1.prototype.nodeType="Group";vr(c1);var Gw=function(){return G0.performance&&G0.performance.now?function(){return G0.performance.now()}:function(){return new Date().getTime()}}();class za{constructor(t,n){this.id=za.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Gw(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;ithis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=jM,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=YM,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var t=this.getTimer()-this._startTime;this.state===jM?this.setTime(t):this.state===YM&&this.setTime(this.duration-t)}pause(){this.state=fSe,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Br{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||ov.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=hSe++;var u=r.getLayer()||(r instanceof st.Stage?r.getLayers():null);u||de.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new za(function(){n.tween.onEnterFrame()},u),this.tween=new pSe(l,function(h){n._tweenFunc(h)},a,0,1,o*1e3,s),this._addListeners(),Br.attrs[i]||(Br.attrs[i]={}),Br.attrs[i][this._id]||(Br.attrs[i][this._id]={}),Br.tweens[i]||(Br.tweens[i]={});for(l in t)dSe[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,u,h,g,m;if(s=Br.tweens[i][t],s&&delete Br.attrs[i][s][t],o=r.getAttr(t),de._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(g=o,o=de._prepareArrayForTween(o,n,r.closed())):(h=n,n=de._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Br.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Br.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t=this.node._id,n=this._id,r=Br.tweens[t],i;this.pause();for(i in r)delete Br.tweens[t][i];delete Br.attrs[t][n]}}Br.attrs={};Br.tweens={};He.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Br(e);n.play()};const ov={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),h=a*n,g=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:g,width:h-u,height:m-g}}}$u.prototype._centroid=!0;$u.prototype.className="Arc";$u.prototype._attrsAffectingSize=["innerRadius","outerRadius"];vr($u);K.addGetterSetter($u,"innerRadius",0,$e());K.addGetterSetter($u,"outerRadius",0,$e());K.addGetterSetter($u,"angle",0,$e());K.addGetterSetter($u,"clockwise",!1,Ns());function L7(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),h=a*l/(s+l),g=n-u*(i-e),m=r-u*(o-t),v=n+h*(i-e),b=r+h*(o-t);return[g,m,v,b]}function KM(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);uh?u:h,P=u>h?1:u/h,E=u>h?h/u:1;t.translate(s,l),t.rotate(v),t.scale(P,E),t.arc(0,0,w,g,g+m,1-b),t.scale(1/P,1/E),t.rotate(-v),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var h=u.points[4],g=u.points[5],m=u.points[4]+g,v=Math.PI/180;if(Math.abs(h-m)m;b-=v){const w=zn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(w.x,w.y)}else for(let b=h+v;bthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return zn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return zn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return zn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],h=a[3],g=a[4],m=a[5],v=a[6];return g+=m*t/o.pathLength,zn.getPointOnEllipticalArc(s,l,u,h,g,v)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var _=null,T=[],M=l,O=u,I,D,B,$,H,j,ne,V,q,te;switch(v){case"l":l+=b.shift(),u+=b.shift(),_="L",T.push(l,u);break;case"L":l=b.shift(),u=b.shift(),T.push(l,u);break;case"m":var J=b.shift(),Z=b.shift();if(l+=J,u+=Z,_="M",a.length>2&&a[a.length-1].command==="z"){for(var G=a.length-2;G>=0;G--)if(a[G].command==="M"){l=a[G].points[0]+J,u=a[G].points[1]+Z;break}}T.push(l,u),v="l";break;case"M":l=b.shift(),u=b.shift(),_="M",T.push(l,u),v="L";break;case"h":l+=b.shift(),_="L",T.push(l,u);break;case"H":l=b.shift(),_="L",T.push(l,u);break;case"v":u+=b.shift(),_="L",T.push(l,u);break;case"V":u=b.shift(),_="L",T.push(l,u);break;case"C":T.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"c":T.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",T.push(l,u);break;case"S":D=l,B=u,I=a[a.length-1],I.command==="C"&&(D=l+(l-I.points[2]),B=u+(u-I.points[3])),T.push(D,B,b.shift(),b.shift()),l=b.shift(),u=b.shift(),_="C",T.push(l,u);break;case"s":D=l,B=u,I=a[a.length-1],I.command==="C"&&(D=l+(l-I.points[2]),B=u+(u-I.points[3])),T.push(D,B,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",T.push(l,u);break;case"Q":T.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"q":T.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="Q",T.push(l,u);break;case"T":D=l,B=u,I=a[a.length-1],I.command==="Q"&&(D=l+(l-I.points[0]),B=u+(u-I.points[1])),l=b.shift(),u=b.shift(),_="Q",T.push(D,B,l,u);break;case"t":D=l,B=u,I=a[a.length-1],I.command==="Q"&&(D=l+(l-I.points[0]),B=u+(u-I.points[1])),l+=b.shift(),u+=b.shift(),_="Q",T.push(D,B,l,u);break;case"A":$=b.shift(),H=b.shift(),j=b.shift(),ne=b.shift(),V=b.shift(),q=l,te=u,l=b.shift(),u=b.shift(),_="A",T=this.convertEndpointToCenterParameterization(q,te,l,u,ne,V,$,H,j);break;case"a":$=b.shift(),H=b.shift(),j=b.shift(),ne=b.shift(),V=b.shift(),q=l,te=u,l+=b.shift(),u+=b.shift(),_="A",T=this.convertEndpointToCenterParameterization(q,te,l,u,ne,V,$,H,j);break}a.push({command:_||v,points:T,start:{x:M,y:O},pathLength:this.calcLength(M,O,_||v,T)})}(v==="z"||v==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=zn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var h=i[4],g=i[5],m=i[4]+g,v=Math.PI/180;if(Math.abs(h-m)m;l-=v)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=h+v;l1&&(s*=Math.sqrt(v),l*=Math.sqrt(v));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(g*g))/(s*s*(m*m)+l*l*(g*g)));o===a&&(b*=-1),isNaN(b)&&(b=0);var w=b*s*m/l,P=b*-l*g/s,E=(t+r)/2+Math.cos(h)*w-Math.sin(h)*P,_=(n+i)/2+Math.sin(h)*w+Math.cos(h)*P,T=function(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])},M=function(H,j){return(H[0]*j[0]+H[1]*j[1])/(T(H)*T(j))},O=function(H,j){return(H[0]*j[1]=1&&($=0),a===0&&$>0&&($=$-2*Math.PI),a===1&&$<0&&($=$+2*Math.PI),[E,_,s,l,I,$,h,a]}}zn.prototype.className="Path";zn.prototype._attrsAffectingSize=["data"];vr(zn);K.addGetterSetter(zn,"data");class Ah extends Hu{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],v=zn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=zn.getPointOnQuadraticBezier(Math.min(1,1-a/v),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var h=(Math.atan2(u,l)+n)%n,g=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(h),t.moveTo(0,0),t.lineTo(-a,g/2),t.lineTo(-a,-g/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,g/2),t.lineTo(-a,-g/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}Ah.prototype.className="Arrow";vr(Ah);K.addGetterSetter(Ah,"pointerLength",10,$e());K.addGetterSetter(Ah,"pointerWidth",10,$e());K.addGetterSetter(Ah,"pointerAtBeginning",!1);K.addGetterSetter(Ah,"pointerAtEnding",!0);class M1 extends Re{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}}M1.prototype._centroid=!0;M1.prototype.className="Circle";M1.prototype._attrsAffectingSize=["radius"];vr(M1);K.addGetterSetter(M1,"radius",0,$e());class Id extends Re{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}Id.prototype.className="Ellipse";Id.prototype._centroid=!0;Id.prototype._attrsAffectingSize=["radiusX","radiusY"];vr(Id);K.addComponentsGetterSetter(Id,"radius",["x","y"]);K.addGetterSetter(Id,"radiusX",0,$e());K.addGetterSetter(Id,"radiusY",0,$e());class Bs extends Re{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.attrs.image;let o;if(i){const a=this.attrs.cropWidth,s=this.attrs.cropHeight;a&&s?o=[i,this.cropX(),this.cropY(),a,s,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),i&&t.drawImage.apply(t,o)}_hitFunc(t){var n=this.width(),r=this.height();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=de.createImageElement();i.onload=function(){var o=new Bs({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}}Bs.prototype.className="Image";vr(Bs);K.addGetterSetter(Bs,"image");K.addComponentsGetterSetter(Bs,"crop",["x","y","width","height"]);K.addGetterSetter(Bs,"cropX",0,$e());K.addGetterSetter(Bs,"cropY",0,$e());K.addGetterSetter(Bs,"cropWidth",0,$e());K.addGetterSetter(Bs,"cropHeight",0,$e());var SW=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],gSe="Change.konva",mSe="none",A7="up",M7="right",R7="down",O7="left",vSe=SW.length;class sk extends c1{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Rh.prototype.className="RegularPolygon";Rh.prototype._centroid=!0;Rh.prototype._attrsAffectingSize=["radius"];vr(Rh);K.addGetterSetter(Rh,"radius",0,$e());K.addGetterSetter(Rh,"sides",0,$e());var XM=Math.PI*2;class Oh extends Re{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,XM,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),XM,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Oh.prototype.className="Ring";Oh.prototype._centroid=!0;Oh.prototype._attrsAffectingSize=["innerRadius","outerRadius"];vr(Oh);K.addGetterSetter(Oh,"innerRadius",0,$e());K.addGetterSetter(Oh,"outerRadius",0,$e());class Gl extends Re{constructor(t){super(t),this._updated=!0,this.anim=new za(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){!this.anim.isRunning()||(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],h=o[i+3],g=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,h),t.closePath(),t.fillStrokeShape(this)),g)if(a){var m=a[n],v=r*2;t.drawImage(g,s,l,u,h,m[v+0],m[v+1],u,h)}else t.drawImage(g,s,l,u,h,0,0,u,h)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],h=r*2;t.rect(u[h+0],u[h+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var S3;function Yw(){return S3||(S3=de.createCanvasElement().getContext(bSe),S3)}function MSe(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function RSe(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function OSe(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class mr extends Re{constructor(t){super(OSe(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(E+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=de._isString(t)?t:t==null?"":t+"";return this._setAttr(xSe,n),this}getWidth(){var t=this.attrs.width===Gp||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Gp||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return de.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=Yw(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+y3+this.fontVariant()+y3+(this.fontSize()+kSe)+ASe(this.fontFamily())}_addTextLine(t){this.align()===um&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return Yw().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` `),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Gp&&o!==void 0,l=a!==Gp&&a!==void 0,u=this.padding(),h=o-u*2,g=a-u*2,m=0,v=this.wrap(),b=v!==JM,w=v!==TSe&&b,P=this.ellipsis();this.textArr=[],Yw().font=this._getContextFont();for(var E=P?this._getTextWidth(jw):0,_=0,T=t.length;_h)for(;M.length>0;){for(var I=0,D=M.length,B="",$=0;I>>1,j=M.slice(0,H+1),ne=this._getTextWidth(j)+E;ne<=h?(I=H+1,B=j,$=ne):D=H}if(B){if(w){var V,q=M[B.length],te=q===y3||q===ZM;te&&$<=h?V=B.length:V=Math.max(B.lastIndexOf(y3),B.lastIndexOf(ZM))+1,V>0&&(I=V,B=B.slice(0,I),$=this._getTextWidth(B))}B=B.trimRight(),this._addTextLine(B),r=Math.max(r,$),m+=i;var J=this._shouldHandleEllipsis(m);if(J){this._tryToAddEllipsisToLastLine();break}if(M=M.slice(I),M=M.trimLeft(),M.length>0&&(O=this._getTextWidth(M),O<=h)){this._addTextLine(M),m+=i,r=Math.max(r,O);break}}else break}else this._addTextLine(M),m+=i,r=Math.max(r,O),this._shouldHandleEllipsis(m)&&_g)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Gp&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==JM;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Gp&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+jw)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var h=bW(this.text()),g=this.text().split(" ").length-1,m,v,b,w=-1,P=0,E=function(){P=0;for(var ne=t.dataArray,V=w+1;V0)return w=V,ne[V];ne[V].command==="M"&&(m={x:ne[V].points[0],y:ne[V].points[1]})}return{}},_=function(ne){var V=t._getTextSize(ne).width+r;ne===" "&&i==="justify"&&(V+=(s-a)/g);var q=0,te=0;for(v=void 0;Math.abs(V-q)/V>.01&&te<20;){te++;for(var J=q;b===void 0;)b=E(),b&&J+b.pathLengthV?v=zn.getPointOnLine(V,m.x,m.y,b.points[0],b.points[1],m.x,m.y):b=void 0;break;case"A":var G=b.points[4],ee=b.points[5],le=b.points[4]+ee;P===0?P=G+1e-8:V>q?P+=Math.PI/180*ee/Math.abs(ee):P-=Math.PI/360*ee/Math.abs(ee),(ee<0&&P=0&&P>le)&&(P=le,Z=!0),v=zn.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],P,b.points[6]);break;case"C":P===0?V>b.pathLength?P=1e-8:P=V/b.pathLength:V>q?P+=(V-q)/b.pathLength/2:P=Math.max(P-(q-V)/b.pathLength/2,0),P>1&&(P=1,Z=!0),v=zn.getPointOnCubicBezier(P,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case"Q":P===0?P=V/b.pathLength:V>q?P+=(V-q)/b.pathLength:P-=(q-V)/b.pathLength,P>1&&(P=1,Z=!0),v=zn.getPointOnQuadraticBezier(P,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}v!==void 0&&(q=zn.getLineLength(m.x,m.y,v.x,v.y)),Z&&(Z=!1,b=void 0)}},T="C",M=t._getTextSize(T).width+r,O=u/M-1,I=0;Ie+`.${PW}`).join(" "),eR="nodesRect",NSe=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],BSe={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const zSe="ontouchstart"in st._global;function FSe(e,t){if(e==="rotater")return"crosshair";t+=de.degToRad(BSe[e]||0);var n=(de.radToDeg(t)%360+360)%360;return de._inRange(n,315+22.5,360)||de._inRange(n,0,22.5)?"ns-resize":de._inRange(n,45-22.5,45+22.5)?"nesw-resize":de._inRange(n,90-22.5,90+22.5)?"ew-resize":de._inRange(n,135-22.5,135+22.5)?"nwse-resize":de._inRange(n,180-22.5,180+22.5)?"ns-resize":de._inRange(n,225-22.5,225+22.5)?"nesw-resize":de._inRange(n,270-22.5,270+22.5)?"ew-resize":de._inRange(n,315-22.5,315+22.5)?"nwse-resize":(de.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var k4=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],tR=1e8;function $Se(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function TW(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function HSe(e,t){const n=$Se(e);return TW(e,t,n)}function WSe(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(NSe.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(eR),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(eR,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(st.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),h={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return TW(h,-st.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-tR,y:-tR,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const h=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var g=[{x:h.x,y:h.y},{x:h.x+h.width,y:h.y},{x:h.x+h.width,y:h.y+h.height},{x:h.x,y:h.y+h.height}],m=u.getAbsoluteTransform();g.forEach(function(v){var b=m.point(v);n.push(b)})});const r=new ca;r.rotate(-st.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var h=r.point(u);i===void 0&&(i=a=h.x,o=s=h.y),i=Math.min(i,h.x),o=Math.min(o,h.y),a=Math.max(a,h.x),s=Math.max(s,h.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:st.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),k4.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new _2({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:zSe?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=st.getAngle(this.rotation()),o=FSe(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new Re({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*de._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(!!this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const h=o.getAbsolutePosition();if(!(u.x===h.x&&u.y===h.y)){if(this._movingAnchorName==="rotater"){var g=this._getNodeRect();n=o.x()-g.width/2,r=-o.y()+g.height/2;let ne=Math.atan2(-r,n)+Math.PI/2;g.height<0&&(ne-=Math.PI);var m=st.getAngle(this.rotation());const V=m+ne,q=st.getAngle(this.rotationSnapTolerance()),J=WSe(this.rotationSnaps(),V,q)-g.rotation,Z=HSe(g,J);this._fitNodesInto(Z,t);return}var v=this.keepRatio()||t.shiftKey,_=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(v){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(b.y-o.y(),2));var w=this.findOne(".top-left").x()>b.x?-1:1,P=this.findOne(".top-left").y()>b.y?-1:1;n=i*this.cos*w,r=i*this.sin*P,this.findOne(".top-left").x(b.x-n),this.findOne(".top-left").y(b.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(v){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-b.x,2)+Math.pow(b.y-o.y(),2));var w=this.findOne(".top-right").x()b.y?-1:1;n=i*this.cos*w,r=i*this.sin*P,this.findOne(".top-right").x(b.x+n),this.findOne(".top-right").y(b.y-r)}var E=o.position();this.findOne(".top-left").y(E.y),this.findOne(".bottom-right").x(E.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(v){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(o.y()-b.y,2));var w=b.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(de._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(de._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new ca;if(a.rotate(st.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const g=a.point({x:-this.padding()*2,y:0});if(t.x+=g.x,t.y+=g.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const g=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const g=a.point({x:0,y:-this.padding()*2});if(t.x+=g.x,t.y+=g.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const g=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=g.x,this._anchorDragOffset.y-=g.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const g=this.boundBoxFunc()(r,t);g?t=g:de.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new ca;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new ca;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const h=u.multiply(l.invert());this._nodes.forEach(g=>{var m;const v=g.getParent().getAbsoluteTransform(),b=g.getTransform().copy();b.translate(g.offsetX(),g.offsetY());const w=new ca;w.multiply(v.copy().invert()).multiply(h).multiply(v).multiply(b);const P=w.decompose();g.setAttrs(P),this._fire("transform",{evt:n,target:g}),g._fire("transform",{evt:n,target:g}),(m=g.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(de._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(de._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach(u=>{u.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*de._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),c1.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return He.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}function VSe(e){return e instanceof Array||de.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){k4.indexOf(t)===-1&&de.warn("Unknown anchor name: "+t+". Available names are: "+k4.join(", "))}),e||[]}Tn.prototype.className="Transformer";vr(Tn);K.addGetterSetter(Tn,"enabledAnchors",k4,VSe);K.addGetterSetter(Tn,"flipEnabled",!0,Ns());K.addGetterSetter(Tn,"resizeEnabled",!0);K.addGetterSetter(Tn,"anchorSize",10,$e());K.addGetterSetter(Tn,"rotateEnabled",!0);K.addGetterSetter(Tn,"rotationSnaps",[]);K.addGetterSetter(Tn,"rotateAnchorOffset",50,$e());K.addGetterSetter(Tn,"rotationSnapTolerance",5,$e());K.addGetterSetter(Tn,"borderEnabled",!0);K.addGetterSetter(Tn,"anchorStroke","rgb(0, 161, 255)");K.addGetterSetter(Tn,"anchorStrokeWidth",1,$e());K.addGetterSetter(Tn,"anchorFill","white");K.addGetterSetter(Tn,"anchorCornerRadius",0,$e());K.addGetterSetter(Tn,"borderStroke","rgb(0, 161, 255)");K.addGetterSetter(Tn,"borderStrokeWidth",1,$e());K.addGetterSetter(Tn,"borderDash");K.addGetterSetter(Tn,"keepRatio",!0);K.addGetterSetter(Tn,"centeredScaling",!1);K.addGetterSetter(Tn,"ignoreStroke",!1);K.addGetterSetter(Tn,"padding",0,$e());K.addGetterSetter(Tn,"node");K.addGetterSetter(Tn,"nodes");K.addGetterSetter(Tn,"boundBoxFunc");K.addGetterSetter(Tn,"anchorDragBoundFunc");K.addGetterSetter(Tn,"shouldOverdrawWholeArea",!1);K.addGetterSetter(Tn,"useSingleNodeRotation",!0);K.backCompat(Tn,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Wu extends Re{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,st.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Wu.prototype.className="Wedge";Wu.prototype._centroid=!0;Wu.prototype._attrsAffectingSize=["radius"];vr(Wu);K.addGetterSetter(Wu,"radius",0,$e());K.addGetterSetter(Wu,"angle",0,$e());K.addGetterSetter(Wu,"clockwise",!1);K.backCompat(Wu,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function nR(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var USe=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],GSe=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function jSe(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,h,g,m,v,b,w,P,E,_,T,M,O,I,D,B,$,H,j,ne,V=t+t+1,q=r-1,te=i-1,J=t+1,Z=J*(J+1)/2,G=new nR,ee=null,le=G,me=null,Me=null,Ce=USe[t],be=GSe[t];for(s=1;s>be,j!==0?(j=255/j,n[h]=(m*Ce>>be)*j,n[h+1]=(v*Ce>>be)*j,n[h+2]=(b*Ce>>be)*j):n[h]=n[h+1]=n[h+2]=0,m-=P,v-=E,b-=_,w-=T,P-=me.r,E-=me.g,_-=me.b,T-=me.a,l=g+((l=o+t+1)>be,j>0?(j=255/j,n[l]=(m*Ce>>be)*j,n[l+1]=(v*Ce>>be)*j,n[l+2]=(b*Ce>>be)*j):n[l]=n[l+1]=n[l+2]=0,m-=P,v-=E,b-=_,w-=T,P-=me.r,E-=me.g,_-=me.b,T-=me.a,l=o+((l=a+J)0&&jSe(t,n)};K.addGetterSetter(He,"blurRadius",0,$e(),K.afterSetFilter);const qSe=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};K.addGetterSetter(He,"contrast",0,$e(),K.afterSetFilter);const XSe=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,h=l*4,g=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:de.error("Unknown emboss direction: "+r)}do{var m=(g-1)*h,v=o;g+v<1&&(v=0),g+v>u&&(v=0);var b=(g-1+v)*l*4,w=l;do{var P=m+(w-1)*4,E=a;w+E<1&&(E=0),w+E>l&&(E=0);var _=b+(w-1+E)*4,T=s[P]-s[_],M=s[P+1]-s[_+1],O=s[P+2]-s[_+2],I=T,D=I>0?I:-I,B=M>0?M:-M,$=O>0?O:-O;if(B>D&&(I=M),$>D&&(I=O),I*=t,i){var H=s[P]+I,j=s[P+1]+I,ne=s[P+2]+I;s[P]=H>255?255:H<0?0:H,s[P+1]=j>255?255:j<0?0:j,s[P+2]=ne>255?255:ne<0?0:ne}else{var V=n-I;V<0?V=0:V>255&&(V=255),s[P]=s[P+1]=s[P+2]=V}}while(--w)}while(--g)};K.addGetterSetter(He,"embossStrength",.5,$e(),K.afterSetFilter);K.addGetterSetter(He,"embossWhiteLevel",.5,$e(),K.afterSetFilter);K.addGetterSetter(He,"embossDirection","top-left",null,K.afterSetFilter);K.addGetterSetter(He,"embossBlend",!1,null,K.afterSetFilter);function qw(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const ZSe=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],h=u,g,m,v=this.enhance();if(v!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),g=t[m+2],gh&&(h=g);i===r&&(i=255,r=0),s===a&&(s=255,a=0),h===u&&(h=255,u=0);var b,w,P,E,_,T,M,O,I;for(v>0?(w=i+v*(255-i),P=r-v*(r-0),_=s+v*(255-s),T=a-v*(a-0),O=h+v*(255-h),I=u-v*(u-0)):(b=(i+r)*.5,w=i+v*(i-b),P=r+v*(r-b),E=(s+a)*.5,_=s+v*(s-E),T=a+v*(a-E),M=(h+u)*.5,O=h+v*(h-M),I=u+v*(u-M)),m=0;mE?P:E;var _=a,T=o,M,O,I=360/T*Math.PI/180,D,B;for(O=0;OT?_:T;var M=a,O=o,I,D,B=n.polarRotation||0,$,H;for(h=0;ht&&(M=T,O=0,I=-1),i=0;i=0&&v=0&&b=0&&v=0&&b=255*4?255:0}return a}function cbe(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s=0&&v=0&&b=n))for(o=w;o=r||(a=(n*o+i)*4,s+=M[a+0],l+=M[a+1],u+=M[a+2],h+=M[a+3],T+=1);for(s=s/T,l=l/T,u=u/T,h=h/T,i=v;i=n))for(o=w;o=r||(a=(n*o+i)*4,M[a+0]=s,M[a+1]=l,M[a+2]=u,M[a+3]=h)}};K.addGetterSetter(He,"pixelSize",8,$e(),K.afterSetFilter);const pbe=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});K.addGetterSetter(He,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});K.addGetterSetter(He,"blue",0,ZH,K.afterSetFilter);const mbe=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s255?255:e<0?0:Math.round(e)});K.addGetterSetter(He,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});K.addGetterSetter(He,"blue",0,ZH,K.afterSetFilter);K.addGetterSetter(He,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const vbe=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),h>127&&(h=255-h),g>127&&(g=255-g),t[l]=u,t[l+1]=h,t[l+2]=g}while(--s)}while(--o)},Sbe=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new Kp.Stage({container:i,width:n,height:r}),a=new Kp.Layer,s=new Kp.Layer;a.add(new Kp.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new Kp.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l},xbe=e=>{const t=window.open("");!t||e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})};let LW=null,AW=null;const wbe=e=>{LW=e},Os=()=>LW,Cbe=e=>{AW=e},MW=()=>AW,_be=e=>{const t=Os(),{generationMode:n,optionsState:r,canvasState:i,systemState:o}=e,{cfgScale:a,codeformerFidelity:s,facetoolStrength:l,facetoolType:u,height:h,hiresFix:g,img2imgStrength:m,infillMethod:v,initialImage:b,iterations:w,perlin:P,prompt:E,sampler:_,seamBlur:T,seamless:M,seamSize:O,seamSteps:I,seamStrength:D,seed:B,seedWeights:$,shouldFitToWidthHeight:H,shouldGenerateVariations:j,shouldRandomizeSeed:ne,shouldRunESRGAN:V,shouldRunFacetool:q,steps:te,threshold:J,tileSize:Z,upscalingLevel:G,upscalingStrength:ee,variationAmount:le,width:me}=r,{shouldDisplayInProgressType:Me,saveIntermediatesInterval:Ce,enableImageDebugging:be}=o,we={prompt:E,iterations:w,steps:te,cfg_scale:a,threshold:J,perlin:P,height:h,width:me,sampler_name:_,seed:B,progress_images:Me==="full-res",progress_latents:Me==="latents",save_intermediates:Ce,generation_mode:n,init_mask:""};let Ve=!1,Ze=!1;if(we.seed=ne?XH(tk,nk):B,["txt2img","img2img"].includes(n)&&(we.seamless=M,we.hires_fix=g,V&&(Ve={level:G,strength:ee}),q&&(Ze={type:u,strength:l},u==="codeformer"&&(Ze.codeformer_fidelity=s))),n==="img2img"&&b&&(we.init_img=typeof b=="string"?b:b.url,we.strength=m,we.fit=H),n==="unifiedCanvas"&&t){const{layerState:{objects:it},boundingBoxCoordinates:pt,boundingBoxDimensions:kt,inpaintReplace:gt,shouldUseInpaintReplace:ht,stageScale:vt,isMaskEnabled:Te,shouldPreserveMaskedArea:ot,boundingBoxScaleMethod:Mt,scaledBoundingBoxDimensions:Je}=i,mt={...pt,...kt},un=bbe(Te?it.filter(X_):[],mt);we.init_mask=un,we.fit=!1,we.strength=m,we.invert_mask=ot,ht&&(we.inpaint_replace=gt),we.bounding_box=mt;const Et=t.scale();t.scale({x:1/vt,y:1/vt});const jt=t.getAbsolutePosition(),cn=t.toDataURL({x:mt.x+jt.x,y:mt.y+jt.y,width:mt.width,height:mt.height});be&&xbe([{base64:un,caption:"mask sent as init_mask"},{base64:cn,caption:"image sent as init_img"}]),t.scale(Et),we.init_img=cn,we.progress_images=!1,Mt!=="none"&&(we.inpaint_width=Je.width,we.inpaint_height=Je.height),we.seam_size=O,we.seam_blur=T,we.seam_strength=D,we.seam_steps=I,we.tile_size=Z,we.infill_method=v,we.force_outpaint=!1}return j?(we.variation_amount=le,$&&(we.with_variations=Rye($))):we.variation_amount=0,be&&(we.enable_image_debugging=be),{generationParameters:we,esrganParameters:Ve,facetoolParameters:Ze}},kbe=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(ku(!0));const o=r(),{options:a,system:s,canvas:l}=o,u={generationMode:i,optionsState:a,canvasState:l,systemState:s};n(v3e());const{generationParameters:h,esrganParameters:g,facetoolParameters:m}=_be(u);t.emit("generateImage",h,g,m),h.init_mask&&(h.init_mask=h.init_mask.substr(0,64).concat("...")),h.init_img&&(h.init_img=h.init_img.substr(0,64).concat("...")),n(Po({timestamp:To(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...h,...g,...m})}`}))},emitRunESRGAN:i=>{n(ku(!0));const o=r().options,{upscalingLevel:a,upscalingStrength:s}=o,l={upscale:[a,s]};t.emit("runPostprocessing",i,{type:"esrgan",...l}),n(Po({timestamp:To(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...l})}`}))},emitRunFacetool:i=>{n(ku(!0));const o=r().options,{facetoolType:a,facetoolStrength:s,codeformerFidelity:l}=o,u={facetool_strength:s};a==="codeformer"&&(u.codeformer_fidelity=l),t.emit("runPostprocessing",i,{type:a,...u}),n(Po({timestamp:To(new Date,"isoDateTime"),message:`Face restoration (${a}) requested: ${JSON.stringify({file:i.url,...u})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(dH(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitRequestModelChange:i=>{n(p3e()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}},Ebe=()=>{const{origin:e}=new URL(window.location.href),t=d5(e,{timeout:6e4,path:window.location.pathname+"socket.io"});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:h,onGenerationResult:g,onIntermediateResult:m,onProgressUpdate:v,onGalleryImages:b,onProcessingCanceled:w,onImageDeleted:P,onSystemConfig:E,onModelChanged:_,onModelChangeFailed:T,onTempFolderEmptied:M}=r4e(i),{emitGenerateImage:O,emitRunESRGAN:I,emitRunFacetool:D,emitDeleteImage:B,emitRequestImages:$,emitRequestNewImages:H,emitCancelProcessing:j,emitRequestSystemConfig:ne,emitRequestModelChange:V,emitSaveStagingAreaImageToGallery:q,emitRequestEmptyTempFolder:te}=kbe(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",J=>u(J)),t.on("generationResult",J=>g(J)),t.on("postprocessingResult",J=>h(J)),t.on("intermediateResult",J=>m(J)),t.on("progressUpdate",J=>v(J)),t.on("galleryImages",J=>b(J)),t.on("processingCanceled",()=>{w()}),t.on("imageDeleted",J=>{P(J)}),t.on("systemConfig",J=>{E(J)}),t.on("modelChanged",J=>{_(J)}),t.on("modelChangeFailed",J=>{T(J)}),t.on("tempFolderEmptied",()=>{M()}),n=!0),a.type){case"socketio/generateImage":{O(a.payload);break}case"socketio/runESRGAN":{I(a.payload);break}case"socketio/runFacetool":{D(a.payload);break}case"socketio/deleteImage":{B(a.payload);break}case"socketio/requestImages":{$(a.payload);break}case"socketio/requestNewImages":{H(a.payload);break}case"socketio/cancelProcessing":{j();break}case"socketio/requestSystemConfig":{ne();break}case"socketio/requestModelChange":{V(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{q(a.payload);break}case"socketio/requestEmptyTempFolder":{te();break}}o(a)}},Pbe=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),Tbe=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps"].map(e=>`system.${e}`),Lbe=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),RW=O$({options:Xye,gallery:a3e,system:b3e,canvas:Q3e}),Abe=U$.getPersistConfig({key:"root",storage:V$,rootReducer:RW,blacklist:[...Pbe,...Tbe,...Lbe],debounce:300}),Mbe=gye(Abe,RW),OW=G2e({reducer:Mbe,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(Ebe()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}});var IW={exports:{}},DW={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var d1=C.exports;function Rbe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Obe=typeof Object.is=="function"?Object.is:Rbe,Ibe=d1.useState,Dbe=d1.useEffect,Nbe=d1.useLayoutEffect,Bbe=d1.useDebugValue;function zbe(e,t){var n=t(),r=Ibe({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Nbe(function(){i.value=n,i.getSnapshot=t,Kw(i)&&o({inst:i})},[e,n,t]),Dbe(function(){return Kw(i)&&o({inst:i}),e(function(){Kw(i)&&o({inst:i})})},[e]),Bbe(n),n}function Kw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Obe(e,n)}catch(r){return!0}}function Fbe(e,t){return t()}var $be=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Fbe:zbe;DW.useSyncExternalStore=d1.useSyncExternalStore!==void 0?d1.useSyncExternalStore:$be;(function(e){e.exports=DW})(IW);var NW={exports:{}},BW={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var rb=C.exports,Hbe=IW.exports;function Wbe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vbe=typeof Object.is=="function"?Object.is:Wbe,Ube=Hbe.useSyncExternalStore,Gbe=rb.useRef,jbe=rb.useEffect,Ybe=rb.useMemo,qbe=rb.useDebugValue;BW.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=Gbe(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=Ybe(function(){function l(v){if(!u){if(u=!0,h=v,v=r(v),i!==void 0&&a.hasValue){var b=a.value;if(i(b,v))return g=b}return g=v}if(b=g,Vbe(h,v))return b;var w=r(v);return i!==void 0&&i(b,w)?b:(h=v,g=w)}var u=!1,h,g,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,r,i]);var s=Ube(e,o[0],o[1]);return jbe(function(){a.hasValue=!0,a.value=s},[s]),qbe(s),s};(function(e){e.exports=BW})(NW);function Kbe(e){e()}let zW=Kbe;const Xbe=e=>zW=e,Zbe=()=>zW,xd=C.exports.createContext(null);function FW(){return C.exports.useContext(xd)}const Qbe=()=>{throw new Error("uSES not initialized!")};let $W=Qbe;const Jbe=e=>{$W=e},exe=(e,t)=>e===t;function txe(e=xd){const t=e===xd?FW:()=>C.exports.useContext(e);return function(r,i=exe){const{store:o,subscription:a,getServerState:s}=t(),l=$W(a.addNestedSub,o.getState,s||o.getState,r,i);return C.exports.useDebugValue(l),l}}const nxe=txe();var rxe={exports:{}},Dn={};/** * @license React * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var lk=Symbol.for("react.element"),uk=Symbol.for("react.portal"),ib=Symbol.for("react.fragment"),ob=Symbol.for("react.strict_mode"),ab=Symbol.for("react.profiler"),sb=Symbol.for("react.provider"),lb=Symbol.for("react.context"),ixe=Symbol.for("react.server_context"),ub=Symbol.for("react.forward_ref"),cb=Symbol.for("react.suspense"),db=Symbol.for("react.suspense_list"),fb=Symbol.for("react.memo"),hb=Symbol.for("react.lazy"),oxe=Symbol.for("react.offscreen"),HW;HW=Symbol.for("react.module.reference");function Qa(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case lk:switch(e=e.type,e){case ib:case ab:case ob:case cb:case db:return e;default:switch(e=e&&e.$$typeof,e){case ixe:case lb:case ub:case hb:case fb:case sb:return e;default:return t}}case uk:return t}}}Dn.ContextConsumer=lb;Dn.ContextProvider=sb;Dn.Element=lk;Dn.ForwardRef=ub;Dn.Fragment=ib;Dn.Lazy=hb;Dn.Memo=fb;Dn.Portal=uk;Dn.Profiler=ab;Dn.StrictMode=ob;Dn.Suspense=cb;Dn.SuspenseList=db;Dn.isAsyncMode=function(){return!1};Dn.isConcurrentMode=function(){return!1};Dn.isContextConsumer=function(e){return Qa(e)===lb};Dn.isContextProvider=function(e){return Qa(e)===sb};Dn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===lk};Dn.isForwardRef=function(e){return Qa(e)===ub};Dn.isFragment=function(e){return Qa(e)===ib};Dn.isLazy=function(e){return Qa(e)===hb};Dn.isMemo=function(e){return Qa(e)===fb};Dn.isPortal=function(e){return Qa(e)===uk};Dn.isProfiler=function(e){return Qa(e)===ab};Dn.isStrictMode=function(e){return Qa(e)===ob};Dn.isSuspense=function(e){return Qa(e)===cb};Dn.isSuspenseList=function(e){return Qa(e)===db};Dn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===ib||e===ab||e===ob||e===cb||e===db||e===oxe||typeof e=="object"&&e!==null&&(e.$$typeof===hb||e.$$typeof===fb||e.$$typeof===sb||e.$$typeof===lb||e.$$typeof===ub||e.$$typeof===HW||e.getModuleId!==void 0)};Dn.typeOf=Qa;(function(e){e.exports=Dn})(rxe);function axe(){const e=Zbe();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const rR={notify(){},get:()=>[]};function sxe(e,t){let n,r=rR;function i(g){return l(),r.subscribe(g)}function o(){r.notify()}function a(){h.onStateChange&&h.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=axe())}function u(){n&&(n(),n=void 0,r.clear(),r=rR)}const h={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return h}const lxe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",uxe=lxe?C.exports.useLayoutEffect:C.exports.useEffect;function cxe({store:e,context:t,children:n,serverState:r}){const i=C.exports.useMemo(()=>{const s=sxe(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=C.exports.useMemo(()=>e.getState(),[e]);return uxe(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]),S((t||xd).Provider,{value:i,children:n})}function WW(e=xd){const t=e===xd?FW:()=>C.exports.useContext(e);return function(){const{store:r}=t();return r}}const dxe=WW();function fxe(e=xd){const t=e===xd?dxe:WW(e);return function(){return t().dispatch}}const hxe=fxe();Jbe(NW.exports.useSyncExternalStoreWithSelector);Xbe(Wl.exports.unstable_batchedUpdates);function g5(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?g5=function(n){return typeof n}:g5=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},g5(e)}function pxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iR(e,t){for(var n=0;nS(bt,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:S(p2,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})}),De=hxe,ye=nxe,Sxe=rt(e=>e.system,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),bxe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=ye(Sxe),i=t?Math.round(t*100/n):0;return S(n$,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};var GW={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},oR=se.createContext&&se.createContext(GW),hd=globalThis&&globalThis.__assign||function(){return hd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return S(bi,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:S(Ya,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})});function Kxe(e){const{title:t,hotkey:n,description:r}=e;return X("div",{className:"hotkey-modal-item",children:[X("div",{className:"hotkey-info",children:[S("p",{className:"hotkey-title",children:t}),r&&S("p",{className:"hotkey-description",children:r})]}),S("div",{className:"hotkey-key",children:n})]})}function Xxe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Hv(),i=[{title:"Invoke",desc:"Generate an image",hotkey:"Ctrl+Enter"},{title:"Cancel",desc:"Cancel image generation",hotkey:"Shift+X"},{title:"Focus Prompt",desc:"Focus the prompt input area",hotkey:"Alt+A"},{title:"Toggle Options",desc:"Open and close the options panel",hotkey:"O"},{title:"Pin Options",desc:"Pin the options panel",hotkey:"Shift+O"},{title:"Toggle Viewer",desc:"Open and close Image Viewer",hotkey:"Z"},{title:"Toggle Gallery",desc:"Open and close the gallery drawer",hotkey:"G"},{title:"Maximize Workspace",desc:"Close panels and maximize work area",hotkey:"F"},{title:"Change Tabs",desc:"Switch to another workspace",hotkey:"1-5"},{title:"Console Toggle",desc:"Open and close console",hotkey:"`"}],o=[{title:"Set Prompt",desc:"Use the prompt of the current image",hotkey:"P"},{title:"Set Seed",desc:"Use the seed of the current image",hotkey:"S"},{title:"Set Parameters",desc:"Use all parameters of the current image",hotkey:"A"},{title:"Restore Faces",desc:"Restore the current image",hotkey:"Shift+R"},{title:"Upscale",desc:"Upscale the current image",hotkey:"Shift+U"},{title:"Show Info",desc:"Show metadata info of the current image",hotkey:"I"},{title:"Send To Image To Image",desc:"Send current image to Image to Image",hotkey:"Shift+I"},{title:"Delete Image",desc:"Delete the current image",hotkey:"Del"},{title:"Close Panels",desc:"Closes open panels",hotkey:"Esc"}],a=[{title:"Previous Image",desc:"Display the previous image in gallery",hotkey:"Arrow Left"},{title:"Next Image",desc:"Display the next image in gallery",hotkey:"Arrow Right"},{title:"Toggle Gallery Pin",desc:"Pins and unpins the gallery to the UI",hotkey:"Shift+G"},{title:"Increase Gallery Image Size",desc:"Increases gallery thumbnails size",hotkey:"Shift+Up"},{title:"Decrease Gallery Image Size",desc:"Decreases gallery thumbnails size",hotkey:"Shift+Down"}],s=[{title:"Select Brush",desc:"Selects the canvas brush",hotkey:"B"},{title:"Select Eraser",desc:"Selects the canvas eraser",hotkey:"E"},{title:"Decrease Brush Size",desc:"Decreases the size of the canvas brush/eraser",hotkey:"["},{title:"Increase Brush Size",desc:"Increases the size of the canvas brush/eraser",hotkey:"]"},{title:"Decrease Brush Opacity",desc:"Decreases the opacity of the canvas brush",hotkey:"Shift + ["},{title:"Increase Brush Opacity",desc:"Increases the opacity of the canvas brush",hotkey:"Shift + ]"},{title:"Move Tool",desc:"Allows canvas navigation",hotkey:"V"},{title:"Fill Bounding Box",desc:"Fills the bounding box with brush color",hotkey:"Shift + F"},{title:"Erase Bounding Box",desc:"Erases the bounding box area",hotkey:"Delete / Backspace"},{title:"Select Color Picker",desc:"Selects the canvas color picker",hotkey:"C"},{title:"Toggle Snap",desc:"Toggles Snap to Grid",hotkey:"N"},{title:"Quick Toggle Move",desc:"Temporarily toggles Move mode",hotkey:"Hold Space"},{title:"Toggle Layer",desc:"Toggles mask/base layer selection",hotkey:"Q"},{title:"Clear Mask",desc:"Clear the entire mask",hotkey:"Shift+C"},{title:"Hide Mask",desc:"Hide and unhide mask",hotkey:"H"},{title:"Show/Hide Bounding Box",desc:"Toggle visibility of bounding box",hotkey:"Shift+H"},{title:"Merge Visible",desc:"Merge all visible layers of canvas",hotkey:"Shift+M"},{title:"Save To Gallery",desc:"Save current canvas to gallery",hotkey:"Shift+S"},{title:"Copy to Clipboard",desc:"Copy current canvas to clipboard",hotkey:"Ctrl+C"},{title:"Download Image",desc:"Download current canvas",hotkey:"Shift+D"},{title:"Undo Stroke",desc:"Undo a brush stroke",hotkey:"Ctrl+Z"},{title:"Redo Stroke",desc:"Redo a brush stroke",hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:"Reset View",desc:"Reset Canvas View",hotkey:"R"},{title:"Previous Staging Image",desc:"Previous Staging Area Image",hotkey:"Arrow Left"},{title:"Next Staging Image",desc:"Next Staging Area Image",hotkey:"Arrow Right"},{title:"Accept Staging Image",desc:"Accept Current Staging Area Image",hotkey:"Enter"}],l=u=>{const h=[];return u.forEach((g,m)=>{h.push(S(Kxe,{title:g.title,description:g.desc,hotkey:g.hotkey},m))}),S("div",{className:"hotkey-modal-category",children:h})};return X(Rn,{children:[C.exports.cloneElement(e,{onClick:n}),X(l1,{isOpen:t,onClose:r,children:[S(u1,{}),X(Yv,{className:" modal hotkeys-modal",children:[S(b_,{className:"modal-close-btn"}),S("h1",{children:"Keyboard Shorcuts"}),S("div",{className:"hotkeys-modal-items",children:X(OS,{allowMultiple:!0,children:[X(Zf,{children:[X(Kf,{className:"hotkeys-modal-button",children:[S("h2",{children:"App Hotkeys"}),S(Xf,{})]}),S(Qf,{children:l(i)})]}),X(Zf,{children:[X(Kf,{className:"hotkeys-modal-button",children:[S("h2",{children:"General Hotkeys"}),S(Xf,{})]}),S(Qf,{children:l(o)})]}),X(Zf,{children:[X(Kf,{className:"hotkeys-modal-button",children:[S("h2",{children:"Gallery Hotkeys"}),S(Xf,{})]}),S(Qf,{children:l(a)})]}),X(Zf,{children:[X(Kf,{className:"hotkeys-modal-button",children:[S("h2",{children:"Unified Canvas Hotkeys"}),S(Xf,{})]}),S(Qf,{children:l(s)})]})]})})]})]})]})}const Zxe=e=>{const{isProcessing:t,isConnected:n}=ye(l=>l.system),r=De(),{name:i,status:o,description:a}=e,s=()=>{r(KH(i))};return X("div",{className:"model-list-item",children:[S(bi,{label:a,hasArrow:!0,placement:"bottom",children:S("div",{className:"model-list-item-name",children:i})}),S(Tz,{}),S("div",{className:`model-list-item-status ${o.split(" ").join("-")}`,children:o}),S("div",{className:"model-list-item-load-btn",children:S(ja,{size:"sm",onClick:s,isDisabled:o==="active"||t||!n,children:"Load"})})]})},Qxe=rt(e=>e.system,e=>{const t=We.map(e.model_list,(r,i)=>({name:i,...r})),n=t.find(r=>r.status==="active");return{models:t,activeModel:n}}),Jxe=()=>{const{models:e}=ye(Qxe);return S(OS,{allowToggle:!0,className:"model-list-accordion",variant:"unstyled",children:X(Zf,{children:[S(Kf,{children:X("div",{className:"model-list-button",children:[S("h2",{children:"Models"}),S(Xf,{})]})}),S(Qf,{children:S("div",{className:"model-list-list",children:e.map((t,n)=>S(Zxe,{name:t.name,status:t.status,description:t.description},n))})})]})})},$a=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return S(Td,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,...i,children:X(_h,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",...o,children:[t,S(R_,{className:"invokeai__switch-root",...s})]})})},Is=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="md",styleClass:l,...u}=e;return X(Td,{isDisabled:n,className:`invokeai__select ${l}`,onClick:h=>{h.stopPropagation(),h.nativeEvent.stopImmediatePropagation(),h.nativeEvent.stopPropagation(),h.nativeEvent.cancelBubble=!0},children:[t&&S(_h,{className:"invokeai__select-label",fontSize:s,marginBottom:1,flexGrow:2,whiteSpace:"nowrap",children:t}),S(bi,{label:i,...o,children:S(i$,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(h=>typeof h=="string"||typeof h=="number"?S("option",{value:h,className:"invokeai__select-option",children:h},h):S("option",{value:h.value,className:"invokeai__select-option",children:h.key},h.value))})})]})},sR=/^-?(0\.)?\.?$/,Ds=e=>{const{label:t,labelFontSize:n="1rem",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:h,min:g,max:m,isInteger:v=!0,formControlProps:b,formLabelProps:w,numberInputFieldProps:P,numberInputStepperProps:E,tooltipProps:_,...T}=e,[M,O]=C.exports.useState(String(u));C.exports.useEffect(()=>{!M.match(sR)&&u!==Number(M)&&O(String(u))},[u,M]);const I=B=>{O(B),B.match(sR)||h(v?Math.floor(Number(B)):Number(B))},D=B=>{const $=We.clamp(v?Math.floor(Number(B.target.value)):Number(B.target.value),g,m);O(String($)),h($)};return S(bi,{..._,children:X(Td,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&S(_h,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,...w,children:t}),X(w_,{className:"invokeai__number-input-root",value:M,keepWithinRange:!0,clampValueOnBlur:!1,onChange:I,onBlur:D,width:a,...T,children:[S(C_,{className:"invokeai__number-input-field",textAlign:s,...P}),o&&X("div",{className:"invokeai__number-input-stepper",children:[S(k_,{...E,className:"invokeai__number-input-stepper-button"}),S(__,{...E,className:"invokeai__number-input-stepper-button"})]})]})]})})},Vu=e=>e.system,ewe=e=>e.system.toastQueue,Tr=rt(e=>e.options,e=>Y_[e.activeTab],{memoizeOptions:{equalityCheck:We.isEqual}});rt(e=>e.options,e=>{const{shouldRandomizeSeed:t,shouldGenerateVariations:n}=e;return t||n},{memoizeOptions:{resultEqualityCheck:We.isEqual}});const gk=e=>e.options,twe=rt([Vu,gk],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:We.map(o,(u,h)=>h),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),nwe=({children:e})=>{const t=De(),n=ye(E=>E.options.steps),{isOpen:r,onOpen:i,onClose:o}=Hv(),{isOpen:a,onOpen:s,onClose:l}=Hv(),{shouldDisplayInProgressType:u,shouldConfirmOnDelete:h,shouldDisplayGuides:g,saveIntermediatesInterval:m,enableImageDebugging:v,shouldUseCanvasBetaLayout:b}=ye(twe),w=()=>{UW.purge().then(()=>{o(),s()})},P=E=>{E>n&&(E=n),E<1&&(E=1),t(g3e(E))};return X(Rn,{children:[C.exports.cloneElement(e,{onClick:i}),X(l1,{isOpen:r,onClose:o,children:[S(u1,{}),X(Yv,{className:"modal settings-modal",children:[S(US,{className:"settings-modal-header",children:"Settings"}),S(b_,{className:"modal-close-btn"}),X(jv,{className:"settings-modal-content",children:[X("div",{className:"settings-modal-items",children:[S("div",{className:"settings-modal-item",children:S(Jxe,{})}),X("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[S(Is,{label:"Display In-Progress Images",validValues:u4e,value:u,onChange:E=>t(l3e(E.target.value))}),u==="full-res"&&S(Ds,{label:"Save images every n steps",min:1,max:n,step:1,onChange:P,value:m,width:"auto",textAlign:"center"})]}),S($a,{styleClass:"settings-modal-item",label:"Confirm on Delete",isChecked:h,onChange:E=>t(pH(E.target.checked))}),S($a,{styleClass:"settings-modal-item",label:"Display Help Icons",isChecked:g,onChange:E=>t(f3e(E.target.checked))}),S($a,{styleClass:"settings-modal-item",label:"Use Canvas Beta Layout",isChecked:b,onChange:E=>t(Kye(E.target.checked))})]}),X("div",{className:"settings-modal-items",children:[S("h2",{style:{fontWeight:"bold"},children:"Developer"}),S($a,{styleClass:"settings-modal-item",label:"Enable Image Debugging",isChecked:v,onChange:E=>t(m3e(E.target.checked))})]}),X("div",{className:"settings-modal-reset",children:[S(ah,{size:"md",children:"Reset Web UI"}),S(ja,{colorScheme:"red",onClick:w,children:"Reset Web UI"}),S(Mo,{children:"Resetting the web UI only resets the browser's local cache of your images and remembered settings. It does not delete any images from disk."}),S(Mo,{children:"If images aren't showing up in the gallery or something else isn't working, please try resetting before submitting an issue on GitHub."})]})]}),S(VS,{children:S(ja,{onClick:o,className:"modal-close-btn",children:"Close"})})]})]}),X(l1,{closeOnOverlayClick:!1,isOpen:a,onClose:l,isCentered:!0,children:[S(u1,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),S(Yv,{children:S(jv,{pb:6,pt:6,children:S(bt,{justifyContent:"center",children:S(Mo,{fontSize:"lg",children:"Web UI has been reset. Refresh the page to reload."})})})})]})]})},rwe=rt(e=>e.system,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),iwe=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=ye(rwe),s=De();let l;e&&!o?l="status-good":l="status-bad";let u=i;return["generating","preparing","saving image","restoring faces","upscaling"].includes(u.toLowerCase())&&(l="status-working"),u&&t&&r>1&&(u+=` (${n}/${r})`),S(bi,{label:o&&!a?"Click to clear, check logs for details":void 0,children:S(Mo,{cursor:o&&!a?"pointer":"initial",onClick:()=>{(o||!a)&&s(gH())},className:`status ${l}`,children:u})})},Dl=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return X(E_,{...o,children:[S(L_,{children:t}),X(T_,{className:`invokeai__popover-content ${r}`,children:[i&&S(P_,{className:"invokeai__popover-arrow"}),n]})]})},Ro=Pe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return S(bi,{label:r,...i,children:S(ja,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})}),owe=["dark","light","green"];function awe(){const{setColorMode:e,colorMode:t}=i2(),n=De(),r=ye(o=>o.options.currentTheme);C.exports.useEffect(()=>{t!==r&&e(r)},[e,t,r]);const i=o=>{n(Bye(o))};return S(Dl,{trigger:"hover",triggerComponent:S(Xe,{"aria-label":"Theme",size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:S(Fxe,{})}),children:S(Mz,{align:"stretch",children:owe.map(o=>S(Ro,{style:{width:"6rem"},leftIcon:r===o?S(ck,{}):void 0,size:"sm",onClick:()=>i(o),children:o.charAt(0).toUpperCase()+o.slice(1)},o))})})}const swe=rt([Vu],e=>{const{isProcessing:t,model_list:n}=e,r=We.map(n,(a,s)=>s),i=We.reduce(n,(a,s,l)=>(s.status==="active"&&(a=l),a),""),o=n[i].description;return{models:r,activeModel:i,isProcessing:t,activeDesc:o}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),lwe=()=>{const e=De(),{models:t,activeModel:n,isProcessing:r,activeDesc:i}=ye(swe);return S(bt,{style:{paddingLeft:"0.3rem"},children:S(Is,{style:{fontSize:"0.8rem"},tooltip:i,isDisabled:r,value:n,validValues:t,onChange:a=>{e(KH(a.target.value))}})})},uwe=()=>X("div",{className:"site-header",children:[X("div",{className:"site-header-left-side",children:[S("img",{src:rV,alt:"invoke-ai-logo"}),X("h1",{children:["invoke ",S("strong",{children:"ai"})]})]}),X("div",{className:"site-header-right-side",children:[S(iwe,{}),S(lwe,{}),S(Xxe,{children:S(Xe,{"aria-label":"Hotkeys",tooltip:"Hotkeys",size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:S(Nxe,{})})}),S(awe,{}),S(Xe,{"aria-label":"Report Bug",tooltip:"Report Bug",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(sh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:S(Lxe,{})})}),S(Xe,{"aria-label":"Link to Github Repo",tooltip:"Github",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(sh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:S(_xe,{})})}),S(Xe,{"aria-label":"Link to Discord Server",tooltip:"Discord",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(sh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:S(Cxe,{})})}),S(nwe,{children:S(Xe,{"aria-label":"Settings",tooltip:"Settings",variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:S(gb,{})})})]})]});var cwe=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ur=globalThis&&globalThis.__assign||function(){return Ur=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},vwe=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],fR="__resizable_base__",iV=function(e){hwe(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(fR):o.className+=fR,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;!o||o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||pwe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),h=u/l[s]*100;return h+"%"}return Xw(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?Xw(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?Xw(r.height):i("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&jp("left",o),s=i&&jp("top",o),l,u;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(l=a?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,g=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,v=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,w=u||0;if(s){var P=(m-b)*this.ratio+w,E=(v-b)*this.ratio+w,_=(h-w)/this.ratio+b,T=(g-w)/this.ratio+b,M=Math.max(h,P),O=Math.min(g,E),I=Math.max(m,_),D=Math.min(v,T);n=w3(n,M,O),r=w3(r,I,D)}else n=w3(n,h,g),r=w3(r,m,v);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&gwe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&C3(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var h=this.window.getComputedStyle(u).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var g={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:gl(gl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(g)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&C3(n))try{n.preventDefault(),n.stopPropagation()}catch(te){}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=C3(n)?n.touches[0].clientX:n.clientX,h=C3(n)?n.touches[0].clientY:n.clientY,g=this.state,m=g.direction,v=g.original,b=g.width,w=g.height,P=this.getParentSize(),E=mwe(P,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=E.maxWidth,a=E.maxHeight,s=E.minWidth,l=E.minHeight;var _=this.calculateNewSizeFromDirection(u,h),T=_.newHeight,M=_.newWidth,O=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(M=dR(M,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=dR(T,this.props.snap.y,this.props.snapGap));var I=this.calculateNewSizeFromAspectRatio(M,T,{width:O.maxWidth,height:O.maxHeight},{width:s,height:l});if(M=I.newWidth,T=I.newHeight,this.props.grid){var D=cR(M,this.props.grid[0]),B=cR(T,this.props.grid[1]),$=this.props.snapGap||0;M=$===0||Math.abs(D-M)<=$?D:M,T=$===0||Math.abs(B-T)<=$?B:T}var H={width:M-v.width,height:T-v.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var j=M/P.width*100;M=j+"%"}else if(b.endsWith("vw")){var ne=M/this.window.innerWidth*100;M=ne+"vw"}else if(b.endsWith("vh")){var V=M/this.window.innerHeight*100;M=V+"vh"}}if(w&&typeof w=="string"){if(w.endsWith("%")){var j=T/P.height*100;T=j+"%"}else if(w.endsWith("vw")){var ne=T/this.window.innerWidth*100;T=ne+"vw"}else if(w.endsWith("vh")){var V=T/this.window.innerHeight*100;T=V+"vh"}}var q={width:this.createSizeForCssProperty(M,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?q.flexBasis=q.width:this.flexDir==="column"&&(q.flexBasis=q.height),Wl.exports.flushSync(function(){r.setState(q)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,H)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:gl(gl({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var h=Object.keys(i).map(function(g){return i[g]!==!1?S(fwe,{direction:g,onResizeStart:n.onResizeStart,replaceStyles:o&&o[g],className:a&&a[g],children:u&&u[g]?u[g]:null},g):null});return S("div",{className:l,style:s,children:h})},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return vwe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=gl(gl(gl({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return X(o,{...gl({ref:this.ref,style:i,className:this.props.className},r),children:[this.state.isResizing&&S("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]})},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(C.exports.PureComponent),ywe=Object.create,oV=Object.defineProperty,Swe=Object.getOwnPropertyDescriptor,bwe=Object.getOwnPropertyNames,xwe=Object.getPrototypeOf,wwe=Object.prototype.hasOwnProperty,Fe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Cwe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bwe(t))!wwe.call(e,i)&&i!==n&&oV(e,i,{get:()=>t[i],enumerable:!(r=Swe(t,i))||r.enumerable});return e},aV=(e,t,n)=>(n=e!=null?ywe(xwe(e)):{},Cwe(t||!e||!e.__esModule?oV(n,"default",{value:e,enumerable:!0}):n,e)),_we=Fe((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),sV=Fe((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),mb=Fe((e,t)=>{var n=sV();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),kwe=Fe((e,t)=>{var n=mb(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),Ewe=Fe((e,t)=>{var n=mb();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),Pwe=Fe((e,t)=>{var n=mb();function r(i){return n(this.__data__,i)>-1}t.exports=r}),Twe=Fe((e,t)=>{var n=mb();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),vb=Fe((e,t)=>{var n=_we(),r=kwe(),i=Ewe(),o=Pwe(),a=Twe();function s(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u{var n=vb();function r(){this.__data__=new n,this.size=0}t.exports=r}),Awe=Fe((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),Mwe=Fe((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),Rwe=Fe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),lV=Fe((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),Uu=Fe((e,t)=>{var n=lV(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),mk=Fe((e,t)=>{var n=Uu(),r=n.Symbol;t.exports=r}),Owe=Fe((e,t)=>{var n=mk(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),h=l[a];try{l[a]=void 0;var g=!0}catch(v){}var m=o.call(l);return g&&(u?l[a]=h:delete l[a]),m}t.exports=s}),Iwe=Fe((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),yb=Fe((e,t)=>{var n=mk(),r=Owe(),i=Iwe(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),uV=Fe((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),cV=Fe((e,t)=>{var n=yb(),r=uV(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var h=n(u);return h==o||h==a||h==i||h==s}t.exports=l}),Dwe=Fe((e,t)=>{var n=Uu(),r=n["__core-js_shared__"];t.exports=r}),Nwe=Fe((e,t)=>{var n=Dwe(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),dV=Fe((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch(a){}try{return o+""}catch(a){}}return""}t.exports=i}),Bwe=Fe((e,t)=>{var n=cV(),r=Nwe(),i=uV(),o=dV(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,h=l.toString,g=u.hasOwnProperty,m=RegExp("^"+h.call(g).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(b){if(!i(b)||r(b))return!1;var w=n(b)?m:s;return w.test(o(b))}t.exports=v}),zwe=Fe((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),R1=Fe((e,t)=>{var n=Bwe(),r=zwe();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),vk=Fe((e,t)=>{var n=R1(),r=Uu(),i=n(r,"Map");t.exports=i}),Sb=Fe((e,t)=>{var n=R1(),r=n(Object,"create");t.exports=r}),Fwe=Fe((e,t)=>{var n=Sb();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),$we=Fe((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),Hwe=Fe((e,t)=>{var n=Sb(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),Wwe=Fe((e,t)=>{var n=Sb(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),Vwe=Fe((e,t)=>{var n=Sb(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),Uwe=Fe((e,t)=>{var n=Fwe(),r=$we(),i=Hwe(),o=Wwe(),a=Vwe();function s(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u{var n=Uwe(),r=vb(),i=vk();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),jwe=Fe((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),bb=Fe((e,t)=>{var n=jwe();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),Ywe=Fe((e,t)=>{var n=bb();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),qwe=Fe((e,t)=>{var n=bb();function r(i){return n(this,i).get(i)}t.exports=r}),Kwe=Fe((e,t)=>{var n=bb();function r(i){return n(this,i).has(i)}t.exports=r}),Xwe=Fe((e,t)=>{var n=bb();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),fV=Fe((e,t)=>{var n=Gwe(),r=Ywe(),i=qwe(),o=Kwe(),a=Xwe();function s(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u{var n=vb(),r=vk(),i=fV(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var h=u.__data__;if(!r||h.length{var n=vb(),r=Lwe(),i=Awe(),o=Mwe(),a=Rwe(),s=Zwe();function l(u){var h=this.__data__=new n(u);this.size=h.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),Jwe=Fe((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),e6e=Fe((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),t6e=Fe((e,t)=>{var n=fV(),r=Jwe(),i=e6e();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),hV=Fe((e,t)=>{var n=t6e(),r=n6e(),i=r6e(),o=1,a=2;function s(l,u,h,g,m,v){var b=h&o,w=l.length,P=u.length;if(w!=P&&!(b&&P>w))return!1;var E=v.get(l),_=v.get(u);if(E&&_)return E==u&&_==l;var T=-1,M=!0,O=h&a?new n:void 0;for(v.set(l,u),v.set(u,l);++T{var n=Uu(),r=n.Uint8Array;t.exports=r}),o6e=Fe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),a6e=Fe((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),s6e=Fe((e,t)=>{var n=mk(),r=i6e(),i=sV(),o=hV(),a=o6e(),s=a6e(),l=1,u=2,h="[object Boolean]",g="[object Date]",m="[object Error]",v="[object Map]",b="[object Number]",w="[object RegExp]",P="[object Set]",E="[object String]",_="[object Symbol]",T="[object ArrayBuffer]",M="[object DataView]",O=n?n.prototype:void 0,I=O?O.valueOf:void 0;function D(B,$,H,j,ne,V,q){switch(H){case M:if(B.byteLength!=$.byteLength||B.byteOffset!=$.byteOffset)return!1;B=B.buffer,$=$.buffer;case T:return!(B.byteLength!=$.byteLength||!V(new r(B),new r($)));case h:case g:case b:return i(+B,+$);case m:return B.name==$.name&&B.message==$.message;case w:case E:return B==$+"";case v:var te=a;case P:var J=j&l;if(te||(te=s),B.size!=$.size&&!J)return!1;var Z=q.get(B);if(Z)return Z==$;j|=u,q.set(B,$);var G=o(te(B),te($),j,ne,V,q);return q.delete(B),G;case _:if(I)return I.call(B)==I.call($)}return!1}t.exports=D}),l6e=Fe((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),u6e=Fe((e,t)=>{var n=l6e(),r=yk();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),c6e=Fe((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),f6e=Fe((e,t)=>{var n=c6e(),r=d6e(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),h6e=Fe((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),p6e=Fe((e,t)=>{var n=yb(),r=xb(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),g6e=Fe((e,t)=>{var n=p6e(),r=xb(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),m6e=Fe((e,t)=>{function n(){return!1}t.exports=n}),pV=Fe((e,t)=>{var n=Uu(),r=m6e(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),v6e=Fe((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a!=null?a:n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),y6e=Fe((e,t)=>{var n=yb(),r=gV(),i=xb(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",h="[object Function]",g="[object Map]",m="[object Number]",v="[object Object]",b="[object RegExp]",w="[object Set]",P="[object String]",E="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",M="[object Float32Array]",O="[object Float64Array]",I="[object Int8Array]",D="[object Int16Array]",B="[object Int32Array]",$="[object Uint8Array]",H="[object Uint8ClampedArray]",j="[object Uint16Array]",ne="[object Uint32Array]",V={};V[M]=V[O]=V[I]=V[D]=V[B]=V[$]=V[H]=V[j]=V[ne]=!0,V[o]=V[a]=V[_]=V[s]=V[T]=V[l]=V[u]=V[h]=V[g]=V[m]=V[v]=V[b]=V[w]=V[P]=V[E]=!1;function q(te){return i(te)&&r(te.length)&&!!V[n(te)]}t.exports=q}),S6e=Fe((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),b6e=Fe((e,t)=>{var n=lV(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch(u){}}();t.exports=s}),mV=Fe((e,t)=>{var n=y6e(),r=S6e(),i=b6e(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),x6e=Fe((e,t)=>{var n=h6e(),r=g6e(),i=yk(),o=pV(),a=v6e(),s=mV(),l=Object.prototype,u=l.hasOwnProperty;function h(g,m){var v=i(g),b=!v&&r(g),w=!v&&!b&&o(g),P=!v&&!b&&!w&&s(g),E=v||b||w||P,_=E?n(g.length,String):[],T=_.length;for(var M in g)(m||u.call(g,M))&&!(E&&(M=="length"||w&&(M=="offset"||M=="parent")||P&&(M=="buffer"||M=="byteLength"||M=="byteOffset")||a(M,T)))&&_.push(M);return _}t.exports=h}),w6e=Fe((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),C6e=Fe((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),_6e=Fe((e,t)=>{var n=C6e(),r=n(Object.keys,Object);t.exports=r}),k6e=Fe((e,t)=>{var n=w6e(),r=_6e(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),E6e=Fe((e,t)=>{var n=cV(),r=gV();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),P6e=Fe((e,t)=>{var n=x6e(),r=k6e(),i=E6e();function o(a){return i(a)?n(a):r(a)}t.exports=o}),T6e=Fe((e,t)=>{var n=u6e(),r=f6e(),i=P6e();function o(a){return n(a,i,r)}t.exports=o}),L6e=Fe((e,t)=>{var n=T6e(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,h,g,m){var v=u&r,b=n(s),w=b.length,P=n(l),E=P.length;if(w!=E&&!v)return!1;for(var _=w;_--;){var T=b[_];if(!(v?T in l:o.call(l,T)))return!1}var M=m.get(s),O=m.get(l);if(M&&O)return M==l&&O==s;var I=!0;m.set(s,l),m.set(l,s);for(var D=v;++_{var n=R1(),r=Uu(),i=n(r,"DataView");t.exports=i}),M6e=Fe((e,t)=>{var n=R1(),r=Uu(),i=n(r,"Promise");t.exports=i}),R6e=Fe((e,t)=>{var n=R1(),r=Uu(),i=n(r,"Set");t.exports=i}),O6e=Fe((e,t)=>{var n=R1(),r=Uu(),i=n(r,"WeakMap");t.exports=i}),I6e=Fe((e,t)=>{var n=A6e(),r=vk(),i=M6e(),o=R6e(),a=O6e(),s=yb(),l=dV(),u="[object Map]",h="[object Object]",g="[object Promise]",m="[object Set]",v="[object WeakMap]",b="[object DataView]",w=l(n),P=l(r),E=l(i),_=l(o),T=l(a),M=s;(n&&M(new n(new ArrayBuffer(1)))!=b||r&&M(new r)!=u||i&&M(i.resolve())!=g||o&&M(new o)!=m||a&&M(new a)!=v)&&(M=function(O){var I=s(O),D=I==h?O.constructor:void 0,B=D?l(D):"";if(B)switch(B){case w:return b;case P:return u;case E:return g;case _:return m;case T:return v}return I}),t.exports=M}),D6e=Fe((e,t)=>{var n=Qwe(),r=hV(),i=s6e(),o=L6e(),a=I6e(),s=yk(),l=pV(),u=mV(),h=1,g="[object Arguments]",m="[object Array]",v="[object Object]",b=Object.prototype,w=b.hasOwnProperty;function P(E,_,T,M,O,I){var D=s(E),B=s(_),$=D?m:a(E),H=B?m:a(_);$=$==g?v:$,H=H==g?v:H;var j=$==v,ne=H==v,V=$==H;if(V&&l(E)){if(!l(_))return!1;D=!0,j=!1}if(V&&!j)return I||(I=new n),D||u(E)?r(E,_,T,M,O,I):i(E,_,$,T,M,O,I);if(!(T&h)){var q=j&&w.call(E,"__wrapped__"),te=ne&&w.call(_,"__wrapped__");if(q||te){var J=q?E.value():E,Z=te?_.value():_;return I||(I=new n),O(J,Z,T,M,I)}}return V?(I||(I=new n),o(E,_,T,M,O,I)):!1}t.exports=P}),N6e=Fe((e,t)=>{var n=D6e(),r=xb();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),vV=Fe((e,t)=>{var n=N6e();function r(i,o){return n(i,o)}t.exports=r}),B6e=["ctrl","shift","alt","meta","mod"],z6e={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function Zw(e,t=","){return typeof e=="string"?e.split(t):e}function av(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>z6e[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!B6e.includes(o));return{...r,keys:i}}function F6e(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function $6e(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function H6e(e){return yV(e,["input","textarea","select"])}function yV({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function W6e(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var V6e=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:h,metaKey:g,shiftKey:m,key:v,code:b}=e,w=b.toLowerCase().replace("key",""),P=v.toLowerCase();if(u!==r&&P!=="alt"||m!==s&&P!=="shift")return!1;if(a){if(!g&&!h)return!1}else if(g!==o&&w!=="meta"||h!==i&&w!=="ctrl")return!1;return l&&l.length===1&&(l.includes(P)||l.includes(w))?!0:l?l.every(E=>n.has(E)):!l},U6e=C.exports.createContext(void 0),G6e=()=>C.exports.useContext(U6e),j6e=C.exports.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),Y6e=()=>C.exports.useContext(j6e),q6e=aV(vV());function K6e(e){let t=C.exports.useRef(void 0);return(0,q6e.default)(t.current,e)||(t.current=e),t.current}var hR=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Ue(e,t,n,r){let i=C.exports.useRef(null),{current:o}=C.exports.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=C.exports.useCallback(t,[...s]),u=K6e(a),{enabledScopes:h}=Y6e(),g=G6e();return C.exports.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!W6e(h,u==null?void 0:u.scopes))return;let m=w=>{var P;if(!(H6e(w)&&!yV(w,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){hR(w);return}((P=w.target)==null?void 0:P.isContentEditable)&&!(u!=null&&u.enableOnContentEditable)||Zw(e,u==null?void 0:u.splitKey).forEach(E=>{var T;let _=av(E,u==null?void 0:u.combinationKey);if(V6e(w,_,o)||((T=_.keys)==null?void 0:T.includes("*"))){if(F6e(w,_,u==null?void 0:u.preventDefault),!$6e(w,_,u==null?void 0:u.enabled)){hR(w);return}l(w,_)}})}},v=w=>{o.add(w.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||(u==null?void 0:u.keydown))&&m(w)},b=w=>{w.key.toLowerCase()!=="meta"?o.delete(w.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(w)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",v),g&&Zw(e,u==null?void 0:u.splitKey).forEach(w=>g.addHotkey(av(w,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",v),g&&Zw(e,u==null?void 0:u.splitKey).forEach(w=>g.removeHotkey(av(w,u==null?void 0:u.combinationKey)))}},[e,l,u,h]),i}aV(vV());var N7=new Set;function X6e(e){(Array.isArray(e)?e:[e]).forEach(t=>N7.add(av(t)))}function Z6e(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=av(t);for(let i of N7)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&N7.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{X6e(e.key)}),document.addEventListener("keyup",e=>{Z6e(e.key)})});const Q6e=rt(e=>e.system,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),J6e=rt(e=>e.system,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),eCe=()=>{const e=De(),t=ye(Q6e),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=ye(J6e),[o,a]=C.exports.useState(!0),s=C.exports.useRef(null);C.exports.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(gH()),e(Nw(!n))};return Ue("`",()=>{e(Nw(!n))},[n]),Ue("esc",()=>{e(Nw(!1))}),X(Rn,{children:[n&&S(iV,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:S("div",{className:"console",ref:s,onScroll:()=>{!s.current||o&&s.current.scrollTop{const{timestamp:m,message:v,level:b}=h;return X("div",{className:`console-entry console-${b}-color`,children:[X("p",{className:"console-timestamp",children:[m,":"]}),S("p",{className:"console-message",children:v})]},g)})})}),n&&S(bi,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:S(Ya,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:S(kxe,{}),onClick:()=>a(!o)})}),S(bi,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:S(Ya,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?S(zxe,{}):S(XW,{}),onClick:l})})]})};function tCe(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV||{BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}function nCe(){return X("div",{className:"work-in-progress nodes-work-in-progress",children:[S("h1",{children:"Nodes"}),S("p",{children:"A node based system for the generation of images is under development currently. Stay tuned for updates about this amazing feature."})]})}const rCe=()=>X("div",{className:"work-in-progress post-processing-work-in-progress",children:[S("h1",{children:"Post Processing"}),S("p",{children:"Invoke AI offers a wide variety of post processing features. Image Upscaling and Face Restoration are already available in the WebUI. You can access them from the Advanced Options menu of the Text To Image and Image To Image tabs. You can also process images directly, using the image action buttons above the current image display or in the viewer."}),S("p",{children:"A dedicated UI will be released soon to facilitate more advanced post processing workflows."}),S("p",{children:"The Invoke AI Command Line Interface offers various other features including Embiggen."})]}),iCe=ut({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:S("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),oCe=ut({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),aCe=ut({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),sCe=ut({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:S("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:S("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})});var Yi=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(Yi||{});const lCe={[0]:{text:"This field will take all prompt text, including both content and stylistic terms. While weights can be included in the prompt, standard CLI Commands/parameters will not work.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:"As new invocations are generated, files from the output directory will be displayed here. Generations have additional options to configure new generations.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:"These options will enable alternative processing modes for Invoke. Seamless tiling will work to generate repeating patterns in the output. High Resolution Optimization performs a two-step generation cycle, and should be used at higher resolutions when you desire a more coherent image/composition. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:"Seed values provide an initial set of noise which guide the denoising process, and can be randomized or populated with a seed from a previous invocation. The Threshold feature can be used to mitigate undesirable outcomes at higher CFG values (try between 0-10), and Perlin can be used to add Perlin noise into the denoising process - Both serve to add variation to your outputs. ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:"Try a variation with an amount of between 0 and 1 to change the output image for the set seed - Interesting variations on the seed are found between 0.1 and 0.3.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:"Using ESRGAN you can increase the output resolution without requiring a higher width/height in the initial generation.",href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:"Using GFPGAN or Codeformer, Face Correction will attempt to identify faces in outputs, and correct any defects/abnormalities. Higher strength values will apply a stronger corrective pressure on outputs, resulting in more appealing faces. With Codeformer, a higher fidelity will attempt to preserve the original image, at the expense of face correction strength.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:"Image to Image allows the upload of an initial image, which InvokeAI will use to guide the generation process, along with a prompt. A lower value for this setting will more closely resemble the original image. Values between 0-1 are accepted, and a range of .25-.75 is recommended ",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:"The bounding box is analogous to the Width and Height settings for Text to Image or Image to Image. Only the area in the box will be processed.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:"Control the handling of visible seams which may occur when a generated image is pasted back onto the canvas.",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:"Manage infill methods (used on masked or erased areas of the canvas) and scaling (useful for small bounding box sizes).",href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}},uCe=rt(e=>e.options,e=>({facetoolStrength:e.facetoolStrength,facetoolType:e.facetoolType,codeformerFidelity:e.codeformerFidelity}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),cCe=rt(e=>e.system,e=>({isGFPGANAvailable:e.isGFPGANAvailable}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),Sk=()=>{const e=De(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r}=ye(uCe),{isGFPGANAvailable:i}=ye(cCe),o=l=>e(a5(l)),a=l=>e(X$(l)),s=l=>e(s5(l.target.value));return X(bt,{direction:"column",gap:2,children:[S(Is,{label:"Type",validValues:l4e.concat(),value:n,onChange:s}),S(Ds,{isDisabled:!i,label:"Strength",step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&S(Ds,{isDisabled:!i,label:"Fidelity",step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})};function SV(){const e=ye(i=>i.system.isGFPGANAvailable),t=ye(i=>i.options.shouldRunFacetool),n=De();return S($a,{isDisabled:!e,isChecked:t,onChange:i=>n(jye(i.target.checked))})}function dCe(){const e=De(),t=ye(r=>r.options.shouldFitToWidthHeight);return S($a,{label:"Fit Initial Image To Output Size",isChecked:t,onChange:r=>e(oH(r.target.checked))})}function fCe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}},{tag:"path",attr:{d:"m11 16 5-4-5-4v3.001H3v2h8z"}}]})(e)}function bk(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z"}},{tag:"path",attr:{d:"M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"}}]})(e)}function hCe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z"}}]})(e)}function pCe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(e)}function gCe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 6H9v3H6v2h3v3h2v-3h3V9h-3z"}},{tag:"path",attr:{d:"M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function mCe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}function Do(e){const[t,n]=C.exports.useState(!1),{label:r,value:i,min:o=1,max:a=100,step:s=1,onChange:l,width:u="100%",tooltipSuffix:h="",withSliderMarks:g=!1,sliderMarkLeftOffset:m=0,sliderMarkRightOffset:v=-7,withInput:b=!1,isInteger:w=!1,inputWidth:P="5rem",inputReadOnly:E=!0,withReset:_=!1,hideTooltip:T=!1,handleReset:M,isResetDisabled:O,isSliderDisabled:I,isInputDisabled:D,styleClass:B,sliderFormControlProps:$,sliderFormLabelProps:H,sliderMarkProps:j,sliderTrackProps:ne,sliderThumbProps:V,sliderNumberInputProps:q,sliderNumberInputFieldProps:te,sliderNumberInputStepperProps:J,sliderTooltipProps:Z,sliderIAIIconButtonProps:G,...ee}=e,[le,me]=C.exports.useState(String(i)),Me=C.exports.useMemo(()=>q!=null&&q.max?q.max:a,[a,q==null?void 0:q.max]);C.exports.useEffect(()=>{String(i)!==le&&le!==""&&me(String(i))},[i,le,me]);const Ce=Ve=>{const Ze=We.clamp(w?Math.floor(Number(Ve.target.value)):Number(Ve.target.value),o,Me);me(String(Ze)),l(Ze)},be=Ve=>{me(String(Ve)),l(Number(Ve))},we=()=>{!M||M()};return X(Td,{className:B?`invokeai__slider-component ${B}`:"invokeai__slider-component","data-markers":g,...$,children:[S(_h,{className:"invokeai__slider-component-label",...H,children:r}),X(Az,{w:"100%",gap:2,children:[X(M_,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:be,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:I,width:u,...ee,children:[g&&X(Rn,{children:[S(i7,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...j,children:o}),S(i7,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:v,...j,children:a})]}),S(g$,{className:"invokeai__slider_track",...ne,children:S(m$,{className:"invokeai__slider_track-filled"})}),S(bi,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${h}`,hidden:T,...Z,children:S(p$,{className:"invokeai__slider-thumb",...V})})]}),b&&X(w_,{min:o,max:Me,step:s,value:le,onChange:be,onBlur:Ce,className:"invokeai__slider-number-field",isDisabled:D,...q,children:[S(C_,{className:"invokeai__slider-number-input",width:P,readOnly:E,...te}),X(ZF,{...J,children:[S(k_,{className:"invokeai__slider-number-stepper"}),S(__,{className:"invokeai__slider-number-stepper"})]})]}),_&&S(Xe,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:S(bk,{}),onClick:we,isDisabled:O,...G})]})]})}function bV(e){const{label:t="Strength",styleClass:n}=e,r=ye(s=>s.options.img2imgStrength),i=De();return S(Do,{label:t,step:.01,min:.01,max:.99,onChange:s=>i(p7(s)),value:r,isInteger:!1,styleClass:n,withInput:!0,withReset:!0,withSliderMarks:!0,inputWidth:"5.5rem",handleReset:()=>{i(p7(.75))}})}const vCe=()=>{const e=De(),t=ye(r=>r.options.hiresFix);return S(bt,{gap:2,direction:"column",children:S($a,{label:"High Res Optimization",fontSize:"md",isChecked:t,onChange:r=>e(Q$(r.target.checked))})})},yCe=()=>{const e=De(),t=ye(r=>r.options.seamless);return S(bt,{gap:2,direction:"column",children:S($a,{label:"Seamless tiling",fontSize:"md",isChecked:t,onChange:r=>e(rH(r.target.checked))})})},xV=()=>X(bt,{gap:2,direction:"column",children:[S(yCe,{}),S(vCe,{})]});function SCe(){const e=De(),t=ye(r=>r.options.shouldRandomizeSeed);return S($a,{label:"Randomize Seed",isChecked:t,onChange:r=>e(Uye(r.target.checked))})}function bCe(){const e=ye(o=>o.options.seed),t=ye(o=>o.options.shouldRandomizeSeed),n=ye(o=>o.options.shouldGenerateVariations),r=De(),i=o=>r(w2(o));return S(Ds,{label:"Seed",step:1,precision:0,flexGrow:1,min:tk,max:nk,isDisabled:t,isInvalid:e<0&&n,onChange:i,value:e,width:"10rem"})}function xCe(){const e=De(),t=ye(r=>r.options.shouldRandomizeSeed);return S(ja,{size:"sm",isDisabled:t,onClick:()=>e(w2(XH(tk,nk))),children:S("p",{children:"Shuffle"})})}function wCe(){const e=De(),t=ye(r=>r.options.threshold);return S(Ds,{label:"Noise Threshold",min:0,max:1e3,step:.1,onChange:r=>e(lH(r)),value:t,isInteger:!1})}function CCe(){const e=De(),t=ye(r=>r.options.perlin);return S(Ds,{label:"Perlin Noise",min:0,max:1,step:.05,onChange:r=>e(tH(r)),value:t,isInteger:!1})}const xk=()=>X(bt,{gap:2,direction:"column",children:[S(SCe,{}),X(bt,{gap:2,children:[S(bCe,{}),S(xCe,{})]}),S(bt,{gap:2,children:S(wCe,{})}),S(bt,{gap:2,children:S(CCe,{})})]}),_Ce=rt(e=>e.options,e=>({upscalingLevel:e.upscalingLevel,upscalingStrength:e.upscalingStrength}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),kCe=rt(e=>e.system,e=>({isESRGANAvailable:e.isESRGANAvailable}),{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),wk=()=>{const e=De(),{upscalingLevel:t,upscalingStrength:n}=ye(_Ce),{isESRGANAvailable:r}=ye(kCe);return X("div",{className:"upscale-options",children:[S(Is,{isDisabled:!r,label:"Scale",value:t,onChange:a=>e(g7(Number(a.target.value))),validValues:s4e}),S(Ds,{isDisabled:!r,label:"Strength",step:.05,min:0,max:1,onChange:a=>e(m7(a)),value:n,isInteger:!1})]})};function wV(){const e=ye(i=>i.system.isESRGANAvailable),t=ye(i=>i.options.shouldRunESRGAN),n=De();return S($a,{isDisabled:!e,isChecked:t,onChange:i=>n(Gye(i.target.checked))})}function Ck(){const e=ye(r=>r.options.shouldGenerateVariations),t=De();return S($a,{isChecked:e,width:"auto",onChange:r=>t($ye(r.target.checked))})}function ECe(e){const{label:t,styleClass:n,isDisabled:r=!1,fontSize:i="1rem",width:o,isInvalid:a,...s}=e;return X(Td,{className:`input ${n}`,isInvalid:a,isDisabled:r,flexGrow:1,children:[S(_h,{fontSize:i,marginBottom:1,whiteSpace:"nowrap",className:"input-label",children:t}),S(X8,{...s,className:"input-entry",size:"sm",width:o})]})}function PCe(){const e=ye(i=>i.options.seedWeights),t=ye(i=>i.options.shouldGenerateVariations),n=De(),r=i=>n(iH(i.target.value));return S(ECe,{label:"Seed Weights",value:e,isInvalid:t&&!(j_(e)||e===""),isDisabled:!t,onChange:r})}function TCe(){const e=ye(i=>i.options.variationAmount),t=ye(i=>i.options.shouldGenerateVariations),n=De();return S(Ds,{label:"Variation Amount",value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i=>n(qye(i)),isInteger:!1})}const _k=()=>X(bt,{gap:2,direction:"column",children:[S(TCe,{}),S(PCe,{})]});function LCe(){const e=De(),t=ye(r=>r.options.cfgScale);return S(Ds,{label:"CFG Scale",step:.5,min:1.01,max:200,onChange:r=>e(K$(r)),value:t,width:"auto",styleClass:"main-option-block",textAlign:"center",isInteger:!1})}function ACe(){const e=ye(i=>i.options.height),t=ye(Tr),n=De();return S(Is,{isDisabled:t==="unifiedCanvas",label:"Height",value:e,flexGrow:1,onChange:i=>n(Z$(Number(i.target.value))),validValues:a4e,styleClass:"main-option-block"})}const MCe=rt([e=>e.options],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:We.isEqual}});function RCe(){const e=De(),{iterations:t}=ye(MCe);return S(Ds,{label:"Images",step:1,min:1,max:9999,onChange:r=>e(zye(r)),value:t,width:"auto",labelFontSize:.5,styleClass:"main-option-block",textAlign:"center"})}function OCe(){const e=ye(r=>r.options.sampler),t=De();return S(Is,{label:"Sampler",value:e,onChange:r=>t(nH(r.target.value)),validValues:i4e,styleClass:"main-option-block"})}function ICe(){const e=De(),t=ye(r=>r.options.steps);return S(Ds,{label:"Steps",min:1,max:9999,step:1,onChange:r=>e(sH(r)),value:t,width:"auto",styleClass:"main-option-block",textAlign:"center"})}function DCe(){const e=ye(i=>i.options.width),t=ye(Tr),n=De();return S(Is,{isDisabled:t==="unifiedCanvas",label:"Width",value:e,flexGrow:1,onChange:i=>n(uH(Number(i.target.value))),validValues:o4e,styleClass:"main-option-block"})}function kk(){return S("div",{className:"main-options",children:X("div",{className:"main-options-list",children:[X("div",{className:"main-options-row",children:[S(RCe,{}),S(ICe,{}),S(LCe,{})]}),X("div",{className:"main-options-row",children:[S(DCe,{}),S(ACe,{}),S(OCe,{})]})]})})}function NCe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function BCe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function CV(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}}]})(e)}function zCe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function FCe(e){return dt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}const $Ce=rt(e=>e.system,e=>e.shouldDisplayGuides),HCe=({children:e,feature:t})=>{const n=ye($Ce),{text:r}=lCe[t];return n?X(E_,{trigger:"hover",children:[S(L_,{children:S(Ld,{children:e})}),X(T_,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[S(P_,{className:"guide-popover-arrow"}),S("div",{className:"guide-popover-guide-content",children:r})]})]}):null},WCe=Pe(({feature:e,icon:t=NCe},n)=>S(HCe,{feature:e,children:S(Ld,{ref:n,children:S(wa,{marginBottom:"-.15rem",as:t})})}));function VCe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return X(Zf,{className:"advanced-settings-item",children:[S(Kf,{className:"advanced-settings-header",children:X(bt,{width:"100%",gap:"0.5rem",align:"center",children:[S(Ld,{flexGrow:1,textAlign:"left",children:t}),i,n&&S(WCe,{feature:n}),S(Xf,{})]})}),S(Qf,{className:"advanced-settings-panel",children:r})]})}const Ek=e=>{const{accordionInfo:t}=e,n=ye(a=>a.system.openAccordions),r=De();return S(OS,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:a=>r(u3e(a)),className:"advanced-settings",children:(()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:h,additionalHeaderComponents:g}=t[s];a.push(S(VCe,{header:l,feature:u,content:h,additionalHeaderComponents:g},s))}),a})()})},Qt=e=>e.canvas,yr=rt([Qt,Tr,Vu],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),_V=e=>e.canvas.layerState.objects.find(x4),kV=rt([e=>e.options,e=>e.system,_V,Tr],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:h}=t;let g=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(g=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(g=!1,m.push("No initial image selected")),u&&(g=!1,m.push("System Busy")),h||(g=!1,m.push("System Disconnected")),o&&(!(j_(a)||a==="")||l===-1)&&(g=!1,m.push("Seed-Weights badly formatted.")),{isReady:g,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:We.isEqual,resultEqualityCheck:We.isEqual}});function Pk(e){const{iconButton:t=!1,...n}=e,r=De(),{isReady:i}=ye(kV),o=ye(Tr),a=()=>{r(C7(o))};return Ue(["ctrl+enter","meta+enter"],()=>{r(C7(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),S("div",{style:{flexGrow:4},children:t?S(Xe,{"aria-label":"Invoke",type:"submit",icon:S($xe,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:"Invoke",tooltipProps:{placement:"bottom"},...n}):S(Ro,{"aria-label":"Invoke",type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const UCe=rt(e=>e.system,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:We.isEqual}});function Tk(e){const{...t}=e,n=De(),{isProcessing:r,isConnected:i,isCancelable:o}=ye(UCe),a=()=>n(J5e());return Ue("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),S(Xe,{icon:S(FCe,{}),tooltip:"Cancel","aria-label":"Cancel",isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const GCe=rt(e=>e.options,e=>e.shouldLoopback),jCe=()=>{const e=De(),t=ye(GCe);return S(Xe,{"aria-label":"Toggle Loopback",tooltip:"Toggle Loopback",styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:S(Wxe,{}),onClick:()=>{e(Wye(!t))}})},Lk=()=>{const e=ye(Tr);return X("div",{className:"process-buttons",children:[S(Pk,{}),e==="img2img"&&S(jCe,{}),S(Tk,{})]})},YCe=rt([e=>e.options,Tr],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:We.isEqual}}),Ak=()=>{const e=De(),{prompt:t,activeTabName:n}=ye(YCe),{isReady:r}=ye(kV),i=C.exports.useRef(null),o=s=>{e(XS(s.target.value))};Ue("alt+a",()=>{var s;(s=i.current)==null||s.focus()},[]);const a=s=>{s.key==="Enter"&&s.shiftKey===!1&&r&&(s.preventDefault(),e(C7(n)))};return S("div",{className:"prompt-bar",children:S(Td,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:S(_$,{id:"prompt",name:"prompt",placeholder:"Type prompt here. [negative tokens], (upweight)++, (downweight)--, swap and blend are available (see docs)",size:"lg",value:t,onChange:o,onKeyDown:a,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})};function EV(e){return dt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function PV(e){return dt({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function qCe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function KCe(e,t){e.classList?e.classList.add(t):qCe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function pR(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function XCe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=pR(e.className,t):e.setAttribute("class",pR(e.className&&e.className.baseVal||"",t))}const gR={disabled:!1},TV=se.createContext(null);var LV=function(t){return t.scrollTop},Mm="unmounted",Nf="exited",Bf="entering",Xp="entered",B7="exiting",Gu=function(e){d_(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=Nf,o.appearStatus=Bf):l=Xp:r.unmountOnExit||r.mountOnEnter?l=Mm:l=Nf,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Mm?{status:Nf}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==Bf&&a!==Xp&&(o=Bf):(a===Bf||a===Xp)&&(o=B7)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===Bf){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Iy.findDOMNode(this);a&&LV(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Nf&&this.setState({status:Mm})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Iy.findDOMNode(this),s],u=l[0],h=l[1],g=this.getTimeouts(),m=s?g.appear:g.enter;if(!i&&!a||gR.disabled){this.safeSetState({status:Xp},function(){o.props.onEntered(u)});return}this.props.onEnter(u,h),this.safeSetState({status:Bf},function(){o.props.onEntering(u,h),o.onTransitionEnd(m,function(){o.safeSetState({status:Xp},function(){o.props.onEntered(u,h)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Iy.findDOMNode(this);if(!o||gR.disabled){this.safeSetState({status:Nf},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:B7},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:Nf},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Iy.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],h=l[1];this.props.addEndListener(u,h)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Mm)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=l_(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return S(TV.Provider,{value:null,children:typeof a=="function"?a(i,s):se.cloneElement(se.Children.only(a),s)})},t}(se.Component);Gu.contextType=TV;Gu.propTypes={};function Yp(){}Gu.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yp,onEntering:Yp,onEntered:Yp,onExit:Yp,onExiting:Yp,onExited:Yp};Gu.UNMOUNTED=Mm;Gu.EXITED=Nf;Gu.ENTERING=Bf;Gu.ENTERED=Xp;Gu.EXITING=B7;const ZCe=Gu;var QCe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return KCe(t,r)})},Qw=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return XCe(t,r)})},Mk=function(e){d_(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ae.options,e=>{const{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}=e;return{shouldShowOptionsPanel:t,shouldHoldOptionsPanelOpen:n,shouldPinOptionsPanel:r,optionsPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),Rk=e=>{const t=De(),{shouldShowOptionsPanel:n,shouldHoldOptionsPanelOpen:r,shouldPinOptionsPanel:i}=ye(JCe),o=C.exports.useRef(null),a=C.exports.useRef(null),s=C.exports.useRef(null),{children:l}=e;Ue("o",()=>{t(_u(!n)),i&&setTimeout(()=>t(ai(!0)),400)},[n,i]),Ue("esc",()=>{t(_u(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Ue("shift+o",()=>{m(),t(ai(!0))},[i]);const u=C.exports.useCallback(()=>{i||(t(Fye(a.current?a.current.scrollTop:0)),t(_u(!1)),t(Hye(!1)))},[t,i]),h=()=>{s.current=window.setTimeout(()=>u(),500)},g=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(Vye(!i)),t(ai(!0))};return C.exports.useEffect(()=>{function v(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",v),()=>{document.removeEventListener("mousedown",v)}},[u]),S(AV,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"options-panel-wrapper",children:S("div",{className:"options-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:g,onMouseOver:i?void 0:g,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:S("div",{className:"options-panel-margin",children:X("div",{className:"options-panel",ref:a,onMouseLeave:v=>{v.target!==a.current?g():!i&&h()},children:[S(bi,{label:"Pin Options Panel",children:S("div",{className:"options-panel-pin-button","data-selected":i,onClick:m,children:i?S(EV,{}):S(PV,{})})}),!i&&X("div",{className:"invoke-ai-logo-wrapper",children:[S("img",{src:rV,alt:"invoke-ai-logo"}),X("h1",{children:["invoke ",S("strong",{children:"ai"})]})]}),l]})})})})};function e7e(){const e={seed:{header:"Seed",feature:Yi.SEED,content:S(xk,{})},variations:{header:"Variations",feature:Yi.VARIATIONS,content:S(_k,{}),additionalHeaderComponents:S(Ck,{})},face_restore:{header:"Face Restoration",feature:Yi.FACE_CORRECTION,content:S(Sk,{}),additionalHeaderComponents:S(SV,{})},upscale:{header:"Upscaling",feature:Yi.UPSCALE,content:S(wk,{}),additionalHeaderComponents:S(wV,{})},other:{header:"Other Options",feature:Yi.OTHER,content:S(xV,{})}};return X(Rk,{children:[S(Ak,{}),S(Lk,{}),S(kk,{}),S(bV,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"}),S(dCe,{}),S(Ek,{accordionInfo:e})]})}const Ok=C.exports.createContext(null),t7e=e=>{const{styleClass:t}=e,n=C.exports.useContext(Ok),r=()=>{n&&n()};return S("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:X("div",{className:"image-upload-button",children:[S(pb,{}),S(ah,{size:"lg",children:"Click or Drag and Drop"})]})})},n7e=rt(e=>e.system,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),z7=C.exports.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Hv(),a=De(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=ye(n7e),h=C.exports.useRef(null),g=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(Q5e(e)),o()};Ue("delete",()=>{s?i():m()},[e,s]);const v=b=>a(pH(!b.target.checked));return X(Rn,{children:[C.exports.cloneElement(t,{onClick:e?g:void 0,ref:n}),S(qF,{isOpen:r,leastDestructiveRef:h,onClose:o,children:S(u1,{children:X(KF,{className:"modal",children:[S(US,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),S(jv,{children:X(bt,{direction:"column",gap:5,children:[S(Mo,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),S(Td,{children:X(bt,{alignItems:"center",children:[S(_h,{mb:0,children:"Don't ask me again"}),S(R_,{checked:!s,onChange:v})]})})]})}),X(VS,{children:[S(ja,{ref:h,onClick:o,className:"modal-close-btn",children:"Cancel"}),S(ja,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})}),r7e=rt([e=>e.system,e=>e.options,e=>e.gallery,Tr],(e,t,n,r)=>{const{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s}=e,{upscalingLevel:l,facetoolStrength:u,shouldShowImageDetails:h,isLightBoxOpen:g}=t,{intermediateImage:m,currentImage:v}=n;return{isProcessing:i,isConnected:o,isGFPGANAvailable:a,isESRGANAvailable:s,upscalingLevel:l,facetoolStrength:u,shouldDisableToolbarButtons:Boolean(m)||!v,currentImage:v,shouldShowImageDetails:h,activeTabName:r,isLightBoxOpen:g}},{memoizeOptions:{resultEqualityCheck:ii.exports.isEqual}}),MV=()=>{var D,B,$,H,j,ne;const e=De(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightBoxOpen:h,activeTabName:g}=ye(r7e),m=x2(),v=()=>{!u||(h&&e(Cu(!1)),e(T1(u)),e(Lo("img2img")))},b=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:"Image Link Copied",status:"success",duration:2500,isClosable:!0})})};Ue("shift+i",()=>{u?(v(),m({title:"Sent To Image To Image",status:"success",duration:2500,isClosable:!0})):m({title:"No Image Loaded",description:"No image found to send to image to image module.",status:"error",duration:2500,isClosable:!0})},[u]);const w=()=>{var V,q;!u||(u.metadata&&e(Dye(u.metadata)),((V=u.metadata)==null?void 0:V.image.type)==="img2img"?e(Lo("img2img")):((q=u.metadata)==null?void 0:q.image.type)==="txt2img"&&e(Lo("txt2img")))};Ue("a",()=>{var V,q;["txt2img","img2img"].includes((q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)==null?void 0:q.type)?(w(),m({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})):m({title:"Parameters Not Set",description:"No metadata found for this image.",status:"error",duration:2500,isClosable:!0})},[u]);const P=()=>{u!=null&&u.metadata&&e(w2(u.metadata.image.seed))};Ue("s",()=>{var V,q;(q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)!=null&&q.seed?(P(),m({title:"Seed Set",status:"success",duration:2500,isClosable:!0})):m({title:"Seed Not Set",description:"Could not find seed for this image.",status:"error",duration:2500,isClosable:!0})},[u]);const E=()=>{var V,q;return((q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)==null?void 0:q.prompt)&&e(XS(u.metadata.image.prompt))};Ue("p",()=>{var V,q;(q=(V=u==null?void 0:u.metadata)==null?void 0:V.image)!=null&&q.prompt?(E(),m({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})):m({title:"Prompt Not Set",description:"Could not find prompt for this image.",status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{u&&e(X5e(u))};Ue("Shift+U",()=>{i&&!s&&n&&!t&&o?_():m({title:"Upscaling Failed",status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const T=()=>{u&&e(Z5e(u))};Ue("Shift+R",()=>{r&&!s&&n&&!t&&a?T():m({title:"Face Restoration Failed",status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const M=()=>e(aH(!l)),O=()=>{!u||(h&&e(Cu(!1)),e(QS(u)),e(ai(!0)),g!=="unifiedCanvas"&&e(Lo("unifiedCanvas")),m({title:"Sent to Unified Canvas",status:"success",duration:2500,isClosable:!0}))};Ue("i",()=>{u?M():m({title:"Failed to load metadata",status:"error",duration:2500,isClosable:!0})},[u,l]);const I=()=>{e(Cu(!h))};return X("div",{className:"current-image-options",children:[X(ji,{isAttached:!0,children:[S(Dl,{trigger:"hover",triggerComponent:S(Xe,{"aria-label":"Send to...",icon:S(Gxe,{})}),children:X("div",{className:"current-image-send-to-popover",children:[S(Ro,{size:"sm",onClick:v,leftIcon:S(aR,{}),children:"Send to Image to Image"}),S(Ro,{size:"sm",onClick:O,leftIcon:S(aR,{}),children:"Send to Unified Canvas"}),S(Ro,{size:"sm",onClick:b,leftIcon:S(k2,{}),children:"Copy Link to Image"}),S(Ro,{leftIcon:S(dk,{}),size:"sm",children:S(sh,{download:!0,href:u==null?void 0:u.url,children:"Download Image"})})]})}),S(Xe,{icon:S(Mxe,{}),tooltip:h?"Close Viewer (Z)":"Open In Viewer (Z)","aria-label":h?"Close Viewer (Z)":"Open In Viewer (Z)","data-selected":h,onClick:I})]}),X(ji,{isAttached:!0,children:[S(Xe,{icon:S(Hxe,{}),tooltip:"Use Prompt (P)","aria-label":"Use Prompt (P)",isDisabled:!((B=(D=u==null?void 0:u.metadata)==null?void 0:D.image)!=null&&B.prompt),onClick:E}),S(Xe,{icon:S(Uxe,{}),tooltip:"Use Seed (S)","aria-label":"Use Seed (S)",isDisabled:!((H=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&H.seed),onClick:P}),S(Xe,{icon:S(Txe,{}),tooltip:"Use All (A)","aria-label":"Use All (A)",isDisabled:!["txt2img","img2img"].includes((ne=(j=u==null?void 0:u.metadata)==null?void 0:j.image)==null?void 0:ne.type),onClick:w})]}),X(ji,{isAttached:!0,children:[S(Dl,{trigger:"hover",triggerComponent:S(Xe,{icon:S(Ixe,{}),"aria-label":"Restore Faces"}),children:X("div",{className:"current-image-postprocessing-popover",children:[S(Sk,{}),S(Ro,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:T,children:"Restore Faces"})]})}),S(Dl,{trigger:"hover",triggerComponent:S(Xe,{icon:S(Axe,{}),"aria-label":"Upscale"}),children:X("div",{className:"current-image-postprocessing-popover",children:[S(wk,{}),S(Ro,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:_,children:"Upscale Image"})]})})]}),S(ji,{isAttached:!0,children:S(Xe,{icon:S(XW,{}),tooltip:"Info (I)","aria-label":"Info (I)","data-selected":l,onClick:M})}),S(z7,{image:u,children:S(Xe,{icon:S(Ih,{}),tooltip:"Delete Image","aria-label":"Delete Image",isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};ut({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});ut({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});ut({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});ut({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});ut({displayName:"SunIcon",path:X("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor",children:[S("circle",{cx:"12",cy:"12",r:"5"}),S("path",{d:"M12 1v2"}),S("path",{d:"M12 21v2"}),S("path",{d:"M4.22 4.22l1.42 1.42"}),S("path",{d:"M18.36 18.36l1.42 1.42"}),S("path",{d:"M1 12h2"}),S("path",{d:"M21 12h2"}),S("path",{d:"M4.22 19.78l1.42-1.42"}),S("path",{d:"M18.36 5.64l1.42-1.42"})]})});ut({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});ut({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:S("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});ut({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});ut({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});ut({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});ut({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});ut({displayName:"ViewIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),S("circle",{cx:"12",cy:"12",r:"2"})]})});ut({displayName:"ViewOffIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),S("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"})]})});ut({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});ut({displayName:"DeleteIcon",path:S("g",{fill:"currentColor",children:S("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})});ut({displayName:"RepeatIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),S("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"})]})});ut({displayName:"RepeatClockIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),S("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"})]})});ut({displayName:"EditIcon",path:X("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[S("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),S("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})});ut({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});ut({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});ut({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});ut({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});ut({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});ut({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});ut({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});ut({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});ut({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var RV=ut({displayName:"ExternalLinkIcon",path:X("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[S("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),S("path",{d:"M15 3h6v6"}),S("path",{d:"M10 14L21 3"})]})});ut({displayName:"LinkIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),S("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"})]})});ut({displayName:"PlusSquareIcon",path:X("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[S("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),S("path",{d:"M12 8v8"}),S("path",{d:"M8 12h8"})]})});ut({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});ut({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});ut({displayName:"TimeIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),S("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"})]})});ut({displayName:"ArrowRightIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),S("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"})]})});ut({displayName:"ArrowLeftIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),S("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"})]})});ut({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});ut({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});ut({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});ut({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});ut({displayName:"EmailIcon",path:X("g",{fill:"currentColor",children:[S("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),S("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"})]})});ut({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});ut({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});ut({displayName:"SpinnerIcon",path:X(Rn,{children:[S("defs",{children:X("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a",children:[S("stop",{stopColor:"currentColor",offset:"0%"}),S("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"})]})}),X("g",{transform:"translate(2)",fill:"none",children:[S("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),S("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),S("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})]})]})});ut({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});ut({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:S("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});ut({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});ut({d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z",displayName:"TriangleDownIcon"});ut({d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z",displayName:"TriangleUpIcon"});ut({displayName:"InfoOutlineIcon",path:X("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2",children:[S("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),S("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),S("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"})]})});ut({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});ut({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});ut({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});ut({displayName:"QuestionOutlineIcon",path:X("g",{stroke:"currentColor",strokeWidth:"1.5",children:[S("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),S("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),S("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]})});ut({d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z",displayName:"WarningIcon"});ut({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});ut({viewBox:"0 0 14 14",path:S("g",{fill:"currentColor",children:S("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});ut({displayName:"MinusIcon",path:S("g",{fill:"currentColor",children:S("rect",{height:"4",width:"20",x:"2",y:"10"})})});ut({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function i7e(e){return dt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const Nn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>X(bt,{gap:2,children:[n&&S(bi,{label:`Recall ${e}`,children:S(Ya,{"aria-label":"Use this parameter",icon:S(i7e,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&S(bi,{label:`Copy ${e}`,children:S(Ya,{"aria-label":`Copy ${e}`,icon:S(k2,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),X(bt,{direction:i?"column":"row",children:[X(Mo,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?X(sh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",S(RV,{mx:"2px"})]}):S(Mo,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),o7e=(e,t)=>e.image.uuid===t.image.uuid,OV=C.exports.memo(({image:e,styleClass:t})=>{var H,j;const n=De();Ue("esc",()=>{n(aH(!1))});const r=((H=e==null?void 0:e.metadata)==null?void 0:H.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:h,orig_path:g,perlin:m,postprocessing:v,prompt:b,sampler:w,scale:P,seamless:E,seed:_,steps:T,strength:M,threshold:O,type:I,variations:D,width:B}=r,$=JSON.stringify(e.metadata,null,2);return S("div",{className:`image-metadata-viewer ${t}`,children:X(bt,{gap:1,direction:"column",width:"100%",children:[X(bt,{gap:2,children:[S(Mo,{fontWeight:"semibold",children:"File:"}),X(sh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,S(RV,{mx:"2px"})]})]}),Object.keys(r).length>0?X(Rn,{children:[I&&S(Nn,{label:"Generation type",value:I}),((j=e.metadata)==null?void 0:j.model_weights)&&S(Nn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(I)&&S(Nn,{label:"Original image",value:g}),I==="gfpgan"&&M!==void 0&&S(Nn,{label:"Fix faces strength",value:M,onClick:()=>n(a5(M))}),I==="esrgan"&&P!==void 0&&S(Nn,{label:"Upscaling scale",value:P,onClick:()=>n(g7(P))}),I==="esrgan"&&M!==void 0&&S(Nn,{label:"Upscaling strength",value:M,onClick:()=>n(m7(M))}),b&&S(Nn,{label:"Prompt",labelPosition:"top",value:o5(b),onClick:()=>n(XS(b))}),_!==void 0&&S(Nn,{label:"Seed",value:_,onClick:()=>n(w2(_))}),O!==void 0&&S(Nn,{label:"Noise Threshold",value:O,onClick:()=>n(lH(O))}),m!==void 0&&S(Nn,{label:"Perlin Noise",value:m,onClick:()=>n(tH(m))}),w&&S(Nn,{label:"Sampler",value:w,onClick:()=>n(nH(w))}),T&&S(Nn,{label:"Steps",value:T,onClick:()=>n(sH(T))}),o!==void 0&&S(Nn,{label:"CFG scale",value:o,onClick:()=>n(K$(o))}),D&&D.length>0&&S(Nn,{label:"Seed-weight pairs",value:b4(D),onClick:()=>n(iH(b4(D)))}),E&&S(Nn,{label:"Seamless",value:E,onClick:()=>n(rH(E))}),l&&S(Nn,{label:"High Resolution Optimization",value:l,onClick:()=>n(Q$(l))}),B&&S(Nn,{label:"Width",value:B,onClick:()=>n(uH(B))}),s&&S(Nn,{label:"Height",value:s,onClick:()=>n(Z$(s))}),u&&S(Nn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(T1(u))}),h&&S(Nn,{label:"Mask image",value:h,isLink:!0,onClick:()=>n(eH(h))}),I==="img2img"&&M&&S(Nn,{label:"Image to image strength",value:M,onClick:()=>n(p7(M))}),a&&S(Nn,{label:"Image to image fit",value:a,onClick:()=>n(oH(a))}),v&&v.length>0&&X(Rn,{children:[S(ah,{size:"sm",children:"Postprocessing"}),v.map((ne,V)=>{if(ne.type==="esrgan"){const{scale:q,strength:te}=ne;return X(bt,{pl:"2rem",gap:1,direction:"column",children:[S(Mo,{size:"md",children:`${V+1}: Upscale (ESRGAN)`}),S(Nn,{label:"Scale",value:q,onClick:()=>n(g7(q))}),S(Nn,{label:"Strength",value:te,onClick:()=>n(m7(te))})]},V)}else if(ne.type==="gfpgan"){const{strength:q}=ne;return X(bt,{pl:"2rem",gap:1,direction:"column",children:[S(Mo,{size:"md",children:`${V+1}: Face restoration (GFPGAN)`}),S(Nn,{label:"Strength",value:q,onClick:()=>{n(a5(q)),n(s5("gfpgan"))}})]},V)}else if(ne.type==="codeformer"){const{strength:q,fidelity:te}=ne;return X(bt,{pl:"2rem",gap:1,direction:"column",children:[S(Mo,{size:"md",children:`${V+1}: Face restoration (Codeformer)`}),S(Nn,{label:"Strength",value:q,onClick:()=>{n(a5(q)),n(s5("codeformer"))}}),te&&S(Nn,{label:"Fidelity",value:te,onClick:()=>{n(X$(te)),n(s5("codeformer"))}})]},V)}})]}),i&&S(Nn,{withCopy:!0,label:"Dream Prompt",value:i}),X(bt,{gap:2,direction:"column",children:[X(bt,{gap:2,children:[S(bi,{label:"Copy metadata JSON",children:S(Ya,{"aria-label":"Copy metadata JSON",icon:S(k2,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText($)})}),S(Mo,{fontWeight:"semibold",children:"Metadata JSON:"})]}),S("div",{className:"image-json-viewer",children:S("pre",{children:$})})]})]}):S(kz,{width:"100%",pt:10,children:S(Mo,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},o7e),IV=rt([e=>e.gallery,e=>e.options],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var h;return u.uuid===((h=e==null?void 0:e.currentImage)==null?void 0:h.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:We.isEqual}});function a7e(){const e=De(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=ye(IV),[a,s]=C.exports.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},h=()=>{e(K_())},g=()=>{e(q_())};return X("div",{className:"current-image-preview",children:[i&&S(DS,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&X("div",{className:"current-image-next-prev-buttons",children:[S("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&S(Ya,{"aria-label":"Previous image",icon:S(YW,{className:"next-prev-button"}),variant:"unstyled",onClick:h})}),S("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&S(Ya,{"aria-label":"Next image",icon:S(qW,{className:"next-prev-button"}),variant:"unstyled",onClick:g})})]}),r&&i&&S(OV,{image:i,styleClass:"current-image-metadata"})]})}const s7e=rt([e=>e.gallery,e=>e.options,Tr],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),DV=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=ye(s7e);return S("div",{className:"current-image-area","data-tab-name":t,children:e?X(Rn,{children:[S(MV,{}),S(a7e,{})]}):S("div",{className:"current-image-display-placeholder",children:S(zCe,{})})})},l7e=()=>{const e=C.exports.useContext(Ok);return S(Xe,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:S(pb,{}),onClick:e||void 0})};function u7e(){const e=ye(i=>i.options.initialImage),t=De(),n=x2(),r=()=>{n({title:"Problem loading parameters",description:"Unable to load init image.",status:"error",isClosable:!0}),t(q$())};return X(Rn,{children:[X("div",{className:"init-image-preview-header",children:[S("h2",{children:"Initial Image"}),S(l7e,{})]}),e&&S("div",{className:"init-image-preview",children:S(DS,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:r})})]})}const c7e=()=>{const e=ye(r=>r.options.initialImage),{currentImage:t}=ye(r=>r.gallery);return X("div",{className:"workarea-split-view",children:[S("div",{className:"workarea-split-view-left",children:e?S("div",{className:"image-to-image-area",children:S(u7e,{})}):S(t7e,{})}),t&&S("div",{className:"workarea-split-view-right",children:S(DV,{})})]})};function d7e(e){return dt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}function Xn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function E2(e,t=[]){let n=[];function r(o,a){const s=C.exports.createContext(a),l=n.length;n=[...n,a];function u(g){const{scope:m,children:v,...b}=g,w=(m==null?void 0:m[e][l])||s,P=C.exports.useMemo(()=>b,Object.values(b));return C.exports.createElement(w.Provider,{value:P},v)}function h(g,m){const v=(m==null?void 0:m[e][l])||s,b=C.exports.useContext(v);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,h]}const i=()=>{const o=n.map(a=>C.exports.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return C.exports.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,f7e(i,...t)]}function f7e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const g=l(o)[`__scope${u}`];return{...s,...g}},{});return C.exports.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function h7e(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function NV(...e){return t=>e.forEach(n=>h7e(n,t))}function Xa(...e){return C.exports.useCallback(NV(...e),e)}const Zv=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e,i=C.exports.Children.toArray(n),o=i.find(g7e);if(o){const a=o.props.children,s=i.map(l=>l===o?C.exports.Children.count(a)>1?C.exports.Children.only(null):C.exports.isValidElement(a)?a.props.children:null:l);return C.exports.createElement(F7,On({},r,{ref:t}),C.exports.isValidElement(a)?C.exports.cloneElement(a,void 0,s):null)}return C.exports.createElement(F7,On({},r,{ref:t}),n)});Zv.displayName="Slot";const F7=C.exports.forwardRef((e,t)=>{const{children:n,...r}=e;return C.exports.isValidElement(n)?C.exports.cloneElement(n,{...m7e(r,n.props),ref:NV(t,n.ref)}):C.exports.Children.count(n)>1?C.exports.Children.only(null):null});F7.displayName="SlotClone";const p7e=({children:e})=>C.exports.createElement(C.exports.Fragment,null,e);function g7e(e){return C.exports.isValidElement(e)&&e.type===p7e}function m7e(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const v7e=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Iu=v7e.reduce((e,t)=>{const n=C.exports.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Zv:t;return C.exports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),C.exports.createElement(s,On({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function BV(e,t){e&&Wl.exports.flushSync(()=>e.dispatchEvent(t))}function zV(e){const t=e+"CollectionProvider",[n,r]=E2(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:b,children:w}=v,P=se.useRef(null),E=se.useRef(new Map).current;return se.createElement(i,{scope:b,itemMap:E,collectionRef:P},w)},s=e+"CollectionSlot",l=se.forwardRef((v,b)=>{const{scope:w,children:P}=v,E=o(s,w),_=Xa(b,E.collectionRef);return se.createElement(Zv,{ref:_},P)}),u=e+"CollectionItemSlot",h="data-radix-collection-item",g=se.forwardRef((v,b)=>{const{scope:w,children:P,...E}=v,_=se.useRef(null),T=Xa(b,_),M=o(u,w);return se.useEffect(()=>(M.itemMap.set(_,{ref:_,...E}),()=>void M.itemMap.delete(_))),se.createElement(Zv,{[h]:"",ref:T},P)});function m(v){const b=o(e+"CollectionConsumer",v);return se.useCallback(()=>{const P=b.collectionRef.current;if(!P)return[];const E=Array.from(P.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((M,O)=>E.indexOf(M.ref.current)-E.indexOf(O.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:g},m,r]}const y7e=C.exports.createContext(void 0);function FV(e){const t=C.exports.useContext(y7e);return e||t||"ltr"}function $l(e){const t=C.exports.useRef(e);return C.exports.useEffect(()=>{t.current=e}),C.exports.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function S7e(e,t=globalThis==null?void 0:globalThis.document){const n=$l(e);C.exports.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const $7="dismissableLayer.update",b7e="dismissableLayer.pointerDownOutside",x7e="dismissableLayer.focusOutside";let mR;const w7e=C.exports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),C7e=C.exports.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,h=C.exports.useContext(w7e),[g,m]=C.exports.useState(null),v=(n=g==null?void 0:g.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=C.exports.useState({}),w=Xa(t,B=>m(B)),P=Array.from(h.layers),[E]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),_=P.indexOf(E),T=g?P.indexOf(g):-1,M=h.layersWithOutsidePointerEventsDisabled.size>0,O=T>=_,I=_7e(B=>{const $=B.target,H=[...h.branches].some(j=>j.contains($));!O||H||(o==null||o(B),s==null||s(B),B.defaultPrevented||l==null||l())},v),D=k7e(B=>{const $=B.target;[...h.branches].some(j=>j.contains($))||(a==null||a(B),s==null||s(B),B.defaultPrevented||l==null||l())},v);return S7e(B=>{T===h.layers.size-1&&(i==null||i(B),!B.defaultPrevented&&l&&(B.preventDefault(),l()))},v),C.exports.useEffect(()=>{if(!!g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(mR=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),vR(),()=>{r&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=mR)}},[g,v,r,h]),C.exports.useEffect(()=>()=>{!g||(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),vR())},[g,h]),C.exports.useEffect(()=>{const B=()=>b({});return document.addEventListener($7,B),()=>document.removeEventListener($7,B)},[]),C.exports.createElement(Iu.div,On({},u,{ref:w,style:{pointerEvents:M?O?"auto":"none":void 0,...e.style},onFocusCapture:Xn(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Xn(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Xn(e.onPointerDownCapture,I.onPointerDownCapture)}))});function _7e(e,t=globalThis==null?void 0:globalThis.document){const n=$l(e),r=C.exports.useRef(!1),i=C.exports.useRef(()=>{});return C.exports.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){$V(b7e,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function k7e(e,t=globalThis==null?void 0:globalThis.document){const n=$l(e),r=C.exports.useRef(!1);return C.exports.useEffect(()=>{const i=o=>{o.target&&!r.current&&$V(x7e,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vR(){const e=new CustomEvent($7);document.dispatchEvent(e)}function $V(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?BV(i,o):i.dispatchEvent(o)}let Jw=0;function E7e(){C.exports.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:yR()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:yR()),Jw++,()=>{Jw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Jw--}},[])}function yR(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const e6="focusScope.autoFocusOnMount",t6="focusScope.autoFocusOnUnmount",SR={bubbles:!1,cancelable:!0},P7e=C.exports.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=C.exports.useState(null),u=$l(i),h=$l(o),g=C.exports.useRef(null),m=Xa(t,w=>l(w)),v=C.exports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.exports.useEffect(()=>{if(r){let w=function(E){if(v.paused||!s)return;const _=E.target;s.contains(_)?g.current=_:zf(g.current,{select:!0})},P=function(E){v.paused||!s||s.contains(E.relatedTarget)||zf(g.current,{select:!0})};return document.addEventListener("focusin",w),document.addEventListener("focusout",P),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",P)}}},[r,s,v.paused]),C.exports.useEffect(()=>{if(s){xR.add(v);const w=document.activeElement;if(!s.contains(w)){const E=new CustomEvent(e6,SR);s.addEventListener(e6,u),s.dispatchEvent(E),E.defaultPrevented||(T7e(O7e(HV(s)),{select:!0}),document.activeElement===w&&zf(s))}return()=>{s.removeEventListener(e6,u),setTimeout(()=>{const E=new CustomEvent(t6,SR);s.addEventListener(t6,h),s.dispatchEvent(E),E.defaultPrevented||zf(w!=null?w:document.body,{select:!0}),s.removeEventListener(t6,h),xR.remove(v)},0)}}},[s,u,h,v]);const b=C.exports.useCallback(w=>{if(!n&&!r||v.paused)return;const P=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,E=document.activeElement;if(P&&E){const _=w.currentTarget,[T,M]=L7e(_);T&&M?!w.shiftKey&&E===M?(w.preventDefault(),n&&zf(T,{select:!0})):w.shiftKey&&E===T&&(w.preventDefault(),n&&zf(M,{select:!0})):E===_&&w.preventDefault()}},[n,r,v.paused]);return C.exports.createElement(Iu.div,On({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function T7e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zf(r,{select:t}),document.activeElement!==n)return}function L7e(e){const t=HV(e),n=bR(t,e),r=bR(t.reverse(),e);return[n,r]}function HV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function bR(e,t){for(const n of e)if(!A7e(n,{upTo:t}))return n}function A7e(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function M7e(e){return e instanceof HTMLInputElement&&"select"in e}function zf(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&M7e(e)&&t&&e.select()}}const xR=R7e();function R7e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=wR(e,t),e.unshift(t)},remove(t){var n;e=wR(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function wR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function O7e(e){return e.filter(t=>t.tagName!=="A")}const f1=Boolean(globalThis==null?void 0:globalThis.document)?C.exports.useLayoutEffect:()=>{},I7e=s6["useId".toString()]||(()=>{});let D7e=0;function N7e(e){const[t,n]=C.exports.useState(I7e());return f1(()=>{e||n(r=>r!=null?r:String(D7e++))},[e]),e||(t?`radix-${t}`:"")}function O1(e){return e.split("-")[0]}function wb(e){return e.split("-")[1]}function I1(e){return["top","bottom"].includes(O1(e))?"x":"y"}function Ik(e){return e==="y"?"height":"width"}function CR(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=I1(t),l=Ik(s),u=r[l]/2-i[l]/2,h=O1(t),g=s==="x";let m;switch(h){case"top":m={x:o,y:r.y-i.height};break;case"bottom":m={x:o,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:a};break;case"left":m={x:r.x-i.width,y:a};break;default:m={x:r.x,y:r.y}}switch(wb(t)){case"start":m[s]-=u*(n&&g?-1:1);break;case"end":m[s]+=u*(n&&g?-1:1);break}return m}const B7e=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:h}=CR(l,r,s),g=r,m={},v=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e!=null?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=WV(r),h={x:i,y:o},g=I1(a),m=wb(a),v=Ik(g),b=await l.getDimensions(n),w=g==="y"?"top":"left",P=g==="y"?"bottom":"right",E=s.reference[v]+s.reference[g]-h[g]-s.floating[v],_=h[g]-s.reference[g],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let M=T?g==="y"?T.clientHeight||0:T.clientWidth||0:0;M===0&&(M=s.floating[v]);const O=E/2-_/2,I=u[w],D=M-b[v]-u[P],B=M/2-b[v]/2+O,$=H7(I,B,D),ne=(m==="start"?u[w]:u[P])>0&&B!==$&&s.reference[v]<=s.floating[v]?BH7e[t])}function W7e(e,t,n){n===void 0&&(n=!1);const r=wb(e),i=I1(e),o=Ik(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=T4(a)),{main:a,cross:T4(a)}}const V7e={start:"end",end:"start"};function kR(e){return e.replace(/start|end/g,t=>V7e[t])}const U7e=["top","right","bottom","left"];function G7e(e){const t=T4(e);return[kR(e),t,kR(t)]}const j7e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...b}=e,w=O1(r),E=g||(w===a||!v?[T4(a)]:G7e(a)),_=[a,...E],T=await P4(t,b),M=[];let O=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&M.push(T[w]),h){const{main:$,cross:H}=W7e(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));M.push(T[$],T[H])}if(O=[...O,{placement:r,overflows:M}],!M.every($=>$<=0)){var I,D;const $=((I=(D=i.flip)==null?void 0:D.index)!=null?I:0)+1,H=_[$];if(H)return{data:{index:$,overflows:O},reset:{placement:H}};let j="bottom";switch(m){case"bestFit":{var B;const ne=(B=O.map(V=>[V,V.overflows.filter(q=>q>0).reduce((q,te)=>q+te,0)]).sort((V,q)=>V[1]-q[1])[0])==null?void 0:B[0].placement;ne&&(j=ne);break}case"initialPlacement":j=a;break}if(r!==j)return{reset:{placement:j}}}return{}}}};function ER(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function PR(e){return U7e.some(t=>e[t]>=0)}const Y7e=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=await P4(r,{...n,elementContext:"reference"}),a=ER(o,i.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:PR(a)}}}case"escaped":{const o=await P4(r,{...n,altBoundary:!0}),a=ER(o,i.floating);return{data:{escapedOffsets:a,escaped:PR(a)}}}default:return{}}}}};async function q7e(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=O1(n),s=wb(n),l=I1(n)==="x",u=["left","top"].includes(a)?-1:1,h=o&&l?-1:1,g=typeof t=="function"?t(e):t;let{mainAxis:m,crossAxis:v,alignmentAxis:b}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return s&&typeof b=="number"&&(v=s==="end"?b*-1:b),l?{x:v*h,y:m*u}:{x:m*u,y:v*h}}const K7e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await q7e(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function VV(e){return e==="x"?"y":"x"}const X7e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:P=>{let{x:E,y:_}=P;return{x:E,y:_}}},...l}=e,u={x:n,y:r},h=await P4(t,l),g=I1(O1(i)),m=VV(g);let v=u[g],b=u[m];if(o){const P=g==="y"?"top":"left",E=g==="y"?"bottom":"right",_=v+h[P],T=v-h[E];v=H7(_,v,T)}if(a){const P=m==="y"?"top":"left",E=m==="y"?"bottom":"right",_=b+h[P],T=b-h[E];b=H7(_,b,T)}const w=s.fn({...t,[g]:v,[m]:b});return{...w,data:{x:w.x-n,y:w.y-r}}}}},Z7e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,h={x:n,y:r},g=I1(i),m=VV(g);let v=h[g],b=h[m];const w=typeof s=="function"?s({...o,placement:i}):s,P=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const O=g==="y"?"height":"width",I=o.reference[g]-o.floating[O]+P.mainAxis,D=o.reference[g]+o.reference[O]-P.mainAxis;vD&&(v=D)}if(u){var E,_,T,M;const O=g==="y"?"width":"height",I=["top","left"].includes(O1(i)),D=o.reference[m]-o.floating[O]+(I&&(E=(_=a.offset)==null?void 0:_[m])!=null?E:0)+(I?0:P.crossAxis),B=o.reference[m]+o.reference[O]+(I?0:(T=(M=a.offset)==null?void 0:M[m])!=null?T:0)-(I?P.crossAxis:0);bB&&(b=B)}return{[g]:v,[m]:b}}}};function UV(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function ju(e){if(e==null)return window;if(!UV(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function P2(e){return ju(e).getComputedStyle(e)}function Du(e){return UV(e)?"":e?(e.nodeName||"").toLowerCase():""}function GV(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function Hl(e){return e instanceof ju(e).HTMLElement}function wd(e){return e instanceof ju(e).Element}function Q7e(e){return e instanceof ju(e).Node}function Dk(e){if(typeof ShadowRoot>"u")return!1;const t=ju(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Cb(e){const{overflow:t,overflowX:n,overflowY:r}=P2(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function J7e(e){return["table","td","th"].includes(Du(e))}function jV(e){const t=/firefox/i.test(GV()),n=P2(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)}function YV(){return!/^((?!chrome|android).)*safari/i.test(GV())}const TR=Math.min,sv=Math.max,L4=Math.round;function Nu(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&Hl(e)&&(l=e.offsetWidth>0&&L4(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&L4(s.height)/e.offsetHeight||1);const h=wd(e)?ju(e):window,g=!YV()&&n,m=(s.left+(g&&(r=(i=h.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,v=(s.top+(g&&(o=(a=h.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,w=s.height/u;return{width:b,height:w,top:v,right:m+b,bottom:v+w,left:m,x:m,y:v}}function Nd(e){return((Q7e(e)?e.ownerDocument:e.document)||window.document).documentElement}function _b(e){return wd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function qV(e){return Nu(Nd(e)).left+_b(e).scrollLeft}function e9e(e){const t=Nu(e);return L4(t.width)!==e.offsetWidth||L4(t.height)!==e.offsetHeight}function t9e(e,t,n){const r=Hl(t),i=Nd(t),o=Nu(e,r&&e9e(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Du(t)!=="body"||Cb(i))&&(a=_b(t)),Hl(t)){const l=Nu(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=qV(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function KV(e){return Du(e)==="html"?e:e.assignedSlot||e.parentNode||(Dk(e)?e.host:null)||Nd(e)}function LR(e){return!Hl(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function n9e(e){let t=KV(e);for(Dk(t)&&(t=t.host);Hl(t)&&!["html","body"].includes(Du(t));){if(jV(t))return t;t=t.parentNode}return null}function W7(e){const t=ju(e);let n=LR(e);for(;n&&J7e(n)&&getComputedStyle(n).position==="static";)n=LR(n);return n&&(Du(n)==="html"||Du(n)==="body"&&getComputedStyle(n).position==="static"&&!jV(n))?t:n||n9e(e)||t}function AR(e){if(Hl(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Nu(e);return{width:t.width,height:t.height}}function r9e(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=Hl(n),o=Nd(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Du(n)!=="body"||Cb(o))&&(a=_b(n)),Hl(n))){const l=Nu(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}}function i9e(e,t){const n=ju(e),r=Nd(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=YV();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function o9e(e){var t;const n=Nd(e),r=_b(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=sv(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=sv(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let s=-r.scrollLeft+qV(e);const l=-r.scrollTop;return P2(i||n).direction==="rtl"&&(s+=sv(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function XV(e){const t=KV(e);return["html","body","#document"].includes(Du(t))?e.ownerDocument.body:Hl(t)&&Cb(t)?t:XV(t)}function A4(e,t){var n;t===void 0&&(t=[]);const r=XV(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=ju(r),a=i?[o].concat(o.visualViewport||[],Cb(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(A4(a))}function a9e(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Dk(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function s9e(e,t){const n=Nu(e,!1,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}function MR(e,t,n){return t==="viewport"?E4(i9e(e,n)):wd(t)?s9e(t,n):E4(o9e(Nd(e)))}function l9e(e){const t=A4(e),r=["absolute","fixed"].includes(P2(e).position)&&Hl(e)?W7(e):e;return wd(r)?t.filter(i=>wd(i)&&a9e(i,r)&&Du(i)!=="body"):[]}function u9e(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?l9e(t):[].concat(n),r],s=a[0],l=a.reduce((u,h)=>{const g=MR(t,h,i);return u.top=sv(g.top,u.top),u.right=TR(g.right,u.right),u.bottom=TR(g.bottom,u.bottom),u.left=sv(g.left,u.left),u},MR(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}const c9e={getClippingRect:u9e,convertOffsetParentRelativeRectToViewportRelativeRect:r9e,isElement:wd,getDimensions:AR,getOffsetParent:W7,getDocumentElement:Nd,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:t9e(t,W7(n),r),floating:{...AR(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>P2(e).direction==="rtl"};function d9e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,h=l||u?[...wd(e)?A4(e):[],...A4(t)]:[];h.forEach(w=>{l&&w.addEventListener("scroll",n,{passive:!0}),u&&w.addEventListener("resize",n)});let g=null;if(a){let w=!0;g=new ResizeObserver(()=>{w||n(),w=!1}),wd(e)&&!s&&g.observe(e),g.observe(t)}let m,v=s?Nu(e):null;s&&b();function b(){const w=Nu(e);v&&(w.x!==v.x||w.y!==v.y||w.width!==v.width||w.height!==v.height)&&n(),v=w,m=requestAnimationFrame(b)}return n(),()=>{var w;h.forEach(P=>{l&&P.removeEventListener("scroll",n),u&&P.removeEventListener("resize",n)}),(w=g)==null||w.disconnect(),g=null,s&&cancelAnimationFrame(m)}}const f9e=(e,t,n)=>B7e(e,t,{platform:c9e,...n});var V7=typeof document<"u"?C.exports.useLayoutEffect:C.exports.useEffect;function U7(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!U7(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!U7(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function h9e(e){const t=C.exports.useRef(e);return V7(()=>{t.current=e}),t}function p9e(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=C.exports.useRef(null),a=C.exports.useRef(null),s=h9e(i),l=C.exports.useRef(null),[u,h]=C.exports.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[g,m]=C.exports.useState(t);U7(g==null?void 0:g.map(T=>{let{options:M}=T;return M}),t==null?void 0:t.map(T=>{let{options:M}=T;return M}))||m(t);const v=C.exports.useCallback(()=>{!o.current||!a.current||f9e(o.current,a.current,{middleware:g,placement:n,strategy:r}).then(T=>{b.current&&Wl.exports.flushSync(()=>{h(T)})})},[g,n,r]);V7(()=>{b.current&&v()},[v]);const b=C.exports.useRef(!1);V7(()=>(b.current=!0,()=>{b.current=!1}),[]);const w=C.exports.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const T=s.current(o.current,a.current,v);l.current=T}else v()},[v,s]),P=C.exports.useCallback(T=>{o.current=T,w()},[w]),E=C.exports.useCallback(T=>{a.current=T,w()},[w]),_=C.exports.useMemo(()=>({reference:o,floating:a}),[]);return C.exports.useMemo(()=>({...u,update:v,refs:_,reference:P,floating:E}),[u,v,_,P,E])}const g9e=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?_R({element:t.current,padding:n}).fn(i):{}:t?_R({element:t,padding:n}).fn(i):{}}}};function m9e(e){const[t,n]=C.exports.useState(void 0);return f1(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const ZV="Popper",[Nk,QV]=E2(ZV),[v9e,JV]=Nk(ZV),y9e=e=>{const{__scopePopper:t,children:n}=e,[r,i]=C.exports.useState(null);return C.exports.createElement(v9e,{scope:t,anchor:r,onAnchorChange:i},n)},S9e="PopperAnchor",b9e=C.exports.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=JV(S9e,n),a=C.exports.useRef(null),s=Xa(t,a);return C.exports.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:C.exports.createElement(Iu.div,On({},i,{ref:s}))}),M4="PopperContent",[x9e,$Le]=Nk(M4),[w9e,C9e]=Nk(M4,{hasParent:!1,positionUpdateFns:new Set}),_9e=C.exports.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:h,side:g="bottom",sideOffset:m=0,align:v="center",alignOffset:b=0,arrowPadding:w=0,collisionBoundary:P=[],collisionPadding:E=0,sticky:_="partial",hideWhenDetached:T=!1,avoidCollisions:M=!0,...O}=e,I=JV(M4,h),[D,B]=C.exports.useState(null),$=Xa(t,Et=>B(Et)),[H,j]=C.exports.useState(null),ne=m9e(H),V=(n=ne==null?void 0:ne.width)!==null&&n!==void 0?n:0,q=(r=ne==null?void 0:ne.height)!==null&&r!==void 0?r:0,te=g+(v!=="center"?"-"+v:""),J=typeof E=="number"?E:{top:0,right:0,bottom:0,left:0,...E},Z=Array.isArray(P)?P:[P],G=Z.length>0,ee={padding:J,boundary:Z.filter(E9e),altBoundary:G},{reference:le,floating:me,strategy:Me,x:Ce,y:be,placement:we,middlewareData:Ve,update:Ze}=p9e({strategy:"fixed",placement:te,whileElementsMounted:d9e,middleware:[K7e({mainAxis:m+q,alignmentAxis:b}),M?X7e({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?Z7e():void 0,...ee}):void 0,H?g9e({element:H,padding:w}):void 0,M?j7e({...ee}):void 0,P9e({arrowWidth:V,arrowHeight:q}),T?Y7e({strategy:"referenceHidden"}):void 0].filter(k9e)});f1(()=>{le(I.anchor)},[le,I.anchor]);const it=Ce!==null&&be!==null,[pt,kt]=eU(we),gt=(i=Ve.arrow)===null||i===void 0?void 0:i.x,ht=(o=Ve.arrow)===null||o===void 0?void 0:o.y,vt=((a=Ve.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Te,ot]=C.exports.useState();f1(()=>{D&&ot(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Mt,positionUpdateFns:Je}=C9e(M4,h),mt=!Mt;C.exports.useLayoutEffect(()=>{if(!mt)return Je.add(Ze),()=>{Je.delete(Ze)}},[mt,Je,Ze]),C.exports.useLayoutEffect(()=>{mt&&it&&Array.from(Je).reverse().forEach(Et=>requestAnimationFrame(Et))},[mt,it,Je]);const un={"data-side":pt,"data-align":kt,...O,ref:$,style:{...O.style,animation:it?void 0:"none",opacity:(s=Ve.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return C.exports.createElement("div",{ref:me,"data-radix-popper-content-wrapper":"",style:{position:Me,left:0,top:0,transform:it?`translate3d(${Math.round(Ce)}px, ${Math.round(be)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Te,["--radix-popper-transform-origin"]:[(l=Ve.transformOrigin)===null||l===void 0?void 0:l.x,(u=Ve.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},C.exports.createElement(x9e,{scope:h,placedSide:pt,onArrowChange:j,arrowX:gt,arrowY:ht,shouldHideArrow:vt},mt?C.exports.createElement(w9e,{scope:h,hasParent:!0,positionUpdateFns:Je},C.exports.createElement(Iu.div,un)):C.exports.createElement(Iu.div,un)))});function k9e(e){return e!==void 0}function E9e(e){return e!==null}const P9e=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,g=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=g?0:e.arrowWidth,v=g?0:e.arrowHeight,[b,w]=eU(s),P={start:"0%",center:"50%",end:"100%"}[w],E=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+v/2;let T="",M="";return b==="bottom"?(T=g?P:`${E}px`,M=`${-v}px`):b==="top"?(T=g?P:`${E}px`,M=`${l.floating.height+v}px`):b==="right"?(T=`${-v}px`,M=g?P:`${_}px`):b==="left"&&(T=`${l.floating.width+v}px`,M=g?P:`${_}px`),{data:{x:T,y:M}}}});function eU(e){const[t,n="center"]=e.split("-");return[t,n]}const T9e=y9e,L9e=b9e,A9e=_9e;function M9e(e,t){return C.exports.useReducer((n,r)=>{const i=t[n][r];return i!=null?i:n},e)}const tU=e=>{const{present:t,children:n}=e,r=R9e(t),i=typeof n=="function"?n({present:r.isPresent}):C.exports.Children.only(n),o=Xa(r.ref,i.ref);return typeof n=="function"||r.isPresent?C.exports.cloneElement(i,{ref:o}):null};tU.displayName="Presence";function R9e(e){const[t,n]=C.exports.useState(),r=C.exports.useRef({}),i=C.exports.useRef(e),o=C.exports.useRef("none"),a=e?"mounted":"unmounted",[s,l]=M9e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.exports.useEffect(()=>{const u=k3(r.current);o.current=s==="mounted"?u:"none"},[s]),f1(()=>{const u=r.current,h=i.current;if(h!==e){const m=o.current,v=k3(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(h&&m!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),f1(()=>{if(t){const u=g=>{const v=k3(r.current).includes(g.animationName);g.target===t&&v&&Wl.exports.flushSync(()=>l("ANIMATION_END"))},h=g=>{g.target===t&&(o.current=k3(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:C.exports.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function k3(e){return(e==null?void 0:e.animationName)||"none"}function O9e({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=I9e({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=$l(n),l=C.exports.useCallback(u=>{if(o){const g=typeof u=="function"?u(e):u;g!==e&&s(g)}else i(u)},[o,e,i,s]);return[a,l]}function I9e({defaultProp:e,onChange:t}){const n=C.exports.useState(e),[r]=n,i=C.exports.useRef(r),o=$l(t);return C.exports.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const n6="rovingFocusGroup.onEntryFocus",D9e={bubbles:!1,cancelable:!0},Bk="RovingFocusGroup",[G7,nU,N9e]=zV(Bk),[B9e,rU]=E2(Bk,[N9e]),[z9e,F9e]=B9e(Bk),$9e=C.exports.forwardRef((e,t)=>C.exports.createElement(G7.Provider,{scope:e.__scopeRovingFocusGroup},C.exports.createElement(G7.Slot,{scope:e.__scopeRovingFocusGroup},C.exports.createElement(H9e,On({},e,{ref:t}))))),H9e=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...h}=e,g=C.exports.useRef(null),m=Xa(t,g),v=FV(o),[b=null,w]=O9e({prop:a,defaultProp:s,onChange:l}),[P,E]=C.exports.useState(!1),_=$l(u),T=nU(n),M=C.exports.useRef(!1),[O,I]=C.exports.useState(0);return C.exports.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(n6,_),()=>D.removeEventListener(n6,_)},[_]),C.exports.createElement(z9e,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:b,onItemFocus:C.exports.useCallback(D=>w(D),[w]),onItemShiftTab:C.exports.useCallback(()=>E(!0),[]),onFocusableItemAdd:C.exports.useCallback(()=>I(D=>D+1),[]),onFocusableItemRemove:C.exports.useCallback(()=>I(D=>D-1),[])},C.exports.createElement(Iu.div,On({tabIndex:P||O===0?-1:0,"data-orientation":r},h,{ref:m,style:{outline:"none",...e.style},onMouseDown:Xn(e.onMouseDown,()=>{M.current=!0}),onFocus:Xn(e.onFocus,D=>{const B=!M.current;if(D.target===D.currentTarget&&B&&!P){const $=new CustomEvent(n6,D9e);if(D.currentTarget.dispatchEvent($),!$.defaultPrevented){const H=T().filter(te=>te.focusable),j=H.find(te=>te.active),ne=H.find(te=>te.id===b),q=[j,ne,...H].filter(Boolean).map(te=>te.ref.current);iU(q)}}M.current=!1}),onBlur:Xn(e.onBlur,()=>E(!1))})))}),W9e="RovingFocusGroupItem",V9e=C.exports.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=N7e(),s=F9e(W9e,n),l=s.currentTabStopId===a,u=nU(n),{onFocusableItemAdd:h,onFocusableItemRemove:g}=s;return C.exports.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),C.exports.createElement(G7.ItemSlot,{scope:n,id:a,focusable:r,active:i},C.exports.createElement(Iu.span,On({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:Xn(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:Xn(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:Xn(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=j9e(m,s.orientation,s.dir);if(v!==void 0){m.preventDefault();let w=u().filter(P=>P.focusable).map(P=>P.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const P=w.indexOf(m.currentTarget);w=s.loop?Y9e(w,P+1):w.slice(P+1)}setTimeout(()=>iU(w))}})})))}),U9e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function G9e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function j9e(e,t,n){const r=G9e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return U9e[r]}function iU(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Y9e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const q9e=$9e,K9e=V9e,X9e=["Enter"," "],Z9e=["ArrowDown","PageUp","Home"],oU=["ArrowUp","PageDown","End"],Q9e=[...Z9e,...oU],kb="Menu",[j7,J9e,e8e]=zV(kb),[Dh,aU]=E2(kb,[e8e,QV,rU]),zk=QV(),sU=rU(),[t8e,Eb]=Dh(kb),[n8e,Fk]=Dh(kb),r8e=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=zk(t),[l,u]=C.exports.useState(null),h=C.exports.useRef(!1),g=$l(o),m=FV(i);return C.exports.useEffect(()=>{const v=()=>{h.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>h.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),C.exports.createElement(T9e,s,C.exports.createElement(t8e,{scope:t,open:n,onOpenChange:g,content:l,onContentChange:u},C.exports.createElement(n8e,{scope:t,onClose:C.exports.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:h,dir:m,modal:a},r)))},i8e=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=zk(n);return C.exports.createElement(L9e,On({},i,r,{ref:t}))}),o8e="MenuPortal",[HLe,a8e]=Dh(o8e,{forceMount:void 0}),pd="MenuContent",[s8e,lU]=Dh(pd),l8e=C.exports.forwardRef((e,t)=>{const n=a8e(pd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Eb(pd,e.__scopeMenu),a=Fk(pd,e.__scopeMenu);return C.exports.createElement(j7.Provider,{scope:e.__scopeMenu},C.exports.createElement(tU,{present:r||o.open},C.exports.createElement(j7.Slot,{scope:e.__scopeMenu},a.modal?C.exports.createElement(u8e,On({},i,{ref:t})):C.exports.createElement(c8e,On({},i,{ref:t})))))}),u8e=C.exports.forwardRef((e,t)=>{const n=Eb(pd,e.__scopeMenu),r=C.exports.useRef(null),i=Xa(t,r);return C.exports.useEffect(()=>{const o=r.current;if(o)return oF(o)},[]),C.exports.createElement(uU,On({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Xn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),c8e=C.exports.forwardRef((e,t)=>{const n=Eb(pd,e.__scopeMenu);return C.exports.createElement(uU,On({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),uU=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:g,onDismiss:m,disableOutsideScroll:v,...b}=e,w=Eb(pd,n),P=Fk(pd,n),E=zk(n),_=sU(n),T=J9e(n),[M,O]=C.exports.useState(null),I=C.exports.useRef(null),D=Xa(t,I,w.onContentChange),B=C.exports.useRef(0),$=C.exports.useRef(""),H=C.exports.useRef(0),j=C.exports.useRef(null),ne=C.exports.useRef("right"),V=C.exports.useRef(0),q=v?GF:C.exports.Fragment,te=v?{as:Zv,allowPinchZoom:!0}:void 0,J=G=>{var ee,le;const me=$.current+G,Me=T().filter(it=>!it.disabled),Ce=document.activeElement,be=(ee=Me.find(it=>it.ref.current===Ce))===null||ee===void 0?void 0:ee.textValue,we=Me.map(it=>it.textValue),Ve=S8e(we,me,be),Ze=(le=Me.find(it=>it.textValue===Ve))===null||le===void 0?void 0:le.ref.current;(function it(pt){$.current=pt,window.clearTimeout(B.current),pt!==""&&(B.current=window.setTimeout(()=>it(""),1e3))})(me),Ze&&setTimeout(()=>Ze.focus())};C.exports.useEffect(()=>()=>window.clearTimeout(B.current),[]),E7e();const Z=C.exports.useCallback(G=>{var ee,le;return ne.current===((ee=j.current)===null||ee===void 0?void 0:ee.side)&&x8e(G,(le=j.current)===null||le===void 0?void 0:le.area)},[]);return C.exports.createElement(s8e,{scope:n,searchRef:$,onItemEnter:C.exports.useCallback(G=>{Z(G)&&G.preventDefault()},[Z]),onItemLeave:C.exports.useCallback(G=>{var ee;Z(G)||((ee=I.current)===null||ee===void 0||ee.focus(),O(null))},[Z]),onTriggerLeave:C.exports.useCallback(G=>{Z(G)&&G.preventDefault()},[Z]),pointerGraceTimerRef:H,onPointerGraceIntentChange:C.exports.useCallback(G=>{j.current=G},[])},C.exports.createElement(q,te,C.exports.createElement(P7e,{asChild:!0,trapped:i,onMountAutoFocus:Xn(o,G=>{var ee;G.preventDefault(),(ee=I.current)===null||ee===void 0||ee.focus()}),onUnmountAutoFocus:a},C.exports.createElement(C7e,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:h,onInteractOutside:g,onDismiss:m},C.exports.createElement(q9e,On({asChild:!0},_,{dir:P.dir,orientation:"vertical",loop:r,currentTabStopId:M,onCurrentTabStopIdChange:O,onEntryFocus:G=>{P.isUsingKeyboardRef.current||G.preventDefault()}}),C.exports.createElement(A9e,On({role:"menu","aria-orientation":"vertical","data-state":m8e(w.open),"data-radix-menu-content":"",dir:P.dir},E,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:Xn(b.onKeyDown,G=>{const le=G.target.closest("[data-radix-menu-content]")===G.currentTarget,me=G.ctrlKey||G.altKey||G.metaKey,Me=G.key.length===1;le&&(G.key==="Tab"&&G.preventDefault(),!me&&Me&&J(G.key));const Ce=I.current;if(G.target!==Ce||!Q9e.includes(G.key))return;G.preventDefault();const we=T().filter(Ve=>!Ve.disabled).map(Ve=>Ve.ref.current);oU.includes(G.key)&&we.reverse(),v8e(we)}),onBlur:Xn(e.onBlur,G=>{G.currentTarget.contains(G.target)||(window.clearTimeout(B.current),$.current="")}),onPointerMove:Xn(e.onPointerMove,q7(G=>{const ee=G.target,le=V.current!==G.clientX;if(G.currentTarget.contains(ee)&&le){const me=G.clientX>V.current?"right":"left";ne.current=me,V.current=G.clientX}}))})))))))}),Y7="MenuItem",RR="menu.itemSelect",d8e=C.exports.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=C.exports.useRef(null),a=Fk(Y7,e.__scopeMenu),s=lU(Y7,e.__scopeMenu),l=Xa(t,o),u=C.exports.useRef(!1),h=()=>{const g=o.current;if(!n&&g){const m=new CustomEvent(RR,{bubbles:!0,cancelable:!0});g.addEventListener(RR,v=>r==null?void 0:r(v),{once:!0}),BV(g,m),m.defaultPrevented?u.current=!1:a.onClose()}};return C.exports.createElement(f8e,On({},i,{ref:l,disabled:n,onClick:Xn(e.onClick,h),onPointerDown:g=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,g),u.current=!0},onPointerUp:Xn(e.onPointerUp,g=>{var m;u.current||(m=g.currentTarget)===null||m===void 0||m.click()}),onKeyDown:Xn(e.onKeyDown,g=>{const m=s.searchRef.current!=="";n||m&&g.key===" "||X9e.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})}))}),f8e=C.exports.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=lU(Y7,n),s=sU(n),l=C.exports.useRef(null),u=Xa(t,l),[h,g]=C.exports.useState(!1),[m,v]=C.exports.useState("");return C.exports.useEffect(()=>{const b=l.current;if(b){var w;v(((w=b.textContent)!==null&&w!==void 0?w:"").trim())}},[o.children]),C.exports.createElement(j7.ItemSlot,{scope:n,disabled:r,textValue:i!=null?i:m},C.exports.createElement(K9e,On({asChild:!0},s,{focusable:!r}),C.exports.createElement(Iu.div,On({role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:Xn(e.onPointerMove,q7(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:Xn(e.onPointerLeave,q7(b=>a.onItemLeave(b))),onFocus:Xn(e.onFocus,()=>g(!0)),onBlur:Xn(e.onBlur,()=>g(!1))}))))}),h8e="MenuRadioGroup";Dh(h8e,{value:void 0,onValueChange:()=>{}});const p8e="MenuItemIndicator";Dh(p8e,{checked:!1});const g8e="MenuSub";Dh(g8e);function m8e(e){return e?"open":"closed"}function v8e(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function y8e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function S8e(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=y8e(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function b8e(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=h>r&&n<(u-s)*(r-l)/(h-l)+s&&(i=!i)}return i}function x8e(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return b8e(n,t)}function q7(e){return t=>t.pointerType==="mouse"?e(t):void 0}const w8e=r8e,C8e=i8e,_8e=l8e,k8e=d8e,cU="ContextMenu",[E8e,WLe]=E2(cU,[aU]),Pb=aU(),[P8e,dU]=E8e(cU),T8e=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=C.exports.useState(!1),l=Pb(t),u=$l(r),h=C.exports.useCallback(g=>{s(g),u(g)},[u]);return C.exports.createElement(P8e,{scope:t,open:a,onOpenChange:h,modal:o},C.exports.createElement(w8e,On({},l,{dir:i,open:a,onOpenChange:h,modal:o}),n))},L8e="ContextMenuTrigger",A8e=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=dU(L8e,n),o=Pb(n),a=C.exports.useRef({x:0,y:0}),s=C.exports.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=C.exports.useRef(0),u=C.exports.useCallback(()=>window.clearTimeout(l.current),[]),h=g=>{a.current={x:g.clientX,y:g.clientY},i.onOpenChange(!0)};return C.exports.useEffect(()=>u,[u]),C.exports.createElement(C.exports.Fragment,null,C.exports.createElement(C8e,On({},o,{virtualRef:s})),C.exports.createElement(Iu.span,On({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:Xn(e.onContextMenu,g=>{u(),h(g),g.preventDefault()}),onPointerDown:Xn(e.onPointerDown,E3(g=>{u(),l.current=window.setTimeout(()=>h(g),700)})),onPointerMove:Xn(e.onPointerMove,E3(u)),onPointerCancel:Xn(e.onPointerCancel,E3(u)),onPointerUp:Xn(e.onPointerUp,E3(u))})))}),M8e="ContextMenuContent",R8e=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=dU(M8e,n),o=Pb(n),a=C.exports.useRef(!1);return C.exports.createElement(_8e,On({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),O8e=C.exports.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=Pb(n);return C.exports.createElement(k8e,On({},i,r,{ref:t}))});function E3(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const I8e=T8e,D8e=A8e,N8e=R8e,Bc=O8e,B8e=rt([e=>e.gallery,e=>e.options,yr,Tr],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:h,galleryImageObjectFit:g,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,galleryWidth:b,shouldUseSingleGalleryColumn:w}=e,{isLightBoxOpen:P}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:h,galleryImageObjectFit:g,galleryGridTemplateColumns:w?"auto":`repeat(auto-fill, minmax(${h}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:v,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightBoxOpen:P,isStaging:n,shouldEnableResize:!(P||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:w}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),z8e=rt([e=>e.options,e=>e.gallery,e=>e.system,Tr],(e,t,n,r)=>({mayDeleteImage:n.isConnected&&!n.isProcessing,galleryImageObjectFit:t.galleryImageObjectFit,galleryImageMinimumWidth:t.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:t.shouldUseSingleGalleryColumn,activeTabName:r,isLightBoxOpen:e.isLightBoxOpen}),{memoizeOptions:{resultEqualityCheck:We.isEqual}}),F8e=e=>e.gallery,$8e=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,H8e=C.exports.memo(e=>{var ne,V,q,te,J,Z,G,ee;const t=De(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,isLightBoxOpen:a,shouldUseSingleGalleryColumn:s}=ye(z8e),{image:l,isSelected:u}=e,{url:h,thumbnail:g,uuid:m,metadata:v}=l,[b,w]=C.exports.useState(!1),P=x2(),E=()=>w(!0),_=()=>w(!1),T=()=>{l.metadata&&t(XS(l.metadata.image.prompt)),P({title:"Prompt Set",status:"success",duration:2500,isClosable:!0})},M=()=>{l.metadata&&t(w2(l.metadata.image.seed)),P({title:"Seed Set",status:"success",duration:2500,isClosable:!0})},O=()=>{a&&t(Cu(!1)),t(T1(l)),n!=="img2img"&&t(Lo("img2img")),P({title:"Sent to Image To Image",status:"success",duration:2500,isClosable:!0})},I=()=>{a&&t(Cu(!1)),t(QS(l)),t(ZS()),n!=="unifiedCanvas"&&t(Lo("unifiedCanvas")),P({title:"Sent to Unified Canvas",status:"success",duration:2500,isClosable:!0})},D=()=>{v&&t(Nye(v)),P({title:"Parameters Set",status:"success",duration:2500,isClosable:!0})},B=async()=>{var le;if((le=v==null?void 0:v.image)!=null&&le.init_image_path&&(await fetch(v.image.init_image_path)).ok){t(Lo("img2img")),t(Iye(v)),P({title:"Initial Image Set",status:"success",duration:2500,isClosable:!0});return}P({title:"Initial Image Not Set",description:"Could not load initial image.",status:"error",duration:2500,isClosable:!0})},$=()=>t(gM(l)),H=le=>{le.dataTransfer.setData("invokeai/imageUuid",m),le.dataTransfer.effectAllowed="move"},j=()=>{t(Cu(!0)),t(gM(l))};return X(I8e,{onOpenChange:le=>{t(fH(le))},children:[S(D8e,{children:X(Ld,{position:"relative",className:"hoverable-image",onMouseOver:E,onMouseOut:_,userSelect:"none",draggable:!0,onDragStart:H,children:[S(DS,{className:"hoverable-image-image",objectFit:s?"contain":r,rounded:"md",src:g||h,loading:"lazy"}),S("div",{className:"hoverable-image-content",onClick:$,children:u&&S(wa,{width:"50%",height:"50%",as:ck,className:"hoverable-image-check"})}),b&&i>=64&&S("div",{className:"hoverable-image-delete-button",children:S(bi,{label:"Delete image",hasArrow:!0,children:S(z7,{image:l,children:S(Ya,{"aria-label":"Delete image",icon:S(jxe,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})})]},m)}),X(N8e,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:le=>{le.detail.originalEvent.preventDefault()},children:[S(Bc,{onClickCapture:j,children:"Open In Viewer"}),S(Bc,{onClickCapture:T,disabled:((V=(ne=l==null?void 0:l.metadata)==null?void 0:ne.image)==null?void 0:V.prompt)===void 0,children:"Use Prompt"}),S(Bc,{onClickCapture:M,disabled:((te=(q=l==null?void 0:l.metadata)==null?void 0:q.image)==null?void 0:te.seed)===void 0,children:"Use Seed"}),S(Bc,{onClickCapture:D,disabled:!["txt2img","img2img"].includes((Z=(J=l==null?void 0:l.metadata)==null?void 0:J.image)==null?void 0:Z.type),children:"Use All Parameters"}),S(bi,{label:"Load initial image used for this generation",children:S(Bc,{onClickCapture:B,disabled:((ee=(G=l==null?void 0:l.metadata)==null?void 0:G.image)==null?void 0:ee.type)!=="img2img",children:"Use Initial Image"})}),S(Bc,{onClickCapture:O,children:"Send to Image To Image"}),S(Bc,{onClickCapture:I,children:"Send to Unified Canvas"}),S(z7,{image:l,children:S(Bc,{"data-warning":!0,children:"Delete Image"})})]})]})},$8e),fr=e=>{const{label:t,styleClass:n,...r}=e;return S(pz,{className:`invokeai__checkbox ${n}`,...r,children:t})},P3=320,OR=40,W8e={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},IR=400;function fU(){const e=De(),{images:t,currentCategory:n,currentImageUuid:r,shouldPinGallery:i,shouldShowGallery:o,galleryScrollPosition:a,galleryImageMinimumWidth:s,galleryGridTemplateColumns:l,activeTabName:u,galleryImageObjectFit:h,shouldHoldGalleryOpen:g,shouldAutoSwitchToNewImages:m,areMoreImagesAvailable:v,galleryWidth:b,isLightBoxOpen:w,isStaging:P,shouldEnableResize:E,shouldUseSingleGalleryColumn:_}=ye(B8e),{galleryMinWidth:T,galleryMaxWidth:M}=w?{galleryMinWidth:IR,galleryMaxWidth:IR}:W8e[u],[O,I]=C.exports.useState(b>=P3),[D,B]=C.exports.useState(!1),[$,H]=C.exports.useState(0),j=C.exports.useRef(null),ne=C.exports.useRef(null),V=C.exports.useRef(null);C.exports.useEffect(()=>{b>=P3&&I(!1)},[b]);const q=()=>{e(e3e(!i)),e(ai(!0))},te=()=>{o?Z():J()},J=()=>{e(fd(!0)),i&&e(ai(!0))},Z=C.exports.useCallback(()=>{e(fd(!1)),e(fH(!1)),e(t3e(ne.current?ne.current.scrollTop:0)),setTimeout(()=>i&&e(ai(!0)),400)},[e,i]),G=()=>{e(_7(n))},ee=Ce=>{e(im(Ce))},le=()=>{g||(V.current=window.setTimeout(()=>Z(),500))},me=()=>{V.current&&window.clearTimeout(V.current)};Ue("g",()=>{te()},[o,i]),Ue("left",()=>{e(K_())},{enabled:!P||u!=="unifiedCanvas"},[P]),Ue("right",()=>{e(q_())},{enabled:!P||u!=="unifiedCanvas"},[P]),Ue("shift+g",()=>{q()},[i]),Ue("esc",()=>{e(fd(!1))},{enabled:()=>!i,preventDefault:!0},[i]);const Me=32;return Ue("shift+up",()=>{if(s<256){const Ce=We.clamp(s+Me,32,256);e(im(Ce))}},[s]),Ue("shift+down",()=>{if(s>32){const Ce=We.clamp(s-Me,32,256);e(im(Ce))}},[s]),C.exports.useEffect(()=>{!ne.current||(ne.current.scrollTop=a)},[a,o]),C.exports.useEffect(()=>{function Ce(be){!i&&j.current&&!j.current.contains(be.target)&&Z()}return document.addEventListener("mousedown",Ce),()=>{document.removeEventListener("mousedown",Ce)}},[Z,i]),S(AV,{nodeRef:j,in:o||g,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:X("div",{className:"image-gallery-wrapper",style:{zIndex:i?1:100},"data-pinned":i,ref:j,onMouseLeave:i?void 0:le,onMouseEnter:i?void 0:me,onMouseOver:i?void 0:me,children:[X(iV,{minWidth:T,maxWidth:i?M:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:E},size:{width:b,height:i?"100%":"100vh"},onResizeStart:(Ce,be,we)=>{H(we.clientHeight),we.style.height=`${we.clientHeight}px`,i&&(we.style.position="fixed",we.style.right="1rem",B(!0))},onResizeStop:(Ce,be,we,Ve)=>{const Ze=i?We.clamp(Number(b)+Ve.width,T,Number(M)):Number(b)+Ve.width;e(i3e(Ze)),we.removeAttribute("data-resize-alert"),i&&(we.style.position="relative",we.style.removeProperty("right"),we.style.setProperty("height",i?"100%":"100vh"),B(!1),e(ai(!0)))},onResize:(Ce,be,we,Ve)=>{const Ze=We.clamp(Number(b)+Ve.width,T,Number(i?M:.95*window.innerWidth));Ze>=P3&&!O?I(!0):ZeZe-OR&&e(im(Ze-OR)),i&&(Ze>=M?we.setAttribute("data-resize-alert","true"):we.removeAttribute("data-resize-alert")),we.style.height=`${$}px`},children:[X("div",{className:"image-gallery-header",children:[S(ji,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:O?X(Rn,{children:[S(Ro,{size:"sm","data-selected":n==="result",onClick:()=>e(i3("result")),children:"Generations"}),S(Ro,{size:"sm","data-selected":n==="user",onClick:()=>e(i3("user")),children:"Uploads"})]}):X(Rn,{children:[S(Xe,{"aria-label":"Show Generations",tooltip:"Show Generations","data-selected":n==="result",icon:S(Dxe,{}),onClick:()=>e(i3("result"))}),S(Xe,{"aria-label":"Show Uploads",tooltip:"Show Uploads","data-selected":n==="user",icon:S(qxe,{}),onClick:()=>e(i3("user"))})]})}),X("div",{className:"image-gallery-header-right-icons",children:[S(Dl,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:S(Xe,{size:"sm","aria-label":"Gallery Settings",icon:S(gb,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:X("div",{className:"image-gallery-settings-popover",children:[X("div",{children:[S(Do,{value:s,onChange:ee,min:32,max:256,hideTooltip:!0,label:"Image Size"}),S(Xe,{size:"sm","aria-label":"Reset",tooltip:"Reset Size",onClick:()=>e(im(64)),icon:S(bk,{}),"data-selected":i,styleClass:"image-gallery-icon-btn"})]}),S("div",{children:S(fr,{label:"Maintain Aspect Ratio",isChecked:h==="contain",onChange:()=>e(n3e(h==="contain"?"cover":"contain"))})}),S("div",{children:S(fr,{label:"Auto-Switch to New Images",isChecked:m,onChange:Ce=>e(r3e(Ce.target.checked))})}),S("div",{children:S(fr,{label:"Single Column Layout",isChecked:_,onChange:Ce=>e(o3e(Ce.target.checked))})})]})}),S(Xe,{size:"sm",className:"image-gallery-icon-btn","aria-label":"Pin Gallery",tooltip:"Pin Gallery (Shift+G)",onClick:q,icon:i?S(EV,{}):S(PV,{})})]})]}),S("div",{className:"image-gallery-container",ref:ne,children:t.length||v?X(Rn,{children:[S("div",{className:"image-gallery",style:{gridTemplateColumns:l},children:t.map(Ce=>{const{uuid:be}=Ce;return S(H8e,{image:Ce,isSelected:r===be},be)})}),S(ja,{onClick:G,isDisabled:!v,className:"image-gallery-load-more-btn",children:v?"Load More":"All Images Loaded"})]}):X("div",{className:"image-gallery-container-placeholder",children:[S(CV,{}),S("p",{children:"No Images In Gallery"})]})})]}),D&&S("div",{style:{width:b+"px",height:"100%"}})]})})}const V8e=rt(F8e,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),U8e=()=>{const{resultImages:e,userImages:t}=ye(V8e);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},G8e=rt([e=>e.options,Tr],(e,t)=>{const{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i}=e;return{showDualDisplay:n,shouldPinOptionsPanel:r,isLightBoxOpen:i,shouldShowDualDisplayButton:["inpainting"].includes(t),activeTabName:t}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),$k=e=>{const t=De(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,showDualDisplay:a,isLightBoxOpen:s,shouldShowDualDisplayButton:l}=ye(G8e),u=U8e(),h=()=>{t(Yye(!a)),t(ai(!0))},g=m=>{const v=m.dataTransfer.getData("invokeai/imageUuid"),b=u(v);!b||(o==="img2img"?t(T1(b)):o==="unifiedCanvas"&&t(QS(b)))};return S("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:X("div",{className:"workarea-main",children:[n,X("div",{className:"workarea-children-wrapper",onDrop:g,children:[r,l&&S(bi,{label:"Toggle Split View",children:S("div",{className:"workarea-split-button","data-selected":a,onClick:h,children:S(d7e,{})})})]}),!s&&S(fU,{})]})})};function j8e(){return S($k,{optionsPanel:S(e7e,{}),children:S(c7e,{})})}function Y8e(){const e={seed:{header:"Seed",feature:Yi.SEED,content:S(xk,{})},variations:{header:"Variations",feature:Yi.VARIATIONS,content:S(_k,{}),additionalHeaderComponents:S(Ck,{})},face_restore:{header:"Face Restoration",feature:Yi.FACE_CORRECTION,content:S(Sk,{}),additionalHeaderComponents:S(SV,{})},upscale:{header:"Upscaling",feature:Yi.UPSCALE,content:S(wk,{}),additionalHeaderComponents:S(wV,{})},other:{header:"Other Options",feature:Yi.OTHER,content:S(xV,{})}};return X(Rk,{children:[S(Ak,{}),S(Lk,{}),S(kk,{}),S(Ek,{accordionInfo:e})]})}const q8e=()=>S("div",{className:"workarea-single-view",children:S("div",{className:"text-to-image-area",children:S(DV,{})})});function K8e(){return S($k,{optionsPanel:S(Y8e,{}),children:S(q8e,{})})}var K7=function(e,t){return K7=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},K7(e,t)};function X8e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");K7(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Nl=function(){return Nl=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Bd(e,t,n,r){var i=f_e(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,h=t.scale-s,g=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):gU(e,r,n,function(v){var b=s+h*v,w=l+g*v,P=u+m*v;o(b,w,P)})}}function f_e(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function h_e(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,h=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:h}}var p_e=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,h=s,g=r-i-l,m=l;return{minPositionX:u,maxPositionX:h,minPositionY:g,maxPositionY:m}},Hk=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=h_e(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,h=o.newContentHeight,g=o.newDiffHeight,m=p_e(a,l,u,s,h,g,Boolean(i));return m},h1=function(e,t){var n=Hk(e,t);return e.bounds=n,n};function Tb(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,h=n.maxPositionY,g=0,m=0;a&&(g=i,m=o);var v=X7(e,s-g,u+g,r),b=X7(t,l-m,h+m,r);return{x:v,y:b}}var X7=function(e,t,n,r){return r?en?Ha(n,2):Ha(e,2):Ha(e,2)};function Lb(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,h=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var g=l-t*h,m=u-n*h,v=Tb(g,m,i,o,0,0,null);return v}function T2(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var NR=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=Ab(o,n);return!l},BR=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},g_e=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},m_e=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function v_e(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var h=e.bounds,g=h.maxPositionX,m=h.minPositionX,v=h.maxPositionY,b=h.minPositionY,w=n>g||nv||rg?u.offsetWidth:e.setup.minPositionX||0,_=r>v?u.offsetHeight:e.setup.minPositionY||0,T=Lb(e,E,_,i,e.bounds,s||l),M=T.x,O=T.y;return{scale:i,positionX:w?M:n,positionY:P?O:r}}}function y_e(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,h=l.positionX,g=l.positionY,m=t!==h,v=n!==g,b=!m||!v;if(!(!a||b||!s)){var w=Tb(t,n,s,o,r,i,a),P=w.x,E=w.y;e.setTransformState(u,P,E)}}var S_e=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var h=t-r.x,g=n-r.y,m=a?l:h,v=s?u:g;return{x:m,y:v}},R4=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},b_e=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},x_e=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function w_e(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function zR(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var h=a+(e-a)*u;return h>l?l:ho?o:h}}return r?t:X7(e,o,a,i)}function C_e(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function __e(e,t){var n=b_e(e);if(!!n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=C_e(a,s),h=t.x-r.x,g=t.y-r.y,m=h/u,v=g/u,b=l-i,w=h*h+g*g,P=Math.sqrt(w)/b;e.velocity={velocityX:m,velocityY:v,total:P}}e.lastMousePosition=t,e.velocityTime=l}}function k_e(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=x_e(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,h=n.minPositionX,g=n.maxPositionY,m=n.minPositionY,v=r.limitToBounds,b=r.alignmentAnimation,w=r.zoomAnimation,P=r.panning,E=P.lockAxisY,_=P.lockAxisX,T=w.animationType,M=b.sizeX,O=b.sizeY,I=b.velocityAlignmentTime,D=I,B=w_e(e,l),$=Math.max(B,D),H=R4(e,M),j=R4(e,O),ne=H*i.offsetWidth/100,V=j*i.offsetHeight/100,q=u+ne,te=h-ne,J=g+V,Z=m-V,G=e.transformState,ee=new Date().getTime();gU(e,T,$,function(le){var me=e.transformState,Me=me.scale,Ce=me.positionX,be=me.positionY,we=new Date().getTime()-ee,Ve=we/D,Ze=hU[b.animationType],it=1-Ze(Math.min(1,Ve)),pt=1-le,kt=Ce+a*pt,gt=be+s*pt,ht=zR(kt,G.positionX,Ce,_,v,h,u,te,q,it),vt=zR(gt,G.positionY,be,E,v,m,g,Z,J,it);(Ce!==kt||be!==gt)&&e.setTransformState(Me,ht,vt)})}}function FR(e,t){var n=e.transformState.scale;wl(e),h1(e,n),t.touches?m_e(e,t):g_e(e,t)}function $R(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(!!r){var l=S_e(e,t,n),u=l.x,h=l.y,g=R4(e,a),m=R4(e,s);__e(e,{x:u,y:h}),y_e(e,u,h,g,m)}}function E_e(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,h=(a==null?void 0:a.height)||0,g=s.1&&g;m?k_e(e):mU(e)}}function mU(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,h=o||t=a;if((r>=1||s)&&mU(e),!(m||!i||!e.mounted)){var v=t||i.offsetWidth/2,b=n||i.offsetHeight/2,w=Wk(e,a,v,b);w&&Bd(e,w,h,g)}}function Wk(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=T2(Ha(t,2),o,a,0,!1),u=h1(e,l),h=Lb(e,n,r,l,u,s),g=h.x,m=h.y;return{scale:l,positionX:g,positionY:m}}var v0={previousScale:1,scale:1,positionX:0,positionY:0},P_e=Nl(Nl({},v0),{setComponents:function(){},contextInstance:null}),dm={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},yU=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:v0.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:v0.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:v0.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:v0.positionY}},HR=function(e){var t=Nl({},dm);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof dm[n]<"u";if(i&&r){var o=Object.prototype.toString.call(dm[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=Nl(Nl({},dm[n]),e[n]):s?t[n]=DR(DR([],dm[n]),e[n]):t[n]=e[n]}}),t},SU=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var h=r*Math.exp(t*n),g=T2(Ha(h,3),s,a,u,!1);return g};function bU(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var h=o.offsetWidth,g=o.offsetHeight,m=(h/2-l)/s,v=(g/2-u)/s,b=SU(e,t,n),w=Wk(e,b,m,v);if(!w)return console.error("Error during zoom event. New transformation state was not calculated.");Bd(e,w,r,i)}function xU(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=yU(e.props),s=e.transformState,l=s.scale,u=s.positionX,h=s.positionY;if(!!i){var g=Hk(e,a.scale),m=Tb(a.positionX,a.positionY,g,o,0,0,i),v={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&h===a.positionY||Bd(e,v,t,n)}}function T_e(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return v0;var l=r.getBoundingClientRect(),u=L_e(t),h=u.x,g=u.y,m=t.offsetWidth,v=t.offsetHeight,b=r.offsetWidth/m,w=r.offsetHeight/v,P=T2(n||Math.min(b,w),a,s,0,!1),E=(l.width-m*P)/2,_=(l.height-v*P)/2,T=(l.left-h)*P+E,M=(l.top-g)*P+_,O=Hk(e,P),I=Tb(T,M,O,o,0,0,r),D=I.x,B=I.y;return{positionX:D,positionY:B,scale:P}}function L_e(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function A_e(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var M_e=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),bU(e,1,t,n,r)}},R_e=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),bU(e,-1,t,n,r)}},O_e=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,h=e.wrapperComponent,g=e.contentComponent,m=e.setup.disabled;if(!(m||!h||!g)){var v={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};Bd(e,v,i,o)}}},I_e=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),xU(e,t,n)}},D_e=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=wU(t||i.scale,o,a);Bd(e,s,n,r)}}},N_e=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),wl(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&A_e(a)&&a&&o.contains(a)){var s=T_e(e,a,n);Bd(e,s,r,i)}}},Gr=function(e){return{instance:e,state:e.transformState,zoomIn:M_e(e),zoomOut:R_e(e),setTransform:O_e(e),resetTransform:I_e(e),centerView:D_e(e),zoomToElement:N_e(e)}},r6=!1;function i6(){try{var e={get passive(){return r6=!0,!1}};return e}catch(t){return r6=!1,r6}}var Ab=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},WR=function(e){e&&clearTimeout(e)},B_e=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},wU=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},z_e=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,h=s&&!l&&!r&&u;if(!h||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var g=Ab(u,a);return!g};function F_e(e,t){var n=e?e.deltaY<0?1:-1:0,r=Z8e(t,n);return r}function CU(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var $_e=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,h=s.zoomAnimation,g=h.size,m=h.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+t*(o-o*n)*n;if(i)return v;var b=r?!1:!m,w=T2(Ha(v,3),u,l,g,b);return w},H_e=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},W_e=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=Ab(a,i);return!l},V_e=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},U_e=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=Ha(i[0].clientX-r.left,5),a=Ha(i[0].clientY-r.top,5),s=Ha(i[1].clientX-r.left,5),l=Ha(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},_U=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},G_e=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var h=t/r,g=h*n;return T2(Ha(g,2),a,o,l,!u)},j_e=160,Y_e=100,q_e=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(wl(e),vi(Gr(e),t,r),vi(Gr(e),t,i))},K_e=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,h=a.centerZoomedOut,g=a.zoomAnimation,m=a.wheel,v=g.size,b=g.disabled,w=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var P=F_e(t,null),E=$_e(e,P,w,!t.ctrlKey);if(l!==E){var _=h1(e,E),T=CU(t,o,l),M=b||v===0||h,O=u&&M,I=Lb(e,T.x,T.y,E,_,O),D=I.x,B=I.y;e.previousWheelEvent=t,e.setTransformState(E,D,B),vi(Gr(e),t,r),vi(Gr(e),t,i)}},X_e=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;WR(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){!e.mounted||(vU(e,t.x,t.y),e.wheelAnimationTimer=null)},Y_e);var o=H_e(e,t);o&&(WR(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){!e.mounted||(e.wheelStopEventTimer=null,vi(Gr(e),t,r),vi(Gr(e),t,i))},j_e))},Z_e=function(e,t){var n=_U(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,wl(e)},Q_e=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,h=l.size;if(!(r===null||!n)){var g=U_e(t,i,n);if(!(!isFinite(g.x)||!isFinite(g.y))){var m=_U(t),v=G_e(e,m);if(v!==i){var b=h1(e,v),w=u||h===0||s,P=a&&w,E=Lb(e,g.x,g.y,v,b,P),_=E.x,T=E.y;e.pinchMidpoint=g,e.lastDistance=m,e.setTransformState(v,_,T)}}}},J_e=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,vU(e,t==null?void 0:t.x,t==null?void 0:t.y)};function eke(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return xU(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var h=i==="zoomOut"?-1:1,g=SU(e,h,o),m=CU(t,u,l),v=Wk(e,g,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");Bd(e,v,a,s)}}var tke=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),h=n&&l&&u&&!a;if(!h)return!1;var g=Ab(l,s);return!(g||!h)},kU=se.createContext(P_e),nke=function(e){X8e(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=yU(n.props),n.setup=HR(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=i6();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=z_e(n,r);if(!!o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);!a||(q_e(n,r),K_e(n,r),X_e(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=NR(n,r);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),wl(n),FR(n,r),vi(Gr(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=BR(n);if(!!a){var s=n.isPressingKeys(n.setup.panning.activationKeys);!s||(r.preventDefault(),r.stopPropagation(),$R(n,r.clientX,r.clientY),vi(Gr(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(E_e(n),vi(Gr(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=W_e(n,r);!l||(Z_e(n,r),wl(n),vi(Gr(n),r,a),vi(Gr(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=V_e(n);!l||(r.preventDefault(),r.stopPropagation(),Q_e(n,r),vi(Gr(n),r,a),vi(Gr(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(J_e(n),vi(Gr(n),r,o),vi(Gr(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=NR(n,r);if(!!a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,wl(n);var l=r.touches,u=l.length===1,h=l.length===2;u&&(wl(n),FR(n,r),vi(Gr(n),r,o)),h&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=BR(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];$R(n,s.clientX,s.clientY),vi(Gr(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=tke(n,r);!o||eke(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,h1(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,vi(Gr(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=wU(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=B_e(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(Gr(n))},n}return t.prototype.componentDidMount=function(){var n=i6();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=i6();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),wl(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(h1(this,this.transformState.scale),this.setup=HR(this.props))},t.prototype.render=function(){var n=Gr(this),r=this.props.children,i=typeof r=="function"?r(n):r;return S(kU.Provider,{value:Nl(Nl({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:i})},t}(C.exports.Component),rke=se.forwardRef(function(e,t){var n=C.exports.useState(null),r=n[0],i=n[1];return C.exports.useImperativeHandle(t,function(){return r},[r]),S(nke,{...Nl({},e,{setRef:i})})});function ike(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var oke=`.transform-component-module_wrapper__1_Fgj { position: relative; width: -moz-fit-content; width: fit-content; height: -moz-fit-content; height: fit-content; overflow: hidden; -webkit-touch-callout: none; /* iOS Safari */ -webkit-user-select: none; /* Safari */ -khtml-user-select: none; /* Konqueror HTML */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* Internet Explorer/Edge */ user-select: none; margin: 0; padding: 0; } .transform-component-module_content__2jYgh { display: flex; flex-wrap: wrap; width: -moz-fit-content; width: fit-content; height: -moz-fit-content; height: fit-content; margin: 0; padding: 0; transform-origin: 0% 0%; } .transform-component-module_content__2jYgh img { pointer-events: none; } `,VR={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};ike(oke);var ake=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=C.exports.useContext(kU).setComponents,u=C.exports.useRef(null),h=C.exports.useRef(null);return C.exports.useEffect(function(){var g=u.current,m=h.current;g!==null&&m!==null&&l&&l(g,m)},[]),S("div",{ref:u,className:"react-transform-wrapper "+VR.wrapper+" "+r,style:a,children:S("div",{ref:h,className:"react-transform-component "+VR.content+" "+o,style:s,children:t})})};function ske({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=C.exports.useState(0),[a,s]=C.exports.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},h=()=>{s(!a)};return S(rke,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:g,zoomOut:m,resetTransform:v,centerView:b})=>X(Rn,{children:[X("div",{className:"lightbox-image-options",children:[S(Xe,{icon:S(gCe,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>g(),fontSize:20}),S(Xe,{icon:S(mCe,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),S(Xe,{icon:S(hCe,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),S(Xe,{icon:S(pCe,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),S(Xe,{icon:S(BCe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:h,fontSize:20}),S(Xe,{icon:S(bk,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{v(),o(0),s(!1)},fontSize:20})]}),S(ake,{wrapperStyle:{width:"100%",height:"100%"},children:S("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function lke(){const e=De(),t=ye(m=>m.options.isLightBoxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=ye(IV),[a,s]=C.exports.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},h=()=>{e(K_())},g=()=>{e(q_())};return Ue("Esc",()=>{t&&e(Cu(!1))},[t]),X("div",{className:"lightbox-container",children:[S(Xe,{icon:S(fCe,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Cu(!1))},fontSize:20}),X("div",{className:"lightbox-display-container",children:[X("div",{className:"lightbox-preview-wrapper",children:[S(MV,{}),!r&&X("div",{className:"current-image-next-prev-buttons",children:[S("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&S(Ya,{"aria-label":"Previous image",icon:S(YW,{className:"next-prev-button"}),variant:"unstyled",onClick:h})}),S("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&S(Ya,{"aria-label":"Next image",icon:S(qW,{className:"next-prev-button"}),variant:"unstyled",onClick:g})})]}),n&&X(Rn,{children:[S(ske,{image:n.url,styleClass:"lightbox-image"}),r&&S(OV,{image:n})]})]}),S(fU,{})]})]})}const uke=rt([gk],e=>{const{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:i}=e;return{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:i}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),cke=()=>{const e=De(),{seamSize:t,seamBlur:n,seamStrength:r,seamSteps:i}=ye(uke);return X(bt,{direction:"column",gap:"1rem",children:[S(Do,{sliderMarkRightOffset:-6,label:"Seam Size",min:1,max:256,sliderNumberInputProps:{max:512},value:t,onChange:o=>{e(dM(o))},handleReset:()=>e(dM(96)),withInput:!0,withSliderMarks:!0,withReset:!0}),S(Do,{sliderMarkRightOffset:-4,label:"Seam Blur",min:0,max:64,sliderNumberInputProps:{max:512},value:n,onChange:o=>{e(cM(o))},handleReset:()=>{e(cM(16))},withInput:!0,withSliderMarks:!0,withReset:!0}),S(Do,{sliderMarkRightOffset:-2,label:"Seam Strength",min:.01,max:.99,step:.01,value:r,onChange:o=>{e(hM(o))},handleReset:()=>{e(hM(.7))},withInput:!0,withSliderMarks:!0,withReset:!0}),S(Do,{sliderMarkRightOffset:-4,label:"Seam Steps",min:1,max:32,sliderNumberInputProps:{max:100},value:i,onChange:o=>{e(fM(o))},handleReset:()=>{e(fM(10))},withInput:!0,withSliderMarks:!0,withReset:!0})]})},dke=rt(Qt,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),fke=()=>{const e=De(),{boundingBoxDimensions:t}=ye(dke),n=a=>{e(km({...t,width:Math.floor(a)}))},r=a=>{e(km({...t,height:Math.floor(a)}))},i=()=>{e(km({...t,width:Math.floor(512)}))},o=()=>{e(km({...t,height:Math.floor(512)}))};return X(bt,{direction:"column",gap:"1rem",children:[S(Do,{label:"Width",min:64,max:1024,step:64,value:t.width,onChange:n,handleReset:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),S(Do,{label:"Height",min:64,max:1024,step:64,value:t.height,onChange:r,handleReset:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0})]})},hke=rt(Qt,e=>{const{inpaintReplace:t,shouldUseInpaintReplace:n}=e;return{inpaintReplace:t,shouldUseInpaintReplace:n}},{memoizeOptions:{resultEqualityCheck:We.isEqual}});function pke(){const{inpaintReplace:e,shouldUseInpaintReplace:t}=ye(hke),n=De();return X(bt,{alignItems:"center",columnGap:"1rem",children:[S(Do,{label:"Inpaint Replace",value:e,onChange:r=>{n(xM(r))},min:0,max:1,step:.05,isInteger:!1,isSliderDisabled:!t,withSliderMarks:!0,sliderMarkRightOffset:-2,withReset:!0,handleReset:()=>n(xM(1)),isResetDisabled:!t}),S($a,{isChecked:t,onChange:r=>n(K3e(r.target.checked))})]})}const gke=rt([gk,Vu,Qt],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),mke=()=>{const e=De(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=ye(gke),s=m=>{e(a3({...a,width:Math.floor(m)}))},l=m=>{e(a3({...a,height:Math.floor(m)}))},u=()=>{e(a3({...a,width:Math.floor(512)}))},h=()=>{e(a3({...a,height:Math.floor(512)}))};return X(bt,{direction:"column",gap:"1rem",children:[S(Is,{label:"Scale Before Processing",validValues:k3e,value:i,onChange:m=>{e(W3e(m.target.value))}}),S(Do,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:"Scaled W",min:64,max:1024,step:64,value:a.width,onChange:s,handleReset:u,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),S(Do,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:"Scaled H",min:64,max:1024,step:64,value:a.height,onChange:l,handleReset:h,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0}),S(pke,{}),S(Is,{label:"Infill Method",value:n,validValues:r,onChange:m=>e(J$(m.target.value))}),S(Do,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:"Tile Size",min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:m=>{e(pM(m))},handleReset:()=>{e(pM(32))},withInput:!0,withSliderMarks:!0,withReset:!0})]})};function vke(){const e={boundingBox:{header:"Bounding Box",feature:Yi.BOUNDING_BOX,content:S(fke,{})},seamCorrection:{header:"Seam Correction",feature:Yi.SEAM_CORRECTION,content:S(cke,{})},infillAndScaling:{header:"Infill and Scaling",feature:Yi.INFILL_AND_SCALING,content:S(mke,{})},seed:{header:"Seed",feature:Yi.SEED,content:S(xk,{})},variations:{header:"Variations",feature:Yi.VARIATIONS,content:S(_k,{}),additionalHeaderComponents:S(Ck,{})}};return X(Rk,{children:[S(Ak,{}),S(Lk,{}),S(kk,{}),S(bV,{label:"Image To Image Strength",styleClass:"main-option-block image-to-image-strength-main-option"}),S(Ek,{accordionInfo:e})]})}const yke=rt(Qt,_V,Tr,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),EU=()=>{const e=De(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=ye(yke),o=C.exports.useRef(null);return C.exports.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(V3e({width:a,height:s})),e(i?H3e():ZS()),e(ai(!1))},0)},[e,r,t,n,i]),S("div",{ref:o,className:"inpainting-canvas-area",children:S(p2,{thickness:"2px",speed:"1s",size:"xl"})})};var PU={exports:{}};/** * @license React * react-reconciler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ske=function(t){var n={},r=C.exports,i=S0.exports,o=Object.assign;function a(d){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+d,y=1;yae||L[W]!==R[ae]){var fe=` `+L[W].replace(" at new "," at ");return d.displayName&&fe.includes("")&&(fe=fe.replace("",d.displayName)),fe}while(1<=W&&0<=ae);break}}}finally{$s=!1,Error.prepareStackTrace=y}return(d=d?d.displayName||d.name:"")?Yl(d):""}var $h=Object.prototype.hasOwnProperty,Xu=[],Hs=-1;function Uo(d){return{current:d}}function Ln(d){0>Hs||(d.current=Xu[Hs],Xu[Hs]=null,Hs--)}function wn(d,f){Hs++,Xu[Hs]=d.current,d.current=f}var Go={},Lr=Uo(Go),Xr=Uo(!1),jo=Go;function Ws(d,f){var y=d.type.contextTypes;if(!y)return Go;var k=d.stateNode;if(k&&k.__reactInternalMemoizedUnmaskedChildContext===f)return k.__reactInternalMemoizedMaskedChildContext;var L={},R;for(R in y)L[R]=f[R];return k&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=f,d.__reactInternalMemoizedMaskedChildContext=L),L}function Zr(d){return d=d.childContextTypes,d!=null}function ts(){Ln(Xr),Ln(Lr)}function Hd(d,f,y){if(Lr.current!==Go)throw Error(a(168));wn(Lr,f),wn(Xr,y)}function Kl(d,f,y){var k=d.stateNode;if(f=f.childContextTypes,typeof k.getChildContext!="function")return y;k=k.getChildContext();for(var L in k)if(!(L in f))throw Error(a(108,B(d)||"Unknown",L));return o({},y,k)}function ns(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||Go,jo=Lr.current,wn(Lr,d),wn(Xr,Xr.current),!0}function Wd(d,f,y){var k=d.stateNode;if(!k)throw Error(a(169));y?(d=Kl(d,f,jo),k.__reactInternalMemoizedMergedChildContext=d,Ln(Xr),Ln(Lr),wn(Lr,d)):Ln(Xr),wn(Xr,y)}var wi=Math.clz32?Math.clz32:Vd,Hh=Math.log,Wh=Math.LN2;function Vd(d){return d>>>=0,d===0?32:31-(Hh(d)/Wh|0)|0}var Vs=64,po=4194304;function Us(d){switch(d&-d){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function Xl(d,f){var y=d.pendingLanes;if(y===0)return 0;var k=0,L=d.suspendedLanes,R=d.pingedLanes,W=y&268435455;if(W!==0){var ae=W&~L;ae!==0?k=Us(ae):(R&=W,R!==0&&(k=Us(R)))}else W=y&~L,W!==0?k=Us(W):R!==0&&(k=Us(R));if(k===0)return 0;if(f!==0&&f!==k&&(f&L)===0&&(L=k&-k,R=f&-f,L>=R||L===16&&(R&4194240)!==0))return f;if((k&4)!==0&&(k|=y&16),f=d.entangledLanes,f!==0)for(d=d.entanglements,f&=k;0y;y++)f.push(d);return f}function _a(d,f,y){d.pendingLanes|=f,f!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,f=31-wi(f),d[f]=y}function Gd(d,f){var y=d.pendingLanes&~f;d.pendingLanes=f,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=f,d.mutableReadLanes&=f,d.entangledLanes&=f,f=d.entanglements;var k=d.eventTimes;for(d=d.expirationTimes;0>=W,L-=W,Ki=1<<32-wi(f)+L|y<$t?(Vr=Lt,Lt=null):Vr=Lt.sibling;var Xt=qe(pe,Lt,ve[$t],Ge);if(Xt===null){Lt===null&&(Lt=Vr);break}d&&Lt&&Xt.alternate===null&&f(pe,Lt),ue=R(Xt,ue,$t),Ot===null?Le=Xt:Ot.sibling=Xt,Ot=Xt,Lt=Vr}if($t===ve.length)return y(pe,Lt),$n&&Gs(pe,$t),Le;if(Lt===null){for(;$t$t?(Vr=Lt,Lt=null):Vr=Lt.sibling;var ds=qe(pe,Lt,Xt.value,Ge);if(ds===null){Lt===null&&(Lt=Vr);break}d&&Lt&&ds.alternate===null&&f(pe,Lt),ue=R(ds,ue,$t),Ot===null?Le=ds:Ot.sibling=ds,Ot=ds,Lt=Vr}if(Xt.done)return y(pe,Lt),$n&&Gs(pe,$t),Le;if(Lt===null){for(;!Xt.done;$t++,Xt=ve.next())Xt=Rt(pe,Xt.value,Ge),Xt!==null&&(ue=R(Xt,ue,$t),Ot===null?Le=Xt:Ot.sibling=Xt,Ot=Xt);return $n&&Gs(pe,$t),Le}for(Lt=k(pe,Lt);!Xt.done;$t++,Xt=ve.next())Xt=Wn(Lt,pe,$t,Xt.value,Ge),Xt!==null&&(d&&Xt.alternate!==null&&Lt.delete(Xt.key===null?$t:Xt.key),ue=R(Xt,ue,$t),Ot===null?Le=Xt:Ot.sibling=Xt,Ot=Xt);return d&&Lt.forEach(function(gi){return f(pe,gi)}),$n&&Gs(pe,$t),Le}function ra(pe,ue,ve,Ge){if(typeof ve=="object"&&ve!==null&&ve.type===h&&ve.key===null&&(ve=ve.props.children),typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case l:e:{for(var Le=ve.key,Ot=ue;Ot!==null;){if(Ot.key===Le){if(Le=ve.type,Le===h){if(Ot.tag===7){y(pe,Ot.sibling),ue=L(Ot,ve.props.children),ue.return=pe,pe=ue;break e}}else if(Ot.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===T&&rg(Le)===Ot.type){y(pe,Ot.sibling),ue=L(Ot,ve.props),ue.ref=Pa(pe,Ot,ve),ue.return=pe,pe=ue;break e}y(pe,Ot);break}else f(pe,Ot);Ot=Ot.sibling}ve.type===h?(ue=ol(ve.props.children,pe.mode,Ge,ve.key),ue.return=pe,pe=ue):(Ge=bf(ve.type,ve.key,ve.props,null,pe.mode,Ge),Ge.ref=Pa(pe,ue,ve),Ge.return=pe,pe=Ge)}return W(pe);case u:e:{for(Ot=ve.key;ue!==null;){if(ue.key===Ot)if(ue.tag===4&&ue.stateNode.containerInfo===ve.containerInfo&&ue.stateNode.implementation===ve.implementation){y(pe,ue.sibling),ue=L(ue,ve.children||[]),ue.return=pe,pe=ue;break e}else{y(pe,ue);break}else f(pe,ue);ue=ue.sibling}ue=al(ve,pe.mode,Ge),ue.return=pe,pe=ue}return W(pe);case T:return Ot=ve._init,ra(pe,ue,Ot(ve._payload),Ge)}if(te(ve))return An(pe,ue,ve,Ge);if(I(ve))return nr(pe,ue,ve,Ge);Fi(pe,ve)}return typeof ve=="string"&&ve!==""||typeof ve=="number"?(ve=""+ve,ue!==null&&ue.tag===6?(y(pe,ue.sibling),ue=L(ue,ve),ue.return=pe,pe=ue):(y(pe,ue),ue=Lp(ve,pe.mode,Ge),ue.return=pe,pe=ue),W(pe)):y(pe,ue)}return ra}var sc=z2(!0),F2=z2(!1),nf={},yo=Uo(nf),Ta=Uo(nf),ie=Uo(nf);function Se(d){if(d===nf)throw Error(a(174));return d}function ge(d,f){wn(ie,f),wn(Ta,d),wn(yo,nf),d=Z(f),Ln(yo),wn(yo,d)}function Ye(){Ln(yo),Ln(Ta),Ln(ie)}function Tt(d){var f=Se(ie.current),y=Se(yo.current);f=G(y,d.type,f),y!==f&&(wn(Ta,d),wn(yo,f))}function en(d){Ta.current===d&&(Ln(yo),Ln(Ta))}var It=Uo(0);function hn(d){for(var f=d;f!==null;){if(f.tag===13){var y=f.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||qu(y)||$d(y)))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===d)break;for(;f.sibling===null;){if(f.return===null||f.return===d)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var rf=[];function ig(){for(var d=0;dy?y:4,d(!0);var k=lc.transition;lc.transition={};try{d(!1),f()}finally{Vt=y,lc.transition=k}}function gc(){return ki().memoizedState}function fg(d,f,y){var k=Ir(d);if(y={lane:k,action:y,hasEagerState:!1,eagerState:null,next:null},vc(d))yc(f,y);else if(y=ac(d,f,y,k),y!==null){var L=pi();xo(y,d,k,L),cf(y,f,k)}}function mc(d,f,y){var k=Ir(d),L={lane:k,action:y,hasEagerState:!1,eagerState:null,next:null};if(vc(d))yc(f,L);else{var R=d.alternate;if(d.lanes===0&&(R===null||R.lanes===0)&&(R=f.lastRenderedReducer,R!==null))try{var W=f.lastRenderedState,ae=R(W,y);if(L.hasEagerState=!0,L.eagerState=ae,U(ae,W)){var fe=f.interleaved;fe===null?(L.next=L,ef(f)):(L.next=fe.next,fe.next=L),f.interleaved=L;return}}catch(Be){}finally{}y=ac(d,f,L,k),y!==null&&(L=pi(),xo(y,d,k,L),cf(y,f,k))}}function vc(d){var f=d.alternate;return d===Cn||f!==null&&f===Cn}function yc(d,f){of=rn=!0;var y=d.pending;y===null?f.next=f:(f.next=y.next,y.next=f),d.pending=f}function cf(d,f,y){if((y&4194240)!==0){var k=f.lanes;k&=d.pendingLanes,y|=k,f.lanes=y,Zl(d,y)}}var os={readContext:Xi,useCallback:ci,useContext:ci,useEffect:ci,useImperativeHandle:ci,useInsertionEffect:ci,useLayoutEffect:ci,useMemo:ci,useReducer:ci,useRef:ci,useState:ci,useDebugValue:ci,useDeferredValue:ci,useTransition:ci,useMutableSource:ci,useSyncExternalStore:ci,useId:ci,unstable_isNewReconciler:!1},Ib={readContext:Xi,useCallback:function(d,f){return Jr().memoizedState=[d,f===void 0?null:f],d},useContext:Xi,useEffect:W2,useImperativeHandle:function(d,f,y){return y=y!=null?y.concat([d]):null,tu(4194308,4,xr.bind(null,f,d),y)},useLayoutEffect:function(d,f){return tu(4194308,4,d,f)},useInsertionEffect:function(d,f){return tu(4,2,d,f)},useMemo:function(d,f){var y=Jr();return f=f===void 0?null:f,d=d(),y.memoizedState=[d,f],d},useReducer:function(d,f,y){var k=Jr();return f=y!==void 0?y(f):f,k.memoizedState=k.baseState=f,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:f},k.queue=d,d=d.dispatch=fg.bind(null,Cn,d),[k.memoizedState,d]},useRef:function(d){var f=Jr();return d={current:d},f.memoizedState=d},useState:H2,useDebugValue:ug,useDeferredValue:function(d){return Jr().memoizedState=d},useTransition:function(){var d=H2(!1),f=d[0];return d=dg.bind(null,d[1]),Jr().memoizedState=d,[f,d]},useMutableSource:function(){},useSyncExternalStore:function(d,f,y){var k=Cn,L=Jr();if($n){if(y===void 0)throw Error(a(407));y=y()}else{if(y=f(),Wr===null)throw Error(a(349));(eu&30)!==0||lg(k,f,y)}L.memoizedState=y;var R={value:y,getSnapshot:f};return L.queue=R,W2(qs.bind(null,k,R,d),[d]),k.flags|=2048,lf(9,hc.bind(null,k,R,y,f),void 0,null),y},useId:function(){var d=Jr(),f=Wr.identifierPrefix;if($n){var y=ka,k=Ki;y=(k&~(1<<32-wi(k)-1)).toString(32)+y,f=":"+f+"R"+y,y=uc++,0Sp&&(f.flags|=128,k=!0,xc(L,!1),f.lanes=4194304)}else{if(!k)if(d=hn(R),d!==null){if(f.flags|=128,k=!0,d=d.updateQueue,d!==null&&(f.updateQueue=d,f.flags|=4),xc(L,!0),L.tail===null&&L.tailMode==="hidden"&&!R.alternate&&!$n)return di(f),null}else 2*Gn()-L.renderingStartTime>Sp&&y!==1073741824&&(f.flags|=128,k=!0,xc(L,!1),f.lanes=4194304);L.isBackwards?(R.sibling=f.child,f.child=R):(d=L.last,d!==null?d.sibling=R:f.child=R,L.last=R)}return L.tail!==null?(f=L.tail,L.rendering=f,L.tail=f.sibling,L.renderingStartTime=Gn(),f.sibling=null,d=It.current,wn(It,k?d&1|2:d&1),f):(di(f),null);case 22:case 23:return Ac(),y=f.memoizedState!==null,d!==null&&d.memoizedState!==null!==y&&(f.flags|=8192),y&&(f.mode&1)!==0?(Qi&1073741824)!==0&&(di(f),gt&&f.subtreeFlags&6&&(f.flags|=8192)):di(f),null;case 24:return null;case 25:return null}throw Error(a(156,f.tag))}function bg(d,f){switch(J1(f),f.tag){case 1:return Zr(f.type)&&ts(),d=f.flags,d&65536?(f.flags=d&-65537|128,f):null;case 3:return Ye(),Ln(Xr),Ln(Lr),ig(),d=f.flags,(d&65536)!==0&&(d&128)===0?(f.flags=d&-65537|128,f):null;case 5:return en(f),null;case 13:if(Ln(It),d=f.memoizedState,d!==null&&d.dehydrated!==null){if(f.alternate===null)throw Error(a(340));rc()}return d=f.flags,d&65536?(f.flags=d&-65537|128,f):null;case 19:return Ln(It),null;case 4:return Ye(),null;case 10:return Qd(f.type._context),null;case 22:case 23:return Ac(),null;case 24:return null;default:return null}}var Xs=!1,Mr=!1,$b=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function wc(d,f){var y=d.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(k){Yn(d,f,k)}else y.current=null}function Jo(d,f,y){try{y()}catch(k){Yn(d,f,k)}}var ap=!1;function ru(d,f){for(ee(d.containerInfo),Qe=f;Qe!==null;)if(d=Qe,f=d.child,(d.subtreeFlags&1028)!==0&&f!==null)f.return=d,Qe=f;else for(;Qe!==null;){d=Qe;try{var y=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var k=y.memoizedProps,L=y.memoizedState,R=d.stateNode,W=R.getSnapshotBeforeUpdate(d.elementType===d.type?k:qo(d.type,k),L);R.__reactInternalSnapshotBeforeUpdate=W}break;case 3:gt&&Wo(d.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(ae){Yn(d,d.return,ae)}if(f=d.sibling,f!==null){f.return=d.return,Qe=f;break}Qe=d.return}return y=ap,ap=!1,y}function fi(d,f,y){var k=f.updateQueue;if(k=k!==null?k.lastEffect:null,k!==null){var L=k=k.next;do{if((L.tag&d)===d){var R=L.destroy;L.destroy=void 0,R!==void 0&&Jo(f,y,R)}L=L.next}while(L!==k)}}function sp(d,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var y=f=f.next;do{if((y.tag&d)===d){var k=y.create;y.destroy=k()}y=y.next}while(y!==f)}}function lp(d){var f=d.ref;if(f!==null){var y=d.stateNode;switch(d.tag){case 5:d=J(y);break;default:d=y}typeof f=="function"?f(d):f.current=d}}function xg(d){var f=d.alternate;f!==null&&(d.alternate=null,xg(f)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(f=d.stateNode,f!==null&&Je(f)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function Cc(d){return d.tag===5||d.tag===3||d.tag===4}function ss(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||Cc(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function up(d,f,y){var k=d.tag;if(k===5||k===6)d=d.stateNode,f?Ne(y,d,f):xt(y,d);else if(k!==4&&(d=d.child,d!==null))for(up(d,f,y),d=d.sibling;d!==null;)up(d,f,y),d=d.sibling}function wg(d,f,y){var k=d.tag;if(k===5||k===6)d=d.stateNode,f?dn(y,d,f):Ee(y,d);else if(k!==4&&(d=d.child,d!==null))for(wg(d,f,y),d=d.sibling;d!==null;)wg(d,f,y),d=d.sibling}var Cr=null,ea=!1;function ta(d,f,y){for(y=y.child;y!==null;)Rr(d,f,y),y=y.sibling}function Rr(d,f,y){if(Ut&&typeof Ut.onCommitFiberUnmount=="function")try{Ut.onCommitFiberUnmount(fn,y)}catch(ae){}switch(y.tag){case 5:Mr||wc(y,f);case 6:if(gt){var k=Cr,L=ea;Cr=null,ta(d,f,y),Cr=k,ea=L,Cr!==null&&(ea?tt(Cr,y.stateNode):ct(Cr,y.stateNode))}else ta(d,f,y);break;case 18:gt&&Cr!==null&&(ea?q1(Cr,y.stateNode):Y1(Cr,y.stateNode));break;case 4:gt?(k=Cr,L=ea,Cr=y.stateNode.containerInfo,ea=!0,ta(d,f,y),Cr=k,ea=L):(ht&&(k=y.stateNode.containerInfo,L=Ca(k),Yu(k,L)),ta(d,f,y));break;case 0:case 11:case 14:case 15:if(!Mr&&(k=y.updateQueue,k!==null&&(k=k.lastEffect,k!==null))){L=k=k.next;do{var R=L,W=R.destroy;R=R.tag,W!==void 0&&((R&2)!==0||(R&4)!==0)&&Jo(y,f,W),L=L.next}while(L!==k)}ta(d,f,y);break;case 1:if(!Mr&&(wc(y,f),k=y.stateNode,typeof k.componentWillUnmount=="function"))try{k.props=y.memoizedProps,k.state=y.memoizedState,k.componentWillUnmount()}catch(ae){Yn(y,f,ae)}ta(d,f,y);break;case 21:ta(d,f,y);break;case 22:y.mode&1?(Mr=(k=Mr)||y.memoizedState!==null,ta(d,f,y),Mr=k):ta(d,f,y);break;default:ta(d,f,y)}}function cp(d){var f=d.updateQueue;if(f!==null){d.updateQueue=null;var y=d.stateNode;y===null&&(y=d.stateNode=new $b),f.forEach(function(k){var L=ay.bind(null,d,k);y.has(k)||(y.add(k),k.then(L,L))})}}function So(d,f){var y=f.deletions;if(y!==null)for(var k=0;k";case pp:return":has("+(kg(d)||"")+")";case gp:return'[role="'+d.value+'"]';case mp:return'"'+d.value+'"';case _c:return'[data-testname="'+d.value+'"]';default:throw Error(a(365))}}function kc(d,f){var y=[];d=[d,0];for(var k=0;kL&&(L=W),k&=~R}if(k=L,k=Gn()-k,k=(120>k?120:480>k?480:1080>k?1080:1920>k?1920:3e3>k?3e3:4320>k?4320:1960*Hb(k/1960))-k,10d?16:d,Pt===null)var k=!1;else{if(d=Pt,Pt=null,bp=0,(Ft&6)!==0)throw Error(a(331));var L=Ft;for(Ft|=4,Qe=d.current;Qe!==null;){var R=Qe,W=R.child;if((Qe.flags&16)!==0){var ae=R.deletions;if(ae!==null){for(var fe=0;feGn()-Tg?nl(d,0):Pg|=y),ti(d,f)}function Og(d,f){f===0&&((d.mode&1)===0?f=1:(f=po,po<<=1,(po&130023424)===0&&(po=4194304)));var y=pi();d=Ko(d,f),d!==null&&(_a(d,f,y),ti(d,y))}function Vb(d){var f=d.memoizedState,y=0;f!==null&&(y=f.retryLane),Og(d,y)}function ay(d,f){var y=0;switch(d.tag){case 13:var k=d.stateNode,L=d.memoizedState;L!==null&&(y=L.retryLane);break;case 19:k=d.stateNode;break;default:throw Error(a(314))}k!==null&&k.delete(f),Og(d,y)}var Ig;Ig=function(d,f,y){if(d!==null)if(d.memoizedProps!==f.pendingProps||Xr.current)$i=!0;else{if((d.lanes&y)===0&&(f.flags&128)===0)return $i=!1,zb(d,f,y);$i=(d.flags&131072)!==0}else $i=!1,$n&&(f.flags&1048576)!==0&&Q1(f,br,f.index);switch(f.lanes=0,f.tag){case 2:var k=f.type;La(d,f),d=f.pendingProps;var L=Ws(f,Lr.current);oc(f,y),L=ag(null,f,k,d,L,y);var R=cc();return f.flags|=1,typeof L=="object"&&L!==null&&typeof L.render=="function"&&L.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Zr(k)?(R=!0,ns(f)):R=!1,f.memoizedState=L.state!==null&&L.state!==void 0?L.state:null,tg(f),L.updater=Xo,f.stateNode=L,L._reactInternals=f,ng(f,k,d,y),f=Zo(null,f,k,!0,R,y)):(f.tag=0,$n&&R&&Ci(f),Ei(null,f,L,y),f=f.child),f;case 16:k=f.elementType;e:{switch(La(d,f),d=f.pendingProps,L=k._init,k=L(k._payload),f.type=k,L=f.tag=Pp(k),d=qo(k,d),L){case 0:f=gg(null,f,k,d,y);break e;case 1:f=Z2(null,f,k,d,y);break e;case 11:f=Y2(null,f,k,d,y);break e;case 14:f=Ks(null,f,k,qo(k.type,d),y);break e}throw Error(a(306,k,""))}return f;case 0:return k=f.type,L=f.pendingProps,L=f.elementType===k?L:qo(k,L),gg(d,f,k,L,y);case 1:return k=f.type,L=f.pendingProps,L=f.elementType===k?L:qo(k,L),Z2(d,f,k,L,y);case 3:e:{if(Q2(f),d===null)throw Error(a(387));k=f.pendingProps,R=f.memoizedState,L=R.element,I2(d,f),Zh(f,k,null,y);var W=f.memoizedState;if(k=W.element,vt&&R.isDehydrated)if(R={element:k,isDehydrated:!1,cache:W.cache,pendingSuspenseBoundaries:W.pendingSuspenseBoundaries,transitions:W.transitions},f.updateQueue.baseState=R,f.memoizedState=R,f.flags&256){L=Sc(Error(a(423)),f),f=J2(d,f,k,y,L);break e}else if(k!==L){L=Sc(Error(a(424)),f),f=J2(d,f,k,y,L);break e}else for(vt&&(mo=$1(f.stateNode.containerInfo),jn=f,$n=!0,zi=null,vo=!1),y=F2(f,null,k,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(rc(),k===L){f=as(d,f,y);break e}Ei(d,f,k,y)}f=f.child}return f;case 5:return Tt(f),d===null&&qd(f),k=f.type,L=f.pendingProps,R=d!==null?d.memoizedProps:null,W=L.children,we(k,L)?W=null:R!==null&&we(k,R)&&(f.flags|=32),X2(d,f),Ei(d,f,W,y),f.child;case 6:return d===null&&qd(f),null;case 13:return ey(d,f,y);case 4:return ge(f,f.stateNode.containerInfo),k=f.pendingProps,d===null?f.child=sc(f,null,k,y):Ei(d,f,k,y),f.child;case 11:return k=f.type,L=f.pendingProps,L=f.elementType===k?L:qo(k,L),Y2(d,f,k,L,y);case 7:return Ei(d,f,f.pendingProps,y),f.child;case 8:return Ei(d,f,f.pendingProps.children,y),f.child;case 12:return Ei(d,f,f.pendingProps.children,y),f.child;case 10:e:{if(k=f.type._context,L=f.pendingProps,R=f.memoizedProps,W=L.value,O2(f,k,W),R!==null)if(U(R.value,W)){if(R.children===L.children&&!Xr.current){f=as(d,f,y);break e}}else for(R=f.child,R!==null&&(R.return=f);R!==null;){var ae=R.dependencies;if(ae!==null){W=R.child;for(var fe=ae.firstContext;fe!==null;){if(fe.context===k){if(R.tag===1){fe=is(-1,y&-y),fe.tag=2;var Be=R.updateQueue;if(Be!==null){Be=Be.shared;var nt=Be.pending;nt===null?fe.next=fe:(fe.next=nt.next,nt.next=fe),Be.pending=fe}}R.lanes|=y,fe=R.alternate,fe!==null&&(fe.lanes|=y),Jd(R.return,y,f),ae.lanes|=y;break}fe=fe.next}}else if(R.tag===10)W=R.type===f.type?null:R.child;else if(R.tag===18){if(W=R.return,W===null)throw Error(a(341));W.lanes|=y,ae=W.alternate,ae!==null&&(ae.lanes|=y),Jd(W,y,f),W=R.sibling}else W=R.child;if(W!==null)W.return=R;else for(W=R;W!==null;){if(W===f){W=null;break}if(R=W.sibling,R!==null){R.return=W.return,W=R;break}W=W.return}R=W}Ei(d,f,L.children,y),f=f.child}return f;case 9:return L=f.type,k=f.pendingProps.children,oc(f,y),L=Xi(L),k=k(L),f.flags|=1,Ei(d,f,k,y),f.child;case 14:return k=f.type,L=qo(k,f.pendingProps),L=qo(k.type,L),Ks(d,f,k,L,y);case 15:return q2(d,f,f.type,f.pendingProps,y);case 17:return k=f.type,L=f.pendingProps,L=f.elementType===k?L:qo(k,L),La(d,f),f.tag=1,Zr(k)?(d=!0,ns(f)):d=!1,oc(f,y),N2(f,k,L),ng(f,k,L,y),Zo(null,f,k,!0,d,y);case 19:return ny(d,f,y);case 22:return K2(d,f,y)}throw Error(a(156,f.tag))};function Li(d,f){return ec(d,f)}function Aa(d,f,y,k){this.tag=d,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=k,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wo(d,f,y,k){return new Aa(d,f,y,k)}function Dg(d){return d=d.prototype,!(!d||!d.isReactComponent)}function Pp(d){if(typeof d=="function")return Dg(d)?1:0;if(d!=null){if(d=d.$$typeof,d===w)return 11;if(d===_)return 14}return 2}function eo(d,f){var y=d.alternate;return y===null?(y=wo(d.tag,f,d.key,d.mode),y.elementType=d.elementType,y.type=d.type,y.stateNode=d.stateNode,y.alternate=d,d.alternate=y):(y.pendingProps=f,y.type=d.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=d.flags&14680064,y.childLanes=d.childLanes,y.lanes=d.lanes,y.child=d.child,y.memoizedProps=d.memoizedProps,y.memoizedState=d.memoizedState,y.updateQueue=d.updateQueue,f=d.dependencies,y.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},y.sibling=d.sibling,y.index=d.index,y.ref=d.ref,y}function bf(d,f,y,k,L,R){var W=2;if(k=d,typeof d=="function")Dg(d)&&(W=1);else if(typeof d=="string")W=5;else e:switch(d){case h:return ol(y.children,L,R,f);case g:W=8,L|=8;break;case m:return d=wo(12,y,f,L|2),d.elementType=m,d.lanes=R,d;case P:return d=wo(13,y,f,L),d.elementType=P,d.lanes=R,d;case E:return d=wo(19,y,f,L),d.elementType=E,d.lanes=R,d;case M:return Tp(y,L,R,f);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case v:W=10;break e;case b:W=9;break e;case w:W=11;break e;case _:W=14;break e;case T:W=16,k=null;break e}throw Error(a(130,d==null?d:typeof d,""))}return f=wo(W,y,f,L),f.elementType=d,f.type=k,f.lanes=R,f}function ol(d,f,y,k){return d=wo(7,d,k,f),d.lanes=y,d}function Tp(d,f,y,k){return d=wo(22,d,k,f),d.elementType=M,d.lanes=y,d.stateNode={isHidden:!1},d}function Lp(d,f,y){return d=wo(6,d,null,f),d.lanes=y,d}function al(d,f,y){return f=wo(4,d.children!==null?d.children:[],d.key,f),f.lanes=y,f.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},f}function xf(d,f,y,k,L){this.tag=f,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=pt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ju(0),this.expirationTimes=Ju(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ju(0),this.identifierPrefix=k,this.onRecoverableError=L,vt&&(this.mutableSourceEagerHydrationData=null)}function sy(d,f,y,k,L,R,W,ae,fe){return d=new xf(d,f,y,ae,fe),f===1?(f=1,R===!0&&(f|=8)):f=0,R=wo(3,null,null,f),d.current=R,R.stateNode=d,R.memoizedState={element:k,isDehydrated:y,cache:null,transitions:null,pendingSuspenseBoundaries:null},tg(R),d}function Ng(d){if(!d)return Go;d=d._reactInternals;e:{if($(d)!==d||d.tag!==1)throw Error(a(170));var f=d;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(Zr(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(a(171))}if(d.tag===1){var y=d.type;if(Zr(y))return Kl(d,y,f)}return f}function Bg(d){var f=d._reactInternals;if(f===void 0)throw typeof d.render=="function"?Error(a(188)):(d=Object.keys(d).join(","),Error(a(268,d)));return d=ne(f),d===null?null:d.stateNode}function wf(d,f){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var y=d.retryLane;d.retryLane=y!==0&&y=Be&&R>=Rt&&L<=nt&&W<=qe){d.splice(f,1);break}else if(k!==Be||y.width!==fe.width||qeW){if(!(R!==Rt||y.height!==fe.height||ntL)){Be>k&&(fe.width+=Be-k,fe.x=k),ntR&&(fe.height+=Rt-R,fe.y=R),qey&&(y=W)),W ")+` No matching component was found for: `)+d.join(" > ")}return null},n.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return J(d.child.stateNode);default:return d.child.stateNode}},n.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:Ap,findFiberByHostInstance:d.findFiberByHostInstance||zg,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)d=!0;else{try{fn=f.inject(d),Ut=f}catch(y){}d=!!f.checkDCE}}return d},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(d,f,y,k){if(!Et)throw Error(a(363));d=Eg(d,f);var L=Kt(d,y,k).disconnect;return{disconnect:function(){L()}}},n.registerMutableSourceForHydration=function(d,f){var y=f._getVersion;y=y(f._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[f,y]:d.mutableSourceEagerHydrationData.push(f,y)},n.runWithPriority=function(d,f){var y=Vt;try{return Vt=d,f()}finally{Vt=y}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(d,f,y,k){var L=f.current,R=pi(),W=Ir(L);return y=Ng(y),f.context===null?f.context=y:f.pendingContext=y,f=is(R,W),f.payload={element:d},k=k===void 0?null:k,k!==null&&(f.callback=k),d=Ys(L,f,W),d!==null&&(xo(d,L,W,R),Xh(d,L,W)),W},n};(function(e){e.exports=Ske})(PU);const bke=o9(PU.exports);var Vk={exports:{}},Nh={};/** * @license React * react-reconciler-constants.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */Nh.ConcurrentRoot=1;Nh.ContinuousEventPriority=4;Nh.DefaultEventPriority=16;Nh.DiscreteEventPriority=1;Nh.IdleEventPriority=536870912;Nh.LegacyRoot=0;(function(e){e.exports=Nh})(Vk);const UR={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let GR=!1,jR=!1;const Uk=".react-konva-event",xke=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. Position of a node will be changed during drag&drop, so you should update state of the react app as well. Consider to add onDragMove or onDragEnd events. For more info see: https://github.com/konvajs/react-konva/issues/256 `,wke=`ReactKonva: You are using "zIndex" attribute for a Konva node. react-konva may get confused with ordering. Just define correct order of elements in your render function of a component. For more info see: https://github.com/konvajs/react-konva/issues/194 `,Cke={};function Mb(e,t,n=Cke){if(!GR&&"zIndex"in t&&(console.warn(wke),GR=!0),!jR&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(xke),jR=!0)}for(var o in n)if(!UR[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var h=t._useStrictMode,g={},m=!1;const v={};for(var o in t)if(!UR[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(v[l]=t[o])}!a&&(t[o]!==n[o]||h&&t[o]!==e.getAttr(o))&&(m=!0,g[o]=t[o])}m&&(e.setAttrs(g),zd(e));for(var l in v)e.on(l+Uk,v[l])}function zd(e){if(!st.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const TU={},_ke={};Sh.Node.prototype._applyProps=Mb;function kke(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),zd(e)}function Eke(e,t,n){let r=Sh[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=Sh.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return Mb(l,o),l}function Pke(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Tke(e,t,n){return!1}function Lke(e){return e}function Ake(){return null}function Mke(){return null}function Rke(e,t,n,r){return _ke}function Oke(){}function Ike(e){}function Dke(e,t){return!1}function Nke(){return TU}function Bke(){return TU}const zke=setTimeout,Fke=clearTimeout,$ke=-1;function Hke(e,t){return!1}const Wke=!1,Vke=!0,Uke=!0;function Gke(e,t){t.parent===e?t.moveToTop():e.add(t),zd(e)}function jke(e,t){t.parent===e?t.moveToTop():e.add(t),zd(e)}function LU(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),zd(e)}function Yke(e,t,n){LU(e,t,n)}function qke(e,t){t.destroy(),t.off(Uk),zd(e)}function Kke(e,t){t.destroy(),t.off(Uk),zd(e)}function Xke(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function Zke(e,t,n){}function Qke(e,t,n,r,i){Mb(e,i,r)}function Jke(e){e.hide(),zd(e)}function eEe(e){}function tEe(e,t){(t.visible==null||t.visible)&&e.show()}function nEe(e,t){}function rEe(e){}function iEe(){}const oEe=()=>Vk.exports.DefaultEventPriority,aEe=Object.freeze(Object.defineProperty({__proto__:null,appendInitialChild:kke,createInstance:Eke,createTextInstance:Pke,finalizeInitialChildren:Tke,getPublicInstance:Lke,prepareForCommit:Ake,preparePortalMount:Mke,prepareUpdate:Rke,resetAfterCommit:Oke,resetTextContent:Ike,shouldDeprioritizeSubtree:Dke,getRootHostContext:Nke,getChildHostContext:Bke,scheduleTimeout:zke,cancelTimeout:Fke,noTimeout:$ke,shouldSetTextContent:Hke,isPrimaryRenderer:Wke,warnsIfNotActing:Vke,supportsMutation:Uke,appendChild:Gke,appendChildToContainer:jke,insertBefore:LU,insertInContainerBefore:Yke,removeChild:qke,removeChildFromContainer:Kke,commitTextUpdate:Xke,commitMount:Zke,commitUpdate:Qke,hideInstance:Jke,hideTextInstance:eEe,unhideInstance:tEe,unhideTextInstance:nEe,clearContainer:rEe,detachDeletedInstance:iEe,getCurrentEventPriority:oEe,now:S0.exports.unstable_now,idlePriority:S0.exports.unstable_IdlePriority,run:S0.exports.unstable_runWithPriority},Symbol.toStringTag,{value:"Module"}));var sEe=Object.defineProperty,lEe=Object.defineProperties,uEe=Object.getOwnPropertyDescriptors,YR=Object.getOwnPropertySymbols,cEe=Object.prototype.hasOwnProperty,dEe=Object.prototype.propertyIsEnumerable,qR=(e,t,n)=>t in e?sEe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KR=(e,t)=>{for(var n in t||(t={}))cEe.call(t,n)&&qR(e,n,t[n]);if(YR)for(var n of YR(t))dEe.call(t,n)&&qR(e,n,t[n]);return e},fEe=(e,t)=>lEe(e,uEe(t));function Gk(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=Gk(r,t,n);if(i)return i;r=t?null:r.sibling}}function AU(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch(t){return e}}const jk=AU(C.exports.createContext(null));class MU extends C.exports.Component{render(){return S(jk.Provider,{value:this._reactInternals,children:this.props.children})}}const{ReactCurrentOwner:hEe,ReactCurrentDispatcher:pEe}=C.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function gEe(){const e=C.exports.useContext(jk);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=C.exports.useId();return C.exports.useMemo(()=>{var r;return(r=hEe.current)!=null?r:Gk(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const fm=[],XR=new WeakMap;function mEe(){var e;const t=gEe();fm.splice(0,fm.length),Gk(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==jk&&fm.push(AU(i))});for(const n of fm){const r=(e=pEe.current)==null?void 0:e.readContext(n);XR.set(n,r)}return C.exports.useMemo(()=>fm.reduce((n,r)=>i=>C.exports.createElement(n,null,C.exports.createElement(r.Provider,fEe(KR({},i),{value:XR.get(r)}))),n=>S(MU,{...KR({},n)})),[])}function vEe(e){const t=se.useRef();return se.useLayoutEffect(()=>{t.current=e}),t.current}const yEe=e=>{const t=se.useRef(),n=se.useRef(),r=se.useRef(),i=vEe(e),o=mEe(),a=s=>{const{forwardedRef:l}=e;!l||(typeof l=="function"?l(s):l.current=s)};return se.useLayoutEffect(()=>(n.current=new Sh.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=Rm.createContainer(n.current,Vk.exports.LegacyRoot,!1,null),Rm.updateContainer(S(o,{children:e.children}),r.current),()=>{!Sh.isBrowser||(a(null),Rm.updateContainer(null,r.current,null),n.current.destroy())}),[]),se.useLayoutEffect(()=>{a(n.current),Mb(n.current,e,i),Rm.updateContainer(S(o,{children:e.children}),r.current,null)}),S("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},hm="Layer",Bu="Group",zu="Rect",Af="Circle",O4="Line",RU="Image",SEe="Transformer",Rm=bke(aEe);Rm.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:se.version,rendererPackageName:"react-konva"});const bEe=se.forwardRef((e,t)=>S(MU,{children:S(yEe,{...e,forwardedRef:t})})),xEe=rt([Qt],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:We.isEqual}}),wEe=e=>{const{...t}=e,{objects:n}=ye(xEe);return S(Bu,{listening:!1,...t,children:n.filter(X_).map((r,i)=>S(O4,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})},uh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},CEe=rt(Qt,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:h,stageScale:g,stageDimensions:m,boundingBoxCoordinates:v,boundingBoxDimensions:b,shouldRestrictStrokesToBox:w}=e,P=w?{clipX:v.x,clipY:v.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:SM/g,colorPickerInnerRadius:(SM-v7+1)/g,maskColorString:uh({...i,a:.5}),brushColorString:uh(o),colorPickerColorString:uh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||h||!t)&&l,strokeWidth:1.5/g,dotRadius:1.5/g,clip:P}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),_Ee=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:h,brushColorString:g,colorPickerColorString:m,colorPickerInnerRadius:v,colorPickerOuterRadius:b,clip:w}=ye(CEe);return l?X(Bu,{listening:!1,...w,...t,children:[a==="colorPicker"?X(Rn,{children:[S(Af,{x:n,y:r,radius:b,stroke:g,strokeWidth:v7,strokeScaleEnabled:!1}),S(Af,{x:n,y:r,radius:v,stroke:m,strokeWidth:v7,strokeScaleEnabled:!1})]}):X(Rn,{children:[S(Af,{x:n,y:r,radius:i,fill:s==="mask"?o:g,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),S(Af,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:h*2,strokeEnabled:!0,listening:!1}),S(Af,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:h,strokeEnabled:!0,listening:!1})]}),S(Af,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),S(Af,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},kEe=rt(Qt,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),EEe=e=>{const{...t}=e,n=De(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:h,hitStrokeWidth:g}=ye(kEe),m=C.exports.useRef(null),v=C.exports.useRef(null),[b,w]=C.exports.useState(!1);C.exports.useEffect(()=>{var ne;!m.current||!v.current||(m.current.nodes([v.current]),(ne=m.current.getLayer())==null||ne.batchDraw())},[]);const P=64*l,E=C.exports.useCallback(ne=>{if(!u){n(Bw({x:Math.floor(ne.target.x()),y:Math.floor(ne.target.y())}));return}const V=ne.target.x(),q=ne.target.y(),te=kl(V,64),J=kl(q,64);ne.target.x(te),ne.target.y(J),n(Bw({x:te,y:J}))},[n,u]),_=C.exports.useCallback(()=>{if(!v.current)return;const ne=v.current,V=ne.scaleX(),q=ne.scaleY(),te=Math.round(ne.width()*V),J=Math.round(ne.height()*q),Z=Math.round(ne.x()),G=Math.round(ne.y());n(km({width:te,height:J})),n(Bw({x:u?ed(Z,64):Z,y:u?ed(G,64):G})),ne.scaleX(1),ne.scaleY(1)},[n,u]),T=C.exports.useCallback((ne,V,q)=>{const te=ne.x%P,J=ne.y%P;return{x:ed(V.x,P)+te,y:ed(V.y,P)+J}},[P]),M=()=>{n(Fw(!0))},O=()=>{n(Fw(!1)),n(zw(!1)),n(o3(!1)),w(!1)},I=()=>{n(zw(!0))},D=()=>{n(Fw(!1)),n(zw(!1)),n(o3(!1)),w(!1)},B=()=>{w(!0)},$=()=>{!s&&!a&&w(!1)},H=()=>{n(o3(!0))},j=()=>{n(o3(!1))};return X(Bu,{...t,children:[S(zu,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:H,onMouseOver:H,onMouseLeave:j,onMouseOut:j}),S(zu,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:g,listening:!o&&h==="move",onDragStart:I,onDragEnd:D,onDragMove:E,onMouseDown:I,onMouseOut:$,onMouseOver:B,onMouseEnter:B,onMouseUp:D,onTransform:_,onTransformEnd:O,ref:v,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),S(SEe,{anchorCornerRadius:3,anchorDragBoundFunc:T,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:h==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&h==="move",onDragStart:I,onDragEnd:D,onMouseDown:M,onMouseUp:O,onTransformEnd:O,ref:m,rotateEnabled:!1})]})},PEe=rt([Qt,Tr,yr],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),TEe=()=>{const e=De(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=ye(PEe),s=C.exports.useRef(null),l=MW(),u=()=>e(Z_());Ue(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const h=()=>e(C2(!o));Ue(["h"],()=>{h()},{enabled:()=>!i,preventDefault:!0},[o]),Ue(["n"],()=>{e(_4(!a))},{enabled:!0,preventDefault:!0},[a]),Ue("esc",()=>{e($3e())},{enabled:()=>!0,preventDefault:!0}),Ue("shift+h",()=>{e(Y3e(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),Ue(["space"],g=>{g.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(Ol("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(Ol(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},LEe=rt(Qt,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:uh(t)}}),ZR=e=>`data:image/svg+xml;utf8, `.replaceAll("black",e),AEe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ye(LEe),[a,s]=C.exports.useState(null),[l,u]=C.exports.useState(0),h=C.exports.useRef(null),g=C.exports.useCallback(()=>{u(l+1),setTimeout(g,500)},[l]);return C.exports.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=ZR(n)},[a,n]),C.exports.useEffect(()=>{!a||(a.src=ZR(n))},[a,n]),C.exports.useEffect(()=>{const m=setInterval(()=>u(v=>(v+1)%5),50);return()=>clearInterval(m)},[]),!a||!ii.exports.isNumber(r.x)||!ii.exports.isNumber(r.y)||!ii.exports.isNumber(o)||!ii.exports.isNumber(i.width)||!ii.exports.isNumber(i.height)?null:S(zu,{ref:h,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:ii.exports.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},MEe=rt([Qt],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),REe=e=>{const t=De(),{isMoveStageKeyHeld:n,stageScale:r}=ye(MEe);return C.exports.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=We.clamp(r*x3e**s,w3e,C3e),u={x:o.x-a.x*l,y:o.y-a.y*l};t(X3e(l)),t(RH(u))},[e,n,r,t])},Yk=e=>{const t=e.getPointerPosition(),n=e.getAbsoluteTransform().copy();if(!t||!n)return;const r=n.invert().point(t);return{x:r.x,y:r.y}},OU=()=>{const e=De(),t=Os(),n=MW();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=Kp.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(U3e({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(O3e())}}},OEe=rt([Tr,Qt,yr],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),IEe=e=>{const t=De(),{tool:n,isStaging:r}=ye(OEe),{commitColorUnderCursor:i}=OU();return C.exports.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(w4(!0));return}if(n==="colorPicker"){i();return}const a=Yk(e.current);!a||(o.evt.preventDefault(),t(CH(!0)),t(R3e([a.x,a.y])))},[e,n,r,t,i])},DEe=rt([Tr,Qt,yr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),NEe=(e,t)=>{const n=De(),{tool:r,isDrawing:i,isStaging:o}=ye(DEe);return C.exports.useCallback(()=>{if(r==="move"||o){n(w4(!1));return}if(!t.current&&i&&e.current){const a=Yk(e.current);if(!a)return;n(bH([a.x,a.y]))}else t.current=!1;n(CH(!1))},[t,n,i,o,e,r])},BEe=rt([Tr,Qt,yr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),zEe=(e,t,n)=>{const r=De(),{isDrawing:i,tool:o,isStaging:a}=ye(BEe),{updateColorUnderCursor:s}=OU();return C.exports.useCallback(()=>{if(!e.current)return;const l=Yk(e.current);if(!!l){if(r(G3e(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(bH([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},FEe=()=>{const e=De();return C.exports.useCallback(()=>{e(N3e())},[e])},$Ee=rt([Qt,yr],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),HEe=()=>{const e=De(),{tool:t,isStaging:n,isMovingBoundingBox:r}=ye($Ee);return{handleDragStart:C.exports.useCallback(()=>{!((t==="move"||n)&&!r)||e(w4(!0))},[e,r,n,t]),handleDragMove:C.exports.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(RH(o))},[e,r,n,t]),handleDragEnd:C.exports.useCallback(()=>{!((t==="move"||n)&&!r)||e(w4(!1))},[e,r,n,t])}};var Mf=C.exports,WEe=function(t,n,r){const i=Mf.useRef("loading"),o=Mf.useRef(),[a,s]=Mf.useState(0),l=Mf.useRef(),u=Mf.useRef(),h=Mf.useRef();return(l.current!==t||u.current!==n||h.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,h.current=r),Mf.useLayoutEffect(function(){if(!t)return;var g=document.createElement("img");function m(){i.current="loaded",o.current=g,s(Math.random())}function v(){i.current="failed",o.current=void 0,s(Math.random())}return g.addEventListener("load",m),g.addEventListener("error",v),n&&(g.crossOrigin=n),r&&(g.referrerpolicy=r),g.src=t,function(){g.removeEventListener("load",m),g.removeEventListener("error",v)}},[t,n,r]),[o.current,i.current]};const IU=e=>{const{url:t,x:n,y:r}=e,[i]=WEe(t);return S(RU,{x:n,y:r,image:i,listening:!1})},VEe=rt([Qt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),UEe=()=>{const{objects:e}=ye(VEe);return e?S(Bu,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(x4(t))return S(IU,{x:t.x,y:t.y,url:t.image.url},n);if(E3e(t)){const r=S(O4,{points:t.points,stroke:t.color?uh(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?S(Bu,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(P3e(t))return S(zu,{x:t.x,y:t.y,width:t.width,height:t.height,fill:uh(t.color)},n);if(T3e(t))return S(zu,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},GEe=rt([Qt],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),jEe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},YEe=()=>{const{colorMode:e}=i2(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=ye(GEe),[i,o]=C.exports.useState([]),a=C.exports.useCallback(s=>s/t,[t]);return C.exports.useLayoutEffect(()=>{const s=jEe[e],{width:l,height:u}=r,{x:h,y:g}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(h),y:a(g)}},v={x:Math.ceil(a(h)/64)*64,y:Math.ceil(a(g)/64)*64},b={x1:-v.x,y1:-v.y,x2:a(l)-v.x+64,y2:a(u)-v.y+64},P={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},E=P.x2-P.x1,_=P.y2-P.y1,T=Math.round(E/64)+1,M=Math.round(_/64)+1,O=We.range(0,T).map(D=>S(O4,{x:P.x1+D*64,y:P.y1,points:[0,0,0,_],stroke:s,strokeWidth:1},`x_${D}`)),I=We.range(0,M).map(D=>S(O4,{x:P.x1,y:P.y1+D*64,points:[0,0,E,0],stroke:s,strokeWidth:1},`y_${D}`));o(O.concat(I))},[t,n,r,e,a]),S(Bu,{children:i})},qEe=rt([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:We.isEqual}}),KEe=e=>{const{...t}=e,n=ye(qEe),[r,i]=C.exports.useState(null);if(C.exports.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?S(RU,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},y0=e=>Math.round(e*100)/100,XEe=rt([Qt],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${y0(n)}, ${y0(r)})`}},{memoizeOptions:{resultEqualityCheck:We.isEqual}});function ZEe(){const{cursorCoordinatesString:e}=ye(XEe);return S("div",{children:`Cursor Position: ${e}`})}const QEe=rt([Qt],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:h},stageScale:g,shouldShowCanvasDebugInfo:m,layer:v,boundingBoxScaleMethod:b}=e;let w="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(w="var(--status-working-color)"),{activeLayerColor:v==="mask"?"var(--status-working-color)":"inherit",activeLayerString:v.charAt(0).toUpperCase()+v.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${y0(u)}, ${y0(h)})`,boundingBoxDimensionsString:`${o}\xD7${a}`,scaledBoundingBoxDimensionsString:`${s}\xD7${l}`,canvasCoordinatesString:`${y0(r)}\xD7${y0(i)}`,canvasDimensionsString:`${t}\xD7${n}`,canvasScaleString:Math.round(g*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none"}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),JEe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:g}=ye(QEe);return X("div",{className:"canvas-status-text",children:[S("div",{style:{color:e},children:`Active Layer: ${t}`}),S("div",{children:`Canvas Scale: ${u}%`}),g&&S("div",{style:{color:n},children:`Bounding Box: ${i}`}),a&&S("div",{style:{color:n},children:`Scaled Bounding Box: ${o}`}),h&&X(Rn,{children:[S("div",{children:`Bounding Box Position: ${r}`}),S("div",{children:`Canvas Dimensions: ${l}`}),S("div",{children:`Canvas Position: ${s}`}),S(ZEe,{})]})]})},ePe=rt([Qt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),tPe=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=ye(ePe);return X(Bu,{...t,children:[r&&n&&S(IU,{url:n.image.url,x:o,y:a}),i&&X(Bu,{children:[S(zu,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),S(zu,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},nPe=rt([Qt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),rPe=()=>{const e=De(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=ye(nPe),o=C.exports.useCallback(()=>{e(wM(!0))},[e]),a=C.exports.useCallback(()=>{e(wM(!1))},[e]);Ue(["left"],()=>{s()},{enabled:()=>!0,preventDefault:!0}),Ue(["right"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),Ue(["enter"],()=>{u()},{enabled:()=>!0,preventDefault:!0});const s=()=>e(z3e()),l=()=>e(B3e()),u=()=>e(I3e());return r?S(bt,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:o,onMouseOut:a,children:X(ji,{isAttached:!0,children:[S(Xe,{tooltip:"Previous (Left)","aria-label":"Previous (Left)",icon:S(Exe,{}),onClick:s,"data-selected":!0,isDisabled:t}),S(Xe,{tooltip:"Next (Right)","aria-label":"Next (Right)",icon:S(Pxe,{}),onClick:l,"data-selected":!0,isDisabled:n}),S(Xe,{tooltip:"Accept (Enter)","aria-label":"Accept (Enter)",icon:S(ck,{}),onClick:u,"data-selected":!0}),S(Xe,{tooltip:"Show/Hide","aria-label":"Show/Hide","data-alert":!i,icon:i?S(Oxe,{}):S(Rxe,{}),onClick:()=>e(q3e(!i)),"data-selected":!0}),S(Xe,{tooltip:"Save to Gallery","aria-label":"Save to Gallery",icon:S(hk,{}),onClick:()=>e(t4e(r.image.url)),"data-selected":!0}),S(Xe,{tooltip:"Discard All","aria-label":"Discard All",icon:S(fk,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(D3e()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},iPe=rt(Qt,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),oPe=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ye(iPe);return X(Bu,{children:[S(zu,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),S(zu,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},aPe=rt([Qt,yr],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:h,isMovingStage:g,shouldShowIntermediates:m,shouldShowGrid:v,shouldRestrictStrokesToBox:b}=e;let w="none";return h==="move"||t?g?w="grabbing":w="grab":o?w=void 0:b&&!a&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:v,stageCoordinates:u,stageCursor:w,stageDimensions:l,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),DU=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:h}=ye(aPe);TEe();const g=C.exports.useRef(null),m=C.exports.useRef(null),v=C.exports.useCallback($=>{Cbe($),g.current=$},[]),b=C.exports.useCallback($=>{wbe($),m.current=$},[]),w=C.exports.useRef({x:0,y:0}),P=C.exports.useRef(!1),E=REe(g),_=IEe(g),T=NEe(g,P),M=zEe(g,P,w),O=FEe(),{handleDragStart:I,handleDragMove:D,handleDragEnd:B}=HEe();return S("div",{className:"inpainting-canvas-container",children:X("div",{className:"inpainting-canvas-wrapper",children:[X(bEe,{tabIndex:-1,ref:v,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:_,onTouchMove:M,onTouchEnd:T,onMouseDown:_,onMouseLeave:O,onMouseMove:M,onMouseUp:T,onDragStart:I,onDragMove:D,onDragEnd:B,onContextMenu:$=>$.evt.preventDefault(),onWheel:E,draggable:(l==="move"||u)&&!t,children:[S(hm,{id:"grid",visible:r,children:S(YEe,{})}),S(hm,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:S(UEe,{})}),X(hm,{id:"mask",visible:e,listening:!1,children:[S(wEe,{visible:!0,listening:!1}),S(AEe,{listening:!1})]}),S(hm,{children:S(oPe,{})}),X(hm,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&S(_Ee,{visible:l!=="move",listening:!1}),S(tPe,{visible:u}),h&&S(KEe,{}),S(EEe,{visible:n&&!u})]})]}),S(JEe,{}),S(rPe,{})]})})},sPe=rt([Qt,Tr,Vu],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:We.isEqual}});function NU(){const e=De(),{canUndo:t,activeTabName:n}=ye(sPe),r=()=>{e(Z3e())};return Ue(["meta+z","ctrl+z"],()=>{r()},{enabled:()=>t,preventDefault:!0},[n,t]),S(Xe,{"aria-label":"Undo (Ctrl+Z)",tooltip:"Undo (Ctrl+Z)",icon:S(Yxe,{}),onClick:r,isDisabled:!t})}const lPe=rt([Qt,Tr,Vu],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:We.isEqual}});function BU(){const e=De(),{canRedo:t,activeTabName:n}=ye(lPe),r=()=>{e(F3e())};return Ue(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{r()},{enabled:()=>t,preventDefault:!0},[n,t]),S(Xe,{"aria-label":"Redo (Ctrl+Shift+Z)",tooltip:"Redo (Ctrl+Shift+Z)",icon:S(Vxe,{}),onClick:r,isDisabled:!t})}const zU=Pe((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:h,onClose:g}=Hv(),m=C.exports.useRef(null),v=()=>{r(),g()},b=()=>{o&&o(),g()};return X(Rn,{children:[C.exports.cloneElement(l,{onClick:h,ref:t}),S(qF,{isOpen:u,leastDestructiveRef:m,onClose:g,children:S(u1,{children:X(KF,{className:"modal",children:[S(US,{fontSize:"lg",fontWeight:"bold",children:s}),S(jv,{children:a}),X(VS,{children:[S(ja,{ref:m,onClick:b,className:"modal-close-btn",children:i}),S(ja,{colorScheme:"red",onClick:v,ml:3,children:n})]})]})})})]})}),FU=()=>{const e=ye(yr),t=De();return X(zU,{title:"Empty Temp Image Folder",acceptCallback:()=>{t(n4e()),t(Q_()),t(xH())},acceptButtonText:"Empty Folder",triggerComponent:S(Ro,{leftIcon:S(Ih,{}),size:"sm",isDisabled:e,children:"Empty Temp Image Folder"}),children:[S("p",{children:"Emptying the temp image folder also fully resets the Unified Canvas. This includes all undo/redo history, images in the staging area, and the canvas base layer."}),S("br",{}),S("p",{children:"Are you sure you want to empty the temp folder?"})]})},$U=()=>{const e=ye(yr),t=De();return X(zU,{title:"Clear Canvas History",acceptCallback:()=>t(xH()),acceptButtonText:"Clear History",triggerComponent:S(Ro,{size:"sm",leftIcon:S(Ih,{}),isDisabled:e,children:"Clear Canvas History"}),children:[S("p",{children:"Clearing the canvas history leaves your current canvas intact, but irreversibly clears the undo and redo history."}),S("br",{}),S("p",{children:"Are you sure you want to clear the canvas history?"})]})},uPe=rt([Qt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),cPe=()=>{const e=De(),{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=ye(uPe);return Ue(["n"],()=>{e(_4(!s))},{enabled:!0,preventDefault:!0},[s]),S(Dl,{trigger:"hover",triggerComponent:S(Xe,{tooltip:"Canvas Settings","aria-label":"Canvas Settings",icon:S(gb,{})}),children:X(bt,{direction:"column",gap:"0.5rem",children:[S(fr,{label:"Show Intermediates",isChecked:a,onChange:h=>e(MH(h.target.checked))}),S(fr,{label:"Show Grid",isChecked:o,onChange:h=>e(AH(h.target.checked))}),S(fr,{label:"Snap to Grid",isChecked:s,onChange:h=>e(_4(h.target.checked))}),S(fr,{label:"Darken Outside Selection",isChecked:r,onChange:h=>e(PH(h.target.checked))}),S(fr,{label:"Auto Save to Gallery",isChecked:t,onChange:h=>e(kH(h.target.checked))}),S(fr,{label:"Save Box Region Only",isChecked:n,onChange:h=>e(EH(h.target.checked))}),S(fr,{label:"Limit Strokes to Box",isChecked:l,onChange:h=>e(OH(h.target.checked))}),S(fr,{label:"Show Canvas Debug Info",isChecked:i,onChange:h=>e(LH(h.target.checked))}),S($U,{}),S(FU,{})]})})};function Rb(){return(Rb=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function Z7(e){var t=C.exports.useRef(e),n=C.exports.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var p1=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:P.buttons>0)&&i.current?o(QR(i.current,P,s.current)):w(!1)},b=function(){return w(!1)};function w(P){var E=l.current,_=Q7(i.current),T=P?_.addEventListener:_.removeEventListener;T(E?"touchmove":"mousemove",v),T(E?"touchend":"mouseup",b)}return[function(P){var E=P.nativeEvent,_=i.current;if(_&&(JR(E),!function(M,O){return O&&!lv(M)}(E,l.current)&&_)){if(lv(E)){l.current=!0;var T=E.changedTouches||[];T.length&&(s.current=T[0].identifier)}_.focus(),o(QR(_,E,s.current)),w(!0)}},function(P){var E=P.which||P.keyCode;E<37||E>40||(P.preventDefault(),a({left:E===39?.05:E===37?-.05:0,top:E===40?.05:E===38?-.05:0}))},w]},[a,o]),h=u[0],g=u[1],m=u[2];return C.exports.useEffect(function(){return m},[m]),S("div",{...Rb({},r,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:i,onKeyDown:g,tabIndex:0,role:"slider"})})}),Ob=function(e){return e.filter(Boolean).join(" ")},Kk=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=Ob(["react-colorful__pointer",e.className]);return S("div",{className:o,style:{top:100*i+"%",left:100*n+"%"},children:S("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}})})},so=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},WU=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:so(e.h),s:so(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:so(i/2),a:so(r,2)}},J7=function(e){var t=WU(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},o6=function(e){var t=WU(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},dPe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:so(255*[r,s,a,a,l,r][u]),g:so(255*[l,r,r,s,a,a][u]),b:so(255*[a,a,l,r,r,s][u]),a:so(i,2)}},fPe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:so(60*(s<0?s+6:s)),s:so(o?a/o*100:0),v:so(o/255*100),a:i}},hPe=se.memo(function(e){var t=e.hue,n=e.onChange,r=Ob(["react-colorful__hue",e.className]);return se.createElement("div",{className:r},se.createElement(qk,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:p1(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":so(t),"aria-valuemax":"360","aria-valuemin":"0"},se.createElement(Kk,{className:"react-colorful__hue-pointer",left:t/360,color:J7({h:t,s:100,v:100,a:1})})))}),pPe=se.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:J7({h:t.h,s:100,v:100,a:1})};return se.createElement("div",{className:"react-colorful__saturation",style:r},se.createElement(qk,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:p1(t.s+100*i.left,0,100),v:p1(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+so(t.s)+"%, Brightness "+so(t.v)+"%"},se.createElement(Kk,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:J7(t)})))}),VU=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function gPe(e,t,n){var r=Z7(n),i=C.exports.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=C.exports.useRef({color:t,hsva:o});C.exports.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),C.exports.useEffect(function(){var u;VU(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=C.exports.useCallback(function(u){a(function(h){return Object.assign({},h,u)})},[]);return[o,l]}var mPe=typeof window<"u"?C.exports.useLayoutEffect:C.exports.useEffect,vPe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},eO=new Map,yPe=function(e){mPe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!eO.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,eO.set(t,n);var r=vPe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},SPe=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+o6(Object.assign({},n,{a:0}))+", "+o6(Object.assign({},n,{a:1}))+")"},o=Ob(["react-colorful__alpha",t]),a=so(100*n.a);return se.createElement("div",{className:o},S("div",{className:"react-colorful__alpha-gradient",style:i}),se.createElement(qk,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:p1(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},se.createElement(Kk,{className:"react-colorful__alpha-pointer",left:n.a,color:o6(n)})))},bPe=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=HU(e,["className","colorModel","color","onChange"]),s=C.exports.useRef(null);yPe(s);var l=gPe(n,i,o),u=l[0],h=l[1],g=Ob(["react-colorful",t]);return se.createElement("div",Rb({},a,{ref:s,className:g}),S(pPe,{hsva:u,onChange:h}),S(hPe,{hue:u.h,onChange:h}),se.createElement(SPe,{hsva:u,onChange:h,className:"react-colorful__last-control"}))},xPe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:fPe,fromHsva:dPe,equal:VU},wPe=function(e){return se.createElement(bPe,Rb({},e,{colorModel:xPe}))};const I4=e=>{const{styleClass:t,...n}=e;return S(wPe,{className:`invokeai__color-picker ${t}`,...n})},CPe=rt([Qt,yr],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:uh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),_Pe=()=>{const e=De(),{layer:t,maskColor:n,isMaskEnabled:r,shouldPreserveMaskedArea:i,isStaging:o}=ye(CPe);Ue(["q"],()=>{a()},{enabled:()=>!o,preventDefault:!0},[t]),Ue(["shift+c"],()=>{s()},{enabled:()=>!o,preventDefault:!0},[]),Ue(["h"],()=>{l()},{enabled:()=>!o,preventDefault:!0},[r]);const a=()=>{e(C4(t==="mask"?"base":"mask"))},s=()=>e(Z_()),l=()=>e(C2(!r));return S(Dl,{trigger:"hover",triggerComponent:S(ji,{children:S(Xe,{"aria-label":"Masking Options",tooltip:"Masking Options",icon:S(Bxe,{}),style:t==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:o})}),children:X(bt,{direction:"column",gap:"0.5rem",children:[S(fr,{label:"Enable Mask (H)",isChecked:r,onChange:l}),S(fr,{label:"Preserve Masked Area",isChecked:i,onChange:u=>e(TH(u.target.checked))}),S(I4,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:u=>e(_H(u))}),S(Ro,{size:"sm",leftIcon:S(Ih,{}),onClick:s,children:"Clear Mask (Shift+C)"})]})})},kPe=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),h=r?{x:Math.round(r.x+n.x),y:Math.round(r.y+n.y),width:Math.round(r.width),height:Math.round(r.height)}:{x:Math.round(a),y:Math.round(s),width:Math.round(l),height:Math.round(u)},g=e.toDataURL(h);return e.scale(i),{dataURL:g,boundingBox:{x:Math.round(o.x),y:Math.round(o.y),width:Math.round(l),height:Math.round(u)}}},EPe=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},PPe=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");!o||(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},TPe={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},nd=(e=TPe)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(S3e("Exporting Image")),t(p0(!1));const u=n(),{stageScale:h,boundingBoxCoordinates:g,boundingBoxDimensions:m,stageCoordinates:v}=u.canvas,b=Os();if(!b){t(ku(!1)),t(p0(!0));return}const{dataURL:w,boundingBox:P}=kPe(b,h,v,i?{...g,...m}:void 0);if(!w){t(ku(!1)),t(p0(!0));return}const E=new FormData;E.append("data",JSON.stringify({dataURL:w,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const T=await(await fetch(window.location.origin+"/upload",{method:"POST",body:E})).json(),{url:M,width:O,height:I}=T,D={uuid:g0(),category:o?"result":"user",...T};a&&(EPe(M),t(Cm({title:"Image Download Started",status:"success",duration:2500,isClosable:!0}))),s&&(PPe(M,O,I),t(Cm({title:"Image Copied",status:"success",duration:2500,isClosable:!0}))),o&&(t(h0({image:D,category:"result"})),t(Cm({title:"Image Saved to Gallery",status:"success",duration:2500,isClosable:!0}))),l&&(t(j3e({kind:"image",layer:"base",...P,image:D})),t(Cm({title:"Canvas Merged",status:"success",duration:2500,isClosable:!0}))),t(ku(!1)),t(l5("Connected")),t(p0(!0))},LPe=rt([Qt,yr,Vu],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),APe=()=>{const e=De(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=ye(LPe);Ue(["b"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[]),Ue(["e"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[t]),Ue(["c"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),Ue(["shift+f"],()=>{l()},{enabled:()=>!i,preventDefault:!0}),Ue(["delete","backspace"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),Ue(["BracketLeft"],()=>{e(U0(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),Ue(["BracketRight"],()=>{e(U0(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),Ue(["shift+BracketLeft"],()=>{e(V0({...n,a:We.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),Ue(["shift+BracketRight"],()=>{e(V0({...n,a:We.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const o=()=>e(Ol("brush")),a=()=>e(Ol("eraser")),s=()=>e(Ol("colorPicker")),l=()=>e(SH()),u=()=>e(yH());return X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Brush Tool (B)",tooltip:"Brush Tool (B)",icon:S(nV,{}),"data-selected":t==="brush"&&!i,onClick:o,isDisabled:i}),S(Xe,{"aria-label":"Eraser Tool (E)",tooltip:"Eraser Tool (E)",icon:S(QW,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:a}),S(Xe,{"aria-label":"Fill Bounding Box (Shift+F)",tooltip:"Fill Bounding Box (Shift+F)",icon:S(eV,{}),isDisabled:i,onClick:l}),S(Xe,{"aria-label":"Erase Bounding Box Area (Delete/Backspace)",tooltip:"Erase Bounding Box Area (Delete/Backspace)",icon:S(fk,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:u}),S(Xe,{"aria-label":"Color Picker (C)",tooltip:"Color Picker (C)",icon:S(JW,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:s}),S(Dl,{trigger:"hover",triggerComponent:S(Xe,{"aria-label":"Brush Options",tooltip:"Brush Options",icon:S(pk,{})}),children:X(bt,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[S(bt,{gap:"1rem",justifyContent:"space-between",children:S(Do,{label:"Size",value:r,withInput:!0,onChange:h=>e(U0(h)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),S(I4,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:h=>e(V0(h))})]})})]})};let tO;const Xk=()=>({setOpenUploader:e=>{e&&(tO=e)},openUploader:tO}),MPe=rt([Vu,Qt,yr],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),RPe=()=>{const e=De(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=ye(MPe),s=Os(),{openUploader:l}=Xk();Ue(["v"],()=>{u()},{enabled:()=>!n,preventDefault:!0},[]),Ue(["r"],()=>{h()},{enabled:()=>!0,preventDefault:!0},[s]),Ue(["shift+m"],()=>{m()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ue(["shift+s"],()=>{v()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ue(["meta+c","ctrl+c"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),Ue(["shift+d"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[s,t]);const u=()=>e(Ol("move")),h=()=>{const E=Os();if(!E)return;const _=E.getClientRect({skipTransform:!0});e(wH({contentRect:_}))},g=()=>{e(Q_()),e(ZS())},m=()=>{e(nd({cropVisible:!1,shouldSetAsInitialImage:!0}))},v=()=>{e(nd({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},b=()=>{e(nd({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},w=()=>{e(nd({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))};return X("div",{className:"inpainting-settings",children:[S(Is,{tooltip:"Layer (Q)",tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:mH,onChange:E=>{const _=E.target.value;e(C4(_)),_==="mask"&&!r&&e(C2(!0))},isDisabled:n}),S(_Pe,{}),S(APe,{}),X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Move Tool (V)",tooltip:"Move Tool (V)",icon:S(KW,{}),"data-selected":o==="move"||n,onClick:u}),S(Xe,{"aria-label":"Reset View (R)",tooltip:"Reset View (R)",icon:S(ZW,{}),onClick:h})]}),X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Merge Visible (Shift+M)",tooltip:"Merge Visible (Shift+M)",icon:S(tV,{}),onClick:m,isDisabled:n}),S(Xe,{"aria-label":"Save to Gallery (Shift+S)",tooltip:"Save to Gallery (Shift+S)",icon:S(hk,{}),onClick:v,isDisabled:n}),S(Xe,{"aria-label":"Copy to Clipboard (Cmd/Ctrl+C)",tooltip:"Copy to Clipboard (Cmd/Ctrl+C)",icon:S(k2,{}),onClick:b,isDisabled:n}),S(Xe,{"aria-label":"Download as Image (Shift+D)",tooltip:"Download as Image (Shift+D)",icon:S(dk,{}),onClick:w,isDisabled:n})]}),X(ji,{isAttached:!0,children:[S(NU,{}),S(BU,{})]}),X(ji,{isAttached:!0,children:[S(Xe,{"aria-label":"Upload",tooltip:"Upload",icon:S(pb,{}),onClick:l,isDisabled:n}),S(Xe,{"aria-label":"Clear Canvas",tooltip:"Clear Canvas",icon:S(Ih,{}),onClick:g,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),S(ji,{isAttached:!0,children:S(cPe,{})})]})},OPe=rt([Qt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),IPe=()=>{const e=De(),{doesCanvasNeedScaling:t}=ye(OPe);return C.exports.useLayoutEffect(()=>{e(ai(!0));const n=We.debounce(()=>{e(ai(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),S("div",{className:"workarea-single-view",children:S("div",{className:"workarea-split-view-left",children:X("div",{className:"inpainting-main-area",children:[S(RPe,{}),S("div",{className:"inpainting-canvas-area",children:t?S(EU,{}):S(DU,{})})]})})})},DPe=rt([Qt,yr],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:We.isEqual}});function NPe(){const e=De(),{layer:t,isMaskEnabled:n,isStaging:r}=ye(DPe),i=()=>{e(C4(t==="mask"?"base":"mask"))};return Ue(["q"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[t]),S(Is,{tooltip:"Layer (Q)",tooltipProps:{hasArrow:!0,placement:"top"},value:t,validValues:mH,onChange:a=>{const s=a.target.value;e(C4(s)),s==="mask"&&!n&&e(C2(!0))},isDisabled:r})}const BPe=rt([Qt,yr,Vu],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),zPe=()=>{const e=De(),{tool:t,isStaging:n}=ye(BPe);Ue(["b"],()=>{r()},{enabled:()=>!n,preventDefault:!0},[]),Ue(["e"],()=>{i()},{enabled:()=>!n,preventDefault:!0},[t]),Ue(["c"],()=>{o()},{enabled:()=>!n,preventDefault:!0},[t]),Ue(["shift+f"],()=>{a()},{enabled:()=>!n,preventDefault:!0}),Ue(["delete","backspace"],()=>{s()},{enabled:()=>!n,preventDefault:!0});const r=()=>e(Ol("brush")),i=()=>e(Ol("eraser")),o=()=>e(Ol("colorPicker")),a=()=>e(SH()),s=()=>e(yH());return X(bt,{flexDirection:"column",gap:"0.5rem",children:[X(ji,{children:[S(Xe,{"aria-label":"Brush Tool (B)",tooltip:"Brush Tool (B)",icon:S(nV,{}),"data-selected":t==="brush"&&!n,onClick:r,isDisabled:n}),S(Xe,{"aria-label":"Eraser Tool (E)",tooltip:"Eraser Tool (E)",icon:S(QW,{}),"data-selected":t==="eraser"&&!n,isDisabled:n,onClick:i})]}),X(ji,{children:[S(Xe,{"aria-label":"Fill Bounding Box (Shift+F)",tooltip:"Fill Bounding Box (Shift+F)",icon:S(eV,{}),isDisabled:n,onClick:a}),S(Xe,{"aria-label":"Erase Bounding Box Area (Delete/Backspace)",tooltip:"Erase Bounding Box Area (Delete/Backspace)",icon:S(fk,{style:{transform:"rotate(45deg)"}}),isDisabled:n,onClick:s})]}),S(Xe,{"aria-label":"Color Picker (C)",tooltip:"Color Picker (C)",icon:S(JW,{}),"data-selected":t==="colorPicker"&&!n,isDisabled:n,onClick:o,width:"max-content"})]})},FPe=rt([Qt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),$Pe=()=>{const e=De(),{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=ye(FPe);return S(Dl,{trigger:"hover",triggerComponent:S(Xe,{tooltip:"Canvas Settings",tooltipProps:{placement:"bottom"},"aria-label":"Canvas Settings",icon:S(gb,{})}),children:X(bt,{direction:"column",gap:"0.5rem",children:[S(fr,{label:"Show Intermediates",isChecked:i,onChange:o=>e(MH(o.target.checked))}),S(fr,{label:"Auto Save to Gallery",isChecked:t,onChange:o=>e(kH(o.target.checked))}),S(fr,{label:"Save Box Region Only",isChecked:n,onChange:o=>e(EH(o.target.checked))}),S(fr,{label:"Show Canvas Debug Info",isChecked:r,onChange:o=>e(LH(o.target.checked))}),S($U,{}),S(FU,{})]})})};function HPe(){const e=ye(i=>i.canvas.tool),t=ye(yr),n=De();Ue(["v"],()=>{r()},{enabled:()=>!t,preventDefault:!0},[]);const r=()=>n(Ol("move"));return S(Xe,{"aria-label":"Move Tool (V)",tooltip:"Move Tool (V)",icon:S(KW,{}),"data-selected":e==="move"||t,onClick:r})}function WPe(){const e=Os(),t=De();Ue(["r"],()=>{n()},{enabled:()=>!0,preventDefault:!0},[e]);const n=()=>{const r=Os();if(!r)return;const i=r.getClientRect({skipTransform:!0});t(wH({contentRect:i}))};return S(Xe,{"aria-label":"Reset View (R)",tooltip:"Reset View (R)",icon:S(ZW,{}),onClick:n})}function VPe(){const e=De(),t=Os(),n=ye(yr),r=ye(o=>o.system.isProcessing);Ue(["shift+m"],()=>{i()},{enabled:()=>!n,preventDefault:!0},[t,r]);const i=()=>{e(nd({cropVisible:!1,shouldSetAsInitialImage:!0}))};return S(Xe,{"aria-label":"Merge Visible (Shift+M)",tooltip:"Merge Visible (Shift+M)",icon:S(tV,{}),onClick:i,isDisabled:n})}function UPe(){const e=ye(yr),t=Os(),n=ye(a=>a.system.isProcessing),r=ye(a=>a.canvas.shouldCropToBoundingBoxOnSave),i=De();Ue(["shift+s"],()=>{o()},{enabled:()=>!e,preventDefault:!0},[t,n]);const o=()=>{i(nd({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return S(Xe,{"aria-label":"Save to Gallery (Shift+S)",tooltip:"Save to Gallery (Shift+S)",icon:S(hk,{}),onClick:o,isDisabled:e})}function GPe(){const e=ye(yr),t=Os(),n=ye(a=>a.system.isProcessing),r=ye(a=>a.canvas.shouldCropToBoundingBoxOnSave),i=De();Ue(["meta+c","ctrl+c"],()=>{o()},{enabled:()=>!e,preventDefault:!0},[t,n]);const o=()=>{i(nd({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return S(Xe,{"aria-label":"Copy to Clipboard (Cmd/Ctrl+C)",tooltip:"Copy to Clipboard (Cmd/Ctrl+C)",icon:S(k2,{}),onClick:o,isDisabled:e})}function jPe(){const e=De(),t=Os(),n=ye(yr),r=ye(a=>a.system.isProcessing),i=ye(a=>a.canvas.shouldCropToBoundingBoxOnSave);Ue(["shift+d"],()=>{o()},{enabled:()=>!n,preventDefault:!0},[t,r]);const o=()=>{e(nd({cropVisible:!i,cropToBoundingBox:i,shouldDownload:!0}))};return S(Xe,{"aria-label":"Download as Image (Shift+D)",tooltip:"Download as Image (Shift+D)",icon:S(dk,{}),onClick:o,isDisabled:n})}function YPe(){const e=ye(yr),{openUploader:t}=Xk();return S(Xe,{"aria-label":"Upload",tooltip:"Upload",icon:S(pb,{}),onClick:t,isDisabled:e})}function qPe(){const e=De(),t=ye(yr);return S(Xe,{"aria-label":"Clear Canvas",tooltip:"Clear Canvas",icon:S(Ih,{}),onClick:()=>{e(Q_()),e(ZS())},style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:t})}function KPe(){const e=ye(r=>r.options.shouldPinOptionsPanel),t=De();return X(bt,{flexDirection:"column",gap:"0.5rem",children:[S(Xe,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:()=>{t(_u(!0)),e&&setTimeout(()=>t(ai(!0)),400)},children:S(pk,{})}),S(bt,{children:S(Pk,{iconButton:!0})}),S(bt,{children:S(Tk,{width:"100%",height:"40px"})})]})}const XPe=()=>{const e=ye(t=>t.options.shouldShowOptionsPanel);return X(bt,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[S(NPe,{}),S(zPe,{}),X(bt,{gap:"0.5rem",children:[S(HPe,{}),S(WPe,{})]}),X(bt,{columnGap:"0.5rem",children:[S(VPe,{}),S(UPe,{})]}),X(bt,{columnGap:"0.5rem",children:[S(GPe,{}),S(jPe,{})]}),X(bt,{gap:"0.5rem",children:[S(NU,{}),S(BU,{})]}),X(bt,{gap:"0.5rem",children:[S(YPe,{}),S(qPe,{})]}),S($Pe,{}),!e&&S(KPe,{})]})};function ZPe(){const e=De(),t=ye(r=>r.canvas.brushSize),n=ye(yr);return Ue(["BracketLeft"],()=>{e(U0(Math.max(t-5,5)))},{enabled:()=>!n,preventDefault:!0},[t]),Ue(["BracketRight"],()=>{e(U0(Math.min(t+5,500)))},{enabled:()=>!n,preventDefault:!0},[t]),S(Do,{label:"Size",value:t,withInput:!0,onChange:r=>e(U0(r)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px"})}const QPe=rt([Qt,yr],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:We.isEqual}});function JPe(){const e=De(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=ye(QPe),o=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return Ue(["shift+BracketLeft"],()=>{e(V0({...t,a:We.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),Ue(["shift+BracketRight"],()=>{e(V0({...t,a:We.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),S(Dl,{trigger:"hover",triggerComponent:S(Ld,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:X(bt,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&S(I4,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e(V0(a))}),r==="mask"&&S(I4,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(_H(a))})]})})}function UU(){return X(bt,{columnGap:"1rem",alignItems:"center",children:[S(ZPe,{}),S(JPe,{})]})}function eTe(){const e=De(),t=ye(n=>n.canvas.shouldRestrictStrokesToBox);return S(fr,{label:"Limit To Box",isChecked:t,onChange:n=>e(OH(n.target.checked))})}function tTe(){return X(bt,{gap:"1rem",alignItems:"center",children:[S(UU,{}),S(eTe,{})]})}function nTe(){const e=De();return S(Ro,{size:"sm",leftIcon:S(Ih,{}),onClick:()=>e(Z_()),tooltip:"Clear Mask (Shift+C)",children:"Clear"})}function rTe(){const e=ye(r=>r.canvas.isMaskEnabled),t=De();return S(fr,{label:"Enable Mask (H)",isChecked:e,onChange:()=>t(C2(!e))})}function iTe(){const e=De(),t=ye(n=>n.canvas.shouldPreserveMaskedArea);return S(fr,{label:"Preserve Masked",isChecked:t,onChange:n=>e(TH(n.target.checked))})}function oTe(){return X(bt,{gap:"1rem",alignItems:"center",children:[S(UU,{}),S(rTe,{}),S(iTe,{}),S(nTe,{})]})}function aTe(){const e=ye(n=>n.canvas.shouldDarkenOutsideBoundingBox),t=De();return S(fr,{label:"Darken Outside",isChecked:e,onChange:n=>t(PH(n.target.checked))})}function sTe(){const e=ye(n=>n.canvas.shouldShowGrid),t=De();return S(fr,{label:"Show Grid",isChecked:e,onChange:n=>t(AH(n.target.checked))})}function lTe(){const e=ye(r=>r.canvas.shouldSnapToGrid),t=De();return S(fr,{label:"Snap to Grid (N)",isChecked:e,onChange:r=>t(_4(r.target.checked))})}function uTe(){return X(bt,{alignItems:"center",gap:"1rem",children:[S(sTe,{}),S(lTe,{}),S(aTe,{})]})}const cTe=rt([Qt],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:We.isEqual}});function dTe(){const{tool:e,layer:t}=ye(cTe);return X(bt,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&S(tTe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&S(oTe,{}),e=="move"&&S(uTe,{})]})}const fTe=rt([Qt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),hTe=()=>{const e=De(),{doesCanvasNeedScaling:t}=ye(fTe);return C.exports.useLayoutEffect(()=>{e(ai(!0));const n=We.debounce(()=>{e(ai(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),S("div",{className:"workarea-single-view",children:X(bt,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[S(XPe,{}),X(bt,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[S(dTe,{}),t?S(EU,{}):S(DU,{})]})]})})};function pTe(){const e=ye(t=>t.options.shouldUseCanvasBetaLayout);return S($k,{optionsPanel:S(vke,{}),styleClass:"inpainting-workarea-overrides",children:e?S(hTe,{}):S(IPe,{})})}const gTe=ut({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})});function mTe(){return X("div",{className:"work-in-progress nodes-work-in-progress",children:[S("h1",{children:"Training"}),X("p",{children:["A dedicated workflow for training your own embeddings and checkpoints using Textual Inversion and Dreambooth from the web interface. ",S("br",{}),S("br",{}),"InvokeAI already supports training custom embeddings using Textual Inversion using the main script."]})]})}const vTe=ut({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:S("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),Zp={txt2img:{title:S(sCe,{fill:"black",boxSize:"2.5rem"}),workarea:S(K8e,{}),tooltip:"Text To Image"},img2img:{title:S(iCe,{fill:"black",boxSize:"2.5rem"}),workarea:S(j8e,{}),tooltip:"Image To Image"},unifiedCanvas:{title:S(gTe,{fill:"black",boxSize:"2.5rem"}),workarea:S(pTe,{}),tooltip:"Unified Canvas"},nodes:{title:S(oCe,{fill:"black",boxSize:"2.5rem"}),workarea:S(nCe,{}),tooltip:"Nodes"},postprocess:{title:S(aCe,{fill:"black",boxSize:"2.5rem"}),workarea:S(rCe,{}),tooltip:"Post Processing"},training:{title:S(vTe,{fill:"black",boxSize:"2.5rem"}),workarea:S(mTe,{}),tooltip:"Training"}};function yTe(){const e=ye(o=>o.options.activeTab),t=ye(o=>o.options.isLightBoxOpen),n=De();Ue("1",()=>{n(Lo(0))}),Ue("2",()=>{n(Lo(1))}),Ue("3",()=>{n(Lo(2))}),Ue("4",()=>{n(Lo(3))}),Ue("5",()=>{n(Lo(4))}),Ue("6",()=>{n(Lo(5))}),Ue("z",()=>{n(Cu(!t))},[t]);const r=()=>{const o=[];return Object.keys(Zp).forEach(a=>{o.push(S(bi,{hasArrow:!0,label:Zp[a].tooltip,placement:"right",children:S(C$,{children:Zp[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(Zp).forEach(a=>{o.push(S(x$,{className:"app-tabs-panel",children:Zp[a].workarea},a))}),o};return X(b$,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(Lo(o))},children:[S("div",{className:"app-tabs-list",children:r()}),S(w$,{className:"app-tabs-panels",children:t?S(lke,{}):i()})]})}var STe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function L2(e,t){var n=bTe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function bTe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=STe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var xTe=[".DS_Store","Thumbs.db"];function wTe(e){return w1(this,void 0,void 0,function(){return C1(this,function(t){return D4(e)&&CTe(e.dataTransfer)?[2,PTe(e.dataTransfer,e.type)]:_Te(e)?[2,kTe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,ETe(e)]:[2,[]]})})}function CTe(e){return D4(e)}function _Te(e){return D4(e)&&D4(e.target)}function D4(e){return typeof e=="object"&&e!==null}function kTe(e){return e9(e.target.files).map(function(t){return L2(t)})}function ETe(e){return w1(this,void 0,void 0,function(){var t;return C1(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return L2(r)})]}})})}function PTe(e,t){return w1(this,void 0,void 0,function(){var n,r;return C1(this,function(i){switch(i.label){case 0:return e.items?(n=e9(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(TTe))]):[3,2];case 1:return r=i.sent(),[2,nO(GU(r))];case 2:return[2,nO(e9(e.files).map(function(o){return L2(o)}))]}})})}function nO(e){return e.filter(function(t){return xTe.indexOf(t.name)===-1})}function e9(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,sO(n)];if(e.sizen)return[!1,sO(n)]}return[!0,null]}function Hf(e){return e!=null}function UTe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=KU(l,n),h=Qv(u,1),g=h[0],m=XU(l,r,i),v=Qv(m,1),b=v[0],w=s?s(l):null;return g&&b&&!w})}function N4(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function T3(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function uO(e){e.preventDefault()}function GTe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function jTe(e){return e.indexOf("Edge/")!==-1}function YTe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return GTe(e)||jTe(e)}function fl(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function cLe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var Zk=C.exports.forwardRef(function(e,t){var n=e.children,r=B4(e,JTe),i=tG(r),o=i.open,a=B4(i,eLe);return C.exports.useImperativeHandle(t,function(){return{open:o}},[o]),S(C.exports.Fragment,{children:n(cr(cr({},a),{},{open:o}))})});Zk.displayName="Dropzone";var eG={disabled:!1,getFilesFromEvent:wTe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Zk.defaultProps=eG;Zk.propTypes={children:Bn.exports.func,accept:Bn.exports.objectOf(Bn.exports.arrayOf(Bn.exports.string)),multiple:Bn.exports.bool,preventDropOnDocument:Bn.exports.bool,noClick:Bn.exports.bool,noKeyboard:Bn.exports.bool,noDrag:Bn.exports.bool,noDragEventsBubbling:Bn.exports.bool,minSize:Bn.exports.number,maxSize:Bn.exports.number,maxFiles:Bn.exports.number,disabled:Bn.exports.bool,getFilesFromEvent:Bn.exports.func,onFileDialogCancel:Bn.exports.func,onFileDialogOpen:Bn.exports.func,useFsAccessApi:Bn.exports.bool,autoFocus:Bn.exports.bool,onDragEnter:Bn.exports.func,onDragLeave:Bn.exports.func,onDragOver:Bn.exports.func,onDrop:Bn.exports.func,onDropAccepted:Bn.exports.func,onDropRejected:Bn.exports.func,onError:Bn.exports.func,validator:Bn.exports.func};var i9={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function tG(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=cr(cr({},eG),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,h=t.onDragLeave,g=t.onDragOver,m=t.onDrop,v=t.onDropAccepted,b=t.onDropRejected,w=t.onFileDialogCancel,P=t.onFileDialogOpen,E=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,M=t.noClick,O=t.noKeyboard,I=t.noDrag,D=t.noDragEventsBubbling,B=t.onError,$=t.validator,H=C.exports.useMemo(function(){return XTe(n)},[n]),j=C.exports.useMemo(function(){return KTe(n)},[n]),ne=C.exports.useMemo(function(){return typeof P=="function"?P:dO},[P]),V=C.exports.useMemo(function(){return typeof w=="function"?w:dO},[w]),q=C.exports.useRef(null),te=C.exports.useRef(null),J=C.exports.useReducer(dLe,i9),Z=a6(J,2),G=Z[0],ee=Z[1],le=G.isFocused,me=G.isFileDialogActive,Me=C.exports.useRef(typeof window<"u"&&window.isSecureContext&&E&&qTe()),Ce=function(){!Me.current&&me&&setTimeout(function(){if(te.current){var et=te.current.files;et.length||(ee({type:"closeDialog"}),V())}},300)};C.exports.useEffect(function(){return window.addEventListener("focus",Ce,!1),function(){window.removeEventListener("focus",Ce,!1)}},[te,me,V,Me]);var be=C.exports.useRef([]),we=function(et){q.current&&q.current.contains(et.target)||(et.preventDefault(),be.current=[])};C.exports.useEffect(function(){return T&&(document.addEventListener("dragover",uO,!1),document.addEventListener("drop",we,!1)),function(){T&&(document.removeEventListener("dragover",uO),document.removeEventListener("drop",we))}},[q,T]),C.exports.useEffect(function(){return!r&&_&&q.current&&q.current.focus(),function(){}},[q,_,r]);var Ve=C.exports.useCallback(function(Oe){B?B(Oe):console.error(Oe)},[B]),Ze=C.exports.useCallback(function(Oe){Oe.preventDefault(),Oe.persist(),Et(Oe),be.current=[].concat(rLe(be.current),[Oe.target]),T3(Oe)&&Promise.resolve(i(Oe)).then(function(et){if(!(N4(Oe)&&!D)){var Jt=et.length,Kt=Jt>0&&UTe({files:et,accept:H,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:$}),Ee=Jt>0&&!Kt;ee({isDragAccept:Kt,isDragReject:Ee,isDragActive:!0,type:"setDraggedFiles"}),u&&u(Oe)}}).catch(function(et){return Ve(et)})},[i,u,Ve,D,H,a,o,s,l,$]),it=C.exports.useCallback(function(Oe){Oe.preventDefault(),Oe.persist(),Et(Oe);var et=T3(Oe);if(et&&Oe.dataTransfer)try{Oe.dataTransfer.dropEffect="copy"}catch(Jt){}return et&&g&&g(Oe),!1},[g,D]),pt=C.exports.useCallback(function(Oe){Oe.preventDefault(),Oe.persist(),Et(Oe);var et=be.current.filter(function(Kt){return q.current&&q.current.contains(Kt)}),Jt=et.indexOf(Oe.target);Jt!==-1&&et.splice(Jt,1),be.current=et,!(et.length>0)&&(ee({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),T3(Oe)&&h&&h(Oe))},[q,h,D]),kt=C.exports.useCallback(function(Oe,et){var Jt=[],Kt=[];Oe.forEach(function(Ee){var xt=KU(Ee,H),Wt=a6(xt,2),ze=Wt[0],lt=Wt[1],dn=XU(Ee,a,o),Ne=a6(dn,2),ct=Ne[0],tt=Ne[1],Nt=$?$(Ee):null;if(ze&&ct&&!Nt)Jt.push(Ee);else{var an=[lt,tt];Nt&&(an=an.concat(Nt)),Kt.push({file:Ee,errors:an.filter(function(Sr){return Sr})})}}),(!s&&Jt.length>1||s&&l>=1&&Jt.length>l)&&(Jt.forEach(function(Ee){Kt.push({file:Ee,errors:[VTe]})}),Jt.splice(0)),ee({acceptedFiles:Jt,fileRejections:Kt,type:"setFiles"}),m&&m(Jt,Kt,et),Kt.length>0&&b&&b(Kt,et),Jt.length>0&&v&&v(Jt,et)},[ee,s,H,a,o,l,m,v,b,$]),gt=C.exports.useCallback(function(Oe){Oe.preventDefault(),Oe.persist(),Et(Oe),be.current=[],T3(Oe)&&Promise.resolve(i(Oe)).then(function(et){N4(Oe)&&!D||kt(et,Oe)}).catch(function(et){return Ve(et)}),ee({type:"reset"})},[i,kt,Ve,D]),ht=C.exports.useCallback(function(){if(Me.current){ee({type:"openDialog"}),ne();var Oe={multiple:s,types:j};window.showOpenFilePicker(Oe).then(function(et){return i(et)}).then(function(et){kt(et,null),ee({type:"closeDialog"})}).catch(function(et){ZTe(et)?(V(et),ee({type:"closeDialog"})):QTe(et)?(Me.current=!1,te.current?(te.current.value=null,te.current.click()):Ve(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):Ve(et)});return}te.current&&(ee({type:"openDialog"}),ne(),te.current.value=null,te.current.click())},[ee,ne,V,E,kt,Ve,j,s]),vt=C.exports.useCallback(function(Oe){!q.current||!q.current.isEqualNode(Oe.target)||(Oe.key===" "||Oe.key==="Enter"||Oe.keyCode===32||Oe.keyCode===13)&&(Oe.preventDefault(),ht())},[q,ht]),Te=C.exports.useCallback(function(){ee({type:"focus"})},[]),ot=C.exports.useCallback(function(){ee({type:"blur"})},[]),Mt=C.exports.useCallback(function(){M||(YTe()?setTimeout(ht,0):ht())},[M,ht]),Je=function(et){return r?null:et},mt=function(et){return O?null:Je(et)},un=function(et){return I?null:Je(et)},Et=function(et){D&&et.stopPropagation()},jt=C.exports.useMemo(function(){return function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},et=Oe.refKey,Jt=et===void 0?"ref":et,Kt=Oe.role,Ee=Oe.onKeyDown,xt=Oe.onFocus,Wt=Oe.onBlur,ze=Oe.onClick,lt=Oe.onDragEnter,dn=Oe.onDragOver,Ne=Oe.onDragLeave,ct=Oe.onDrop,tt=B4(Oe,tLe);return cr(cr(r9({onKeyDown:mt(fl(Ee,vt)),onFocus:mt(fl(xt,Te)),onBlur:mt(fl(Wt,ot)),onClick:Je(fl(ze,Mt)),onDragEnter:un(fl(lt,Ze)),onDragOver:un(fl(dn,it)),onDragLeave:un(fl(Ne,pt)),onDrop:un(fl(ct,gt)),role:typeof Kt=="string"&&Kt!==""?Kt:"presentation"},Jt,q),!r&&!O?{tabIndex:0}:{}),tt)}},[q,vt,Te,ot,Mt,Ze,it,pt,gt,O,I,r]),cn=C.exports.useCallback(function(Oe){Oe.stopPropagation()},[]),xn=C.exports.useMemo(function(){return function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},et=Oe.refKey,Jt=et===void 0?"ref":et,Kt=Oe.onChange,Ee=Oe.onClick,xt=B4(Oe,nLe),Wt=r9({accept:H,multiple:s,type:"file",style:{display:"none"},onChange:Je(fl(Kt,gt)),onClick:Je(fl(Ee,cn)),tabIndex:-1},Jt,te);return cr(cr({},Wt),xt)}},[te,n,s,gt,r]);return cr(cr({},G),{},{isFocused:le&&!r,getRootProps:jt,getInputProps:xn,rootRef:q,inputRef:te,open:Je(ht)})}function dLe(e,t){switch(t.type){case"focus":return cr(cr({},e),{},{isFocused:!0});case"blur":return cr(cr({},e),{},{isFocused:!1});case"openDialog":return cr(cr({},i9),{},{isFileDialogActive:!0});case"closeDialog":return cr(cr({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return cr(cr({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return cr(cr({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return cr({},i9);default:return e}}function dO(){}const fLe=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return Ue("esc",()=>{i(!1)}),X("div",{className:"dropzone-container",children:[t&&S("div",{className:"dropzone-overlay is-drag-accept",children:X(ah,{size:"lg",children:["Upload Image",r]})}),n&&X("div",{className:"dropzone-overlay is-drag-reject",children:[S(ah,{size:"lg",children:"Invalid Upload"}),S(ah,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},fO=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=Tr(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(window.location.origin+"/upload",{method:"POST",body:a})).json();console.log(l);const u={uuid:g0(),category:"user",...l};t(h0({image:u,category:"user"})),o==="unifiedCanvas"?t(QS(u)):o==="img2img"&&t(T1(u))},hLe=e=>{const{children:t}=e,n=De(),r=ye(Tr),i=x2({}),[o,a]=C.exports.useState(!1),{setOpenUploader:s}=Xk(),l=C.exports.useCallback(_=>{a(!0);const T=_.errors.reduce((M,O)=>M+` `+O.message,"");i({title:"Upload failed",description:T,status:"error",isClosable:!0})},[i]),u=C.exports.useCallback(async _=>{n(fO({imageFile:_}))},[n]),h=C.exports.useCallback((_,T)=>{T.forEach(M=>{l(M)}),_.forEach(M=>{u(M)})},[u,l]),{getRootProps:g,getInputProps:m,isDragAccept:v,isDragReject:b,isDragActive:w,open:P}=tG({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:()=>a(!0),maxFiles:1});s(P),C.exports.useEffect(()=>{const _=T=>{var D;const M=(D=T.clipboardData)==null?void 0:D.items;if(!M)return;const O=[];for(const B of M)B.kind==="file"&&["image/png","image/jpg"].includes(B.type)&&O.push(B);if(!O.length)return;if(T.stopImmediatePropagation(),O.length>1){i({description:"Multiple images pasted, may only upload one image at a time",status:"error",isClosable:!0});return}const I=O[0].getAsFile();if(!I){i({description:"Unable to load file",status:"error",isClosable:!0});return}n(fO({imageFile:I}))};return document.addEventListener("paste",_),()=>{document.removeEventListener("paste",_)}},[n,i,r]);const E=["img2img","unifiedCanvas"].includes(r)?` to ${Zp[r].tooltip}`:"";return S(Ok.Provider,{value:P,children:X("div",{...g({style:{}}),onKeyDown:_=>{_.key},children:[S("input",{...m()}),t,w&&o&&S(fLe,{isDragAccept:v,isDragReject:b,overlaySecondaryText:E,setIsHandlingUpload:a})]})})},pLe=()=>{const e=De(),t=ye(ewe),n=x2();C.exports.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(y3e())},[e,n,t])},nG=rt([e=>e.options,e=>e.gallery,Tr],(e,t,n)=>{const{shouldPinOptionsPanel:r,shouldShowOptionsPanel:i,shouldHoldOptionsPanelOpen:o,shouldUseCanvasBetaLayout:a}=e,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=t,h=a&&n==="unifiedCanvas",g=!h&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinOptionsPanel:r,shouldShowProcessButtons:!h&&(!r||!i),shouldShowOptionsPanelButton:g,shouldShowOptionsPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:We.isEqual}}),gLe=()=>{const e=De(),{shouldShowOptionsPanel:t,shouldShowOptionsPanelButton:n,shouldShowProcessButtons:r,shouldPinOptionsPanel:i,shouldShowGallery:o,shouldPinGallery:a}=ye(nG),s=()=>{e(_u(!0)),i&&setTimeout(()=>e(ai(!0)),400)};return Ue("f",()=>{o||t?(e(_u(!1)),e(fd(!1))):(e(_u(!0)),e(fd(!0))),(a||i)&&setTimeout(()=>e(ai(!0)),400)},[o,t]),n?X("div",{className:"show-hide-button-options",children:[S(Xe,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:s,children:S(pk,{})}),r&&X(Rn,{children:[S(Pk,{iconButton:!0}),S(Tk,{})]})]}):null},mLe=()=>{const e=De(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowOptionsPanel:i,shouldPinOptionsPanel:o}=ye(nG),a=()=>{e(fd(!0)),r&&e(ai(!0))};return Ue("f",()=>{t||i?(e(_u(!1)),e(fd(!1))):(e(_u(!0)),e(fd(!0))),(r||o)&&setTimeout(()=>e(ai(!0)),400)},[t,i]),n?S(Xe,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:a,children:S(CV,{})}):null};tCe();const vLe=()=>(pLe(),X("div",{className:"App",children:[X(hLe,{children:[S(bxe,{}),X("div",{className:"app-content",children:[S(uwe,{}),S(yTe,{})]}),S("div",{className:"app-console",children:S(eCe,{})})]}),S(gLe,{}),S(mLe,{})]}));const yLe=GD({key:"invokeai-style-cache",prepend:!0});l6.createRoot(document.getElementById("root")).render(S(se.StrictMode,{children:S(cxe,{store:OW,children:S(VW,{loading:S(yxe,{}),persistor:UW,children:S(fee,{value:yLe,children:S(u2e,{children:S(vLe,{})})})})})}));export{bLe as __vite_legacy_guard};