mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
189 lines
590 KiB
JavaScript
189 lines
590 KiB
JavaScript
import{r as y,f as fe,j as l,u as NS,c as ne,a as Ae,b as Ee,w as ns,d as un,o as At,S as yc,e as yo,g as qe,h as Nr,k as ei,i as xc,_ as Xd,l as FS,m as LS,R as Me,n as Ev,p as BS,q as Qd,s as ta,t as x1,v as b1,x as HS,y as WS,z as ee,A as S1,B as C1,C as bc,D as rs,F as L,E as K,G as VS,H as dd,T as Ce,I as w1,J as US,K as os,L as Pv,M as $S,N as GS,O as qS,P as Di,Q as j1,U as Iv,V as YS,W as k1,X as KS,Y as XS,Z as QS,$ as E1,a0 as ZS,a1 as JS,a2 as e3,a3 as t3,a4 as n3,a5 as r3,a6 as o3,a7 as P1,a8 as i3,a9 as a3,aa as ql,ab as s3,ac as l3,ad as Nl,ae as Yl,af as Zd,ag as Jd,ah as ef,ai as c3,aj as I1,ak as u3,al as M1,am as d3,an as T1,ao as _1,ap as Uo,aq as kn,ar as D1,as as is,at as f3,au as h3,av as A1,aw as tf,ax as nf,ay as O1,az as rf,aA as of,aB as Mv,aC as z1,aD as R1,aE as N1,aF as Fl,aG as Ll,aH as p3,aI as af,aJ as F1,aK as L1,aL as B1,aM as m3,aN as v3,aO as Tv,aP as _v,aQ as g3,aR as y3,aS as x3,aT as H1,aU as W1,aV as b3,aW as S3,aX as V1,aY as Dv,aZ as C3,a_ as Av,a$ as w3,b0 as j3,b1 as U1,b2 as k3,b3 as E3,b4 as P3,b5 as fd,b6 as Ov,b7 as $1,b8 as sf,b9 as I3,ba as zv,bb as Bl,bc as M3,bd as T3,be as Ua,bf as Kl,bg as G1,bh as Xl,bi as _3,bj as D3,bk as Sr,bl as q1,bm as Zf,bn as as,bo as A3,bp as O3,bq as z3,br as jr,bs as Y1,bt as R3,bu as N3,bv as K1,bw as F3,bx as L3,by as B3,bz as H3,bA as W3,bB as V3,bC as U3,bD as $3,bE as G3,bF as Rv,bG as q3,bH as Y3,bI as K3,bJ as X3,bK as Q3,bL as Z3,bM as hd,bN as za,bO as ml,bP as Nv,bQ as pd,bR as md,bS as vl,bT as Fv,bU as lf,bV as J3,bW as eC,bX as tC,bY as Sc,bZ as nC,b_ as rC,b$ as oC,c0 as iC,c1 as gl,c2 as vd,c3 as yl,c4 as Ma,c5 as aC,c6 as sC,c7 as X1,c8 as Ql,c9 as Jf,ca as Q1,cb as Z1,cc as J1,cd as lC,ce as e2,cf as t2,cg as n2,ch as r2,ci as o2,cj as Li,ck as Bi,cl as i2,cm as a2,cn as s2,co as l2,cp as c2,cq as cC,cr as uC,cs as Lv,ct as xl,cu as dC,cv as Bv,cw as Hv,cx as Wv,cy as Vv,cz as fC,cA as hC,cB as cf,cC as pC,cD as Uv,cE as bl,cF as Zl,cG as mC,cH as vC,cI as gC,cJ as yC,cK as u2,cL as xC,cM as bC}from"./index-f7f41e1f.js";import{I as tn,u as SC,c as CC,a as kt,b as Wt,A as xo,m as ar,d as Hi,e as ti,P as $a,f as wC,C as jC,g as Y,h as A}from"./storeHooks-eaf47ae3.js";function kC(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Jl="NOT_FOUND";function EC(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:Jl},put:function(r,o){t={key:r,value:o}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function PC(e,t){var n=[];function r(u){var f=n.findIndex(function(m){return t(u,m.key)});if(f>-1){var h=n[f];return f>0&&(n.splice(f,1),n.unshift(h)),h.value}return Jl}function o(u,f){r(u)===Jl&&(n.unshift({key:u,value:f}),n.length>e&&n.pop())}function s(){return n}function c(){n=[]}return{get:r,put:o,getEntries:s,clear:c}}var IC=function(t,n){return t===n};function MC(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function TC(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,o=r===void 0?IC:r,s=n.maxSize,c=s===void 0?1:s,u=n.resultEqualityCheck,f=MC(o),h=c===1?EC(f):PC(c,f);function m(){var v=h.get(arguments);if(v===Jl){if(v=e.apply(null,arguments),u){var x=h.getEntries(),S=x.find(function(C){return u(C.value,v)});S&&(v=S.value)}h.put(arguments,v)}return v}return m.clearCache=function(){return h.clear()},m}function _C(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function DC(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];var h=0,m,v={memoizeOptions:void 0},x=u.pop();if(typeof x=="object"&&(v=x,x=u.pop()),typeof x!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof x+"]");var S=v,C=S.memoizeOptions,j=C===void 0?n:C,w=Array.isArray(j)?j:[j],k=_C(u),M=e.apply(void 0,[function(){return h++,x.apply(null,arguments)}].concat(w)),P=e(function(){for(var T=[],_=k.length,D=0;D<_;D++)T.push(k[D].apply(null,arguments));return m=M.apply(null,T),m});return Object.assign(P,{resultFunc:x,memoizedResultFunc:M,dependencies:k,lastResult:function(){return m},recomputations:function(){return h},resetRecomputations:function(){return h=0}}),P};return o}var me=DC(TC);function AC(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function d2(e){var t;return AC(e)&&(t=e.ownerDocument)!=null?t:document}function OC(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var zC=OC();const f2=1/60*1e3,RC=typeof performance<"u"?()=>performance.now():()=>Date.now(),h2=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(RC()),f2);function NC(e){let t=[],n=[],r=0,o=!1,s=!1;const c=new WeakSet,u={schedule:(f,h=!1,m=!1)=>{const v=m&&o,x=v?t:n;return h&&c.add(f),x.indexOf(f)===-1&&(x.push(f),v&&o&&(r=t.length)),f},cancel:f=>{const h=n.indexOf(f);h!==-1&&n.splice(h,1),c.delete(f)},process:f=>{if(o){s=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let h=0;h<r;h++){const m=t[h];m(f),c.has(m)&&(u.schedule(m),e())}o=!1,s&&(s=!1,u.process(f))}};return u}const FC=40;let uf=!0,Ga=!1,df=!1;const Wi={delta:0,timestamp:0},ss=["read","update","preRender","render","postRender"],Cc=ss.reduce((e,t)=>(e[t]=NC(()=>Ga=!0),e),{}),LC=ss.reduce((e,t)=>{const n=Cc[t];return e[t]=(r,o=!1,s=!1)=>(Ga||WC(),n.schedule(r,o,s)),e},{}),BC=ss.reduce((e,t)=>(e[t]=Cc[t].cancel,e),{});ss.reduce((e,t)=>(e[t]=()=>Cc[t].process(Wi),e),{});const HC=e=>Cc[e].process(Wi),p2=e=>{Ga=!1,Wi.delta=uf?f2:Math.max(Math.min(e-Wi.timestamp,FC),1),Wi.timestamp=e,df=!0,ss.forEach(HC),df=!1,Ga&&(uf=!1,h2(p2))},WC=()=>{Ga=!0,uf=!0,df||h2(p2)},$v=()=>Wi;function eh(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=y.Children.toArray(e.path),c=fe((u,f)=>l.jsx(tn,{ref:f,viewBox:t,...o,...u,children:s.length?s:l.jsx("path",{fill:"currentColor",d:n})}));return c.displayName=r,c}function ls(e){const{theme:t}=NS(),n=SC();return y.useMemo(()=>CC(t.direction,{...n,...e}),[e,t.direction,n])}var VC=Object.defineProperty,UC=(e,t,n)=>t in e?VC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zt=(e,t,n)=>(UC(e,typeof t!="symbol"?t+"":t,n),n);function Gv(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 $C=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function qv(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function Yv(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var ff=typeof window<"u"?y.useLayoutEffect:y.useEffect,ec=e=>e,GC=class{constructor(){zt(this,"descendants",new Map),zt(this,"register",e=>{if(e!=null)return $C(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),zt(this,"unregister",e=>{this.descendants.delete(e);const t=Gv(Array.from(this.descendants.keys()));this.assignIndex(t)}),zt(this,"destroy",()=>{this.descendants.clear()}),zt(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),zt(this,"count",()=>this.descendants.size),zt(this,"enabledCount",()=>this.enabledValues().length),zt(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),zt(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),zt(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),zt(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),zt(this,"first",()=>this.item(0)),zt(this,"firstEnabled",()=>this.enabledItem(0)),zt(this,"last",()=>this.item(this.descendants.size-1)),zt(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),zt(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),zt(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),zt(this,"next",(e,t=!0)=>{const n=qv(e,this.count(),t);return this.item(n)}),zt(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=qv(r,this.enabledCount(),t);return this.enabledItem(o)}),zt(this,"prev",(e,t=!0)=>{const n=Yv(e,this.count()-1,t);return this.item(n)}),zt(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Yv(r,this.enabledCount()-1,t);return this.enabledItem(o)}),zt(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=Gv(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const o={node:e,index:-1,...t};this.descendants.set(e,o),this.assignIndex(r)})}};function qC(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function ct(...e){return t=>{e.forEach(n=>{qC(n,t)})}}function YC(...e){return y.useMemo(()=>ct(...e),e)}function KC(){const e=y.useRef(new GC);return ff(()=>()=>e.current.destroy()),e.current}var[XC,m2]=kt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function QC(e){const t=m2(),[n,r]=y.useState(-1),o=y.useRef(null);ff(()=>()=>{o.current&&t.unregister(o.current)},[]),ff(()=>{if(!o.current)return;const c=Number(o.current.dataset.index);n!=c&&!Number.isNaN(c)&&r(c)});const s=ec(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:ct(s,o)}}function th(){return[ec(XC),()=>ec(m2()),()=>KC(),o=>QC(o)]}var[ZC,wc]=kt({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[JC,nh]=kt({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[ew,nL,tw,nw]=th(),Ai=fe(function(t,n){const{getButtonProps:r}=nh(),o=r(t,n),c={display:"flex",alignItems:"center",width:"100%",outline:0,...wc().button};return l.jsx(ne.button,{...o,className:Ae("chakra-accordion__button",t.className),__css:c})});Ai.displayName="AccordionButton";function rh(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(x,S)=>x!==S}=e,s=Wt(r),c=Wt(o),[u,f]=y.useState(n),h=t!==void 0,m=h?t:u,v=Wt(x=>{const C=typeof x=="function"?x(m):x;c(m,C)&&(h||f(C),s(C))},[h,s,m,c]);return[m,v]}function rw(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...c}=e;aw(e),sw(e);const u=tw(),[f,h]=y.useState(-1);y.useEffect(()=>()=>{h(-1)},[]);const[m,v]=rh({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:m,setIndex:v,htmlProps:c,getAccordionItemProps:S=>{let C=!1;return S!==null&&(C=Array.isArray(m)?m.includes(S):m===S),{isOpen:C,onChange:w=>{if(S!==null)if(o&&Array.isArray(m)){const k=w?m.concat(S):m.filter(M=>M!==S);v(k)}else w?v(S):s&&v(-1)}}},focusedIndex:f,setFocusedIndex:h,descendants:u}}var[ow,oh]=kt({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function iw(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:c}=oh(),u=y.useRef(null),f=y.useId(),h=r??f,m=`accordion-button-${h}`,v=`accordion-panel-${h}`;lw(e);const{register:x,index:S,descendants:C}=nw({disabled:t&&!n}),{isOpen:j,onChange:w}=s(S===-1?null:S);cw({isOpen:j,isDisabled:t});const k=()=>{w==null||w(!0)},M=()=>{w==null||w(!1)},P=y.useCallback(()=>{w==null||w(!j),c(S)},[S,c,j,w]),I=y.useCallback(z=>{const F={ArrowDown:()=>{const B=C.nextEnabled(S);B==null||B.node.focus()},ArrowUp:()=>{const B=C.prevEnabled(S);B==null||B.node.focus()},Home:()=>{const B=C.firstEnabled();B==null||B.node.focus()},End:()=>{const B=C.lastEnabled();B==null||B.node.focus()}}[z.key];F&&(z.preventDefault(),F(z))},[C,S]),T=y.useCallback(()=>{c(S)},[c,S]),_=y.useCallback(function(W={},F=null){return{...W,type:"button",ref:ct(x,u,F),id:m,disabled:!!t,"aria-expanded":!!j,"aria-controls":v,onClick:Ee(W.onClick,P),onFocus:Ee(W.onFocus,T),onKeyDown:Ee(W.onKeyDown,I)}},[m,t,j,P,T,I,v,x]),D=y.useCallback(function(W={},F=null){return{...W,ref:F,role:"region",id:v,"aria-labelledby":m,hidden:!j}},[m,j,v]);return{isOpen:j,isDisabled:t,isFocusable:n,onOpen:k,onClose:M,getButtonProps:_,getPanelProps:D,htmlProps:o}}function aw(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;ns({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function sw(e){ns({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 lw(e){ns({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 cw(e){ns({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Oi(e){const{isOpen:t,isDisabled:n}=nh(),{reduceMotion:r}=oh(),o=Ae("chakra-accordion__icon",e.className),s=wc(),c={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return l.jsx(tn,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:c,...e,children:l.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Oi.displayName="AccordionIcon";var zi=fe(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...c}=iw(t),f={...wc().container,overflowAnchor:"none"},h=y.useMemo(()=>c,[c]);return l.jsx(JC,{value:h,children:l.jsx(ne.div,{ref:n,...s,className:Ae("chakra-accordion__item",o),__css:f,children:typeof r=="function"?r({isExpanded:!!c.isOpen,isDisabled:!!c.isDisabled}):r})})});zi.displayName="AccordionItem";var Wo={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Ta={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 hf(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return Ta.slideRight;case"left":return Ta.slideLeft;case"bottom":return Ta.slideDown;case"top":return Ta.slideUp;default:return Ta.slideRight}}var $o={enter:{duration:.2,ease:Wo.easeOut},exit:{duration:.1,ease:Wo.easeIn}},rr={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})},uw=e=>e!=null&&parseInt(e.toString(),10)>0,Kv={exit:{height:{duration:.2,ease:Wo.ease},opacity:{duration:.3,ease:Wo.ease}},enter:{height:{duration:.3,ease:Wo.ease},opacity:{duration:.4,ease:Wo.ease}}},dw={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:uw(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:rr.exit(Kv.exit,o)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(s=n==null?void 0:n.enter)!=null?s:rr.enter(Kv.enter,o)}}},v2=y.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:c="auto",style:u,className:f,transition:h,transitionEnd:m,...v}=e,[x,S]=y.useState(!1);y.useEffect(()=>{const M=setTimeout(()=>{S(!0)});return()=>clearTimeout(M)},[]),ns({condition:Boolean(s>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const C=parseFloat(s.toString())>0,j={startingHeight:s,endingHeight:c,animateOpacity:o,transition:x?h:{enter:{duration:0}},transitionEnd:{enter:m==null?void 0:m.enter,exit:r?m==null?void 0:m.exit:{...m==null?void 0:m.exit,display:C?"block":"none"}}},w=r?n:!0,k=n||r?"enter":"exit";return l.jsx(xo,{initial:!1,custom:j,children:w&&l.jsx(ar.div,{ref:t,...v,className:Ae("chakra-collapse",f),style:{overflow:"hidden",display:"block",...u},custom:j,variants:dw,initial:r?"exit":!1,animate:k,exit:"exit"})})});v2.displayName="Collapse";var fw={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:rr.enter($o.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:rr.exit($o.exit,n),transitionEnd:t==null?void 0:t.exit}}},g2={initial:"exit",animate:"enter",exit:"exit",variants:fw},hw=y.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:c,transitionEnd:u,delay:f,...h}=t,m=o||r?"enter":"exit",v=r?o&&r:!0,x={transition:c,transitionEnd:u,delay:f};return l.jsx(xo,{custom:x,children:v&&l.jsx(ar.div,{ref:n,className:Ae("chakra-fade",s),custom:x,...g2,animate:m,...h})})});hw.displayName="Fade";var pw={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(s=n==null?void 0:n.exit)!=null?s:rr.exit($o.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:rr.enter($o.enter,n),transitionEnd:e==null?void 0:e.enter}}},y2={initial:"exit",animate:"enter",exit:"exit",variants:pw},mw=y.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:c=.95,className:u,transition:f,transitionEnd:h,delay:m,...v}=t,x=r?o&&r:!0,S=o||r?"enter":"exit",C={initialScale:c,reverse:s,transition:f,transitionEnd:h,delay:m};return l.jsx(xo,{custom:C,children:x&&l.jsx(ar.div,{ref:n,className:Ae("chakra-offset-slide",u),...y2,animate:S,custom:C,...v})})});mw.displayName="ScaleFade";var vw={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,x:e,y:t,transition:(s=n==null?void 0:n.exit)!=null?s:rr.exit($o.exit,o),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:rr.enter($o.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var c;const u={x:t,y:e};return{opacity:0,transition:(c=n==null?void 0:n.exit)!=null?c:rr.exit($o.exit,s),...o?{...u,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...u,...r==null?void 0:r.exit}}}}},pf={initial:"initial",animate:"enter",exit:"exit",variants:vw},gw=y.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:c,offsetX:u=0,offsetY:f=8,transition:h,transitionEnd:m,delay:v,...x}=t,S=r?o&&r:!0,C=o||r?"enter":"exit",j={offsetX:u,offsetY:f,reverse:s,transition:h,transitionEnd:m,delay:v};return l.jsx(xo,{custom:j,children:S&&l.jsx(ar.div,{ref:n,className:Ae("chakra-offset-slide",c),custom:j,...pf,animate:C,...x})})});gw.displayName="SlideFade";var Xv={exit:{duration:.15,ease:Wo.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},yw={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{var o;const{exit:s}=hf({direction:e});return{...s,transition:(o=t==null?void 0:t.exit)!=null?o:rr.exit(Xv.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{var o;const{enter:s}=hf({direction:e});return{...s,transition:(o=n==null?void 0:n.enter)!=null?o:rr.enter(Xv.enter,r),transitionEnd:t==null?void 0:t.enter}}},x2=y.forwardRef(function(t,n){const{direction:r="right",style:o,unmountOnExit:s,in:c,className:u,transition:f,transitionEnd:h,delay:m,motionProps:v,...x}=t,S=hf({direction:r}),C=Object.assign({position:"fixed"},S.position,o),j=s?c&&s:!0,w=c||s?"enter":"exit",k={transitionEnd:h,transition:f,direction:r,delay:m};return l.jsx(xo,{custom:k,children:j&&l.jsx(ar.div,{...x,ref:n,initial:"exit",className:Ae("chakra-slide",u),animate:w,exit:"exit",custom:k,variants:yw,style:C,...v})})});x2.displayName="Slide";var Ri=fe(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:c}=oh(),{getPanelProps:u,isOpen:f}=nh(),h=u(s,n),m=Ae("chakra-accordion__panel",r),v=wc();c||delete h.hidden;const x=l.jsx(ne.div,{...h,__css:v.panel,className:m});return c?x:l.jsx(v2,{in:f,...o,children:x})});Ri.displayName="AccordionPanel";var ih=fe(function({children:t,reduceMotion:n,...r},o){const s=un("Accordion",r),c=At(r),{htmlProps:u,descendants:f,...h}=rw(c),m=y.useMemo(()=>({...h,reduceMotion:!!n}),[h,n]);return l.jsx(ew,{value:f,children:l.jsx(ow,{value:m,children:l.jsx(ZC,{value:s,children:l.jsx(ne.div,{ref:o,...u,className:Ae("chakra-accordion",r.className),__css:s.root,children:t})})})})});ih.displayName="Accordion";var mf=fe(function(t,n){const{htmlWidth:r,htmlHeight:o,alt:s,...c}=t;return l.jsx("img",{width:r,height:o,ref:n,alt:s,...c})});mf.displayName="NativeImage";function xw(e){const{loading:t,src:n,srcSet:r,onLoad:o,onError:s,crossOrigin:c,sizes:u,ignoreFallback:f}=e,[h,m]=y.useState("pending");y.useEffect(()=>{m(n?"loading":"pending")},[n]);const v=y.useRef(),x=y.useCallback(()=>{if(!n)return;S();const C=new Image;C.src=n,c&&(C.crossOrigin=c),r&&(C.srcset=r),u&&(C.sizes=u),t&&(C.loading=t),C.onload=j=>{S(),m("loaded"),o==null||o(j)},C.onerror=j=>{S(),m("failed"),s==null||s(j)},v.current=C},[n,c,r,u,o,s,t]),S=()=>{v.current&&(v.current.onload=null,v.current.onerror=null,v.current=null)};return Hi(()=>{if(!f)return h==="loading"&&x(),()=>{S()}},[h,x,f]),f?"loaded":h}var bw=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function Sw(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var cs=fe(function(t,n){const{fallbackSrc:r,fallback:o,src:s,srcSet:c,align:u,fit:f,loading:h,ignoreFallback:m,crossOrigin:v,fallbackStrategy:x="beforeLoadOrError",referrerPolicy:S,...C}=t,j=r!==void 0||o!==void 0,w=h!=null||m||!j,k=xw({...t,ignoreFallback:w}),M=bw(k,x),P={ref:n,objectFit:f,objectPosition:u,...w?C:Sw(C,["onError","onLoad"])};return M?o||l.jsx(ne.img,{as:mf,className:"chakra-image__placeholder",src:r,...P}):l.jsx(ne.img,{as:mf,src:s,srcSet:c,crossOrigin:v,loading:h,referrerPolicy:S,className:"chakra-image",...P})});cs.displayName="Image";function ah(e){return y.Children.toArray(e).filter(t=>y.isValidElement(t))}var[Cw,ww]=kt({strict:!1,name:"ButtonGroupContext"}),jw={horizontal:{"> *: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}},vertical:{"> *:first-of-type:not(:last-of-type)":{borderBottomRadius:0},"> *:not(:first-of-type):not(:last-of-type)":{borderRadius:0},"> *:not(:first-of-type):last-of-type":{borderTopRadius:0}}},kw={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Qt=fe(function(t,n){const{size:r,colorScheme:o,variant:s,className:c,spacing:u="0.5rem",isAttached:f,isDisabled:h,orientation:m="horizontal",...v}=t,x=Ae("chakra-button__group",c),S=y.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:h}),[r,o,s,h]);let C={display:"inline-flex",...f?jw[m]:kw[m](u)};const j=m==="vertical";return l.jsx(Cw,{value:S,children:l.jsx(ne.div,{ref:n,role:"group",__css:C,className:x,"data-attached":f?"":void 0,"data-orientation":m,flexDir:j?"column":void 0,...v})})});Qt.displayName="ButtonGroup";function Ew(e){const[t,n]=y.useState(!e);return{ref:y.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function vf(e){const{children:t,className:n,...r}=e,o=y.isValidElement(t)?y.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=Ae("chakra-button__icon",n);return l.jsx(ne.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}vf.displayName="ButtonIcon";function tc(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=l.jsx(yc,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:c,...u}=e,f=Ae("chakra-button__spinner",s),h=n==="start"?"marginEnd":"marginStart",m=y.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[h]:t?r:0,fontSize:"1em",lineHeight:"normal",...c}),[c,t,h,r]);return l.jsx(ne.div,{className:f,...u,__css:m,children:o})}tc.displayName="ButtonSpinner";var ni=fe((e,t)=>{const n=ww(),r=yo("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:c,children:u,leftIcon:f,rightIcon:h,loadingText:m,iconSpacing:v="0.5rem",type:x,spinner:S,spinnerPlacement:C="start",className:j,as:w,...k}=At(e),M=y.useMemo(()=>{const _={...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:_}}},[r,n]),{ref:P,type:I}=Ew(w),T={rightIcon:h,leftIcon:f,iconSpacing:v,children:u};return l.jsxs(ne.button,{ref:YC(t,P),as:w,type:x??I,"data-active":qe(c),"data-loading":qe(s),__css:M,className:Ae("chakra-button",j),...k,disabled:o||s,children:[s&&C==="start"&&l.jsx(tc,{className:"chakra-button__spinner--start",label:m,placement:"start",spacing:v,children:S}),s?m||l.jsx(ne.span,{opacity:0,children:l.jsx(Qv,{...T})}):l.jsx(Qv,{...T}),s&&C==="end"&&l.jsx(tc,{className:"chakra-button__spinner--end",label:m,placement:"end",spacing:v,children:S})]})});ni.displayName="Button";function Qv(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return l.jsxs(l.Fragment,{children:[t&&l.jsx(vf,{marginEnd:o,children:t}),r,n&&l.jsx(vf,{marginStart:o,children:n})]})}var ho=fe((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...c}=e,u=n||r,f=y.isValidElement(u)?y.cloneElement(u,{"aria-hidden":!0,focusable:!1}):null;return l.jsx(ni,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...c,children:f})});ho.displayName="IconButton";var[rL,Pw]=kt({name:"CheckboxGroupContext",strict:!1});function Iw(e){return l.jsx(ne.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:l.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function Mw(e){return l.jsx(ne.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:l.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function Tw(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?Mw:Iw;return n||t?l.jsx(ne.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:l.jsx(o,{...r})}):null}var[_w,b2]=kt({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[Dw,ri]=kt({strict:!1,name:"FormControlContext"});function Aw(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...c}=e,u=y.useId(),f=t||`field-${u}`,h=`${f}-label`,m=`${f}-feedback`,v=`${f}-helptext`,[x,S]=y.useState(!1),[C,j]=y.useState(!1),[w,k]=y.useState(!1),M=y.useCallback((D={},z=null)=>({id:v,...D,ref:ct(z,W=>{W&&j(!0)})}),[v]),P=y.useCallback((D={},z=null)=>{var W,F;return{...D,ref:z,"data-focus":qe(w),"data-disabled":qe(o),"data-invalid":qe(r),"data-readonly":qe(s),id:(W=D.id)!=null?W:h,htmlFor:(F=D.htmlFor)!=null?F:f}},[f,o,w,r,s,h]),I=y.useCallback((D={},z=null)=>({id:m,...D,ref:ct(z,W=>{W&&S(!0)}),"aria-live":"polite"}),[m]),T=y.useCallback((D={},z=null)=>({...D,...c,ref:z,role:"group"}),[c]),_=y.useCallback((D={},z=null)=>({...D,ref:z,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!w,onFocus:()=>k(!0),onBlur:()=>k(!1),hasFeedbackText:x,setHasFeedbackText:S,hasHelpText:C,setHasHelpText:j,id:f,labelId:h,feedbackId:m,helpTextId:v,htmlProps:c,getHelpTextProps:M,getErrorMessageProps:I,getRootProps:T,getLabelProps:P,getRequiredIndicatorProps:_}}var rt=fe(function(t,n){const r=un("Form",t),o=At(t),{getRootProps:s,htmlProps:c,...u}=Aw(o),f=Ae("chakra-form-control",t.className);return l.jsx(Dw,{value:u,children:l.jsx(_w,{value:r,children:l.jsx(ne.div,{...s({},n),className:f,__css:r.container})})})});rt.displayName="FormControl";var pn=fe(function(t,n){const r=ri(),o=b2(),s=Ae("chakra-form__helper-text",t.className);return l.jsx(ne.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});pn.displayName="FormHelperText";var[Ow,zw]=kt({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormError />" `}),mn=fe((e,t)=>{const n=un("FormError",e),r=At(e),o=ri();return o!=null&&o.isInvalid?l.jsx(Ow,{value:n,children:l.jsx(ne.div,{...o==null?void 0:o.getErrorMessageProps(r,t),className:Ae("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})}):null});mn.displayName="FormErrorMessage";var Rw=fe((e,t)=>{const n=zw(),r=ri();if(!(r!=null&&r.isInvalid))return null;const o=Ae("chakra-form__error-icon",e.className);return l.jsx(tn,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:o,children:l.jsx("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"})})});Rw.displayName="FormErrorIcon";var st=fe(function(t,n){var r;const o=yo("FormLabel",t),s=At(t),{className:c,children:u,requiredIndicator:f=l.jsx(S2,{}),optionalIndicator:h=null,...m}=s,v=ri(),x=(r=v==null?void 0:v.getLabelProps(m,n))!=null?r:{ref:n,...m};return l.jsxs(ne.label,{...x,className:Ae("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[u,v!=null&&v.isRequired?f:h]})});st.displayName="FormLabel";var S2=fe(function(t,n){const r=ri(),o=b2();if(!(r!=null&&r.isRequired))return null;const s=Ae("chakra-form__required-indicator",t.className);return l.jsx(ne.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});S2.displayName="RequiredIndicator";function sh(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=lh(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":Nr(n),"aria-required":Nr(o),"aria-readonly":Nr(r)}}function lh(e){var t,n,r;const o=ri(),{id:s,disabled:c,readOnly:u,required:f,isRequired:h,isInvalid:m,isReadOnly:v,isDisabled:x,onFocus:S,onBlur:C,...j}=e,w=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&w.push(o.feedbackId),o!=null&&o.hasHelpText&&w.push(o.helpTextId),{...j,"aria-describedby":w.join(" ")||void 0,id:s??(o==null?void 0:o.id),isDisabled:(t=c??x)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=u??v)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=f??h)!=null?r:o==null?void 0:o.isRequired,isInvalid:m??(o==null?void 0:o.isInvalid),onFocus:Ee(o==null?void 0:o.onFocus,S),onBlur:Ee(o==null?void 0:o.onBlur,C)}}var ch={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},C2=ne("span",{baseStyle:ch});C2.displayName="VisuallyHidden";var Nw=ne("input",{baseStyle:ch});Nw.displayName="VisuallyHiddenInput";var Zv=!1,us=null,Xo=!1,gf=!1,yf=new Set;function uh(e,t){yf.forEach(n=>n(e,t))}var Fw=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function Lw(e){return!(e.metaKey||!Fw&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Jv(e){Xo=!0,Lw(e)&&(us="keyboard",uh("keyboard",e))}function wi(e){if(us="pointer",e.type==="mousedown"||e.type==="pointerdown"){Xo=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;uh("pointer",e)}}function Bw(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function Hw(e){Bw(e)&&(Xo=!0,us="virtual")}function Ww(e){e.target===window||e.target===document||(!Xo&&!gf&&(us="virtual",uh("virtual",e)),Xo=!1,gf=!1)}function Vw(){Xo=!1,gf=!0}function eg(){return us!=="pointer"}function Uw(){if(typeof window>"u"||Zv)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Xo=!0,e.apply(this,n)},document.addEventListener("keydown",Jv,!0),document.addEventListener("keyup",Jv,!0),document.addEventListener("click",Hw,!0),window.addEventListener("focus",Ww,!0),window.addEventListener("blur",Vw,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",wi,!0),document.addEventListener("pointermove",wi,!0),document.addEventListener("pointerup",wi,!0)):(document.addEventListener("mousedown",wi,!0),document.addEventListener("mousemove",wi,!0),document.addEventListener("mouseup",wi,!0)),Zv=!0}function w2(e){Uw(),e(eg());const t=()=>e(eg());return yf.add(t),()=>{yf.delete(t)}}function $w(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function j2(e={}){const t=lh(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:c,onBlur:u,onFocus:f,"aria-describedby":h}=t,{defaultChecked:m,isChecked:v,isFocusable:x,onChange:S,isIndeterminate:C,name:j,value:w,tabIndex:k=void 0,"aria-label":M,"aria-labelledby":P,"aria-invalid":I,...T}=e,_=$w(T,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=Wt(S),z=Wt(u),W=Wt(f),[F,B]=y.useState(!1),[Q,U]=y.useState(!1),[X,te]=y.useState(!1),[re,$]=y.useState(!1);y.useEffect(()=>w2(B),[]);const Z=y.useRef(null),[oe,le]=y.useState(!0),[ze,Re]=y.useState(!!m),Ie=v!==void 0,pe=Ie?v:ze,ce=y.useCallback(ye=>{if(r||n){ye.preventDefault();return}Ie||Re(pe?ye.target.checked:C?!0:ye.target.checked),D==null||D(ye)},[r,n,pe,Ie,C,D]);Hi(()=>{Z.current&&(Z.current.indeterminate=Boolean(C))},[C]),ti(()=>{n&&U(!1)},[n,U]),Hi(()=>{const ye=Z.current;ye!=null&&ye.form&&(ye.form.onreset=()=>{Re(!!m)})},[]);const Ne=n&&!x,Ve=y.useCallback(ye=>{ye.key===" "&&$(!0)},[$]),Ue=y.useCallback(ye=>{ye.key===" "&&$(!1)},[$]);Hi(()=>{if(!Z.current)return;Z.current.checked!==pe&&Re(Z.current.checked)},[Z.current]);const $e=y.useCallback((ye={},Pe=null)=>{const et=Be=>{Q&&Be.preventDefault(),$(!0)};return{...ye,ref:Pe,"data-active":qe(re),"data-hover":qe(X),"data-checked":qe(pe),"data-focus":qe(Q),"data-focus-visible":qe(Q&&F),"data-indeterminate":qe(C),"data-disabled":qe(n),"data-invalid":qe(s),"data-readonly":qe(r),"aria-hidden":!0,onMouseDown:Ee(ye.onMouseDown,et),onMouseUp:Ee(ye.onMouseUp,()=>$(!1)),onMouseEnter:Ee(ye.onMouseEnter,()=>te(!0)),onMouseLeave:Ee(ye.onMouseLeave,()=>te(!1))}},[re,pe,n,Q,F,X,C,s,r]),Qe=y.useCallback((ye={},Pe=null)=>({..._,...ye,ref:ct(Pe,et=>{et&&le(et.tagName==="LABEL")}),onClick:Ee(ye.onClick,()=>{var et;oe||((et=Z.current)==null||et.click(),requestAnimationFrame(()=>{var Be;(Be=Z.current)==null||Be.focus()}))}),"data-disabled":qe(n),"data-checked":qe(pe),"data-invalid":qe(s)}),[_,n,pe,s,oe]),ve=y.useCallback((ye={},Pe=null)=>({...ye,ref:ct(Z,Pe),type:"checkbox",name:j,value:w,id:c,tabIndex:k,onChange:Ee(ye.onChange,ce),onBlur:Ee(ye.onBlur,z,()=>U(!1)),onFocus:Ee(ye.onFocus,W,()=>U(!0)),onKeyDown:Ee(ye.onKeyDown,Ve),onKeyUp:Ee(ye.onKeyUp,Ue),required:o,checked:pe,disabled:Ne,readOnly:r,"aria-label":M,"aria-labelledby":P,"aria-invalid":I?Boolean(I):s,"aria-describedby":h,"aria-disabled":n,style:ch}),[j,w,c,ce,z,W,Ve,Ue,o,pe,Ne,r,M,P,I,s,h,n,k]),Te=y.useCallback((ye={},Pe=null)=>({...ye,ref:Pe,onMouseDown:Ee(ye.onMouseDown,tg),onTouchStart:Ee(ye.onTouchStart,tg),"data-disabled":qe(n),"data-checked":qe(pe),"data-invalid":qe(s)}),[pe,n,s]);return{state:{isInvalid:s,isFocused:Q,isChecked:pe,isActive:re,isHovered:X,isIndeterminate:C,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:Qe,getCheckboxProps:$e,getInputProps:ve,getLabelProps:Te,htmlProps:_}}function tg(e){e.preventDefault(),e.stopPropagation()}var Gw={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},qw={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},Yw=ei({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),Kw=ei({from:{opacity:0},to:{opacity:1}}),Xw=ei({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),k2=fe(function(t,n){const r=Pw(),o={...r,...t},s=un("Checkbox",o),c=At(t),{spacing:u="0.5rem",className:f,children:h,iconColor:m,iconSize:v,icon:x=l.jsx(Tw,{}),isChecked:S,isDisabled:C=r==null?void 0:r.isDisabled,onChange:j,inputProps:w,...k}=c;let M=S;r!=null&&r.value&&c.value&&(M=r.value.includes(c.value));let P=j;r!=null&&r.onChange&&c.value&&(P=xc(r.onChange,j));const{state:I,getInputProps:T,getCheckboxProps:_,getLabelProps:D,getRootProps:z}=j2({...k,isDisabled:C,isChecked:M,onChange:P}),W=y.useMemo(()=>({animation:I.isIndeterminate?`${Kw} 20ms linear, ${Xw} 200ms linear`:`${Yw} 200ms linear`,fontSize:v,color:m,...s.icon}),[m,v,,I.isIndeterminate,s.icon]),F=y.cloneElement(x,{__css:W,isIndeterminate:I.isIndeterminate,isChecked:I.isChecked});return l.jsxs(ne.label,{__css:{...qw,...s.container},className:Ae("chakra-checkbox",f),...z(),children:[l.jsx("input",{className:"chakra-checkbox__input",...T(w,n)}),l.jsx(ne.span,{__css:{...Gw,...s.control},className:"chakra-checkbox__control",..._(),children:F}),h&&l.jsx(ne.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:u,...s.label},children:h})]})});k2.displayName="Checkbox";function Qw(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function dh(e,t){let n=Qw(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function xf(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 ng(e,t,n){return(e-t)*100/(n-t)}function Zw(e,t,n){return(n-t)*e+t}function rg(e,t,n){const r=Math.round((e-t)/n)*n+t,o=xf(n);return dh(r,o)}function Hl(e,t,n){return e==null?e:(n<t&&console.warn("clamp: max cannot be less than min"),Math.min(Math.max(e,t),n))}function Jw(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:c=Number.MIN_SAFE_INTEGER,max:u=Number.MAX_SAFE_INTEGER,keepWithinRange:f=!0}=e,h=Wt(t),[m,v]=y.useState(()=>{var F;return r==null?"":(F=gd(r,s,n))!=null?F:""}),x=typeof o<"u",S=x?o:m,C=E2(io(S),s),j=n??C,w=y.useCallback(F=>{F!==S&&(x||v(F.toString()),h==null||h(F.toString(),io(F)))},[h,x,S]),k=y.useCallback(F=>{let B=F;return f&&(B=Hl(B,c,u)),dh(B,j)},[j,f,u,c]),M=y.useCallback((F=s)=>{let B;S===""?B=io(F):B=io(S)+F,B=k(B),w(B)},[k,s,w,S]),P=y.useCallback((F=s)=>{let B;S===""?B=io(-F):B=io(S)-F,B=k(B),w(B)},[k,s,w,S]),I=y.useCallback(()=>{var F;let B;r==null?B="":B=(F=gd(r,s,n))!=null?F:c,w(B)},[r,n,s,w,c]),T=y.useCallback(F=>{var B;const Q=(B=gd(F,s,j))!=null?B:c;w(Q)},[j,s,w,c]),_=io(S);return{isOutOfRange:_>u||_<c,isAtMax:_===u,isAtMin:_===c,precision:j,value:S,valueAsNumber:_,update:w,reset:I,increment:M,decrement:P,clamp:k,cast:T,setValue:v}}function io(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function E2(e,t){return Math.max(xf(t),xf(e))}function gd(e,t,n){const r=io(e);if(Number.isNaN(r))return;const o=E2(r,t);return dh(r,n??o)}function Go(e,t,n,r){const o=Wt(n);return y.useEffect(()=>{const s=typeof e=="function"?e():e??document;if(!(!n||!s))return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const s=typeof e=="function"?e():e??document;s==null||s.removeEventListener(t,o,r)}}function e5(e){return"current"in e}var P2=()=>typeof window<"u";function t5(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var n5=e=>P2()&&e.test(navigator.vendor),r5=e=>P2()&&e.test(t5()),o5=()=>r5(/mac|iphone|ipad|ipod/i),i5=()=>o5()&&n5(/apple/i);function a5(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,c;return(c=(s=t.current)==null?void 0:s.ownerDocument)!=null?c:document};Go(o,"pointerdown",s=>{if(!i5()||!r)return;const c=s.target,f=(n??[t]).some(h=>{const m=e5(h)?h.current:h;return(m==null?void 0:m.contains(c))||m===c});o().activeElement!==c&&f&&(s.preventDefault(),c.focus())})}var lt={},s5={get exports(){return lt},set exports(e){lt=e}},l5="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",c5=l5,u5=c5;function I2(){}function M2(){}M2.resetWarningCache=I2;var d5=function(){function e(r,o,s,c,u,f){if(f!==u5){var h=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 h.name="Invariant Violation",h}}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:M2,resetWarningCache:I2};return n.PropTypes=n,n};s5.exports=d5();var bf="data-focus-lock",T2="data-focus-lock-disabled",f5="data-no-focus-lock",h5="data-autofocus-inside",p5="data-no-autofocus";function m5(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function v5(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function _2(e,t){return v5(t||null,function(n){return e.forEach(function(r){return m5(r,n)})})}var yd={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},xr=function(){return xr=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},xr.apply(this,arguments)};function D2(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function na(e,t,n,r){function o(s){return s instanceof n?s:new n(function(c){c(s)})}return new(n||(n=Promise))(function(s,c){function u(m){try{h(r.next(m))}catch(v){c(v)}}function f(m){try{h(r.throw(m))}catch(v){c(v)}}function h(m){m.done?s(m.value):o(m.value).then(u,f)}h((r=r.apply(e,t||[])).next())})}function ra(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(m){return f([h,m])}}function f(h){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,h[0]&&(n=0)),n;)try{if(r=1,o&&(s=h[0]&2?o.return:h[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,h[1])).done)return s;switch(o=0,s&&(h=[h[0]&2,s.value]),h[0]){case 0:case 1:s=h;break;case 4:return n.label++,{value:h[1],done:!1};case 5:n.label++,o=h[1],h=[0];continue;case 7:h=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(h[0]===6||h[0]===2)){n=0;continue}if(h[0]===3&&(!s||h[1]>s[0]&&h[1]<s[3])){n.label=h[1];break}if(h[0]===6&&n.label<s[1]){n.label=s[1],s=h;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(h);break}s[2]&&n.ops.pop(),n.trys.pop();continue}h=t.call(e,n)}catch(m){h=[6,m],o=0}finally{r=s=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function og(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],c;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(u){c={error:u}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(c)throw c.error}}return s}function Sf(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function A2(e){return e}function O2(e,t){t===void 0&&(t=A2);var n=[],r=!1,o={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(s){var c=t(s,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(s){for(r=!0;n.length;){var c=n;n=[],c.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(s),c=n}var f=function(){var m=c;c=[],m.forEach(s)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(m){c.push(m),h()},filter:function(m){return c=c.filter(m),n}}}};return o}function fh(e,t){return t===void 0&&(t=A2),O2(e,t)}function z2(e){e===void 0&&(e={});var t=O2(null);return t.options=xr({async:!0,ssr:!1},e),t}var R2=function(e){var t=e.sideCar,n=D2(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 y.createElement(r,xr({},n))};R2.isSideCarExport=!0;function g5(e,t){return e.useMedium(t),R2}var N2=fh({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),F2=fh(),y5=fh(),x5=z2({async:!0}),b5=[],hh=y.forwardRef(function(t,n){var r,o=y.useState(),s=o[0],c=o[1],u=y.useRef(),f=y.useRef(!1),h=y.useRef(null),m=t.children,v=t.disabled,x=t.noFocusGuards,S=t.persistentFocus,C=t.crossFrame,j=t.autoFocus;t.allowTextSelection;var w=t.group,k=t.className,M=t.whiteList,P=t.hasPositiveIndices,I=t.shards,T=I===void 0?b5:I,_=t.as,D=_===void 0?"div":_,z=t.lockProps,W=z===void 0?{}:z,F=t.sideCar,B=t.returnFocus,Q=t.focusOptions,U=t.onActivation,X=t.onDeactivation,te=y.useState({}),re=te[0],$=y.useCallback(function(){h.current=h.current||document&&document.activeElement,u.current&&U&&U(u.current),f.current=!0},[U]),Z=y.useCallback(function(){f.current=!1,X&&X(u.current)},[X]);y.useEffect(function(){v||(h.current=null)},[]);var oe=y.useCallback(function(Ve){var Ue=h.current;if(Ue&&Ue.focus){var $e=typeof B=="function"?B(Ue):B;if($e){var Qe=typeof $e=="object"?$e:void 0;h.current=null,Ve?Promise.resolve().then(function(){return Ue.focus(Qe)}):Ue.focus(Qe)}}},[B]),le=y.useCallback(function(Ve){f.current&&N2.useMedium(Ve)},[]),ze=F2.useMedium,Re=y.useCallback(function(Ve){u.current!==Ve&&(u.current=Ve,c(Ve))},[]),Ie=Xd((r={},r[T2]=v&&"disabled",r[bf]=w,r),W),pe=x!==!0,ce=pe&&x!=="tail",Ne=_2([n,Re]);return y.createElement(y.Fragment,null,pe&&[y.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:v?-1:0,style:yd}),P?y.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:v?-1:1,style:yd}):null],!v&&y.createElement(F,{id:re,sideCar:x5,observed:s,disabled:v,persistentFocus:S,crossFrame:C,autoFocus:j,whiteList:M,shards:T,onActivation:$,onDeactivation:Z,returnFocus:oe,focusOptions:Q}),y.createElement(D,Xd({ref:Ne},Ie,{className:k,onBlur:ze,onFocus:le}),m),ce&&y.createElement("div",{"data-focus-guard":!0,tabIndex:v?-1:0,style:yd}))});hh.propTypes={};hh.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 L2=hh;function S5(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,FS(e,t)}function C5(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],c;function u(){c=e(s.map(function(h){return h.props})),t(c)}var f=function(h){S5(m,h);function m(){return h.apply(this,arguments)||this}m.peek=function(){return c};var v=m.prototype;return v.componentDidMount=function(){s.push(this),u()},v.componentDidUpdate=function(){u()},v.componentWillUnmount=function(){var S=s.indexOf(this);s.splice(S,1),u()},v.render=function(){return Me.createElement(o,this.props)},m}(y.PureComponent);return LS(f,"displayName","SideEffect("+n(o)+")"),f}}var Er=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},nc=function(e){return Array.isArray(e)?e:[e]},B2=function(e){return Array.isArray(e)?e[0]:e},w5=function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(e,null);return!t||!t.getPropertyValue?!1:t.getPropertyValue("display")==="none"||t.getPropertyValue("visibility")==="hidden"},H2=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},W2=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},j5=function(e,t){return!e||W2(e)||!w5(e)&&t(H2(e))},V2=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=j5(t,V2.bind(void 0,e));return e.set(t,r),r},k5=function(e,t){return e&&!W2(e)?I5(e)?t(H2(e)):!1:!0},U2=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=k5(t,U2.bind(void 0,e));return e.set(t,r),r},$2=function(e){return e.dataset},E5=function(e){return e.tagName==="BUTTON"},G2=function(e){return e.tagName==="INPUT"},q2=function(e){return G2(e)&&e.type==="radio"},P5=function(e){return!((G2(e)||E5(e))&&(e.type==="hidden"||e.disabled))},I5=function(e){var t=e.getAttribute(p5);return![!0,"true",""].includes(t)},ph=function(e){var t;return Boolean(e&&((t=$2(e))===null||t===void 0?void 0:t.focusGuard))},rc=function(e){return!ph(e)},M5=function(e){return Boolean(e)},T5=function(e,t){var n=e.tabIndex-t.tabIndex,r=e.index-t.index;if(n){if(!e.tabIndex)return 1;if(!t.tabIndex)return-1}return n||r},Y2=function(e,t,n){return Er(e).map(function(r,o){return{node:r,index:o,tabIndex:n&&r.tabIndex===-1?(r.dataset||{}).focusGuard?0:-1:r.tabIndex}}).filter(function(r){return!t||r.tabIndex>=0}).sort(T5)},_5=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],mh=_5.join(","),D5="".concat(mh,", [data-focus-guard]"),K2=function(e,t){return Er((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?D5:mh)?[r]:[],K2(r))},[])},A5=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?jc([e.contentDocument.body],t):[e]},jc=function(e,t){return e.reduce(function(n,r){var o,s=K2(r,t),c=(o=[]).concat.apply(o,s.map(function(u){return A5(u,t)}));return n.concat(c,r.parentNode?Er(r.parentNode.querySelectorAll(mh)).filter(function(u){return u===r}):[])},[])},O5=function(e){var t=e.querySelectorAll("[".concat(h5,"]"));return Er(t).map(function(n){return jc([n])}).reduce(function(n,r){return n.concat(r)},[])},vh=function(e,t){return Er(e).filter(function(n){return V2(t,n)}).filter(function(n){return P5(n)})},ig=function(e,t){return t===void 0&&(t=new Map),Er(e).filter(function(n){return U2(t,n)})},Cf=function(e,t,n){return Y2(vh(jc(e,n),t),!0,n)},ag=function(e,t){return Y2(vh(jc(e),t),!1)},z5=function(e,t){return vh(O5(e),t)},Vi=function(e,t){return e.shadowRoot?Vi(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Er(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?Vi(o,t):!1}return Vi(n,t)})},R5=function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var o=r+1;o<n;o+=1){var s=e[r].compareDocumentPosition(e[o]);(s&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(s&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(c,u){return!t.has(u)})},X2=function(e){return e.parentNode?X2(e.parentNode):e},gh=function(e){var t=nc(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(bf);return n.push.apply(n,o?R5(Er(X2(r).querySelectorAll("[".concat(bf,'="').concat(o,'"]:not([').concat(T2,'="disabled"])')))):[r]),n},[])},N5=function(e){try{return e()}catch{return}},qa=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?qa(t.shadowRoot):t instanceof HTMLIFrameElement&&N5(function(){return t.contentWindow.document})?qa(t.contentWindow.document):t}},F5=function(e,t){return e===t},L5=function(e,t){return Boolean(Er(e.querySelectorAll("iframe")).some(function(n){return F5(n,t)}))},Q2=function(e,t){return t===void 0&&(t=qa(B2(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:gh(e).some(function(n){return Vi(n,t)||L5(n,t)})},B5=function(e){e===void 0&&(e=document);var t=qa(e);return t?Er(e.querySelectorAll("[".concat(f5,"]"))).some(function(n){return Vi(n,t)}):!1},H5=function(e,t){return t.filter(q2).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},yh=function(e,t){return q2(e)&&e.name?H5(e,t):e},W5=function(e){var t=new Set;return e.forEach(function(n){return t.add(yh(n,e))}),e.filter(function(n){return t.has(n)})},sg=function(e){return e[0]&&e.length>1?yh(e[0],e):e[0]},lg=function(e,t){return e.length>1?e.indexOf(yh(e[t],e)):t},Z2="NEW_FOCUS",V5=function(e,t,n,r){var o=e.length,s=e[0],c=e[o-1],u=ph(n);if(!(n&&e.indexOf(n)>=0)){var f=n!==void 0?t.indexOf(n):-1,h=r?t.indexOf(r):f,m=r?e.indexOf(r):-1,v=f-h,x=t.indexOf(s),S=t.indexOf(c),C=W5(t),j=n!==void 0?C.indexOf(n):-1,w=j-(r?C.indexOf(r):f),k=lg(e,0),M=lg(e,o-1);if(f===-1||m===-1)return Z2;if(!v&&m>=0)return m;if(f<=x&&u&&Math.abs(v)>1)return M;if(f>=S&&u&&Math.abs(v)>1)return k;if(v&&Math.abs(w)>1)return m;if(f<=x)return M;if(f>S)return k;if(v)return Math.abs(v)>1?m:(o+m+v)%o}},U5=function(e){return function(t){var n,r=(n=$2(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},$5=function(e,t,n){var r=e.map(function(s){var c=s.node;return c}),o=ig(r.filter(U5(n)));return o&&o.length?sg(o):sg(ig(t))},wf=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&wf(e.parentNode.host||e.parentNode,t),t},xd=function(e,t){for(var n=wf(e),r=wf(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},J2=function(e,t,n){var r=nc(e),o=nc(t),s=r[0],c=!1;return o.filter(Boolean).forEach(function(u){c=xd(c||u,u)||c,n.filter(Boolean).forEach(function(f){var h=xd(s,f);h&&(!c||Vi(h,c)?c=h:c=xd(h,c))})}),c},G5=function(e,t){return e.reduce(function(n,r){return n.concat(z5(r,t))},[])},q5=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(M5)},Y5=function(e,t){var n=qa(nc(e).length>0?document:B2(e).ownerDocument),r=gh(e).filter(rc),o=J2(n||e,e,r),s=new Map,c=ag(r,s),u=Cf(r,s).filter(function(S){var C=S.node;return rc(C)});if(!(!u[0]&&(u=c,!u[0]))){var f=ag([o],s).map(function(S){var C=S.node;return C}),h=q5(f,u),m=h.map(function(S){var C=S.node;return C}),v=V5(m,f,n,t);if(v===Z2){var x=$5(c,m,G5(r,s));if(x)return{node:x};console.warn("focus-lock: cannot find any node to move focus into");return}return v===void 0?v:h[v]}},K5=function(e){var t=gh(e).filter(rc),n=J2(e,e,t),r=new Map,o=Cf([n],r,!0),s=Cf(t,r).filter(function(c){var u=c.node;return rc(u)}).map(function(c){var u=c.node;return u});return o.map(function(c){var u=c.node,f=c.index;return{node:u,index:f,lockItem:s.indexOf(u)>=0,guard:ph(u)}})},X5=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},bd=0,Sd=!1,ey=function(e,t,n){n===void 0&&(n={});var r=Y5(e,t);if(!Sd&&r){if(bd>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Sd=!0,setTimeout(function(){Sd=!1},1);return}bd++,X5(r.node,n.focusOptions),bd--}};function ty(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var Q5=function(){return document&&document.activeElement===document.body},Z5=function(){return Q5()||B5()},Ui=null,Ni=null,$i=null,Ya=!1,J5=function(){return!0},e6=function(t){return(Ui.whiteList||J5)(t)},t6=function(t,n){$i={observerNode:t,portaledElement:n}},n6=function(t){return $i&&$i.portaledElement===t};function cg(e,t,n,r){var o=null,s=e;do{var c=r[s];if(c.guard)c.node.dataset.focusAutoGuard&&(o=c);else if(c.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var r6=function(t){return t&&"current"in t?t.current:t},o6=function(t){return t?Boolean(Ya):Ya==="meanwhile"},i6=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},a6=function(t,n){return n.some(function(r){return i6(t,r,r)})},oc=function(){var t=!1;if(Ui){var n=Ui,r=n.observed,o=n.persistentFocus,s=n.autoFocus,c=n.shards,u=n.crossFrame,f=n.focusOptions,h=r||$i&&$i.portaledElement,m=document&&document.activeElement;if(h){var v=[h].concat(c.map(r6).filter(Boolean));if((!m||e6(m))&&(o||o6(u)||!Z5()||!Ni&&s)&&(h&&!(Q2(v)||m&&a6(m,v)||n6(m))&&(document&&!Ni&&m&&!s?(m.blur&&m.blur(),document.body.focus()):(t=ey(v,Ni,{focusOptions:f}),$i={})),Ya=!1,Ni=document&&document.activeElement),document){var x=document&&document.activeElement,S=K5(v),C=S.map(function(j){var w=j.node;return w}).indexOf(x);C>-1&&(S.filter(function(j){var w=j.guard,k=j.node;return w&&k.dataset.focusAutoGuard}).forEach(function(j){var w=j.node;return w.removeAttribute("tabIndex")}),cg(C,S.length,1,S),cg(C,-1,-1,S))}}}return t},ny=function(t){oc()&&t&&(t.stopPropagation(),t.preventDefault())},xh=function(){return ty(oc)},s6=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||t6(r,n)},l6=function(){return null},ry=function(){Ya="just",setTimeout(function(){Ya="meanwhile"},0)},c6=function(){document.addEventListener("focusin",ny),document.addEventListener("focusout",xh),window.addEventListener("blur",ry)},u6=function(){document.removeEventListener("focusin",ny),document.removeEventListener("focusout",xh),window.removeEventListener("blur",ry)};function d6(e){return e.filter(function(t){var n=t.disabled;return!n})}function f6(e){var t=e.slice(-1)[0];t&&!Ui&&c6();var n=Ui,r=n&&t&&t.id===n.id;Ui=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Ni=null,(!r||n.observed!==t.observed)&&t.onActivation(),oc(),ty(oc)):(u6(),Ni=null)}N2.assignSyncMedium(s6);F2.assignMedium(xh);y5.assignMedium(function(e){return e({moveFocusInside:ey,focusInside:Q2})});const h6=C5(d6,f6)(l6);var oy=y.forwardRef(function(t,n){return y.createElement(L2,Xd({sideCar:h6,ref:n},t))}),iy=L2.propTypes||{};iy.sideCar;kC(iy,["sideCar"]);oy.propTypes={};const ug=oy;function ay(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function sy(e){var t;if(!ay(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function p6(e){var t,n;return(n=(t=ly(e))==null?void 0:t.defaultView)!=null?n:window}function ly(e){return ay(e)?e.ownerDocument:document}function m6(e){return ly(e).activeElement}var cy=e=>e.hasAttribute("tabindex"),v6=e=>cy(e)&&e.tabIndex===-1;function g6(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function uy(e){return e.parentElement&&uy(e.parentElement)?!0:e.hidden}function y6(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function dy(e){if(!sy(e)||uy(e)||g6(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]():y6(e)?!0:cy(e)}function x6(e){return e?sy(e)&&dy(e)&&!v6(e):!1}var b6=["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]"],S6=b6.join(),C6=e=>e.offsetWidth>0&&e.offsetHeight>0;function fy(e){const t=Array.from(e.querySelectorAll(S6));return t.unshift(e),t.filter(n=>dy(n)&&C6(n))}var dg,w6=(dg=ug.default)!=null?dg:ug,hy=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:c,autoFocus:u,persistentFocus:f,lockFocusAcrossFrames:h}=e,m=y.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&fy(r.current).length===0&&requestAnimationFrame(()=>{var C;(C=r.current)==null||C.focus()})},[t,r]),v=y.useCallback(()=>{var S;(S=n==null?void 0:n.current)==null||S.focus()},[n]),x=o&&!n;return l.jsx(w6,{crossFrame:h,persistentFocus:f,autoFocus:u,disabled:c,onActivation:m,onDeactivation:v,returnFocus:x,children:s})};hy.displayName="FocusLock";var j6=zC?y.useLayoutEffect:y.useEffect;function ic(e,t=[]){const n=y.useRef(e);return j6(()=>{n.current=e}),y.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function k6(e,t,n,r){const o=ic(t);return y.useEffect(()=>{var s;const c=(s=Ev(n))!=null?s:document;if(t)return c.addEventListener(e,o,r),()=>{c.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=Ev(n))!=null?s:document).removeEventListener(e,o,r)}}function E6(e){const{ref:t,handler:n,enabled:r=!0}=e,o=ic(n),c=y.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;y.useEffect(()=>{if(!r)return;const u=v=>{Cd(v,t)&&(c.isPointerDown=!0)},f=v=>{if(c.ignoreEmulatedMouseEvents){c.ignoreEmulatedMouseEvents=!1;return}c.isPointerDown&&n&&Cd(v,t)&&(c.isPointerDown=!1,o(v))},h=v=>{c.ignoreEmulatedMouseEvents=!0,n&&c.isPointerDown&&Cd(v,t)&&(c.isPointerDown=!1,o(v))},m=d2(t.current);return m.addEventListener("mousedown",u,!0),m.addEventListener("mouseup",f,!0),m.addEventListener("touchstart",u,!0),m.addEventListener("touchend",h,!0),()=>{m.removeEventListener("mousedown",u,!0),m.removeEventListener("mouseup",f,!0),m.removeEventListener("touchstart",u,!0),m.removeEventListener("touchend",h,!0)}},[n,t,o,c,r])}function Cd(e,t){var n;const r=e.target;return e.button>0||r&&!d2(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function P6(e,t){const n=y.useId();return y.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function I6(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function po(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=ic(n),c=ic(t),[u,f]=y.useState(e.defaultIsOpen||!1),[h,m]=I6(r,u),v=P6(o,"disclosure"),x=y.useCallback(()=>{h||f(!1),c==null||c()},[h,c]),S=y.useCallback(()=>{h||f(!0),s==null||s()},[h,s]),C=y.useCallback(()=>{(m?x:S)()},[m,S,x]);return{isOpen:!!m,onOpen:S,onClose:x,onToggle:C,isControlled:h,getButtonProps:(j={})=>({...j,"aria-expanded":m,"aria-controls":v,onClick:BS(j.onClick,C)}),getDisclosureProps:(j={})=>({...j,hidden:!m,id:v})}}var bh=fe(function(t,n){const{htmlSize:r,...o}=t,s=un("Input",o),c=At(o),u=sh(c),f=Ae("chakra-input",t.className);return l.jsx(ne.input,{size:r,...u,__css:s.field,ref:n,className:f})});bh.displayName="Input";bh.id="Input";var[M6,py]=kt({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),Sh=fe(function(t,n){const r=un("List",t),{children:o,styleType:s="none",stylePosition:c,spacing:u,...f}=At(t),h=ah(o),v=u?{["& > *:not(style) ~ *:not(style)"]:{mt:u}}:{};return l.jsx(M6,{value:r,children:l.jsx(ne.ul,{ref:n,listStyleType:s,listStylePosition:c,role:"list",__css:{...r.container,...v},...f,children:h})})});Sh.displayName="List";var T6=fe((e,t)=>{const{as:n,...r}=e;return l.jsx(Sh,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});T6.displayName="OrderedList";var my=fe(function(t,n){const{as:r,...o}=t;return l.jsx(Sh,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});my.displayName="UnorderedList";var Ra=fe(function(t,n){const r=py();return l.jsx(ne.li,{ref:n,...t,__css:r.item})});Ra.displayName="ListItem";var _6=fe(function(t,n){const r=py();return l.jsx(tn,{ref:n,role:"presentation",...t,__css:r.icon})});_6.displayName="ListIcon";var ir=fe(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:c,column:u,row:f,autoFlow:h,autoRows:m,templateRows:v,autoColumns:x,templateColumns:S,...C}=t,j={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:c,gridAutoColumns:x,gridColumn:u,gridRow:f,gridAutoFlow:h,gridAutoRows:m,gridTemplateRows:v,gridTemplateColumns:S};return l.jsx(ne.div,{ref:n,__css:j,...C})});ir.displayName="Grid";function vy(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Qd(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var kc=ne("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});kc.displayName="Spacer";var gy=e=>l.jsx(ne.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});gy.displayName="StackItem";var jf="& > *:not(style) ~ *:not(style)";function D6(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,[jf]:vy(n,o=>r[o])}}function A6(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{"&":vy(n,o=>r[o])}}var Ch=fe((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:c="0.5rem",wrap:u,children:f,divider:h,className:m,shouldWrapChildren:v,...x}=e,S=n?"row":r??"column",C=y.useMemo(()=>D6({direction:S,spacing:c}),[S,c]),j=y.useMemo(()=>A6({spacing:c,direction:S}),[c,S]),w=!!h,k=!v&&!w,M=y.useMemo(()=>{const I=ah(f);return k?I:I.map((T,_)=>{const D=typeof T.key<"u"?T.key:_,z=_+1===I.length,F=v?l.jsx(gy,{children:T},D):T;if(!w)return F;const B=y.cloneElement(h,{__css:j}),Q=z?null:B;return l.jsxs(y.Fragment,{children:[F,Q]},D)})},[h,j,w,k,v,f]),P=Ae("chakra-stack",m);return l.jsx(ne.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:C.flexDirection,flexWrap:u,className:P,__css:w?{}:{[jf]:C[jf]},...x,children:M})});Ch.displayName="Stack";var Fe=fe((e,t)=>l.jsx(Ch,{align:"center",...e,direction:"column",ref:t}));Fe.displayName="VStack";var oa=fe((e,t)=>l.jsx(Ch,{align:"center",...e,direction:"row",ref:t}));oa.displayName="HStack";var Wn=fe(function(t,n){const r=yo("Heading",t),{className:o,...s}=At(t);return l.jsx(ne.h2,{ref:n,className:Ae("chakra-heading",t.className),...s,__css:r})});Wn.displayName="Heading";var Ye=ne("div");Ye.displayName="Box";var yy=fe(function(t,n){const{size:r,centerContent:o=!0,...s}=t,c=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return l.jsx(Ye,{ref:n,boxSize:r,__css:{...c,flexShrink:0,flexGrow:0},...s})});yy.displayName="Square";var O6=fe(function(t,n){const{size:r,...o}=t;return l.jsx(yy,{size:r,ref:n,borderRadius:"9999px",...o})});O6.displayName="Circle";var qo=fe(function(t,n){const r=yo("Link",t),{className:o,isExternal:s,...c}=At(t);return l.jsx(ne.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:Ae("chakra-link",o),...c,__css:r})});qo.displayName="Link";var xy=fe(function(t,n){const r=yo("Badge",t),{className:o,...s}=At(t);return l.jsx(ne.span,{ref:n,className:Ae("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});xy.displayName="Badge";var by=ne("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});by.displayName="Center";var z6={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};fe(function(t,n){const{axis:r="both",...o}=t;return l.jsx(ne.div,{ref:n,__css:z6[r],...o,position:"absolute"})});var Sy=fe(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:c,borderWidth:u,borderStyle:f,borderColor:h,...m}=yo("Divider",t),{className:v,orientation:x="horizontal",__css:S,...C}=At(t),j={vertical:{borderLeftWidth:r||c||u||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||u||"1px",width:"100%"}};return l.jsx(ne.hr,{ref:n,"aria-orientation":x,...C,__css:{...m,border:"0",borderColor:h,borderStyle:f,...j[x],...S},className:Ae("chakra-divider",v)})});Sy.displayName="Divider";function R6(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function N6(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=y.useState([]),s=y.useRef(),c=()=>{s.current&&(clearTimeout(s.current),s.current=null)},u=()=>{c(),s.current=setTimeout(()=>{o([]),s.current=null},t)};y.useEffect(()=>c,[]);function f(h){return m=>{if(m.key==="Backspace"){const v=[...r];v.pop(),o(v);return}if(R6(m)){const v=r.concat(m.key);n(m)&&(m.preventDefault(),m.stopPropagation()),o(v),h(v.join("")),u()}}}return f}function F6(e,t,n,r){if(t==null)return r;if(!r)return e.find(c=>n(c).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(s=>n(s).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let s;return o.includes(r)?(s=o.indexOf(r)+1,s===o.length&&(s=0),o[s]):(s=e.indexOf(o[0]),e[s])}return r}function L6(){const e=y.useRef(new Map),t=e.current,n=y.useCallback((o,s,c,u)=>{e.current.set(c,{type:s,el:o,options:u}),o.addEventListener(s,c,u)},[]),r=y.useCallback((o,s,c,u)=>{o.removeEventListener(s,c,u),e.current.delete(c)},[]);return y.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function wd(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function Cy(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:c,onMouseUp:u,onClick:f,onKeyDown:h,onKeyUp:m,tabIndex:v,onMouseOver:x,onMouseLeave:S,...C}=e,[j,w]=y.useState(!0),[k,M]=y.useState(!1),P=L6(),I=$=>{$&&$.tagName!=="BUTTON"&&w(!1)},T=j?v:v||0,_=n&&!r,D=y.useCallback($=>{if(n){$.stopPropagation(),$.preventDefault();return}$.currentTarget.focus(),f==null||f($)},[n,f]),z=y.useCallback($=>{k&&wd($)&&($.preventDefault(),$.stopPropagation(),M(!1),P.remove(document,"keyup",z,!1))},[k,P]),W=y.useCallback($=>{if(h==null||h($),n||$.defaultPrevented||$.metaKey||!wd($.nativeEvent)||j)return;const Z=o&&$.key==="Enter";s&&$.key===" "&&($.preventDefault(),M(!0)),Z&&($.preventDefault(),$.currentTarget.click()),P.add(document,"keyup",z,!1)},[n,j,h,o,s,P,z]),F=y.useCallback($=>{if(m==null||m($),n||$.defaultPrevented||$.metaKey||!wd($.nativeEvent)||j)return;s&&$.key===" "&&($.preventDefault(),M(!1),$.currentTarget.click())},[s,j,n,m]),B=y.useCallback($=>{$.button===0&&(M(!1),P.remove(document,"mouseup",B,!1))},[P]),Q=y.useCallback($=>{if($.button!==0)return;if(n){$.stopPropagation(),$.preventDefault();return}j||M(!0),$.currentTarget.focus({preventScroll:!0}),P.add(document,"mouseup",B,!1),c==null||c($)},[n,j,c,P,B]),U=y.useCallback($=>{$.button===0&&(j||M(!1),u==null||u($))},[u,j]),X=y.useCallback($=>{if(n){$.preventDefault();return}x==null||x($)},[n,x]),te=y.useCallback($=>{k&&($.preventDefault(),M(!1)),S==null||S($)},[k,S]),re=ct(t,I);return j?{...C,ref:re,type:"button","aria-disabled":_?void 0:n,disabled:_,onClick:D,onMouseDown:c,onMouseUp:u,onKeyUp:m,onKeyDown:h,onMouseOver:x,onMouseLeave:S}:{...C,ref:re,role:"button","data-active":qe(k),"aria-disabled":n?"true":void 0,tabIndex:_?void 0:T,onClick:D,onMouseDown:Q,onMouseUp:U,onKeyUp:F,onKeyDown:W,onMouseOver:X,onMouseLeave:te}}function B6(e){const t=e.current;if(!t)return!1;const n=m6(t);return!n||t.contains(n)?!1:!!x6(n)}function wy(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;ti(()=>{if(!s||B6(e))return;const c=(o==null?void 0:o.current)||e.current;c&&requestAnimationFrame(()=>{c.focus()})},[s,e,o])}var H6={preventScroll:!0,shouldFocus:!1};function W6(e,t=H6){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,c=V6(e)?e.current:e,u=o&&s,f=y.useRef(u),h=y.useRef(s);Hi(()=>{!h.current&&s&&(f.current=u),h.current=s},[s,u]);const m=y.useCallback(()=>{if(!(!s||!c||!f.current)&&(f.current=!1,!c.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var v;(v=n.current)==null||v.focus({preventScroll:r})});else{const v=fy(c);v.length>0&&requestAnimationFrame(()=>{v[0].focus({preventScroll:r})})}},[s,r,c,n]);ti(()=>{m()},[m]),Go(c,"transitionend",m)}function V6(e){return"current"in e}var ji=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),Ht={arrowShadowColor:ji("--popper-arrow-shadow-color"),arrowSize:ji("--popper-arrow-size","8px"),arrowSizeHalf:ji("--popper-arrow-size-half"),arrowBg:ji("--popper-arrow-bg"),transformOrigin:ji("--popper-transform-origin"),arrowOffset:ji("--popper-arrow-offset")};function U6(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 $6={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"},G6=e=>$6[e],fg={scroll:!0,resize:!0};function q6(e){let t;return typeof e=="object"?t={enabled:!0,options:{...fg,...e}}:t={enabled:e,options:fg},t}var Y6={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`}},K6={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{hg(e)},effect:({state:e})=>()=>{hg(e)}},hg=e=>{e.elements.popper.style.setProperty(Ht.transformOrigin.var,G6(e.placement))},X6={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{Q6(e)}},Q6=e=>{var t;if(!e.placement)return;const n=Z6(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:Ht.arrowSize.varRef,height:Ht.arrowSize.varRef,zIndex:-1});const r={[Ht.arrowSizeHalf.var]:`calc(${Ht.arrowSize.varRef} / 2)`,[Ht.arrowOffset.var]:`calc(${Ht.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},Z6=e=>{if(e.startsWith("top"))return{property:"bottom",value:Ht.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:Ht.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:Ht.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:Ht.arrowOffset.varRef}},J6={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{pg(e)},effect:({state:e})=>()=>{pg(e)}},pg=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=U6(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:Ht.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},ej={"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"}},tj={"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 nj(e,t="ltr"){var n,r;const o=((n=ej[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=tj[e])!=null?r:o}var Pn="top",Un="bottom",$n="right",In="left",wh="auto",ds=[Pn,Un,$n,In],Gi="start",Ka="end",rj="clippingParents",jy="viewport",_a="popper",oj="reference",mg=ds.reduce(function(e,t){return e.concat([t+"-"+Gi,t+"-"+Ka])},[]),ky=[].concat(ds,[wh]).reduce(function(e,t){return e.concat([t,t+"-"+Gi,t+"-"+Ka])},[]),ij="beforeRead",aj="read",sj="afterRead",lj="beforeMain",cj="main",uj="afterMain",dj="beforeWrite",fj="write",hj="afterWrite",pj=[ij,aj,sj,lj,cj,uj,dj,fj,hj];function kr(e){return e?(e.nodeName||"").toLowerCase():null}function Gn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Qo(e){var t=Gn(e).Element;return e instanceof t||e instanceof Element}function Vn(e){var t=Gn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function jh(e){if(typeof ShadowRoot>"u")return!1;var t=Gn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function mj(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!Vn(s)||!kr(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(c){var u=o[c];u===!1?s.removeAttribute(c):s.setAttribute(c,u===!0?"":u)}))})}function vj(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 o=t.elements[r],s=t.attributes[r]||{},c=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=c.reduce(function(f,h){return f[h]="",f},{});!Vn(o)||!kr(o)||(Object.assign(o.style,u),Object.keys(s).forEach(function(f){o.removeAttribute(f)}))})}}const gj={name:"applyStyles",enabled:!0,phase:"write",fn:mj,effect:vj,requires:["computeStyles"]};function Cr(e){return e.split("-")[0]}var Yo=Math.max,ac=Math.min,qi=Math.round;function kf(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Ey(){return!/^((?!chrome|android).)*safari/i.test(kf())}function Yi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&Vn(e)&&(o=e.offsetWidth>0&&qi(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&qi(r.height)/e.offsetHeight||1);var c=Qo(e)?Gn(e):window,u=c.visualViewport,f=!Ey()&&n,h=(r.left+(f&&u?u.offsetLeft:0))/o,m=(r.top+(f&&u?u.offsetTop:0))/s,v=r.width/o,x=r.height/s;return{width:v,height:x,top:m,right:h+v,bottom:m+x,left:h,x:h,y:m}}function kh(e){var t=Yi(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 Py(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&jh(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Fr(e){return Gn(e).getComputedStyle(e)}function yj(e){return["table","td","th"].indexOf(kr(e))>=0}function bo(e){return((Qo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ec(e){return kr(e)==="html"?e:e.assignedSlot||e.parentNode||(jh(e)?e.host:null)||bo(e)}function vg(e){return!Vn(e)||Fr(e).position==="fixed"?null:e.offsetParent}function xj(e){var t=/firefox/i.test(kf()),n=/Trident/i.test(kf());if(n&&Vn(e)){var r=Fr(e);if(r.position==="fixed")return null}var o=Ec(e);for(jh(o)&&(o=o.host);Vn(o)&&["html","body"].indexOf(kr(o))<0;){var s=Fr(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function fs(e){for(var t=Gn(e),n=vg(e);n&&yj(n)&&Fr(n).position==="static";)n=vg(n);return n&&(kr(n)==="html"||kr(n)==="body"&&Fr(n).position==="static")?t:n||xj(e)||t}function Eh(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Fa(e,t,n){return Yo(e,ac(t,n))}function bj(e,t,n){var r=Fa(e,t,n);return r>n?n:r}function Iy(){return{top:0,right:0,bottom:0,left:0}}function My(e){return Object.assign({},Iy(),e)}function Ty(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Sj=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,My(typeof t!="number"?t:Ty(t,ds))};function Cj(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,c=n.modifiersData.popperOffsets,u=Cr(n.placement),f=Eh(u),h=[In,$n].indexOf(u)>=0,m=h?"height":"width";if(!(!s||!c)){var v=Sj(o.padding,n),x=kh(s),S=f==="y"?Pn:In,C=f==="y"?Un:$n,j=n.rects.reference[m]+n.rects.reference[f]-c[f]-n.rects.popper[m],w=c[f]-n.rects.reference[f],k=fs(s),M=k?f==="y"?k.clientHeight||0:k.clientWidth||0:0,P=j/2-w/2,I=v[S],T=M-x[m]-v[C],_=M/2-x[m]/2+P,D=Fa(I,_,T),z=f;n.modifiersData[r]=(t={},t[z]=D,t.centerOffset=D-_,t)}}function wj(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||Py(t.elements.popper,o)&&(t.elements.arrow=o))}const jj={name:"arrow",enabled:!0,phase:"main",fn:Cj,effect:wj,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ki(e){return e.split("-")[1]}var kj={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ej(e){var t=e.x,n=e.y,r=window,o=r.devicePixelRatio||1;return{x:qi(t*o)/o||0,y:qi(n*o)/o||0}}function gg(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,c=e.offsets,u=e.position,f=e.gpuAcceleration,h=e.adaptive,m=e.roundOffsets,v=e.isFixed,x=c.x,S=x===void 0?0:x,C=c.y,j=C===void 0?0:C,w=typeof m=="function"?m({x:S,y:j}):{x:S,y:j};S=w.x,j=w.y;var k=c.hasOwnProperty("x"),M=c.hasOwnProperty("y"),P=In,I=Pn,T=window;if(h){var _=fs(n),D="clientHeight",z="clientWidth";if(_===Gn(n)&&(_=bo(n),Fr(_).position!=="static"&&u==="absolute"&&(D="scrollHeight",z="scrollWidth")),_=_,o===Pn||(o===In||o===$n)&&s===Ka){I=Un;var W=v&&_===T&&T.visualViewport?T.visualViewport.height:_[D];j-=W-r.height,j*=f?1:-1}if(o===In||(o===Pn||o===Un)&&s===Ka){P=$n;var F=v&&_===T&&T.visualViewport?T.visualViewport.width:_[z];S-=F-r.width,S*=f?1:-1}}var B=Object.assign({position:u},h&&kj),Q=m===!0?Ej({x:S,y:j}):{x:S,y:j};if(S=Q.x,j=Q.y,f){var U;return Object.assign({},B,(U={},U[I]=M?"0":"",U[P]=k?"0":"",U.transform=(T.devicePixelRatio||1)<=1?"translate("+S+"px, "+j+"px)":"translate3d("+S+"px, "+j+"px, 0)",U))}return Object.assign({},B,(t={},t[I]=M?j+"px":"",t[P]=k?S+"px":"",t.transform="",t))}function Pj(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,c=s===void 0?!0:s,u=n.roundOffsets,f=u===void 0?!0:u,h={placement:Cr(t.placement),variation:Ki(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gg(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:f})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gg(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Ij={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Pj,data:{}};var Sl={passive:!0};function Mj(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,c=r.resize,u=c===void 0?!0:c,f=Gn(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&h.forEach(function(m){m.addEventListener("scroll",n.update,Sl)}),u&&f.addEventListener("resize",n.update,Sl),function(){s&&h.forEach(function(m){m.removeEventListener("scroll",n.update,Sl)}),u&&f.removeEventListener("resize",n.update,Sl)}}const Tj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Mj,data:{}};var _j={left:"right",right:"left",bottom:"top",top:"bottom"};function Wl(e){return e.replace(/left|right|bottom|top/g,function(t){return _j[t]})}var Dj={start:"end",end:"start"};function yg(e){return e.replace(/start|end/g,function(t){return Dj[t]})}function Ph(e){var t=Gn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ih(e){return Yi(bo(e)).left+Ph(e).scrollLeft}function Aj(e,t){var n=Gn(e),r=bo(e),o=n.visualViewport,s=r.clientWidth,c=r.clientHeight,u=0,f=0;if(o){s=o.width,c=o.height;var h=Ey();(h||!h&&t==="fixed")&&(u=o.offsetLeft,f=o.offsetTop)}return{width:s,height:c,x:u+Ih(e),y:f}}function Oj(e){var t,n=bo(e),r=Ph(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=Yo(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),c=Yo(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-r.scrollLeft+Ih(e),f=-r.scrollTop;return Fr(o||n).direction==="rtl"&&(u+=Yo(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:c,x:u,y:f}}function Mh(e){var t=Fr(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function _y(e){return["html","body","#document"].indexOf(kr(e))>=0?e.ownerDocument.body:Vn(e)&&Mh(e)?e:_y(Ec(e))}function La(e,t){var n;t===void 0&&(t=[]);var r=_y(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Gn(r),c=o?[s].concat(s.visualViewport||[],Mh(r)?r:[]):r,u=t.concat(c);return o?u:u.concat(La(Ec(c)))}function Ef(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function zj(e,t){var n=Yi(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 xg(e,t,n){return t===jy?Ef(Aj(e,n)):Qo(t)?zj(t,n):Ef(Oj(bo(e)))}function Rj(e){var t=La(Ec(e)),n=["absolute","fixed"].indexOf(Fr(e).position)>=0,r=n&&Vn(e)?fs(e):e;return Qo(r)?t.filter(function(o){return Qo(o)&&Py(o,r)&&kr(o)!=="body"}):[]}function Nj(e,t,n,r){var o=t==="clippingParents"?Rj(e):[].concat(t),s=[].concat(o,[n]),c=s[0],u=s.reduce(function(f,h){var m=xg(e,h,r);return f.top=Yo(m.top,f.top),f.right=ac(m.right,f.right),f.bottom=ac(m.bottom,f.bottom),f.left=Yo(m.left,f.left),f},xg(e,c,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function Dy(e){var t=e.reference,n=e.element,r=e.placement,o=r?Cr(r):null,s=r?Ki(r):null,c=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,f;switch(o){case Pn:f={x:c,y:t.y-n.height};break;case Un:f={x:c,y:t.y+t.height};break;case $n:f={x:t.x+t.width,y:u};break;case In:f={x:t.x-n.width,y:u};break;default:f={x:t.x,y:t.y}}var h=o?Eh(o):null;if(h!=null){var m=h==="y"?"height":"width";switch(s){case Gi:f[h]=f[h]-(t[m]/2-n[m]/2);break;case Ka:f[h]=f[h]+(t[m]/2-n[m]/2);break}}return f}function Xa(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,c=s===void 0?e.strategy:s,u=n.boundary,f=u===void 0?rj:u,h=n.rootBoundary,m=h===void 0?jy:h,v=n.elementContext,x=v===void 0?_a:v,S=n.altBoundary,C=S===void 0?!1:S,j=n.padding,w=j===void 0?0:j,k=My(typeof w!="number"?w:Ty(w,ds)),M=x===_a?oj:_a,P=e.rects.popper,I=e.elements[C?M:x],T=Nj(Qo(I)?I:I.contextElement||bo(e.elements.popper),f,m,c),_=Yi(e.elements.reference),D=Dy({reference:_,element:P,strategy:"absolute",placement:o}),z=Ef(Object.assign({},P,D)),W=x===_a?z:_,F={top:T.top-W.top+k.top,bottom:W.bottom-T.bottom+k.bottom,left:T.left-W.left+k.left,right:W.right-T.right+k.right},B=e.modifiersData.offset;if(x===_a&&B){var Q=B[o];Object.keys(F).forEach(function(U){var X=[$n,Un].indexOf(U)>=0?1:-1,te=[Pn,Un].indexOf(U)>=0?"y":"x";F[U]+=Q[te]*X})}return F}function Fj(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,c=n.padding,u=n.flipVariations,f=n.allowedAutoPlacements,h=f===void 0?ky:f,m=Ki(r),v=m?u?mg:mg.filter(function(C){return Ki(C)===m}):ds,x=v.filter(function(C){return h.indexOf(C)>=0});x.length===0&&(x=v);var S=x.reduce(function(C,j){return C[j]=Xa(e,{placement:j,boundary:o,rootBoundary:s,padding:c})[Cr(j)],C},{});return Object.keys(S).sort(function(C,j){return S[C]-S[j]})}function Lj(e){if(Cr(e)===wh)return[];var t=Wl(e);return[yg(e),t,yg(t)]}function Bj(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,c=n.altAxis,u=c===void 0?!0:c,f=n.fallbackPlacements,h=n.padding,m=n.boundary,v=n.rootBoundary,x=n.altBoundary,S=n.flipVariations,C=S===void 0?!0:S,j=n.allowedAutoPlacements,w=t.options.placement,k=Cr(w),M=k===w,P=f||(M||!C?[Wl(w)]:Lj(w)),I=[w].concat(P).reduce(function(pe,ce){return pe.concat(Cr(ce)===wh?Fj(t,{placement:ce,boundary:m,rootBoundary:v,padding:h,flipVariations:C,allowedAutoPlacements:j}):ce)},[]),T=t.rects.reference,_=t.rects.popper,D=new Map,z=!0,W=I[0],F=0;F<I.length;F++){var B=I[F],Q=Cr(B),U=Ki(B)===Gi,X=[Pn,Un].indexOf(Q)>=0,te=X?"width":"height",re=Xa(t,{placement:B,boundary:m,rootBoundary:v,altBoundary:x,padding:h}),$=X?U?$n:In:U?Un:Pn;T[te]>_[te]&&($=Wl($));var Z=Wl($),oe=[];if(s&&oe.push(re[Q]<=0),u&&oe.push(re[$]<=0,re[Z]<=0),oe.every(function(pe){return pe})){W=B,z=!1;break}D.set(B,oe)}if(z)for(var le=C?3:1,ze=function(ce){var Ne=I.find(function(Ve){var Ue=D.get(Ve);if(Ue)return Ue.slice(0,ce).every(function($e){return $e})});if(Ne)return W=Ne,"break"},Re=le;Re>0;Re--){var Ie=ze(Re);if(Ie==="break")break}t.placement!==W&&(t.modifiersData[r]._skip=!0,t.placement=W,t.reset=!0)}}const Hj={name:"flip",enabled:!0,phase:"main",fn:Bj,requiresIfExists:["offset"],data:{_skip:!1}};function bg(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 Sg(e){return[Pn,$n,Un,In].some(function(t){return e[t]>=0})}function Wj(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,c=Xa(t,{elementContext:"reference"}),u=Xa(t,{altBoundary:!0}),f=bg(c,r),h=bg(u,o,s),m=Sg(f),v=Sg(h);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:h,isReferenceHidden:m,hasPopperEscaped:v},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":m,"data-popper-escaped":v})}const Vj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Wj};function Uj(e,t,n){var r=Cr(e),o=[In,Pn].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,c=s[0],u=s[1];return c=c||0,u=(u||0)*o,[In,$n].indexOf(r)>=0?{x:u,y:c}:{x:c,y:u}}function $j(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,c=ky.reduce(function(m,v){return m[v]=Uj(v,t.rects,s),m},{}),u=c[t.placement],f=u.x,h=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=h),t.modifiersData[r]=c}const Gj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:$j};function qj(e){var t=e.state,n=e.name;t.modifiersData[n]=Dy({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Yj={name:"popperOffsets",enabled:!0,phase:"read",fn:qj,data:{}};function Kj(e){return e==="x"?"y":"x"}function Xj(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,c=n.altAxis,u=c===void 0?!1:c,f=n.boundary,h=n.rootBoundary,m=n.altBoundary,v=n.padding,x=n.tether,S=x===void 0?!0:x,C=n.tetherOffset,j=C===void 0?0:C,w=Xa(t,{boundary:f,rootBoundary:h,padding:v,altBoundary:m}),k=Cr(t.placement),M=Ki(t.placement),P=!M,I=Eh(k),T=Kj(I),_=t.modifiersData.popperOffsets,D=t.rects.reference,z=t.rects.popper,W=typeof j=="function"?j(Object.assign({},t.rects,{placement:t.placement})):j,F=typeof W=="number"?{mainAxis:W,altAxis:W}:Object.assign({mainAxis:0,altAxis:0},W),B=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Q={x:0,y:0};if(_){if(s){var U,X=I==="y"?Pn:In,te=I==="y"?Un:$n,re=I==="y"?"height":"width",$=_[I],Z=$+w[X],oe=$-w[te],le=S?-z[re]/2:0,ze=M===Gi?D[re]:z[re],Re=M===Gi?-z[re]:-D[re],Ie=t.elements.arrow,pe=S&&Ie?kh(Ie):{width:0,height:0},ce=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Iy(),Ne=ce[X],Ve=ce[te],Ue=Fa(0,D[re],pe[re]),$e=P?D[re]/2-le-Ue-Ne-F.mainAxis:ze-Ue-Ne-F.mainAxis,Qe=P?-D[re]/2+le+Ue+Ve+F.mainAxis:Re+Ue+Ve+F.mainAxis,ve=t.elements.arrow&&fs(t.elements.arrow),Te=ve?I==="y"?ve.clientTop||0:ve.clientLeft||0:0,Ge=(U=B==null?void 0:B[I])!=null?U:0,ye=$+$e-Ge-Te,Pe=$+Qe-Ge,et=Fa(S?ac(Z,ye):Z,$,S?Yo(oe,Pe):oe);_[I]=et,Q[I]=et-$}if(u){var Be,vt=I==="x"?Pn:In,Rt=I==="x"?Un:$n,N=_[T],ue=T==="y"?"height":"width",xe=N+w[vt],je=N-w[Rt],q=[Pn,In].indexOf(k)!==-1,ae=(Be=B==null?void 0:B[T])!=null?Be:0,Oe=q?xe:N-D[ue]-z[ue]-ae+F.altAxis,Ze=q?N+D[ue]+z[ue]-ae-F.altAxis:je,J=S&&q?bj(Oe,N,Ze):Fa(S?Oe:xe,N,S?Ze:je);_[T]=J,Q[T]=J-N}t.modifiersData[r]=Q}}const Qj={name:"preventOverflow",enabled:!0,phase:"main",fn:Xj,requiresIfExists:["offset"]};function Zj(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Jj(e){return e===Gn(e)||!Vn(e)?Ph(e):Zj(e)}function ek(e){var t=e.getBoundingClientRect(),n=qi(t.width)/e.offsetWidth||1,r=qi(t.height)/e.offsetHeight||1;return n!==1||r!==1}function tk(e,t,n){n===void 0&&(n=!1);var r=Vn(t),o=Vn(t)&&ek(t),s=bo(t),c=Yi(e,o,n),u={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((kr(t)!=="body"||Mh(s))&&(u=Jj(t)),Vn(t)?(f=Yi(t,!0),f.x+=t.clientLeft,f.y+=t.clientTop):s&&(f.x=Ih(s))),{x:c.left+u.scrollLeft-f.x,y:c.top+u.scrollTop-f.y,width:c.width,height:c.height}}function nk(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var c=[].concat(s.requires||[],s.requiresIfExists||[]);c.forEach(function(u){if(!n.has(u)){var f=t.get(u);f&&o(f)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function rk(e){var t=nk(e);return pj.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function ok(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function ik(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Cg={placement:"bottom",modifiers:[],strategy:"absolute"};function wg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function ak(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?Cg:o;return function(u,f,h){h===void 0&&(h=s);var m={placement:"bottom",orderedModifiers:[],options:Object.assign({},Cg,s),modifiersData:{},elements:{reference:u,popper:f},attributes:{},styles:{}},v=[],x=!1,S={state:m,setOptions:function(k){var M=typeof k=="function"?k(m.options):k;j(),m.options=Object.assign({},s,m.options,M),m.scrollParents={reference:Qo(u)?La(u):u.contextElement?La(u.contextElement):[],popper:La(f)};var P=rk(ik([].concat(r,m.options.modifiers)));return m.orderedModifiers=P.filter(function(I){return I.enabled}),C(),S.update()},forceUpdate:function(){if(!x){var k=m.elements,M=k.reference,P=k.popper;if(wg(M,P)){m.rects={reference:tk(M,fs(P),m.options.strategy==="fixed"),popper:kh(P)},m.reset=!1,m.placement=m.options.placement,m.orderedModifiers.forEach(function(F){return m.modifiersData[F.name]=Object.assign({},F.data)});for(var I=0;I<m.orderedModifiers.length;I++){if(m.reset===!0){m.reset=!1,I=-1;continue}var T=m.orderedModifiers[I],_=T.fn,D=T.options,z=D===void 0?{}:D,W=T.name;typeof _=="function"&&(m=_({state:m,options:z,name:W,instance:S})||m)}}}},update:ok(function(){return new Promise(function(w){S.forceUpdate(),w(m)})}),destroy:function(){j(),x=!0}};if(!wg(u,f))return S;S.setOptions(h).then(function(w){!x&&h.onFirstUpdate&&h.onFirstUpdate(w)});function C(){m.orderedModifiers.forEach(function(w){var k=w.name,M=w.options,P=M===void 0?{}:M,I=w.effect;if(typeof I=="function"){var T=I({state:m,name:k,instance:S,options:P}),_=function(){};v.push(T||_)}})}function j(){v.forEach(function(w){return w()}),v=[]}return S}}var sk=[Tj,Yj,Ij,gj,Gj,Hj,Qj,jj,Vj],lk=ak({defaultModifiers:sk});function Th(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:c=!0,offset:u,gutter:f=8,flip:h=!0,boundary:m="clippingParents",preventOverflow:v=!0,matchWidth:x,direction:S="ltr"}=e,C=y.useRef(null),j=y.useRef(null),w=y.useRef(null),k=nj(r,S),M=y.useRef(()=>{}),P=y.useCallback(()=>{var F;!t||!C.current||!j.current||((F=M.current)==null||F.call(M),w.current=lk(C.current,j.current,{placement:k,modifiers:[J6,X6,K6,{...Y6,enabled:!!x},{name:"eventListeners",...q6(c)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:u??[0,f]}},{name:"flip",enabled:!!h,options:{padding:8}},{name:"preventOverflow",enabled:!!v,options:{boundary:m}},...n??[]],strategy:o}),w.current.forceUpdate(),M.current=w.current.destroy)},[k,t,n,x,c,s,u,f,h,v,m,o]);y.useEffect(()=>()=>{var F;!C.current&&!j.current&&((F=w.current)==null||F.destroy(),w.current=null)},[]);const I=y.useCallback(F=>{C.current=F,P()},[P]),T=y.useCallback((F={},B=null)=>({...F,ref:ct(I,B)}),[I]),_=y.useCallback(F=>{j.current=F,P()},[P]),D=y.useCallback((F={},B=null)=>({...F,ref:ct(_,B),style:{...F.style,position:o,minWidth:x?void 0:"max-content",inset:"0 auto auto 0"}}),[o,_,x]),z=y.useCallback((F={},B=null)=>{const{size:Q,shadowColor:U,bg:X,style:te,...re}=F;return{...re,ref:B,"data-popper-arrow":"",style:ck(F)}},[]),W=y.useCallback((F={},B=null)=>({...F,ref:B,"data-popper-arrow-inner":""}),[]);return{update(){var F;(F=w.current)==null||F.update()},forceUpdate(){var F;(F=w.current)==null||F.forceUpdate()},transformOrigin:Ht.transformOrigin.varRef,referenceRef:I,popperRef:_,getPopperProps:D,getArrowProps:z,getArrowInnerProps:W,getReferenceProps:T}}function ck(e){const{size:t,shadowColor:n,bg:r,style:o}=e,s={...o,position:"absolute"};return t&&(s["--popper-arrow-size"]=t),n&&(s["--popper-arrow-shadow-color"]=n),r&&(s["--popper-arrow-bg"]=r),s}function _h(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=Wt(n),c=Wt(t),[u,f]=y.useState(e.defaultIsOpen||!1),h=r!==void 0?r:u,m=r!==void 0,v=y.useId(),x=o??`disclosure-${v}`,S=y.useCallback(()=>{m||f(!1),c==null||c()},[m,c]),C=y.useCallback(()=>{m||f(!0),s==null||s()},[m,s]),j=y.useCallback(()=>{h?S():C()},[h,C,S]);function w(M={}){return{...M,"aria-expanded":h,"aria-controls":x,onClick(P){var I;(I=M.onClick)==null||I.call(M,P),j()}}}function k(M={}){return{...M,hidden:!h,id:x}}return{isOpen:h,onOpen:C,onClose:S,onToggle:j,isControlled:m,getButtonProps:w,getDisclosureProps:k}}function uk(e){const{ref:t,handler:n,enabled:r=!0}=e,o=Wt(n),c=y.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;y.useEffect(()=>{if(!r)return;const u=v=>{jd(v,t)&&(c.isPointerDown=!0)},f=v=>{if(c.ignoreEmulatedMouseEvents){c.ignoreEmulatedMouseEvents=!1;return}c.isPointerDown&&n&&jd(v,t)&&(c.isPointerDown=!1,o(v))},h=v=>{c.ignoreEmulatedMouseEvents=!0,n&&c.isPointerDown&&jd(v,t)&&(c.isPointerDown=!1,o(v))},m=Ay(t.current);return m.addEventListener("mousedown",u,!0),m.addEventListener("mouseup",f,!0),m.addEventListener("touchstart",u,!0),m.addEventListener("touchend",h,!0),()=>{m.removeEventListener("mousedown",u,!0),m.removeEventListener("mouseup",f,!0),m.removeEventListener("touchstart",u,!0),m.removeEventListener("touchend",h,!0)}},[n,t,o,c,r])}function jd(e,t){var n;const r=e.target;return e.button>0||r&&!Ay(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function Ay(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Oy(e){const{isOpen:t,ref:n}=e,[r,o]=y.useState(t),[s,c]=y.useState(!1);return y.useEffect(()=>{s||(o(t),c(!0))},[t,s,r]),Go(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var f;const h=p6(n.current),m=new h.CustomEvent("animationend",{bubbles:!0});(f=n.current)==null||f.dispatchEvent(m)}}}function Dh(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[dk,fk,hk,pk]=th(),[mk,hs]=kt({strict:!1,name:"MenuContext"});function vk(e,...t){const n=y.useId(),r=e||n;return y.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function zy(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function jg(e){return zy(e).activeElement===e}function gk(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:c,isOpen:u,defaultIsOpen:f,onClose:h,onOpen:m,placement:v="bottom-start",lazyBehavior:x="unmount",direction:S,computePositionOnMount:C=!1,...j}=e,w=y.useRef(null),k=y.useRef(null),M=hk(),P=y.useCallback(()=>{requestAnimationFrame(()=>{var Ie;(Ie=w.current)==null||Ie.focus({preventScroll:!1})})},[]),I=y.useCallback(()=>{const Ie=setTimeout(()=>{var pe;if(o)(pe=o.current)==null||pe.focus();else{const ce=M.firstEnabled();ce&&U(ce.index)}});Z.current.add(Ie)},[M,o]),T=y.useCallback(()=>{const Ie=setTimeout(()=>{const pe=M.lastEnabled();pe&&U(pe.index)});Z.current.add(Ie)},[M]),_=y.useCallback(()=>{m==null||m(),s?I():P()},[s,I,P,m]),{isOpen:D,onOpen:z,onClose:W,onToggle:F}=_h({isOpen:u,defaultIsOpen:f,onClose:h,onOpen:_});uk({enabled:D&&r,ref:w,handler:Ie=>{var pe;(pe=k.current)!=null&&pe.contains(Ie.target)||W()}});const B=Th({...j,enabled:D||C,placement:v,direction:S}),[Q,U]=y.useState(-1);ti(()=>{D||U(-1)},[D]),wy(w,{focusRef:k,visible:D,shouldFocus:!0});const X=Oy({isOpen:D,ref:w}),[te,re]=vk(t,"menu-button","menu-list"),$=y.useCallback(()=>{z(),P()},[z,P]),Z=y.useRef(new Set([]));jk(()=>{Z.current.forEach(Ie=>clearTimeout(Ie)),Z.current.clear()});const oe=y.useCallback(()=>{z(),I()},[I,z]),le=y.useCallback(()=>{z(),T()},[z,T]),ze=y.useCallback(()=>{var Ie,pe;const ce=zy(w.current),Ne=(Ie=w.current)==null?void 0:Ie.contains(ce.activeElement);if(!(D&&!Ne))return;const Ue=(pe=M.item(Q))==null?void 0:pe.node;Ue==null||Ue.focus()},[D,Q,M]),Re=y.useRef(null);return{openAndFocusMenu:$,openAndFocusFirstItem:oe,openAndFocusLastItem:le,onTransitionEnd:ze,unstable__animationState:X,descendants:M,popper:B,buttonId:te,menuId:re,forceUpdate:B.forceUpdate,orientation:"vertical",isOpen:D,onToggle:F,onOpen:z,onClose:W,menuRef:w,buttonRef:k,focusedIndex:Q,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:U,isLazy:c,lazyBehavior:x,initialFocusRef:o,rafId:Re}}function yk(e={},t=null){const n=hs(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:c}=n,u=y.useCallback(f=>{const h=f.key,v={Enter:s,ArrowDown:s,ArrowUp:c}[h];v&&(f.preventDefault(),f.stopPropagation(),v(f))},[s,c]);return{...e,ref:ct(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":qe(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:Ee(e.onClick,r),onKeyDown:Ee(e.onKeyDown,u)}}function Pf(e){var t;return Ck(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function xk(e={},t=null){const n=hs();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");const{focusedIndex:r,setFocusedIndex:o,menuRef:s,isOpen:c,onClose:u,menuId:f,isLazy:h,lazyBehavior:m,unstable__animationState:v}=n,x=fk(),S=N6({preventDefault:k=>k.key!==" "&&Pf(k.target)}),C=y.useCallback(k=>{const M=k.key,I={Tab:_=>_.preventDefault(),Escape:u,ArrowDown:()=>{const _=x.nextEnabled(r);_&&o(_.index)},ArrowUp:()=>{const _=x.prevEnabled(r);_&&o(_.index)}}[M];if(I){k.preventDefault(),I(k);return}const T=S(_=>{const D=F6(x.values(),_,z=>{var W,F;return(F=(W=z==null?void 0:z.node)==null?void 0:W.textContent)!=null?F:""},x.item(r));if(D){const z=x.indexOf(D.node);o(z)}});Pf(k.target)&&T(k)},[x,r,S,u,o]),j=y.useRef(!1);c&&(j.current=!0);const w=Dh({wasSelected:j.current,enabled:h,mode:m,isSelected:v.present});return{...e,ref:ct(s,t),children:w?e.children:null,tabIndex:-1,role:"menu",id:f,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:Ee(e.onKeyDown,C)}}function bk(e={}){const{popper:t,isOpen:n}=hs();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function Sk(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:c,isDisabled:u,isFocusable:f,closeOnSelect:h,type:m,...v}=e,x=hs(),{setFocusedIndex:S,focusedIndex:C,closeOnSelect:j,onClose:w,menuRef:k,isOpen:M,menuId:P,rafId:I}=x,T=y.useRef(null),_=`${P}-menuitem-${y.useId()}`,{index:D,register:z}=pk({disabled:u&&!f}),W=y.useCallback($=>{n==null||n($),!u&&S(D)},[S,D,u,n]),F=y.useCallback($=>{r==null||r($),T.current&&!jg(T.current)&&W($)},[W,r]),B=y.useCallback($=>{o==null||o($),!u&&S(-1)},[S,u,o]),Q=y.useCallback($=>{s==null||s($),Pf($.currentTarget)&&(h??j)&&w()},[w,s,j,h]),U=y.useCallback($=>{c==null||c($),S(D)},[S,c,D]),X=D===C,te=u&&!f;ti(()=>{M&&(X&&!te&&T.current?(I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{var $;($=T.current)==null||$.focus(),I.current=null})):k.current&&!jg(k.current)&&k.current.focus())},[X,te,k,M]);const re=Cy({onClick:Q,onFocus:U,onMouseEnter:W,onMouseMove:F,onMouseLeave:B,ref:ct(z,T,t),isDisabled:u,isFocusable:f});return{...v,...re,type:m??re.type,id:_,role:"menuitem",tabIndex:X?0:-1}}function Ck(e){var t;if(!wk(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function wk(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function jk(e,t=[]){return y.useEffect(()=>()=>e(),t)}var[kk,Pc]=kt({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),Ah=e=>{const{children:t}=e,n=un("Menu",e),r=At(e),{direction:o}=ta(),{descendants:s,...c}=gk({...r,direction:o}),u=y.useMemo(()=>c,[c]),{isOpen:f,onClose:h,forceUpdate:m}=u;return l.jsx(dk,{value:s,children:l.jsx(mk,{value:u,children:l.jsx(kk,{value:n,children:x1(t,{isOpen:f,onClose:h,forceUpdate:m})})})})};Ah.displayName="Menu";var Ry=fe((e,t)=>{const n=Pc();return l.jsx(ne.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});Ry.displayName="MenuCommand";var Ek=fe((e,t)=>{const{type:n,...r}=e,o=Pc(),s=r.as||n?n??void 0:"button",c=y.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return l.jsx(ne.button,{ref:t,type:s,...r,__css:c})}),Ny=e=>{const{className:t,children:n,...r}=e,o=y.Children.only(n),s=y.isValidElement(o)?y.cloneElement(o,{focusable:"false","aria-hidden":!0,className:Ae("chakra-menu__icon",o.props.className)}):null,c=Ae("chakra-menu__icon-wrapper",t);return l.jsx(ne.span,{className:c,...r,__css:{flexShrink:0},children:s})};Ny.displayName="MenuIcon";var gr=fe((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:c,...u}=e,f=Sk(u,t),m=n||o?l.jsx("span",{style:{pointerEvents:"none",flex:1},children:c}):c;return l.jsxs(Ek,{...f,className:Ae("chakra-menu__menuitem",f.className),children:[n&&l.jsx(Ny,{fontSize:"0.8em",marginEnd:r,children:n}),m,o&&l.jsx(Ry,{marginStart:s,children:o})]})});gr.displayName="MenuItem";var Pk={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},Ik=ne(ar.div),Oh=fe(function(t,n){var r,o;const{rootProps:s,motionProps:c,...u}=t,{isOpen:f,onTransitionEnd:h,unstable__animationState:m}=hs(),v=xk(u,n),x=bk(s),S=Pc();return l.jsx(ne.div,{...x,__css:{zIndex:(o=t.zIndex)!=null?o:(r=S.list)==null?void 0:r.zIndex},children:l.jsx(Ik,{variants:Pk,initial:!1,animate:f?"enter":"exit",__css:{outline:0,...S.list},...c,className:Ae("chakra-menu__menu-list",v.className),...v,onUpdate:h,onAnimationComplete:xc(m.onComplete,v.onAnimationComplete)})})});Oh.displayName="MenuList";var Mk=fe((e,t)=>{const n=Pc();return l.jsx(ne.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),zh=fe((e,t)=>{const{children:n,as:r,...o}=e,s=yk(o,t),c=r||Mk;return l.jsx(c,{...s,className:Ae("chakra-menu__menu-button",e.className),children:l.jsx(ne.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});zh.displayName="MenuButton";var Tk={slideInBottom:{...pf,custom:{offsetY:16,reverse:!0}},slideInRight:{...pf,custom:{offsetX:16,reverse:!0}},scale:{...y2,custom:{initialScale:.95,reverse:!0}},none:{}},_k=ne(ar.section),Dk=e=>Tk[e||"none"],Fy=y.forwardRef((e,t)=>{const{preset:n,motionProps:r=Dk(n),...o}=e;return l.jsx(_k,{ref:t,...r,...o})});Fy.displayName="ModalTransition";var Ak=Object.defineProperty,Ok=(e,t,n)=>t in e?Ak(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zk=(e,t,n)=>(Ok(e,typeof t!="symbol"?t+"":t,n),n),Rk=class{constructor(){zk(this,"modals"),this.modals=new Map}add(e){return this.modals.set(e,this.modals.size+1),this.modals.size}remove(e){this.modals.delete(e)}isTopModal(e){return e?this.modals.get(e)===this.modals.size:!1}},If=new Rk;function Ly(e,t){const[n,r]=y.useState(0);return y.useEffect(()=>{const o=e.current;if(o){if(t){const s=If.add(o);r(s)}return()=>{If.remove(o),r(0)}}},[t,e]),n}var Nk=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ki=new WeakMap,Cl=new WeakMap,wl={},kd=0,By=function(e){return e&&(e.host||By(e.parentNode))},Fk=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=By(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)})},Lk=function(e,t,n,r){var o=Fk(t,Array.isArray(e)?e:[e]);wl[n]||(wl[n]=new WeakMap);var s=wl[n],c=[],u=new Set,f=new Set(o),h=function(v){!v||u.has(v)||(u.add(v),h(v.parentNode))};o.forEach(h);var m=function(v){!v||f.has(v)||Array.prototype.forEach.call(v.children,function(x){if(u.has(x))m(x);else{var S=x.getAttribute(r),C=S!==null&&S!=="false",j=(ki.get(x)||0)+1,w=(s.get(x)||0)+1;ki.set(x,j),s.set(x,w),c.push(x),j===1&&C&&Cl.set(x,!0),w===1&&x.setAttribute(n,"true"),C||x.setAttribute(r,"true")}})};return m(t),u.clear(),kd++,function(){c.forEach(function(v){var x=ki.get(v)-1,S=s.get(v)-1;ki.set(v,x),s.set(v,S),x||(Cl.has(v)||v.removeAttribute(r),Cl.delete(v)),S||v.removeAttribute(n)}),kd--,kd||(ki=new WeakMap,ki=new WeakMap,Cl=new WeakMap,wl={})}},Bk=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Nk(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Lk(r,o,n,"aria-hidden")):function(){return null}};function Hk(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:c=!0,onOverlayClick:u,onEsc:f}=e,h=y.useRef(null),m=y.useRef(null),[v,x,S]=Vk(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Wk(h,t&&c),Ly(h,t);const C=y.useRef(null),j=y.useCallback(z=>{C.current=z.target},[]),w=y.useCallback(z=>{z.key==="Escape"&&(z.stopPropagation(),s&&(n==null||n()),f==null||f())},[s,n,f]),[k,M]=y.useState(!1),[P,I]=y.useState(!1),T=y.useCallback((z={},W=null)=>({role:"dialog",...z,ref:ct(W,h),id:v,tabIndex:-1,"aria-modal":!0,"aria-labelledby":k?x:void 0,"aria-describedby":P?S:void 0,onClick:Ee(z.onClick,F=>F.stopPropagation())}),[S,P,v,x,k]),_=y.useCallback(z=>{z.stopPropagation(),C.current===z.target&&If.isTopModal(h.current)&&(o&&(n==null||n()),u==null||u())},[n,o,u]),D=y.useCallback((z={},W=null)=>({...z,ref:ct(W,m),onClick:Ee(z.onClick,_),onKeyDown:Ee(z.onKeyDown,w),onMouseDown:Ee(z.onMouseDown,j)}),[w,j,_]);return{isOpen:t,onClose:n,headerId:x,bodyId:S,setBodyMounted:I,setHeaderMounted:M,dialogRef:h,overlayRef:m,getDialogProps:T,getDialogContainerProps:D}}function Wk(e,t){const n=e.current;y.useEffect(()=>{if(!(!e.current||!t))return Bk(e.current)},[t,e,n])}function Vk(e,...t){const n=y.useId(),r=e||n;return y.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[Uk,ia]=kt({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[$k,Zo]=kt({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),mo=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:s,initialFocusRef:c,finalFocusRef:u,returnFocusOnClose:f,blockScrollOnMount:h,allowPinchZoom:m,preserveScrollBarGap:v,motionPreset:x,lockFocusAcrossFrames:S,onCloseComplete:C}=t,j=un("Modal",t),k={...Hk(t),autoFocus:o,trapFocus:s,initialFocusRef:c,finalFocusRef:u,returnFocusOnClose:f,blockScrollOnMount:h,allowPinchZoom:m,preserveScrollBarGap:v,motionPreset:x,lockFocusAcrossFrames:S};return l.jsx($k,{value:k,children:l.jsx(Uk,{value:j,children:l.jsx(xo,{onExitComplete:C,children:k.isOpen&&l.jsx($a,{...n,children:r})})})})};mo.displayName="Modal";var Vl="right-scroll-bar-position",Ul="width-before-scroll-bar",Gk="with-scroll-bars-hidden",qk="--removed-body-scroll-bar-size",Hy=z2(),Ed=function(){},Ic=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Ed,onWheelCapture:Ed,onTouchMoveCapture:Ed}),o=r[0],s=r[1],c=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,m=e.enabled,v=e.shards,x=e.sideCar,S=e.noIsolation,C=e.inert,j=e.allowPinchZoom,w=e.as,k=w===void 0?"div":w,M=D2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),P=x,I=_2([n,t]),T=xr(xr({},M),o);return y.createElement(y.Fragment,null,m&&y.createElement(P,{sideCar:Hy,removeScrollBar:h,shards:v,noIsolation:S,inert:C,setCallbacks:s,allowPinchZoom:!!j,lockRef:n}),c?y.cloneElement(y.Children.only(u),xr(xr({},T),{ref:I})):y.createElement(k,xr({},T,{className:f,ref:I}),u))});Ic.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ic.classNames={fullWidth:Ul,zeroRight:Vl};var kg,Yk=function(){if(kg)return kg;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Kk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Yk();return t&&e.setAttribute("nonce",t),e}function Xk(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Qk(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Zk=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Kk())&&(Xk(t,n),Qk(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Jk=function(){var e=Zk();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Wy=function(){var e=Jk(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},e7={left:0,top:0,right:0,gap:0},Pd=function(e){return parseInt(e||"",10)||0},t7=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Pd(n),Pd(r),Pd(o)]},n7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return e7;var t=t7(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])}},r7=Wy(),o7=function(e,t,n,r){var o=e.left,s=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(Gk,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
body {
|
||
overflow: hidden `).concat(r,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
||
padding-left: `.concat(o,`px;
|
||
padding-top: `).concat(s,`px;
|
||
padding-right: `).concat(c,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Vl,` {
|
||
right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Ul,` {
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Vl," .").concat(Vl,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(Ul," .").concat(Ul,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body {
|
||
`).concat(qk,": ").concat(u,`px;
|
||
}
|
||
`)},i7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=y.useMemo(function(){return n7(o)},[o]);return y.createElement(r7,{styles:o7(s,!t,o,n?"":"!important")})},Mf=!1;if(typeof window<"u")try{var jl=Object.defineProperty({},"passive",{get:function(){return Mf=!0,!0}});window.addEventListener("test",jl,jl),window.removeEventListener("test",jl,jl)}catch{Mf=!1}var Ei=Mf?{passive:!1}:!1,a7=function(e){return e.tagName==="TEXTAREA"},Vy=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!a7(e)&&n[t]==="visible")},s7=function(e){return Vy(e,"overflowY")},l7=function(e){return Vy(e,"overflowX")},Eg=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Uy(e,n);if(r){var o=$y(e,n),s=o[1],c=o[2];if(s>c)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},c7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},u7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Uy=function(e,t){return e==="v"?s7(t):l7(t)},$y=function(e,t){return e==="v"?c7(t):u7(t)},d7=function(e,t){return e==="h"&&t==="rtl"?-1:1},f7=function(e,t,n,r,o){var s=d7(e,window.getComputedStyle(t).direction),c=s*r,u=n.target,f=t.contains(u),h=!1,m=c>0,v=0,x=0;do{var S=$y(e,u),C=S[0],j=S[1],w=S[2],k=j-w-s*C;(C||k)&&Uy(e,u)&&(v+=k,x+=C),u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&(o&&v===0||!o&&c>v)||!m&&(o&&x===0||!o&&-c>x))&&(h=!0),h},kl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pg=function(e){return[e.deltaX,e.deltaY]},Ig=function(e){return e&&"current"in e?e.current:e},h7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},p7=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},m7=0,Pi=[];function v7(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),o=y.useState(m7++)[0],s=y.useState(function(){return Wy()})[0],c=y.useRef(e);y.useEffect(function(){c.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var j=Sf([e.lockRef.current],(e.shards||[]).map(Ig),!0).filter(Boolean);return j.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),j.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(j,w){if("touches"in j&&j.touches.length===2)return!c.current.allowPinchZoom;var k=kl(j),M=n.current,P="deltaX"in j?j.deltaX:M[0]-k[0],I="deltaY"in j?j.deltaY:M[1]-k[1],T,_=j.target,D=Math.abs(P)>Math.abs(I)?"h":"v";if("touches"in j&&D==="h"&&_.type==="range")return!1;var z=Eg(D,_);if(!z)return!0;if(z?T=D:(T=D==="v"?"h":"v",z=Eg(D,_)),!z)return!1;if(!r.current&&"changedTouches"in j&&(P||I)&&(r.current=T),!T)return!0;var W=r.current||T;return f7(W,w,j,W==="h"?P:I,!0)},[]),f=y.useCallback(function(j){var w=j;if(!(!Pi.length||Pi[Pi.length-1]!==s)){var k="deltaY"in w?Pg(w):kl(w),M=t.current.filter(function(T){return T.name===w.type&&T.target===w.target&&h7(T.delta,k)})[0];if(M&&M.should){w.cancelable&&w.preventDefault();return}if(!M){var P=(c.current.shards||[]).map(Ig).filter(Boolean).filter(function(T){return T.contains(w.target)}),I=P.length>0?u(w,P[0]):!c.current.noIsolation;I&&w.cancelable&&w.preventDefault()}}},[]),h=y.useCallback(function(j,w,k,M){var P={name:j,delta:w,target:k,should:M};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(I){return I!==P})},1)},[]),m=y.useCallback(function(j){n.current=kl(j),r.current=void 0},[]),v=y.useCallback(function(j){h(j.type,Pg(j),j.target,u(j,e.lockRef.current))},[]),x=y.useCallback(function(j){h(j.type,kl(j),j.target,u(j,e.lockRef.current))},[]);y.useEffect(function(){return Pi.push(s),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Ei),document.addEventListener("touchmove",f,Ei),document.addEventListener("touchstart",m,Ei),function(){Pi=Pi.filter(function(j){return j!==s}),document.removeEventListener("wheel",f,Ei),document.removeEventListener("touchmove",f,Ei),document.removeEventListener("touchstart",m,Ei)}},[]);var S=e.removeScrollBar,C=e.inert;return y.createElement(y.Fragment,null,C?y.createElement(s,{styles:p7(o)}):null,S?y.createElement(i7,{gapMode:"margin"}):null)}const g7=g5(Hy,v7);var Gy=y.forwardRef(function(e,t){return y.createElement(Ic,xr({},e,{ref:t,sideCar:g7}))});Gy.classNames=Ic.classNames;const y7=Gy;function x7(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:c,finalFocusRef:u,returnFocusOnClose:f,preserveScrollBarGap:h,lockFocusAcrossFrames:m,isOpen:v}=Zo(),[x,S]=wC();y.useEffect(()=>{!x&&S&&setTimeout(S)},[x,S]);const C=Ly(r,v);return l.jsx(hy,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:u,restoreFocus:f,contentRef:r,lockFocusAcrossFrames:m,children:l.jsx(y7,{removeScrollBar:!h,allowPinchZoom:c,enabled:C===1&&s,forwardProps:!0,children:e.children})})}var vo=fe((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...c}=e,{getDialogProps:u,getDialogContainerProps:f}=Zo(),h=u(c,t),m=f(o),v=Ae("chakra-modal__content",n),x=ia(),S={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...x.dialog},C={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...x.dialogContainer},{motionPreset:j}=Zo();return l.jsx(x7,{children:l.jsx(ne.div,{...m,className:"chakra-modal__content-container",tabIndex:-1,__css:C,children:l.jsx(Fy,{preset:j,motionProps:s,className:v,...h,__css:S,children:r})})})});vo.displayName="ModalContent";function qy(e){const{leastDestructiveRef:t,...n}=e;return l.jsx(mo,{...n,initialFocusRef:t})}var Yy=fe((e,t)=>l.jsx(vo,{ref:t,role:"alertdialog",...e})),Lr=fe((e,t)=>{const{className:n,...r}=e,o=Ae("chakra-modal__footer",n),c={display:"flex",alignItems:"center",justifyContent:"flex-end",...ia().footer};return l.jsx(ne.footer,{ref:t,...r,__css:c,className:o})});Lr.displayName="ModalFooter";var Br=fe((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Zo();y.useEffect(()=>(s(!0),()=>s(!1)),[s]);const c=Ae("chakra-modal__header",n),f={flex:0,...ia().header};return l.jsx(ne.header,{ref:t,className:c,id:o,...r,__css:f})});Br.displayName="ModalHeader";var b7=ne(ar.div),Hr=fe((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,c=Ae("chakra-modal__overlay",n),f={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...ia().overlay},{motionPreset:h}=Zo(),v=o||(h==="none"?{}:g2);return l.jsx(b7,{...v,__css:f,ref:t,className:c,...s})});Hr.displayName="ModalOverlay";var Wr=fe((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Zo();y.useEffect(()=>(s(!0),()=>s(!1)),[s]);const c=Ae("chakra-modal__body",n),u=ia();return l.jsx(ne.div,{ref:t,className:c,id:o,...r,__css:u.body})});Wr.displayName="ModalBody";var aa=fe((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Zo(),c=Ae("chakra-modal__close-btn",r),u=ia();return l.jsx(jC,{ref:t,__css:u.closeButton,className:c,onClick:Ee(n,f=>{f.stopPropagation(),s()}),...o})});aa.displayName="ModalCloseButton";var S7=e=>l.jsx(tn,{viewBox:"0 0 24 24",...e,children:l.jsx("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"})}),C7=e=>l.jsx(tn,{viewBox:"0 0 24 24",...e,children:l.jsx("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 Mg(e,t,n,r){y.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,c=Array.isArray(t)?t:[t],u=new s.MutationObserver(f=>{for(const h of f)h.type==="attributes"&&h.attributeName&&c.includes(h.attributeName)&&n(h)});return u.observe(e.current,{attributes:!0,attributeFilter:c}),()=>u.disconnect()})}function w7(e,t){const n=Wt(e);y.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var j7=50,Tg=300;function k7(e,t){const[n,r]=y.useState(!1),[o,s]=y.useState(null),[c,u]=y.useState(!0),f=y.useRef(null),h=()=>clearTimeout(f.current);w7(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?j7:null);const m=y.useCallback(()=>{c&&e(),f.current=setTimeout(()=>{u(!1),r(!0),s("increment")},Tg)},[e,c]),v=y.useCallback(()=>{c&&t(),f.current=setTimeout(()=>{u(!1),r(!0),s("decrement")},Tg)},[t,c]),x=y.useCallback(()=>{u(!0),r(!1),h()},[]);return y.useEffect(()=>()=>h(),[]),{up:m,down:v,stop:x,isSpinning:n}}var E7=/^[Ee0-9+\-.]$/;function P7(e){return E7.test(e)}function I7(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 M7(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:o=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:c=1,isReadOnly:u,isDisabled:f,isRequired:h,isInvalid:m,pattern:v="[0-9]*(.[0-9]+)?",inputMode:x="decimal",allowMouseWheel:S,id:C,onChange:j,precision:w,name:k,"aria-describedby":M,"aria-label":P,"aria-labelledby":I,onFocus:T,onBlur:_,onInvalid:D,getAriaValueText:z,isValidCharacter:W,format:F,parse:B,...Q}=e,U=Wt(T),X=Wt(_),te=Wt(D),re=Wt(W??P7),$=Wt(z),Z=Jw(e),{update:oe,increment:le,decrement:ze}=Z,[Re,Ie]=y.useState(!1),pe=!(u||f),ce=y.useRef(null),Ne=y.useRef(null),Ve=y.useRef(null),Ue=y.useRef(null),$e=y.useCallback(J=>J.split("").filter(re).join(""),[re]),Qe=y.useCallback(J=>{var Le;return(Le=B==null?void 0:B(J))!=null?Le:J},[B]),ve=y.useCallback(J=>{var Le;return((Le=F==null?void 0:F(J))!=null?Le:J).toString()},[F]);ti(()=>{(Z.valueAsNumber>s||Z.valueAsNumber<o)&&(te==null||te("rangeOverflow",ve(Z.value),Z.valueAsNumber))},[Z.valueAsNumber,Z.value,ve,te]),Hi(()=>{if(!ce.current)return;if(ce.current.value!=Z.value){const Le=Qe(ce.current.value);Z.setValue($e(Le))}},[Qe,$e]);const Te=y.useCallback((J=c)=>{pe&&le(J)},[le,pe,c]),Ge=y.useCallback((J=c)=>{pe&&ze(J)},[ze,pe,c]),ye=k7(Te,Ge);Mg(Ve,"disabled",ye.stop,ye.isSpinning),Mg(Ue,"disabled",ye.stop,ye.isSpinning);const Pe=y.useCallback(J=>{if(J.nativeEvent.isComposing)return;const nt=Qe(J.currentTarget.value);oe($e(nt)),Ne.current={start:J.currentTarget.selectionStart,end:J.currentTarget.selectionEnd}},[oe,$e,Qe]),et=y.useCallback(J=>{var Le,nt,Nt;U==null||U(J),Ne.current&&(J.target.selectionStart=(nt=Ne.current.start)!=null?nt:(Le=J.currentTarget.value)==null?void 0:Le.length,J.currentTarget.selectionEnd=(Nt=Ne.current.end)!=null?Nt:J.currentTarget.selectionStart)},[U]),Be=y.useCallback(J=>{if(J.nativeEvent.isComposing)return;I7(J,re)||J.preventDefault();const Le=vt(J)*c,nt=J.key,he={ArrowUp:()=>Te(Le),ArrowDown:()=>Ge(Le),Home:()=>oe(o),End:()=>oe(s)}[nt];he&&(J.preventDefault(),he(J))},[re,c,Te,Ge,oe,o,s]),vt=J=>{let Le=1;return(J.metaKey||J.ctrlKey)&&(Le=.1),J.shiftKey&&(Le=10),Le},Rt=y.useMemo(()=>{const J=$==null?void 0:$(Z.value);if(J!=null)return J;const Le=Z.value.toString();return Le||void 0},[Z.value,$]),N=y.useCallback(()=>{let J=Z.value;if(Z.value==="")return;/^[eE]/.test(Z.value.toString())?Z.setValue(""):(Z.valueAsNumber<o&&(J=o),Z.valueAsNumber>s&&(J=s),Z.cast(J))},[Z,s,o]),ue=y.useCallback(()=>{Ie(!1),n&&N()},[n,Ie,N]),xe=y.useCallback(()=>{t&&requestAnimationFrame(()=>{var J;(J=ce.current)==null||J.focus()})},[t]),je=y.useCallback(J=>{J.preventDefault(),ye.up(),xe()},[xe,ye]),q=y.useCallback(J=>{J.preventDefault(),ye.down(),xe()},[xe,ye]);Go(()=>ce.current,"wheel",J=>{var Le,nt;const he=((nt=(Le=ce.current)==null?void 0:Le.ownerDocument)!=null?nt:document).activeElement===ce.current;if(!S||!he)return;J.preventDefault();const _e=vt(J)*c,dn=Math.sign(J.deltaY);dn===-1?Te(_e):dn===1&&Ge(_e)},{passive:!1});const ae=y.useCallback((J={},Le=null)=>{const nt=f||r&&Z.isAtMax;return{...J,ref:ct(Le,Ve),role:"button",tabIndex:-1,onPointerDown:Ee(J.onPointerDown,Nt=>{Nt.button!==0||nt||je(Nt)}),onPointerLeave:Ee(J.onPointerLeave,ye.stop),onPointerUp:Ee(J.onPointerUp,ye.stop),disabled:nt,"aria-disabled":Nr(nt)}},[Z.isAtMax,r,je,ye.stop,f]),Oe=y.useCallback((J={},Le=null)=>{const nt=f||r&&Z.isAtMin;return{...J,ref:ct(Le,Ue),role:"button",tabIndex:-1,onPointerDown:Ee(J.onPointerDown,Nt=>{Nt.button!==0||nt||q(Nt)}),onPointerLeave:Ee(J.onPointerLeave,ye.stop),onPointerUp:Ee(J.onPointerUp,ye.stop),disabled:nt,"aria-disabled":Nr(nt)}},[Z.isAtMin,r,q,ye.stop,f]),Ze=y.useCallback((J={},Le=null)=>{var nt,Nt,he,_e;return{name:k,inputMode:x,type:"text",pattern:v,"aria-labelledby":I,"aria-label":P,"aria-describedby":M,id:C,disabled:f,...J,readOnly:(nt=J.readOnly)!=null?nt:u,"aria-readonly":(Nt=J.readOnly)!=null?Nt:u,"aria-required":(he=J.required)!=null?he:h,required:(_e=J.required)!=null?_e:h,ref:ct(ce,Le),value:ve(Z.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(Z.valueAsNumber)?void 0:Z.valueAsNumber,"aria-invalid":Nr(m??Z.isOutOfRange),"aria-valuetext":Rt,autoComplete:"off",autoCorrect:"off",onChange:Ee(J.onChange,Pe),onKeyDown:Ee(J.onKeyDown,Be),onFocus:Ee(J.onFocus,et,()=>Ie(!0)),onBlur:Ee(J.onBlur,X,ue)}},[k,x,v,I,P,ve,M,C,f,h,u,m,Z.value,Z.valueAsNumber,Z.isOutOfRange,o,s,Rt,Pe,Be,et,X,ue]);return{value:ve(Z.value),valueAsNumber:Z.valueAsNumber,isFocused:Re,isDisabled:f,isReadOnly:u,getIncrementButtonProps:ae,getDecrementButtonProps:Oe,getInputProps:Ze,htmlProps:Q}}var[T7,Mc]=kt({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[_7,Rh]=kt({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Nh=fe(function(t,n){const r=un("NumberInput",t),o=At(t),s=lh(o),{htmlProps:c,...u}=M7(s),f=y.useMemo(()=>u,[u]);return l.jsx(_7,{value:f,children:l.jsx(T7,{value:r,children:l.jsx(ne.div,{...c,ref:n,className:Ae("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Nh.displayName="NumberInput";var Fh=fe(function(t,n){const r=Mc();return l.jsx(ne.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}})});Fh.displayName="NumberInputStepper";var Lh=fe(function(t,n){const{getInputProps:r}=Rh(),o=r(t,n),s=Mc();return l.jsx(ne.input,{...o,className:Ae("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Lh.displayName="NumberInputField";var Ky=ne("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Bh=fe(function(t,n){var r;const o=Mc(),{getDecrementButtonProps:s}=Rh(),c=s(t,n);return l.jsx(Ky,{...c,__css:o.stepper,children:(r=t.children)!=null?r:l.jsx(S7,{})})});Bh.displayName="NumberDecrementStepper";var Hh=fe(function(t,n){var r;const{getIncrementButtonProps:o}=Rh(),s=o(t,n),c=Mc();return l.jsx(Ky,{...s,__css:c.stepper,children:(r=t.children)!=null?r:l.jsx(C7,{})})});Hh.displayName="NumberIncrementStepper";var[D7,ps]=kt({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[A7,Wh]=kt({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Vh(e){const t=y.Children.only(e.children),{getTriggerProps:n}=ps();return y.cloneElement(t,n(t.props,t.ref))}Vh.displayName="PopoverTrigger";var Ii={click:"click",hover:"hover"};function O7(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:c=!0,arrowSize:u,arrowShadowColor:f,trigger:h=Ii.click,openDelay:m=200,closeDelay:v=200,isLazy:x,lazyBehavior:S="unmount",computePositionOnMount:C,...j}=e,{isOpen:w,onClose:k,onOpen:M,onToggle:P}=_h(e),I=y.useRef(null),T=y.useRef(null),_=y.useRef(null),D=y.useRef(!1),z=y.useRef(!1);w&&(z.current=!0);const[W,F]=y.useState(!1),[B,Q]=y.useState(!1),U=y.useId(),X=o??U,[te,re,$,Z]=["popover-trigger","popover-content","popover-header","popover-body"].map(Pe=>`${Pe}-${X}`),{referenceRef:oe,getArrowProps:le,getPopperProps:ze,getArrowInnerProps:Re,forceUpdate:Ie}=Th({...j,enabled:w||!!C}),pe=Oy({isOpen:w,ref:_});a5({enabled:w,ref:T}),wy(_,{focusRef:T,visible:w,shouldFocus:s&&h===Ii.click}),W6(_,{focusRef:r,visible:w,shouldFocus:c&&h===Ii.click});const ce=Dh({wasSelected:z.current,enabled:x,mode:S,isSelected:pe.present}),Ne=y.useCallback((Pe={},et=null)=>{const Be={...Pe,style:{...Pe.style,transformOrigin:Ht.transformOrigin.varRef,[Ht.arrowSize.var]:u?`${u}px`:void 0,[Ht.arrowShadowColor.var]:f},ref:ct(_,et),children:ce?Pe.children:null,id:re,tabIndex:-1,role:"dialog",onKeyDown:Ee(Pe.onKeyDown,vt=>{n&&vt.key==="Escape"&&k()}),onBlur:Ee(Pe.onBlur,vt=>{const Rt=_g(vt),N=Id(_.current,Rt),ue=Id(T.current,Rt);w&&t&&(!N&&!ue)&&k()}),"aria-labelledby":W?$:void 0,"aria-describedby":B?Z:void 0};return h===Ii.hover&&(Be.role="tooltip",Be.onMouseEnter=Ee(Pe.onMouseEnter,()=>{D.current=!0}),Be.onMouseLeave=Ee(Pe.onMouseLeave,vt=>{vt.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>k(),v))})),Be},[ce,re,W,$,B,Z,h,n,k,w,t,v,f,u]),Ve=y.useCallback((Pe={},et=null)=>ze({...Pe,style:{visibility:w?"visible":"hidden",...Pe.style}},et),[w,ze]),Ue=y.useCallback((Pe,et=null)=>({...Pe,ref:ct(et,I,oe)}),[I,oe]),$e=y.useRef(),Qe=y.useRef(),ve=y.useCallback(Pe=>{I.current==null&&oe(Pe)},[oe]),Te=y.useCallback((Pe={},et=null)=>{const Be={...Pe,ref:ct(T,et,ve),id:te,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":re};return h===Ii.click&&(Be.onClick=Ee(Pe.onClick,P)),h===Ii.hover&&(Be.onFocus=Ee(Pe.onFocus,()=>{$e.current===void 0&&M()}),Be.onBlur=Ee(Pe.onBlur,vt=>{const Rt=_g(vt),N=!Id(_.current,Rt);w&&t&&N&&k()}),Be.onKeyDown=Ee(Pe.onKeyDown,vt=>{vt.key==="Escape"&&k()}),Be.onMouseEnter=Ee(Pe.onMouseEnter,()=>{D.current=!0,$e.current=window.setTimeout(()=>M(),m)}),Be.onMouseLeave=Ee(Pe.onMouseLeave,()=>{D.current=!1,$e.current&&(clearTimeout($e.current),$e.current=void 0),Qe.current=window.setTimeout(()=>{D.current===!1&&k()},v)})),Be},[te,w,re,h,ve,P,M,t,k,m,v]);y.useEffect(()=>()=>{$e.current&&clearTimeout($e.current),Qe.current&&clearTimeout(Qe.current)},[]);const Ge=y.useCallback((Pe={},et=null)=>({...Pe,id:$,ref:ct(et,Be=>{F(!!Be)})}),[$]),ye=y.useCallback((Pe={},et=null)=>({...Pe,id:Z,ref:ct(et,Be=>{Q(!!Be)})}),[Z]);return{forceUpdate:Ie,isOpen:w,onAnimationComplete:pe.onComplete,onClose:k,getAnchorProps:Ue,getArrowProps:le,getArrowInnerProps:Re,getPopoverPositionerProps:Ve,getPopoverProps:Ne,getTriggerProps:Te,getHeaderProps:Ge,getBodyProps:ye}}function Id(e,t){return e===t||(e==null?void 0:e.contains(t))}function _g(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function Uh(e){const t=un("Popover",e),{children:n,...r}=At(e),o=ta(),s=O7({...r,direction:o.direction});return l.jsx(D7,{value:s,children:l.jsx(A7,{value:t,children:x1(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}Uh.displayName="Popover";function $h(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:c}=e,{getArrowProps:u,getArrowInnerProps:f}=ps(),h=Wh(),m=(t=n??r)!=null?t:o,v=s??c;return l.jsx(ne.div,{...u(),className:"chakra-popover__arrow-positioner",children:l.jsx(ne.div,{className:Ae("chakra-popover__arrow",e.className),...f(e),__css:{"--popper-arrow-bg":m?`colors.${m}, ${m}`:void 0,"--popper-arrow-shadow":v?`shadows.${v}, ${v}`:void 0,...h.arrow}})})}$h.displayName="PopoverArrow";var Xy=fe(function(t,n){const{getBodyProps:r}=ps(),o=Wh();return l.jsx(ne.div,{...r(t,n),className:Ae("chakra-popover__body",t.className),__css:o.body})});Xy.displayName="PopoverBody";function z7(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var R7={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]}}},N7=ne(ar.section),Qy=fe(function(t,n){const{variants:r=R7,...o}=t,{isOpen:s}=ps();return l.jsx(N7,{ref:n,variants:z7(r),initial:!1,animate:s?"enter":"exit",...o})});Qy.displayName="PopoverTransition";var Gh=fe(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:c,getPopoverPositionerProps:u,onAnimationComplete:f}=ps(),h=Wh(),m={position:"relative",display:"flex",flexDirection:"column",...h.content};return l.jsx(ne.div,{...u(r),__css:h.popper,className:"chakra-popover__popper",children:l.jsx(Qy,{...o,...c(s,n),onAnimationComplete:xc(f,s.onAnimationComplete),className:Ae("chakra-popover__content",t.className),__css:m})})});Gh.displayName="PopoverContent";function F7(e,t,n){return(e-t)*100/(n-t)}ei({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});ei({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var L7=ei({"0%":{left:"-40%"},"100%":{left:"100%"}}),B7=ei({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function H7(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:c,role:u="progressbar"}=e,f=F7(t,n,r);return{bind:{"data-indeterminate":c?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":c?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,f):o})(),role:u},percent:f,value:t}}var[W7,V7]=kt({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),U7=fe((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:c,...u}=e,f=H7({value:o,min:n,max:r,isIndeterminate:s,role:c}),m={height:"100%",...V7().filledTrack};return l.jsx(ne.div,{ref:t,style:{width:`${f.percent}%`,...u.style},...f.bind,...u,__css:m})}),Zy=fe((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:c,isAnimated:u,children:f,borderRadius:h,isIndeterminate:m,"aria-label":v,"aria-labelledby":x,"aria-valuetext":S,title:C,role:j,...w}=At(e),k=un("Progress",e),M=h??((n=k.track)==null?void 0:n.borderRadius),P={animation:`${B7} 1s linear infinite`},_={...!m&&c&&u&&P,...m&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${L7} 1s ease infinite normal none running`}},D={overflow:"hidden",position:"relative",...k.track};return l.jsx(ne.div,{ref:t,borderRadius:M,__css:D,...w,children:l.jsxs(W7,{value:k,children:[l.jsx(U7,{"aria-label":v,"aria-labelledby":x,"aria-valuetext":S,min:o,max:s,value:r,isIndeterminate:m,css:_,borderRadius:M,title:C,role:j}),f]})})});Zy.displayName="Progress";function $7(e){return e&&Qd(e)&&Qd(e.target)}function G7(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:c,isNative:u,...f}=e,[h,m]=y.useState(r||""),v=typeof n<"u",x=v?n:h,S=y.useRef(null),C=y.useCallback(()=>{const T=S.current;if(!T)return;let _="input:not(:disabled):checked";const D=T.querySelector(_);if(D){D.focus();return}_="input:not(:disabled)";const z=T.querySelector(_);z==null||z.focus()},[]),w=`radio-${y.useId()}`,k=o||w,M=y.useCallback(T=>{const _=$7(T)?T.target.value:T;v||m(_),t==null||t(String(_))},[t,v]),P=y.useCallback((T={},_=null)=>({...T,ref:ct(_,S),role:"radiogroup"}),[]),I=y.useCallback((T={},_=null)=>({...T,ref:_,name:k,[u?"checked":"isChecked"]:x!=null?T.value===x:void 0,onChange(z){M(z)},"data-radiogroup":!0}),[u,k,M,x]);return{getRootProps:P,getRadioProps:I,name:k,ref:S,focus:C,setValue:m,value:x,onChange:M,isDisabled:s,isFocusable:c,htmlProps:f}}var[q7,Jy]=kt({name:"RadioGroupContext",strict:!1}),Qa=fe((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:c,isDisabled:u,isFocusable:f,...h}=e,{value:m,onChange:v,getRootProps:x,name:S,htmlProps:C}=G7(h),j=y.useMemo(()=>({name:S,size:r,onChange:v,colorScheme:n,value:m,variant:o,isDisabled:u,isFocusable:f}),[S,r,v,n,m,o,u,f]);return l.jsx(q7,{value:j,children:l.jsx(ne.div,{...x(C,t),className:Ae("chakra-radio-group",c),children:s})})});Qa.displayName="RadioGroup";var Y7={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function K7(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:c,onChange:u,isInvalid:f,name:h,value:m,id:v,"data-radiogroup":x,"aria-describedby":S,...C}=e,j=`radio-${y.useId()}`,w=ri(),M=!!Jy()||!!x;let I=!!w&&!M?w.id:j;I=v??I;const T=o??(w==null?void 0:w.isDisabled),_=s??(w==null?void 0:w.isReadOnly),D=c??(w==null?void 0:w.isRequired),z=f??(w==null?void 0:w.isInvalid),[W,F]=y.useState(!1),[B,Q]=y.useState(!1),[U,X]=y.useState(!1),[te,re]=y.useState(!1),[$,Z]=y.useState(Boolean(t)),oe=typeof n<"u",le=oe?n:$;y.useEffect(()=>w2(F),[]);const ze=y.useCallback(ve=>{if(_||T){ve.preventDefault();return}oe||Z(ve.target.checked),u==null||u(ve)},[oe,T,_,u]),Re=y.useCallback(ve=>{ve.key===" "&&re(!0)},[re]),Ie=y.useCallback(ve=>{ve.key===" "&&re(!1)},[re]),pe=y.useCallback((ve={},Te=null)=>({...ve,ref:Te,"data-active":qe(te),"data-hover":qe(U),"data-disabled":qe(T),"data-invalid":qe(z),"data-checked":qe(le),"data-focus":qe(B),"data-focus-visible":qe(B&&W),"data-readonly":qe(_),"aria-hidden":!0,onMouseDown:Ee(ve.onMouseDown,()=>re(!0)),onMouseUp:Ee(ve.onMouseUp,()=>re(!1)),onMouseEnter:Ee(ve.onMouseEnter,()=>X(!0)),onMouseLeave:Ee(ve.onMouseLeave,()=>X(!1))}),[te,U,T,z,le,B,_,W]),{onFocus:ce,onBlur:Ne}=w??{},Ve=y.useCallback((ve={},Te=null)=>{const Ge=T&&!r;return{...ve,id:I,ref:Te,type:"radio",name:h,value:m,onChange:Ee(ve.onChange,ze),onBlur:Ee(Ne,ve.onBlur,()=>Q(!1)),onFocus:Ee(ce,ve.onFocus,()=>Q(!0)),onKeyDown:Ee(ve.onKeyDown,Re),onKeyUp:Ee(ve.onKeyUp,Ie),checked:le,disabled:Ge,readOnly:_,required:D,"aria-invalid":Nr(z),"aria-disabled":Nr(Ge),"aria-required":Nr(D),"data-readonly":qe(_),"aria-describedby":S,style:Y7}},[T,r,I,h,m,ze,Ne,ce,Re,Ie,le,_,D,z,S]);return{state:{isInvalid:z,isFocused:B,isChecked:le,isActive:te,isHovered:U,isDisabled:T,isReadOnly:_,isRequired:D},getCheckboxProps:pe,getInputProps:Ve,getLabelProps:(ve={},Te=null)=>({...ve,ref:Te,onMouseDown:Ee(ve.onMouseDown,Dg),onTouchStart:Ee(ve.onTouchStart,Dg),"data-disabled":qe(T),"data-checked":qe(le),"data-invalid":qe(z)}),getRootProps:(ve,Te=null)=>({...ve,ref:Te,"data-disabled":qe(T),"data-checked":qe(le),"data-invalid":qe(z)}),htmlProps:C}}function Dg(e){e.preventDefault(),e.stopPropagation()}function X7(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var vn=fe((e,t)=>{var n;const r=Jy(),{onChange:o,value:s}=e,c=un("Radio",{...r,...e}),u=At(e),{spacing:f="0.5rem",children:h,isDisabled:m=r==null?void 0:r.isDisabled,isFocusable:v=r==null?void 0:r.isFocusable,inputProps:x,...S}=u;let C=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(C=r.value===s);let j=o;r!=null&&r.onChange&&s!=null&&(j=xc(r.onChange,o));const w=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:k,getCheckboxProps:M,getLabelProps:P,getRootProps:I,htmlProps:T}=K7({...S,isChecked:C,isFocusable:v,isDisabled:m,onChange:j,name:w}),[_,D]=X7(T,b1),z=M(D),W=k(x,t),F=P(),B=Object.assign({},_,I()),Q={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...c.container},U={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...c.control},X={userSelect:"none",marginStart:f,...c.label};return l.jsxs(ne.label,{className:"chakra-radio",...B,__css:Q,children:[l.jsx("input",{className:"chakra-radio__input",...W}),l.jsx(ne.span,{className:"chakra-radio__control",...z,__css:U}),h&&l.jsx(ne.span,{className:"chakra-radio__label",...F,__css:X,children:h})]})});vn.displayName="Radio";var ex=fe(function(t,n){const{children:r,placeholder:o,className:s,...c}=t;return l.jsxs(ne.select,{...c,ref:n,className:Ae("chakra-select",s),children:[o&&l.jsx("option",{value:"",children:o}),r]})});ex.displayName="SelectField";function Q7(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var tx=fe((e,t)=>{var n;const r=un("Select",e),{rootProps:o,placeholder:s,icon:c,color:u,height:f,h,minH:m,minHeight:v,iconColor:x,iconSize:S,...C}=At(e),[j,w]=Q7(C,b1),k=sh(w),M={width:"100%",height:"fit-content",position:"relative",color:u},P={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return l.jsxs(ne.div,{className:"chakra-select__wrapper",__css:M,...j,...o,children:[l.jsx(ex,{ref:t,height:h??f,minH:m??v,placeholder:s,...k,__css:P,children:e.children}),l.jsx(nx,{"data-disabled":qe(k.disabled),...(x||u)&&{color:x||u},__css:r.icon,...S&&{fontSize:S},children:c})]})});tx.displayName="Select";var Z7=e=>l.jsx("svg",{viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),J7=ne("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),nx=e=>{const{children:t=l.jsx(Z7,{}),...n}=e,r=y.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return l.jsx(J7,{...n,className:"chakra-select__icon-wrapper",children:y.isValidElement(t)?r:null})};nx.displayName="SelectIcon";var Mi=e=>e?"":void 0,Md=e=>e?!0:void 0,ms=(...e)=>e.filter(Boolean).join(" ");function Td(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function El(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var $l={width:0,height:0},Pl=e=>e||$l;function e8(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=j=>{var w;const k=(w=r[j])!=null?w:$l;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...El({orientation:t,vertical:{bottom:`calc(${n[j]}% - ${k.height/2}px)`},horizontal:{left:`calc(${n[j]}% - ${k.width/2}px)`}})}},c=t==="vertical"?r.reduce((j,w)=>Pl(j).height>Pl(w).height?j:w,$l):r.reduce((j,w)=>Pl(j).width>Pl(w).width?j:w,$l),u={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...El({orientation:t,vertical:c?{paddingLeft:c.width/2,paddingRight:c.width/2}:{},horizontal:c?{paddingTop:c.height/2,paddingBottom:c.height/2}:{}})},f={position:"absolute",...El({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},h=n.length===1,m=[0,o?100-n[0]:n[0]],v=h?m:n;let x=v[0];!h&&o&&(x=100-x);const S=Math.abs(v[v.length-1]-v[0]),C={...f,...El({orientation:t,vertical:o?{height:`${S}%`,top:`${x}%`}:{height:`${S}%`,bottom:`${x}%`},horizontal:o?{width:`${S}%`,right:`${x}%`}:{width:`${S}%`,left:`${x}%`}})};return{trackStyle:f,innerTrackStyle:C,rootStyle:u,getThumbStyle:s}}function t8(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function n8(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function r8(e){const t=i8(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function rx(e){return!!e.touches}function o8(e){return rx(e)&&e.touches.length>1}function i8(e){var t;return(t=e.view)!=null?t:window}function a8(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function s8(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function ox(e,t="page"){return rx(e)?a8(e,t):s8(e,t)}function l8(e){return t=>{const n=r8(t);(!n||n&&t.button===0)&&e(t)}}function c8(e,t=!1){function n(o){e(o,{point:ox(o)})}return t?l8(n):n}function Gl(e,t,n,r){return n8(e,t,c8(n,t==="pointerdown"),r)}var u8=Object.defineProperty,d8=(e,t,n)=>t in e?u8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jn=(e,t,n)=>(d8(e,typeof t!="symbol"?t+"":t,n),n),f8=class{constructor(e,t,n){Jn(this,"history",[]),Jn(this,"startEvent",null),Jn(this,"lastEvent",null),Jn(this,"lastEventInfo",null),Jn(this,"handlers",{}),Jn(this,"removeListeners",()=>{}),Jn(this,"threshold",3),Jn(this,"win"),Jn(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const u=_d(this.lastEventInfo,this.history),f=this.startEvent!==null,h=v8(u.offset,{x:0,y:0})>=this.threshold;if(!f&&!h)return;const{timestamp:m}=$v();this.history.push({...u.point,timestamp:m});const{onStart:v,onMove:x}=this.handlers;f||(v==null||v(this.lastEvent,u),this.startEvent=this.lastEvent),x==null||x(this.lastEvent,u)}),Jn(this,"onPointerMove",(u,f)=>{this.lastEvent=u,this.lastEventInfo=f,LC.update(this.updatePoint,!0)}),Jn(this,"onPointerUp",(u,f)=>{const h=_d(f,this.history),{onEnd:m,onSessionEnd:v}=this.handlers;v==null||v(u,h),this.end(),!(!m||!this.startEvent)&&(m==null||m(u,h))});var r;if(this.win=(r=e.view)!=null?r:window,o8(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:ox(e)},{timestamp:s}=$v();this.history=[{...o.point,timestamp:s}];const{onSessionStart:c}=t;c==null||c(e,_d(o,this.history)),this.removeListeners=m8(Gl(this.win,"pointermove",this.onPointerMove),Gl(this.win,"pointerup",this.onPointerUp),Gl(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),BC.update(this.updatePoint)}};function Ag(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _d(e,t){return{point:e.point,delta:Ag(e.point,t[t.length-1]),offset:Ag(e.point,t[0]),velocity:p8(t,.1)}}var h8=e=>e*1e3;function p8(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=e[e.length-1];for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>h8(t)));)n--;if(!r)return{x:0,y:0};const s=(o.timestamp-r.timestamp)/1e3;if(s===0)return{x:0,y:0};const c={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function m8(...e){return t=>e.reduce((n,r)=>r(n),t)}function Dd(e,t){return Math.abs(e-t)}function Og(e){return"x"in e&&"y"in e}function v8(e,t){if(typeof e=="number"&&typeof t=="number")return Dd(e,t);if(Og(e)&&Og(t)){const n=Dd(e.x,t.x),r=Dd(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function ix(e){const t=y.useRef(null);return t.current=e,t}function g8(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:c,threshold:u}=t,f=Boolean(n||r||o||s||c),h=y.useRef(null),m=ix({onSessionStart:s,onSessionEnd:c,onStart:r,onMove:n,onEnd(v,x){h.current=null,o==null||o(v,x)}});y.useEffect(()=>{var v;(v=h.current)==null||v.updateHandlers(m.current)}),y.useEffect(()=>{const v=e.current;if(!v||!f)return;function x(S){h.current=new f8(S,m.current,u)}return Gl(v,"pointerdown",x)},[e,f,m,u]),y.useEffect(()=>()=>{var v;(v=h.current)==null||v.end(),h.current=null},[])}function y8(e,t){var n;if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const r=(n=e.ownerDocument.defaultView)!=null?n:window,o=new r.ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const[c]=s;let u,f;if("borderBoxSize"in c){const h=c.borderBoxSize,m=Array.isArray(h)?h[0]:h;u=m.inlineSize,f=m.blockSize}else u=e.offsetWidth,f=e.offsetHeight;t({width:u,height:f})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}var x8=Boolean(globalThis==null?void 0:globalThis.document)?y.useLayoutEffect:y.useEffect;function b8(e,t){var n,r;if(!e||!e.parentElement)return;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window,s=new o.MutationObserver(()=>{t()});return s.observe(e.parentElement,{childList:!0}),()=>{s.disconnect()}}function S8({getNodes:e,observeMutation:t=!0}){const[n,r]=y.useState([]),[o,s]=y.useState(0);return x8(()=>{const c=e(),u=c.map((f,h)=>y8(f,m=>{r(v=>[...v.slice(0,h),m,...v.slice(h+1)])}));if(t){const f=c[0];u.push(b8(f,()=>{s(h=>h+1)}))}return()=>{u.forEach(f=>{f==null||f()})}},[o]),n}function C8(e){return typeof e=="object"&&e!==null&&"current"in e}function w8(e){const[t]=S8({observeMutation:!1,getNodes(){return[C8(e)?e.current:e]}});return t}function j8(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:c,isReversed:u,direction:f="ltr",orientation:h="horizontal",id:m,isDisabled:v,isReadOnly:x,onChangeStart:S,onChangeEnd:C,step:j=1,getAriaValueText:w,"aria-valuetext":k,"aria-label":M,"aria-labelledby":P,name:I,focusThumbOnChange:T=!0,..._}=e,D=Wt(S),z=Wt(C),W=Wt(w),F=t8({isReversed:u,direction:f,orientation:h}),[B,Q]=rh({value:s,defaultValue:c??E8(n,r),onChange:o}),[U,X]=y.useState(!1),[te,re]=y.useState(!1),$=!(v||x),Z=(r-n)/10,oe=j||(r-n)/100,le=Hl(B,n,r),ze=r-le+n,Ie=ng(F?ze:le,n,r),pe=h==="vertical",ce=ix({min:n,max:r,step:j,isDisabled:v,value:le,isInteractive:$,isReversed:F,isVertical:pe,eventSource:null,focusThumbOnChange:T,orientation:h}),Ne=y.useRef(null),Ve=y.useRef(null),Ue=y.useRef(null),$e=y.useId(),Qe=m??$e,[ve,Te]=[`slider-thumb-${Qe}`,`slider-track-${Qe}`],Ge=y.useCallback(he=>{var _e,dn;if(!Ne.current)return;const Vt=ce.current;Vt.eventSource="pointer";const fn=Ne.current.getBoundingClientRect(),{clientX:sr,clientY:ko}=(dn=(_e=he.touches)==null?void 0:_e[0])!=null?dn:he,la=pe?fn.bottom-ko:sr-fn.left,Xc=pe?fn.height:fn.width;let ca=la/Xc;F&&(ca=1-ca);let Eo=Zw(ca,Vt.min,Vt.max);return Vt.step&&(Eo=parseFloat(rg(Eo,Vt.min,Vt.step))),Eo=Hl(Eo,Vt.min,Vt.max),Eo},[pe,F,ce]),ye=y.useCallback(he=>{const _e=ce.current;_e.isInteractive&&(he=parseFloat(rg(he,_e.min,oe)),he=Hl(he,_e.min,_e.max),Q(he))},[oe,Q,ce]),Pe=y.useMemo(()=>({stepUp(he=oe){const _e=F?le-he:le+he;ye(_e)},stepDown(he=oe){const _e=F?le+he:le-he;ye(_e)},reset(){ye(c||0)},stepTo(he){ye(he)}}),[ye,F,le,oe,c]),et=y.useCallback(he=>{const _e=ce.current,Vt={ArrowRight:()=>Pe.stepUp(),ArrowUp:()=>Pe.stepUp(),ArrowLeft:()=>Pe.stepDown(),ArrowDown:()=>Pe.stepDown(),PageUp:()=>Pe.stepUp(Z),PageDown:()=>Pe.stepDown(Z),Home:()=>ye(_e.min),End:()=>ye(_e.max)}[he.key];Vt&&(he.preventDefault(),he.stopPropagation(),Vt(he),_e.eventSource="keyboard")},[Pe,ye,Z,ce]),Be=(t=W==null?void 0:W(le))!=null?t:k,vt=w8(Ve),{getThumbStyle:Rt,rootStyle:N,trackStyle:ue,innerTrackStyle:xe}=y.useMemo(()=>{const he=ce.current,_e=vt??{width:0,height:0};return e8({isReversed:F,orientation:he.orientation,thumbRects:[_e],thumbPercents:[Ie]})},[F,vt,Ie,ce]),je=y.useCallback(()=>{ce.current.focusThumbOnChange&&setTimeout(()=>{var _e;return(_e=Ve.current)==null?void 0:_e.focus()})},[ce]);ti(()=>{const he=ce.current;je(),he.eventSource==="keyboard"&&(z==null||z(he.value))},[le,z]);function q(he){const _e=Ge(he);_e!=null&&_e!==ce.current.value&&Q(_e)}g8(Ue,{onPanSessionStart(he){const _e=ce.current;_e.isInteractive&&(X(!0),je(),q(he),D==null||D(_e.value))},onPanSessionEnd(){const he=ce.current;he.isInteractive&&(X(!1),z==null||z(he.value))},onPan(he){ce.current.isInteractive&&q(he)}});const ae=y.useCallback((he={},_e=null)=>({...he,..._,ref:ct(_e,Ue),tabIndex:-1,"aria-disabled":Md(v),"data-focused":Mi(te),style:{...he.style,...N}}),[_,v,te,N]),Oe=y.useCallback((he={},_e=null)=>({...he,ref:ct(_e,Ne),id:Te,"data-disabled":Mi(v),style:{...he.style,...ue}}),[v,Te,ue]),Ze=y.useCallback((he={},_e=null)=>({...he,ref:_e,style:{...he.style,...xe}}),[xe]),J=y.useCallback((he={},_e=null)=>({...he,ref:ct(_e,Ve),role:"slider",tabIndex:$?0:void 0,id:ve,"data-active":Mi(U),"aria-valuetext":Be,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":le,"aria-orientation":h,"aria-disabled":Md(v),"aria-readonly":Md(x),"aria-label":M,"aria-labelledby":M?void 0:P,style:{...he.style,...Rt(0)},onKeyDown:Td(he.onKeyDown,et),onFocus:Td(he.onFocus,()=>re(!0)),onBlur:Td(he.onBlur,()=>re(!1))}),[$,ve,U,Be,n,r,le,h,v,x,M,P,Rt,et]),Le=y.useCallback((he,_e=null)=>{const dn=!(he.value<n||he.value>r),Vt=le>=he.value,fn=ng(he.value,n,r),sr={position:"absolute",pointerEvents:"none",...k8({orientation:h,vertical:{bottom:F?`${100-fn}%`:`${fn}%`},horizontal:{left:F?`${100-fn}%`:`${fn}%`}})};return{...he,ref:_e,role:"presentation","aria-hidden":!0,"data-disabled":Mi(v),"data-invalid":Mi(!dn),"data-highlighted":Mi(Vt),style:{...he.style,...sr}}},[v,F,r,n,h,le]),nt=y.useCallback((he={},_e=null)=>({...he,ref:_e,type:"hidden",value:le,name:I}),[I,le]);return{state:{value:le,isFocused:te,isDragging:U},actions:Pe,getRootProps:ae,getTrackProps:Oe,getInnerTrackProps:Ze,getThumbProps:J,getMarkerProps:Le,getInputProps:nt}}function k8(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function E8(e,t){return t<e?e:e+(t-e)/2}var[P8,Tc]=kt({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[I8,_c]=kt({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),ax=fe((e,t)=>{const n={orientation:"horizontal",...e},r=un("Slider",n),o=At(n),{direction:s}=ta();o.direction=s;const{getInputProps:c,getRootProps:u,...f}=j8(o),h=u(),m=c({},t);return l.jsx(P8,{value:f,children:l.jsx(I8,{value:r,children:l.jsxs(ne.div,{...h,className:ms("chakra-slider",n.className),__css:r.container,children:[n.children,l.jsx("input",{...m})]})})})});ax.displayName="Slider";var sx=fe((e,t)=>{const{getThumbProps:n}=Tc(),r=_c(),o=n(e,t);return l.jsx(ne.div,{...o,className:ms("chakra-slider__thumb",e.className),__css:r.thumb})});sx.displayName="SliderThumb";var lx=fe((e,t)=>{const{getTrackProps:n}=Tc(),r=_c(),o=n(e,t);return l.jsx(ne.div,{...o,className:ms("chakra-slider__track",e.className),__css:r.track})});lx.displayName="SliderTrack";var cx=fe((e,t)=>{const{getInnerTrackProps:n}=Tc(),r=_c(),o=n(e,t);return l.jsx(ne.div,{...o,className:ms("chakra-slider__filled-track",e.className),__css:r.filledTrack})});cx.displayName="SliderFilledTrack";var Tf=fe((e,t)=>{const{getMarkerProps:n}=Tc(),r=_c(),o=n(e,t);return l.jsx(ne.div,{...o,className:ms("chakra-slider__marker",e.className),__css:r.mark})});Tf.displayName="SliderMark";var ux=fe(function(t,n){const r=un("Switch",t),{spacing:o="0.5rem",children:s,...c}=At(t),{state:u,getInputProps:f,getCheckboxProps:h,getRootProps:m,getLabelProps:v}=j2(c),x=y.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),S=y.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),C=y.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return l.jsxs(ne.label,{...m(),className:Ae("chakra-switch",t.className),__css:x,children:[l.jsx("input",{className:"chakra-switch__input",...f({},n)}),l.jsx(ne.span,{...h(),className:"chakra-switch__track",__css:S,children:l.jsx(ne.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":qe(u.isChecked),"data-hover":qe(u.isHovered)})}),s&&l.jsx(ne.span,{className:"chakra-switch__label",...v(),__css:C,children:s})]})});ux.displayName="Switch";var[M8,T8,_8,D8]=th();function A8(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:c,lazyBehavior:u="unmount",orientation:f="horizontal",direction:h="ltr",...m}=e,[v,x]=y.useState(n??0),[S,C]=rh({defaultValue:n??0,value:o,onChange:r});y.useEffect(()=>{o!=null&&x(o)},[o]);const j=_8(),w=y.useId();return{id:`tabs-${(t=e.id)!=null?t:w}`,selectedIndex:S,focusedIndex:v,setSelectedIndex:C,setFocusedIndex:x,isManual:s,isLazy:c,lazyBehavior:u,orientation:f,descendants:j,direction:h,htmlProps:m}}var[O8,Dc]=kt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function z8(e){const{focusedIndex:t,orientation:n,direction:r}=Dc(),o=T8(),s=y.useCallback(c=>{const u=()=>{var M;const P=o.nextEnabled(t);P&&((M=P.node)==null||M.focus())},f=()=>{var M;const P=o.prevEnabled(t);P&&((M=P.node)==null||M.focus())},h=()=>{var M;const P=o.firstEnabled();P&&((M=P.node)==null||M.focus())},m=()=>{var M;const P=o.lastEnabled();P&&((M=P.node)==null||M.focus())},v=n==="horizontal",x=n==="vertical",S=c.key,C=r==="ltr"?"ArrowLeft":"ArrowRight",j=r==="ltr"?"ArrowRight":"ArrowLeft",k={[C]:()=>v&&f(),[j]:()=>v&&u(),ArrowDown:()=>x&&u(),ArrowUp:()=>x&&f(),Home:h,End:m}[S];k&&(c.preventDefault(),k(c))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Ee(e.onKeyDown,s)}}function R8(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:o,isManual:s,id:c,setFocusedIndex:u,selectedIndex:f}=Dc(),{index:h,register:m}=D8({disabled:t&&!n}),v=h===f,x=()=>{o(h)},S=()=>{u(h),!s&&!(t&&n)&&o(h)},C=Cy({...r,ref:ct(m,e.ref),isDisabled:t,isFocusable:n,onClick:Ee(e.onClick,x)}),j="button";return{...C,id:dx(c,h),role:"tab",tabIndex:v?0:-1,type:j,"aria-selected":v,"aria-controls":fx(c,h),onFocus:t?void 0:Ee(e.onFocus,S)}}var[N8,F8]=kt({});function L8(e){const t=Dc(),{id:n,selectedIndex:r}=t,s=ah(e.children).map((c,u)=>y.createElement(N8,{key:u,value:{isSelected:u===r,id:fx(n,u),tabId:dx(n,u),selectedIndex:r}},c));return{...e,children:s}}function B8(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=Dc(),{isSelected:s,id:c,tabId:u}=F8(),f=y.useRef(!1);s&&(f.current=!0);const h=Dh({wasSelected:f.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:h?t:null,role:"tabpanel","aria-labelledby":u,hidden:!s,id:c}}function dx(e,t){return`${e}--tab-${t}`}function fx(e,t){return`${e}--tabpanel-${t}`}var[H8,Ac]=kt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),hx=fe(function(t,n){const r=un("Tabs",t),{children:o,className:s,...c}=At(t),{htmlProps:u,descendants:f,...h}=A8(c),m=y.useMemo(()=>h,[h]),{isFitted:v,...x}=u;return l.jsx(M8,{value:f,children:l.jsx(O8,{value:m,children:l.jsx(H8,{value:r,children:l.jsx(ne.div,{className:Ae("chakra-tabs",s),ref:n,...x,__css:r.root,children:o})})})})});hx.displayName="Tabs";var px=fe(function(t,n){const r=z8({...t,ref:n}),s={display:"flex",...Ac().tablist};return l.jsx(ne.div,{...r,className:Ae("chakra-tabs__tablist",t.className),__css:s})});px.displayName="TabList";var mx=fe(function(t,n){const r=B8({...t,ref:n}),o=Ac();return l.jsx(ne.div,{outline:"0",...r,className:Ae("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});mx.displayName="TabPanel";var vx=fe(function(t,n){const r=L8(t),o=Ac();return l.jsx(ne.div,{...r,width:"100%",ref:n,className:Ae("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});vx.displayName="TabPanels";var gx=fe(function(t,n){const r=Ac(),o=R8({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return l.jsx(ne.button,{...o,className:Ae("chakra-tabs__tab",t.className),__css:s})});gx.displayName="Tab";function W8(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var V8=["h","minH","height","minHeight"],qh=fe((e,t)=>{const n=yo("Textarea",e),{className:r,rows:o,...s}=At(e),c=sh(s),u=o?W8(n,V8):n;return l.jsx(ne.textarea,{ref:t,rows:o,...c,className:Ae("chakra-textarea",r),__css:u})});qh.displayName="Textarea";var U8={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]}}}},sc=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},_f=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function $8(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:c=o,closeOnEsc:u=!0,onOpen:f,onClose:h,placement:m,id:v,isOpen:x,defaultIsOpen:S,arrowSize:C=10,arrowShadowColor:j,arrowPadding:w,modifiers:k,isDisabled:M,gutter:P,offset:I,direction:T,..._}=e,{isOpen:D,onOpen:z,onClose:W}=_h({isOpen:x,defaultIsOpen:S,onOpen:f,onClose:h}),{referenceRef:F,getPopperProps:B,getArrowInnerProps:Q,getArrowProps:U}=Th({enabled:D,placement:m,arrowPadding:w,modifiers:k,gutter:P,offset:I,direction:T}),X=y.useId(),re=`tooltip-${v??X}`,$=y.useRef(null),Z=y.useRef(),oe=y.useCallback(()=>{Z.current&&(clearTimeout(Z.current),Z.current=void 0)},[]),le=y.useRef(),ze=y.useCallback(()=>{le.current&&(clearTimeout(le.current),le.current=void 0)},[]),Re=y.useCallback(()=>{ze(),W()},[W,ze]),Ie=G8($,Re),pe=y.useCallback(()=>{if(!M&&!Z.current){Ie();const Te=_f($);Z.current=Te.setTimeout(z,t)}},[Ie,M,z,t]),ce=y.useCallback(()=>{oe();const Te=_f($);le.current=Te.setTimeout(Re,n)},[n,Re,oe]),Ne=y.useCallback(()=>{D&&r&&ce()},[r,ce,D]),Ve=y.useCallback(()=>{D&&c&&ce()},[c,ce,D]),Ue=y.useCallback(Te=>{D&&Te.key==="Escape"&&ce()},[D,ce]);Go(()=>sc($),"keydown",u?Ue:void 0),Go(()=>sc($),"scroll",()=>{D&&s&&Re()}),y.useEffect(()=>{M&&(oe(),D&&W())},[M,D,W,oe]),y.useEffect(()=>()=>{oe(),ze()},[oe,ze]),Go(()=>$.current,"pointerleave",ce);const $e=y.useCallback((Te={},Ge=null)=>({...Te,ref:ct($,Ge,F),onPointerEnter:Ee(Te.onPointerEnter,Pe=>{Pe.pointerType!=="touch"&&pe()}),onClick:Ee(Te.onClick,Ne),onPointerDown:Ee(Te.onPointerDown,Ve),onFocus:Ee(Te.onFocus,pe),onBlur:Ee(Te.onBlur,ce),"aria-describedby":D?re:void 0}),[pe,ce,Ve,D,re,Ne,F]),Qe=y.useCallback((Te={},Ge=null)=>B({...Te,style:{...Te.style,[Ht.arrowSize.var]:C?`${C}px`:void 0,[Ht.arrowShadowColor.var]:j}},Ge),[B,C,j]),ve=y.useCallback((Te={},Ge=null)=>{const ye={...Te.style,position:"relative",transformOrigin:Ht.transformOrigin.varRef};return{ref:Ge,..._,...Te,id:re,role:"tooltip",style:ye}},[_,re]);return{isOpen:D,show:pe,hide:ce,getTriggerProps:$e,getTooltipProps:ve,getTooltipPositionerProps:Qe,getArrowProps:U,getArrowInnerProps:Q}}var Ad="chakra-ui:close-tooltip";function G8(e,t){return y.useEffect(()=>{const n=sc(e);return n.addEventListener(Ad,t),()=>n.removeEventListener(Ad,t)},[t,e]),()=>{const n=sc(e),r=_f(e);n.dispatchEvent(new r.CustomEvent(Ad))}}function q8(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Y8(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var K8=ne(ar.div),Gt=fe((e,t)=>{var n,r;const o=yo("Tooltip",e),s=At(e),c=ta(),{children:u,label:f,shouldWrapChildren:h,"aria-label":m,hasArrow:v,bg:x,portalProps:S,background:C,backgroundColor:j,bgColor:w,motionProps:k,...M}=s,P=(r=(n=C??j)!=null?n:x)!=null?r:w;if(P){o.bg=P;const B=HS(c,"colors",P);o[Ht.arrowBg.var]=B}const I=$8({...M,direction:c.direction}),T=typeof u=="string"||h;let _;if(T)_=l.jsx(ne.span,{display:"inline-block",tabIndex:0,...I.getTriggerProps(),children:u});else{const B=y.Children.only(u);_=y.cloneElement(B,I.getTriggerProps(B.props,B.ref))}const D=!!m,z=I.getTooltipProps({},t),W=D?q8(z,["role","id"]):z,F=Y8(z,["role","id"]);return f?l.jsxs(l.Fragment,{children:[_,l.jsx(xo,{children:I.isOpen&&l.jsx($a,{...S,children:l.jsx(ne.div,{...I.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:l.jsxs(K8,{variants:U8,initial:"exit",animate:"enter",exit:"exit",...k,...W,__css:o,children:[f,D&&l.jsx(ne.span,{srOnly:!0,...F,children:m}),v&&l.jsx(ne.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:l.jsx(ne.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):l.jsx(l.Fragment,{children:u})});Gt.displayName="Tooltip";const Yh=y.createContext(null);let zg;const Kh=()=>({setOpenUploader:e=>{e&&(zg=e)},openUploader:zg}),bt=me(e=>e.ui,e=>WS[e.activeTab],{memoizeOptions:{equalityCheck:ee.isEqual}}),X8=me(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:ee.isEqual}}),Pr=me(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:ee.isEqual}}),Rg=e=>async(t,n)=>{const{imageFile:r}=e,o=n(),s=bt(o),c=new FormData;c.append("file",r,r.name),c.append("data",JSON.stringify({kind:"init"}));const f=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:c})).json(),h={uuid:S1(),category:"user",...f};t(C1({image:h,category:"user"})),s==="unifiedCanvas"?t(bc(h)):s==="img2img"&&t(rs(h))};var Q8=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 vs(e,t){var n=Z8(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 Z8(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=Q8.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var J8=[".DS_Store","Thumbs.db"];function eE(e){return na(this,void 0,void 0,function(){return ra(this,function(t){return lc(e)&&tE(e.dataTransfer)?[2,iE(e.dataTransfer,e.type)]:nE(e)?[2,rE(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,oE(e)]:[2,[]]})})}function tE(e){return lc(e)}function nE(e){return lc(e)&&lc(e.target)}function lc(e){return typeof e=="object"&&e!==null}function rE(e){return Df(e.target.files).map(function(t){return vs(t)})}function oE(e){return na(this,void 0,void 0,function(){var t;return ra(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 vs(r)})]}})})}function iE(e,t){return na(this,void 0,void 0,function(){var n,r;return ra(this,function(o){switch(o.label){case 0:return e.items?(n=Df(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(aE))]):[3,2];case 1:return r=o.sent(),[2,Ng(yx(r))];case 2:return[2,Ng(Df(e.files).map(function(s){return vs(s)}))]}})})}function Ng(e){return e.filter(function(t){return J8.indexOf(t.name)===-1})}function Df(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function aE(e){if(typeof e.webkitGetAsEntry!="function")return Fg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?xx(t):Fg(e)}function yx(e){return e.reduce(function(t,n){return Sf(Sf([],og(t),!1),og(Array.isArray(n)?yx(n):[n]),!1)},[])}function Fg(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=vs(t);return Promise.resolve(n)}function sE(e){return na(this,void 0,void 0,function(){return ra(this,function(t){return[2,e.isDirectory?xx(e):lE(e)]})})}function xx(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var c=this;t.readEntries(function(u){return na(c,void 0,void 0,function(){var f,h,m;return ra(this,function(v){switch(v.label){case 0:if(u.length)return[3,5];v.label=1;case 1:return v.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return f=v.sent(),n(f),[3,4];case 3:return h=v.sent(),r(h),[3,4];case 4:return[3,6];case 5:m=Promise.all(u.map(sE)),o.push(m),s(),v.label=6;case 6:return[2]}})})},function(u){r(u)})}s()})}function lE(e){return na(this,void 0,void 0,function(){return ra(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=vs(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var cE=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(c){var u=c.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):o===u})}return!0};function Lg(e){return fE(e)||dE(e)||Sx(e)||uE()}function uE(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fE(e){if(Array.isArray(e))return Af(e)}function Bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Hg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bg(Object(n),!0).forEach(function(r){bx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Za(e,t){return mE(e)||pE(e,t)||Sx(e,t)||hE()}function hE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sx(e,t){if(e){if(typeof e=="string")return Af(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Af(e,t)}}function Af(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pE(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function mE(e){if(Array.isArray(e))return e}var vE="file-invalid-type",gE="file-too-large",yE="file-too-small",xE="too-many-files",bE=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:vE,message:"File type must be ".concat(n)}},Wg=function(t){return{code:gE,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Vg=function(t){return{code:yE,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},SE={code:xE,message:"Too many files"};function Cx(e,t){var n=e.type==="application/x-moz-file"||cE(e,t);return[n,n?null:bE(t)]}function wx(e,t,n){if(Ho(e.size))if(Ho(t)&&Ho(n)){if(e.size>n)return[!1,Wg(n)];if(e.size<t)return[!1,Vg(t)]}else{if(Ho(t)&&e.size<t)return[!1,Vg(t)];if(Ho(n)&&e.size>n)return[!1,Wg(n)]}return[!0,null]}function Ho(e){return e!=null}function CE(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var h=Cx(f,n),m=Za(h,1),v=m[0],x=wx(f,r,o),S=Za(x,1),C=S[0],j=u?u(f):null;return v&&C&&!j})}function cc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Il(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 Ug(e){e.preventDefault()}function wE(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function jE(e){return e.indexOf("Edge/")!==-1}function kE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return wE(e)||jE(e)}function vr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),c=1;c<o;c++)s[c-1]=arguments[c];return t.some(function(u){return!cc(r)&&u&&u.apply(void 0,[r].concat(s)),cc(r)})}}function EE(){return"showOpenFilePicker"in window}function PE(e){if(Ho(e)){var t=Object.entries(e).filter(function(n){var r=Za(n,2),o=r[0],s=r[1],c=!0;return jx(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),c=!1),(!Array.isArray(s)||!s.every(kx))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var o=Za(r,2),s=o[0],c=o[1];return Hg(Hg({},n),{},bx({},s,c))},{});return[{description:"Files",accept:t}]}return e}function IE(e){if(Ho(e))return Object.entries(e).reduce(function(t,n){var r=Za(n,2),o=r[0],s=r[1];return[].concat(Lg(t),[o],Lg(s))},[]).filter(function(t){return jx(t)||kx(t)}).join(",")}function ME(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function TE(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function jx(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function kx(e){return/^.*\.[\w]+$/.test(e)}var _E=["children"],DE=["open"],AE=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],OE=["refKey","onChange","onClick"];function zE(e){return FE(e)||NE(e)||Ex(e)||RE()}function RE(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function FE(e){if(Array.isArray(e))return Of(e)}function Od(e,t){return HE(e)||BE(e,t)||Ex(e,t)||LE()}function LE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ex(e,t){if(e){if(typeof e=="string")return Of(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Of(e,t)}}function Of(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BE(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function HE(e){if(Array.isArray(e))return e}function $g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$g(Object(n),!0).forEach(function(r){zf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$g(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uc(e,t){if(e==null)return{};var n=WE(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WE(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Xh=y.forwardRef(function(e,t){var n=e.children,r=uc(e,_E),o=Ix(r),s=o.open,c=uc(o,DE);return y.useImperativeHandle(t,function(){return{open:s}},[s]),Me.createElement(y.Fragment,null,n(Dt(Dt({},c),{},{open:s})))});Xh.displayName="Dropzone";var Px={disabled:!1,getFilesFromEvent:eE,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};Xh.defaultProps=Px;Xh.propTypes={children:lt.func,accept:lt.objectOf(lt.arrayOf(lt.string)),multiple:lt.bool,preventDropOnDocument:lt.bool,noClick:lt.bool,noKeyboard:lt.bool,noDrag:lt.bool,noDragEventsBubbling:lt.bool,minSize:lt.number,maxSize:lt.number,maxFiles:lt.number,disabled:lt.bool,getFilesFromEvent:lt.func,onFileDialogCancel:lt.func,onFileDialogOpen:lt.func,useFsAccessApi:lt.bool,autoFocus:lt.bool,onDragEnter:lt.func,onDragLeave:lt.func,onDragOver:lt.func,onDrop:lt.func,onDropAccepted:lt.func,onDropRejected:lt.func,onError:lt.func,validator:lt.func};var Rf={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Ix(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Dt(Dt({},Px),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,h=t.onDragEnter,m=t.onDragLeave,v=t.onDragOver,x=t.onDrop,S=t.onDropAccepted,C=t.onDropRejected,j=t.onFileDialogCancel,w=t.onFileDialogOpen,k=t.useFsAccessApi,M=t.autoFocus,P=t.preventDropOnDocument,I=t.noClick,T=t.noKeyboard,_=t.noDrag,D=t.noDragEventsBubbling,z=t.onError,W=t.validator,F=y.useMemo(function(){return IE(n)},[n]),B=y.useMemo(function(){return PE(n)},[n]),Q=y.useMemo(function(){return typeof w=="function"?w:Gg},[w]),U=y.useMemo(function(){return typeof j=="function"?j:Gg},[j]),X=y.useRef(null),te=y.useRef(null),re=y.useReducer(VE,Rf),$=Od(re,2),Z=$[0],oe=$[1],le=Z.isFocused,ze=Z.isFileDialogActive,Re=y.useRef(typeof window<"u"&&window.isSecureContext&&k&&EE()),Ie=function(){!Re.current&&ze&&setTimeout(function(){if(te.current){var ae=te.current.files;ae.length||(oe({type:"closeDialog"}),U())}},300)};y.useEffect(function(){return window.addEventListener("focus",Ie,!1),function(){window.removeEventListener("focus",Ie,!1)}},[te,ze,U,Re]);var pe=y.useRef([]),ce=function(ae){X.current&&X.current.contains(ae.target)||(ae.preventDefault(),pe.current=[])};y.useEffect(function(){return P&&(document.addEventListener("dragover",Ug,!1),document.addEventListener("drop",ce,!1)),function(){P&&(document.removeEventListener("dragover",Ug),document.removeEventListener("drop",ce))}},[X,P]),y.useEffect(function(){return!r&&M&&X.current&&X.current.focus(),function(){}},[X,M,r]);var Ne=y.useCallback(function(q){z?z(q):console.error(q)},[z]),Ve=y.useCallback(function(q){q.preventDefault(),q.persist(),N(q),pe.current=[].concat(zE(pe.current),[q.target]),Il(q)&&Promise.resolve(o(q)).then(function(ae){if(!(cc(q)&&!D)){var Oe=ae.length,Ze=Oe>0&&CE({files:ae,accept:F,minSize:c,maxSize:s,multiple:u,maxFiles:f,validator:W}),J=Oe>0&&!Ze;oe({isDragAccept:Ze,isDragReject:J,isDragActive:!0,type:"setDraggedFiles"}),h&&h(q)}}).catch(function(ae){return Ne(ae)})},[o,h,Ne,D,F,c,s,u,f,W]),Ue=y.useCallback(function(q){q.preventDefault(),q.persist(),N(q);var ae=Il(q);if(ae&&q.dataTransfer)try{q.dataTransfer.dropEffect="copy"}catch{}return ae&&v&&v(q),!1},[v,D]),$e=y.useCallback(function(q){q.preventDefault(),q.persist(),N(q);var ae=pe.current.filter(function(Ze){return X.current&&X.current.contains(Ze)}),Oe=ae.indexOf(q.target);Oe!==-1&&ae.splice(Oe,1),pe.current=ae,!(ae.length>0)&&(oe({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Il(q)&&m&&m(q))},[X,m,D]),Qe=y.useCallback(function(q,ae){var Oe=[],Ze=[];q.forEach(function(J){var Le=Cx(J,F),nt=Od(Le,2),Nt=nt[0],he=nt[1],_e=wx(J,c,s),dn=Od(_e,2),Vt=dn[0],fn=dn[1],sr=W?W(J):null;if(Nt&&Vt&&!sr)Oe.push(J);else{var ko=[he,fn];sr&&(ko=ko.concat(sr)),Ze.push({file:J,errors:ko.filter(function(la){return la})})}}),(!u&&Oe.length>1||u&&f>=1&&Oe.length>f)&&(Oe.forEach(function(J){Ze.push({file:J,errors:[SE]})}),Oe.splice(0)),oe({acceptedFiles:Oe,fileRejections:Ze,type:"setFiles"}),x&&x(Oe,Ze,ae),Ze.length>0&&C&&C(Ze,ae),Oe.length>0&&S&&S(Oe,ae)},[oe,u,F,c,s,f,x,S,C,W]),ve=y.useCallback(function(q){q.preventDefault(),q.persist(),N(q),pe.current=[],Il(q)&&Promise.resolve(o(q)).then(function(ae){cc(q)&&!D||Qe(ae,q)}).catch(function(ae){return Ne(ae)}),oe({type:"reset"})},[o,Qe,Ne,D]),Te=y.useCallback(function(){if(Re.current){oe({type:"openDialog"}),Q();var q={multiple:u,types:B};window.showOpenFilePicker(q).then(function(ae){return o(ae)}).then(function(ae){Qe(ae,null),oe({type:"closeDialog"})}).catch(function(ae){ME(ae)?(U(ae),oe({type:"closeDialog"})):TE(ae)?(Re.current=!1,te.current?(te.current.value=null,te.current.click()):Ne(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 <input> was provided."))):Ne(ae)});return}te.current&&(oe({type:"openDialog"}),Q(),te.current.value=null,te.current.click())},[oe,Q,U,k,Qe,Ne,B,u]),Ge=y.useCallback(function(q){!X.current||!X.current.isEqualNode(q.target)||(q.key===" "||q.key==="Enter"||q.keyCode===32||q.keyCode===13)&&(q.preventDefault(),Te())},[X,Te]),ye=y.useCallback(function(){oe({type:"focus"})},[]),Pe=y.useCallback(function(){oe({type:"blur"})},[]),et=y.useCallback(function(){I||(kE()?setTimeout(Te,0):Te())},[I,Te]),Be=function(ae){return r?null:ae},vt=function(ae){return T?null:Be(ae)},Rt=function(ae){return _?null:Be(ae)},N=function(ae){D&&ae.stopPropagation()},ue=y.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=q.refKey,Oe=ae===void 0?"ref":ae,Ze=q.role,J=q.onKeyDown,Le=q.onFocus,nt=q.onBlur,Nt=q.onClick,he=q.onDragEnter,_e=q.onDragOver,dn=q.onDragLeave,Vt=q.onDrop,fn=uc(q,AE);return Dt(Dt(zf({onKeyDown:vt(vr(J,Ge)),onFocus:vt(vr(Le,ye)),onBlur:vt(vr(nt,Pe)),onClick:Be(vr(Nt,et)),onDragEnter:Rt(vr(he,Ve)),onDragOver:Rt(vr(_e,Ue)),onDragLeave:Rt(vr(dn,$e)),onDrop:Rt(vr(Vt,ve)),role:typeof Ze=="string"&&Ze!==""?Ze:"presentation"},Oe,X),!r&&!T?{tabIndex:0}:{}),fn)}},[X,Ge,ye,Pe,et,Ve,Ue,$e,ve,T,_,r]),xe=y.useCallback(function(q){q.stopPropagation()},[]),je=y.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=q.refKey,Oe=ae===void 0?"ref":ae,Ze=q.onChange,J=q.onClick,Le=uc(q,OE),nt=zf({accept:F,multiple:u,type:"file",style:{display:"none"},onChange:Be(vr(Ze,ve)),onClick:Be(vr(J,xe)),tabIndex:-1},Oe,te);return Dt(Dt({},nt),Le)}},[te,n,u,ve,r]);return Dt(Dt({},Z),{},{isFocused:le&&!r,getRootProps:ue,getInputProps:je,rootRef:X,inputRef:te,open:Be(Te)})}function VE(e,t){switch(t.type){case"focus":return Dt(Dt({},e),{},{isFocused:!0});case"blur":return Dt(Dt({},e),{},{isFocused:!1});case"openDialog":return Dt(Dt({},Rf),{},{isFileDialogActive:!0});case"closeDialog":return Dt(Dt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Dt(Dt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Dt(Dt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Dt({},Rf);default:return e}}function Gg(){}function Nf(){return Nf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nf.apply(this,arguments)}var Mx=["shift","alt","meta","mod","ctrl"],UE={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function so(e){return(UE[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function $E(e){return Mx.includes(e)}function zd(e,t){return t===void 0&&(t=","),e.split(t)}function Rd(e,t){t===void 0&&(t="+");var n=e.toLocaleLowerCase().split(t).map(function(s){return so(s)}),r={alt:n.includes("alt"),ctrl:n.includes("ctrl")||n.includes("control"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},o=n.filter(function(s){return!Mx.includes(s)});return Nf({},r,{keys:o})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&Tx([so(e.key),so(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&_x([so(e.key),so(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){lo.clear()})})();var lo=new Set;function GE(e,t){t===void 0&&(t=",");var n=Array.isArray(e)?e:e.split(t);return n.every(function(r){return lo.has(r.trim().toLowerCase())})}function Tx(e){var t=Array.isArray(e)?e:[e];lo.has("meta")&&lo.forEach(function(n){return!$E(n)&&lo.delete(n.toLowerCase())}),t.forEach(function(n){return lo.add(n.toLowerCase())})}function _x(e){var t=Array.isArray(e)?e:[e];e==="meta"?lo.clear():t.forEach(function(n){return lo.delete(n.toLowerCase())})}function qE(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function YE(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function KE(e){return Dx(e,["input","textarea","select"])}function Dx(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return t instanceof Array?Boolean(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):Boolean(r&&t&&t===!0)}function XE(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 <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var QE=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,c=n.mod,u=n.shift,f=n.ctrl,h=n.keys,m=t.key,v=t.code,x=t.ctrlKey,S=t.metaKey,C=t.shiftKey,j=t.altKey,w=so(v),k=m.toLowerCase();if(!r){if(o===!j&&k!=="alt"||u===!C&&k!=="shift")return!1;if(c){if(!S&&!x)return!1}else if(s===!S&&k!=="meta"&&k!=="os"||f===!x&&k!=="ctrl"&&k!=="control")return!1}return h&&h.length===1&&(h.includes(k)||h.includes(w))?!0:h?GE(h):!h},ZE=y.createContext(void 0),JE=function(){return y.useContext(ZE)};function Ax(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&Ax(e[r],t[r])},!0):e===t}var e9=y.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),t9=function(){return y.useContext(e9)};function n9(e){var t=y.useRef(void 0);return Ax(t.current,e)||(t.current=e),t.current}var qg=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},r9=typeof window<"u"?y.useLayoutEffect:y.useEffect;function de(e,t,n,r){var o=y.useRef(null),s=y.useRef(!1),c=n instanceof Array?r instanceof Array?void 0:r:n,u=e instanceof Array?e.join(c==null?void 0:c.splitKey):e,f=n instanceof Array?n:r instanceof Array?r:void 0,h=y.useCallback(t,f??[]),m=y.useRef(h);f?m.current=h:m.current=t;var v=n9(c),x=t9(),S=x.enabledScopes,C=JE();return r9(function(){if(!((v==null?void 0:v.enabled)===!1||!XE(S,v==null?void 0:v.scopes))){var j=function(I,T){var _;if(T===void 0&&(T=!1),!(KE(I)&&!Dx(I,v==null?void 0:v.enableOnFormTags))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){qg(I);return}(_=I.target)!=null&&_.isContentEditable&&!(v!=null&&v.enableOnContentEditable)||zd(u,v==null?void 0:v.splitKey).forEach(function(D){var z,W=Rd(D,v==null?void 0:v.combinationKey);if(QE(I,W,v==null?void 0:v.ignoreModifiers)||(z=W.keys)!=null&&z.includes("*")){if(T&&s.current)return;if(qE(I,W,v==null?void 0:v.preventDefault),!YE(I,W,v==null?void 0:v.enabled)){qg(I);return}m.current(I,W),T||(s.current=!0)}})}},w=function(I){I.key!==void 0&&(Tx(so(I.code)),((v==null?void 0:v.keydown)===void 0&&(v==null?void 0:v.keyup)!==!0||v!=null&&v.keydown)&&j(I))},k=function(I){I.key!==void 0&&(_x(so(I.code)),s.current=!1,v!=null&&v.keyup&&j(I,!0))},M=o.current||(c==null?void 0:c.document)||document;return M.addEventListener("keyup",k),M.addEventListener("keydown",w),C&&zd(u,v==null?void 0:v.splitKey).forEach(function(P){return C.addHotkey(Rd(P,v==null?void 0:v.combinationKey))}),function(){M.removeEventListener("keyup",k),M.removeEventListener("keydown",w),C&&zd(u,v==null?void 0:v.splitKey).forEach(function(P){return C.removeHotkey(Rd(P,v==null?void 0:v.combinationKey))})}}},[u,v,S]),o}const o9=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:o}=e;return de("esc",()=>{o(!1)}),l.jsx(Ye,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:l.jsx(L,{sx:{opacity:.4,width:"100%",height:"100%",flexDirection:"column",rowGap:4,alignItems:"center",justifyContent:"center",bg:"base.900",boxShadow:`inset 0 0 20rem 1rem var(--invokeai-colors-${t?"accent":"error"}-500)`},children:t?l.jsxs(Wn,{size:"lg",children:["Upload Image",r]}):l.jsxs(l.Fragment,{children:[l.jsx(Wn,{size:"lg",children:"Invalid Upload"}),l.jsx(Wn,{size:"md",children:"Must be single JPEG or PNG image"})]})})})},i9=e=>{const{children:t}=e,n=Y(),r=A(bt),o=ls({}),{t:s}=K(),[c,u]=y.useState(!1),{setOpenUploader:f}=Kh(),h=y.useCallback(P=>{u(!0);const I=P.errors.reduce((T,_)=>`${T}
|
||
${_.message}`,"");o({title:s("toast.uploadFailed"),description:I,status:"error",isClosable:!0})},[s,o]),m=y.useCallback(async P=>{n(Rg({imageFile:P}))},[n]),v=y.useCallback((P,I)=>{I.forEach(T=>{h(T)}),P.forEach(T=>{m(T)})},[m,h]),{getRootProps:x,getInputProps:S,isDragAccept:C,isDragReject:j,isDragActive:w,open:k}=Ix({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>u(!0),maxFiles:1});f(k),y.useEffect(()=>{const P=I=>{var z;const T=(z=I.clipboardData)==null?void 0:z.items;if(!T)return;const _=[];for(const W of T)W.kind==="file"&&["image/png","image/jpg"].includes(W.type)&&_.push(W);if(!_.length)return;if(I.stopImmediatePropagation(),_.length>1){o({description:s("toast.uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const D=_[0].getAsFile();if(!D){o({description:s("toast.uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(Rg({imageFile:D}))};return document.addEventListener("paste",P),()=>{document.removeEventListener("paste",P)}},[s,n,o,r]);const M=["img2img","unifiedCanvas"].includes(r)?` to ${String(s(`common.${r}`))}`:"";return l.jsx(Yh.Provider,{value:k,children:l.jsxs(Ye,{...x({style:{}}),onKeyDown:P=>{P.key},children:[l.jsx("input",{...S()}),t,w&&c&&l.jsx(o9,{isDragAccept:C,isDragReject:j,overlaySecondaryText:M,setIsHandlingUpload:u})]})})},a9=y.memo(i9),Ox=fe((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...c}=e;return l.jsx(Gt,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:l.jsx(ho,{ref:t,role:n,"aria-checked":s!==void 0?s:void 0,...c})})});Ox.displayName="IAIIconButton";const se=y.memo(Ox);var s9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},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)}}(),Bt=globalThis&&globalThis.__assign||function(){return Bt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Bt.apply(this,arguments)},Yg={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Kg={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Ml={width:"20px",height:"20px",position:"absolute"},l9={top:Bt(Bt({},Yg),{top:"-5px"}),right:Bt(Bt({},Kg),{left:void 0,right:"-5px"}),bottom:Bt(Bt({},Yg),{top:void 0,bottom:"-5px"}),left:Bt(Bt({},Kg),{left:"-5px"}),topRight:Bt(Bt({},Ml),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Bt(Bt({},Ml),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Bt(Bt({},Ml),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Bt(Bt({},Ml),{left:"-10px",top:"-10px",cursor:"nw-resize"})},c9=function(e){s9(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.onMouseDown=function(r){n.props.onResizeStart(r,n.props.direction)},n.onTouchStart=function(r){n.props.onResizeStart(r,n.props.direction)},n}return t.prototype.render=function(){return y.createElement("div",{className:this.props.className||"",style:Bt(Bt({position:"absolute",userSelect:"none"},l9[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(y.PureComponent),u9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},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)}}(),yr=globalThis&&globalThis.__assign||function(){return yr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},yr.apply(this,arguments)},d9={width:"auto",height:"auto"},Tl=function(e,t,n){return Math.max(Math.min(e,n),t)},Xg=function(e,t){return Math.round(e/t)*t},Ti=function(e,t){return new RegExp(e,"i").test(t)},_l=function(e){return Boolean(e.touches&&e.touches.length)},f9=function(e){return Boolean((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},Qg=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(s,c,u){return Math.abs(c-e)<Math.abs(t[s]-e)?u:s},0),o=Math.abs(t[r]-e);return n===0||o<n?t[r]:e},Nd=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},Dl=function(e,t,n,r){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var o=Number(e.replace("%",""))/100;return t*o}if(e.endsWith("vw")){var o=Number(e.replace("vw",""))/100;return n*o}if(e.endsWith("vh")){var o=Number(e.replace("vh",""))/100;return r*o}}return e},h9=function(e,t,n,r,o,s,c){return r=Dl(r,e.width,t,n),o=Dl(o,e.height,t,n),s=Dl(s,e.width,t,n),c=Dl(c,e.height,t,n),{maxWidth:typeof r>"u"?void 0:Number(r),maxHeight:typeof o>"u"?void 0:Number(o),minWidth:typeof s>"u"?void 0:Number(s),minHeight:typeof c>"u"?void 0:Number(c)}},p9=["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"],Zg="__resizable_base__",zx=function(e){u9(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 o=r.parentNode;if(!o)return null;var s=r.window.document.createElement("div");return s.style.width="100%",s.style.height="100%",s.style.position="absolute",s.style.transform="scale(0, 0)",s.style.left="0",s.style.flex="0 0 100%",s.classList?s.classList.add(Zg):s.className+=Zg,o.appendChild(s),s},r.removeBase=function(o){var s=r.parentNode;s&&s.removeChild(o)},r.ref=function(o){o&&(r.resizable=o)},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||d9},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,s=this.resizable.offsetHeight,c=this.resizable.style.position;c!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:o,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:s,this.resizable.style.position=c}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,o=function(u){if(typeof n.state[u]>"u"||n.state[u]==="auto")return"auto";if(n.propsSize&&n.propsSize[u]&&n.propsSize[u].toString().endsWith("%")){if(n.state[u].toString().endsWith("%"))return n.state[u].toString();var f=n.getParentSize(),h=Number(n.state[u].toString().replace("px","")),m=h/f[u]*100;return m+"%"}return Nd(n.state[u])},s=r&&typeof r.width<"u"&&!this.state.isResizing?Nd(r.width):o("width"),c=r&&typeof r.height<"u"&&!this.state.isResizing?Nd(r.height):o("height");return{width:s,height:c}},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,o=this.parentNode.style.flexWrap;o!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var s={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=o),this.removeBase(n),s},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 o=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof o>"u"||o==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var o=this.props.boundsByDirection,s=this.state.direction,c=o&&Ti("left",s),u=o&&Ti("top",s),f,h;if(this.props.bounds==="parent"){var m=this.parentNode;m&&(f=c?this.resizableRight-this.parentLeft:m.offsetWidth+(this.parentLeft-this.resizableLeft),h=u?this.resizableBottom-this.parentTop:m.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(f=c?this.resizableRight:this.window.innerWidth-this.resizableLeft,h=u?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(f=c?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),h=u?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return f&&Number.isFinite(f)&&(n=n&&n<f?n:f),h&&Number.isFinite(h)&&(r=r&&r<h?r:h),{maxWidth:n,maxHeight:r}},t.prototype.calculateNewSizeFromDirection=function(n,r){var o=this.props.scale||1,s=this.props.resizeRatio||1,c=this.state,u=c.direction,f=c.original,h=this.props,m=h.lockAspectRatio,v=h.lockAspectRatioExtraHeight,x=h.lockAspectRatioExtraWidth,S=f.width,C=f.height,j=v||0,w=x||0;return Ti("right",u)&&(S=f.width+(n-f.x)*s/o,m&&(C=(S-w)/this.ratio+j)),Ti("left",u)&&(S=f.width-(n-f.x)*s/o,m&&(C=(S-w)/this.ratio+j)),Ti("bottom",u)&&(C=f.height+(r-f.y)*s/o,m&&(S=(C-j)*this.ratio+w)),Ti("top",u)&&(C=f.height-(r-f.y)*s/o,m&&(S=(C-j)*this.ratio+w)),{newWidth:S,newHeight:C}},t.prototype.calculateNewSizeFromAspectRatio=function(n,r,o,s){var c=this.props,u=c.lockAspectRatio,f=c.lockAspectRatioExtraHeight,h=c.lockAspectRatioExtraWidth,m=typeof s.width>"u"?10:s.width,v=typeof o.width>"u"||o.width<0?n:o.width,x=typeof s.height>"u"?10:s.height,S=typeof o.height>"u"||o.height<0?r:o.height,C=f||0,j=h||0;if(u){var w=(x-C)*this.ratio+j,k=(S-C)*this.ratio+j,M=(m-j)/this.ratio+C,P=(v-j)/this.ratio+C,I=Math.max(m,w),T=Math.min(v,k),_=Math.max(x,M),D=Math.min(S,P);n=Tl(n,I,T),r=Tl(r,_,D)}else n=Tl(n,m,v),r=Tl(r,x,S);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 o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left,this.targetTop=o.top}if(this.resizable){var s=this.resizable.getBoundingClientRect(),c=s.left,u=s.top,f=s.right,h=s.bottom;this.resizableLeft=c,this.resizableRight=f,this.resizableTop=u,this.resizableBottom=h}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,s=0;if(n.nativeEvent&&f9(n.nativeEvent)?(o=n.nativeEvent.clientX,s=n.nativeEvent.clientY):n.nativeEvent&&_l(n.nativeEvent)&&(o=n.nativeEvent.touches[0].clientX,s=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var c=this.props.onResizeStart(n,r,this.resizable);if(c===!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 u,f=this.window.getComputedStyle(this.resizable);if(f.flexBasis!=="auto"){var h=this.parentNode;if(h){var m=this.window.getComputedStyle(h).flexDirection;this.flexDir=m.startsWith("row")?"row":"column",u=f.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var v={original:{x:o,y:s,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:yr(yr({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:u};this.setState(v)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&_l(n))try{n.preventDefault(),n.stopPropagation()}catch{}var o=this.props,s=o.maxWidth,c=o.maxHeight,u=o.minWidth,f=o.minHeight,h=_l(n)?n.touches[0].clientX:n.clientX,m=_l(n)?n.touches[0].clientY:n.clientY,v=this.state,x=v.direction,S=v.original,C=v.width,j=v.height,w=this.getParentSize(),k=h9(w,this.window.innerWidth,this.window.innerHeight,s,c,u,f);s=k.maxWidth,c=k.maxHeight,u=k.minWidth,f=k.minHeight;var M=this.calculateNewSizeFromDirection(h,m),P=M.newHeight,I=M.newWidth,T=this.calculateNewMaxFromBoundary(s,c);this.props.snap&&this.props.snap.x&&(I=Qg(I,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(P=Qg(P,this.props.snap.y,this.props.snapGap));var _=this.calculateNewSizeFromAspectRatio(I,P,{width:T.maxWidth,height:T.maxHeight},{width:u,height:f});if(I=_.newWidth,P=_.newHeight,this.props.grid){var D=Xg(I,this.props.grid[0]),z=Xg(P,this.props.grid[1]),W=this.props.snapGap||0;I=W===0||Math.abs(D-I)<=W?D:I,P=W===0||Math.abs(z-P)<=W?z:P}var F={width:I-S.width,height:P-S.height};if(C&&typeof C=="string"){if(C.endsWith("%")){var B=I/w.width*100;I=B+"%"}else if(C.endsWith("vw")){var Q=I/this.window.innerWidth*100;I=Q+"vw"}else if(C.endsWith("vh")){var U=I/this.window.innerHeight*100;I=U+"vh"}}if(j&&typeof j=="string"){if(j.endsWith("%")){var B=P/w.height*100;P=B+"%"}else if(j.endsWith("vw")){var Q=P/this.window.innerWidth*100;P=Q+"vw"}else if(j.endsWith("vh")){var U=P/this.window.innerHeight*100;P=U+"vh"}}var X={width:this.createSizeForCssProperty(I,"width"),height:this.createSizeForCssProperty(P,"height")};this.flexDir==="row"?X.flexBasis=X.width:this.flexDir==="column"&&(X.flexBasis=X.height),VS.flushSync(function(){r.setState(X)}),this.props.onResize&&this.props.onResize(n,x,this.resizable,F)}},t.prototype.onMouseUp=function(n){var r=this.state,o=r.isResizing,s=r.direction,c=r.original;if(!(!o||!this.resizable)){var u={width:this.size.width-c.width,height:this.size.height-c.height};this.props.onResizeStop&&this.props.onResizeStop(n,s,this.resizable,u),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:yr(yr({},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,o=r.enable,s=r.handleStyles,c=r.handleClasses,u=r.handleWrapperStyle,f=r.handleWrapperClass,h=r.handleComponent;if(!o)return null;var m=Object.keys(o).map(function(v){return o[v]!==!1?y.createElement(c9,{key:v,direction:v,onResizeStart:n.onResizeStart,replaceStyles:s&&s[v],className:c&&c[v]},h&&h[v]?h[v]:null):null});return y.createElement("div",{className:f,style:u},m)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(c,u){return p9.indexOf(u)!==-1||(c[u]=n.props[u]),c},{}),o=yr(yr(yr({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&&(o.flexBasis=this.state.flexBasis);var s=this.props.as||"div";return y.createElement(s,yr({ref:this.ref,style:o,className:this.props.className},r),this.state.isResizing&&y.createElement("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}(y.PureComponent),Rx={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Jg=Me.createContext&&Me.createContext(Rx),uo=globalThis&&globalThis.__assign||function(){return uo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},uo.apply(this,arguments)},m9=globalThis&&globalThis.__rest||function(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function Nx(e){return e&&e.map(function(t,n){return Me.createElement(t.tag,uo({key:n},t.attr),Nx(t.child))})}function ge(e){return function(t){return Me.createElement(v9,uo({attr:uo({},e.attr)},t),Nx(e.child))}}function v9(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,c=m9(e,["attr","size","title"]),u=o||n.size||"1em",f;return n.className&&(f=n.className),e.className&&(f=(f?f+" ":"")+e.className),Me.createElement("svg",uo({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,c,{className:f,style:uo(uo({color:e.color||n.color},n.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),s&&Me.createElement("title",null,s),e.children)};return Jg!==void 0?Me.createElement(Jg.Consumer,null,function(n){return t(n)}):t(Rx)}function g9(e){return ge({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"}}]})(e)}function y9(e){return ge({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"}}]})(e)}function x9(e){return ge({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function b9(e){return ge({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"}}]})(e)}function S9(e){return ge({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"}}]})(e)}function Fx(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"}}]})(e)}function C9(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"}}]})(e)}function Lx(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"}}]})(e)}function w9(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.21 334.093L336 256l142.21-78.093c11.795-6.477 15.961-21.384 9.232-33.037l-19.48-33.741c-6.728-11.653-21.72-15.499-33.227-8.523L296 186.718l3.475-162.204C299.763 11.061 288.937 0 275.48 0h-38.96c-13.456 0-24.283 11.061-23.994 24.514L216 186.718 77.265 102.607c-11.506-6.976-26.499-3.13-33.227 8.523l-19.48 33.741c-6.728 11.653-2.562 26.56 9.233 33.037L176 256 33.79 334.093c-11.795 6.477-15.961 21.384-9.232 33.037l19.48 33.741c6.728 11.653 21.721 15.499 33.227 8.523L216 325.282l-3.475 162.204C212.237 500.939 223.064 512 236.52 512h38.961c13.456 0 24.283-11.061 23.995-24.514L296 325.282l138.735 84.111c11.506 6.976 26.499 3.13 33.227-8.523l19.48-33.741c6.728-11.653 2.563-26.559-9.232-33.036z"}}]})(e)}function j9(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M511.988 288.9c-.478 17.43-15.217 31.1-32.653 31.1H424v16c0 21.864-4.882 42.584-13.6 61.145l60.228 60.228c12.496 12.497 12.496 32.758 0 45.255-12.498 12.497-32.759 12.496-45.256 0l-54.736-54.736C345.886 467.965 314.351 480 280 480V236c0-6.627-5.373-12-12-12h-24c-6.627 0-12 5.373-12 12v244c-34.351 0-65.886-12.035-90.636-32.108l-54.736 54.736c-12.498 12.497-32.759 12.496-45.256 0-12.496-12.497-12.496-32.758 0-45.255l60.228-60.228C92.882 378.584 88 357.864 88 336v-16H32.666C15.23 320 .491 306.33.013 288.9-.484 270.816 14.028 256 32 256h56v-58.745l-46.628-46.628c-12.496-12.497-12.496-32.758 0-45.255 12.498-12.497 32.758-12.497 45.256 0L141.255 160h229.489l54.627-54.627c12.498-12.497 32.758-12.497 45.256 0 12.496 12.497 12.496 32.758 0 45.255L424 197.255V256h56c17.972 0 32.484 14.816 31.988 32.9zM257 0c-61.856 0-112 50.144-112 112h224C369 50.144 318.856 0 257 0z"}}]})(e)}function Oc(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function Bx(e){return ge({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"}}]})(e)}function Xi(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z"}}]})(e)}function Hx(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500 224h-30.364C455.724 130.325 381.675 56.276 288 42.364V12c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v30.364C130.325 56.276 56.276 130.325 42.364 224H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h30.364C56.276 381.675 130.325 455.724 224 469.636V500c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-30.364C381.675 455.724 455.724 381.675 469.636 288H500c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12zM288 404.634V364c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40.634C165.826 392.232 119.783 346.243 107.366 288H148c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-40.634C119.768 165.826 165.757 119.783 224 107.366V148c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40.634C346.174 119.768 392.217 165.757 404.634 224H364c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40.634C392.232 346.174 346.243 392.217 288 404.634zM288 256c0 17.673-14.327 32-32 32s-32-14.327-32-32c0-17.673 14.327-32 32-32s32 14.327 32 32z"}}]})(e)}function k9(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function Qh(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function Wx(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"}}]})(e)}function E9(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function P9(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M0 180V56c0-13.3 10.7-24 24-24h124c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H64v84c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12zM288 44v40c0 6.6 5.4 12 12 12h84v84c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12V56c0-13.3-10.7-24-24-24H300c-6.6 0-12 5.4-12 12zm148 276h-40c-6.6 0-12 5.4-12 12v84h-84c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h124c13.3 0 24-10.7 24-24V332c0-6.6-5.4-12-12-12zM160 468v-40c0-6.6-5.4-12-12-12H64v-84c0-6.6-5.4-12-12-12H12c-6.6 0-12 5.4-12 12v124c0 13.3 10.7 24 24 24h124c6.6 0 12-5.4 12-12z"}}]})(e)}function Vx(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M50.75 333.25c-12 12-18.75 28.28-18.75 45.26V424L0 480l32 32 56-32h45.49c16.97 0 33.25-6.74 45.25-18.74l126.64-126.62-128-128L50.75 333.25zM483.88 28.12c-37.47-37.5-98.28-37.5-135.75 0l-77.09 77.09-13.1-13.1c-9.44-9.44-24.65-9.31-33.94 0l-40.97 40.97c-9.37 9.37-9.37 24.57 0 33.94l161.94 161.94c9.44 9.44 24.65 9.31 33.94 0L419.88 288c9.37-9.37 9.37-24.57 0-33.94l-13.1-13.1 77.09-77.09c37.51-37.48 37.51-98.26.01-135.75z"}}]})(e)}function I9(e){return ge({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function M9(e){return ge({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z"}}]})(e)}function Ux(e){return ge({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M512 320s-64 92.65-64 128c0 35.35 28.66 64 64 64s64-28.65 64-64-64-128-64-128zm-9.37-102.94L294.94 9.37C288.69 3.12 280.5 0 272.31 0s-16.38 3.12-22.62 9.37l-81.58 81.58L81.93 4.76c-6.25-6.25-16.38-6.25-22.62 0L36.69 27.38c-6.24 6.25-6.24 16.38 0 22.62l86.19 86.18-94.76 94.76c-37.49 37.48-37.49 98.26 0 135.75l117.19 117.19c18.74 18.74 43.31 28.12 67.87 28.12 24.57 0 49.13-9.37 67.87-28.12l221.57-221.57c12.5-12.5 12.5-32.75.01-45.25zm-116.22 70.97H65.93c1.36-3.84 3.57-7.98 7.43-11.83l13.15-13.15 81.61-81.61 58.6 58.6c12.49 12.49 32.75 12.49 45.24 0s12.49-32.75 0-45.24l-58.6-58.6 58.95-58.95 162.44 162.44-48.34 48.34z"}}]})(e)}function T9(e){return ge({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function _9(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"}}]})(e)}function D9(e){return ge({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function A9(e){return ge({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"}}]})(e)}function $x(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z"}}]})(e)}function O9(e){return ge({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320.67 64c-442.6 0-357.57 384-158.46 384 39.9 0 77.47-20.69 101.42-55.86l25.73-37.79c15.66-22.99 46.97-22.99 62.63 0l25.73 37.79C401.66 427.31 439.23 448 479.13 448c189.86 0 290.63-384-158.46-384zM184 308.36c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05zm272 0c-41.06 0-67.76-25.66-80.08-41.05-5.23-6.53-5.23-16.09 0-22.63 12.32-15.4 39.01-41.05 80.08-41.05s67.76 25.66 80.08 41.05c5.23 6.53 5.23 16.09 0 22.63-12.32 15.4-39.02 41.05-80.08 41.05z"}}]})(e)}function z9(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function Gx(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"}}]})(e)}function R9(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function N9(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function zc(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z"}}]})(e)}function F9(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 32H336c-26.5 0-48 21.5-48 48v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48zm-288 0H48C21.5 32 0 53.5 0 80v128c0 26.5 21.5 48 48 48h80v64c0 35.3-28.7 64-64 64h-8c-13.3 0-24 10.7-24 24v48c0 13.3 10.7 24 24 24h8c88.4 0 160-71.6 160-160V80c0-26.5-21.5-48-48-48z"}}]})(e)}function L9(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function B9(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M500.33 0h-47.41a12 12 0 0 0-12 12.57l4 82.76A247.42 247.42 0 0 0 256 8C119.34 8 7.9 119.53 8 256.19 8.1 393.07 119.1 504 256 504a247.1 247.1 0 0 0 166.18-63.91 12 12 0 0 0 .48-17.43l-34-34a12 12 0 0 0-16.38-.55A176 176 0 1 1 402.1 157.8l-101.53-4.87a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12h200.33a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12z"}}]})(e)}function Zh(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"}}]})(e)}function e0(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"}}]})(e)}function H9(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M64 96H0c0 123.7 100.3 224 224 224v144c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V320C288 196.3 187.7 96 64 96zm384-64c-84.2 0-157.4 46.5-195.7 115.2 27.7 30.2 48.2 66.9 59 107.6C424 243.1 512 147.9 512 32h-64z"}}]})(e)}function W9(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function t0(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M503.691 189.836L327.687 37.851C312.281 24.546 288 35.347 288 56.015v80.053C127.371 137.907 0 170.1 0 322.326c0 61.441 39.581 122.309 83.333 154.132 13.653 9.931 33.111-2.533 28.077-18.631C66.066 312.814 132.917 274.316 288 272.085V360c0 20.7 24.3 31.453 39.687 18.164l176.004-152c11.071-9.562 11.086-26.753 0-36.328z"}}]})(e)}function Jh(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M496 384H160v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h80v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h336c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160h-80v-16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h336v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h80c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm0-160H288V48c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v16H16C7.2 64 0 71.2 0 80v32c0 8.8 7.2 16 16 16h208v16c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-16h208c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16z"}}]})(e)}function V9(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"}}]})(e)}function So(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}function U9(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z"}}]})(e)}function Rc(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M296 384h-80c-13.3 0-24-10.7-24-24V192h-87.7c-17.8 0-26.7-21.5-14.1-34.1L242.3 5.7c7.5-7.5 19.8-7.5 27.3 0l152.2 152.2c12.6 12.6 3.7 34.1-14.1 34.1H320v168c0 13.3-10.7 24-24 24zm216-8v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h136v8c0 30.9 25.1 56 56 56h80c30.9 0 56-25.1 56-56v-8h136c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"}}]})(e)}function $9(e){return ge({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function ep(e){return ge({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const Et=e=>e.system,G9=e=>e.system.toastQueue,qx=me(Et,e=>{const{model_list:t}=e,n=ee.reduce(t,(r,o,s)=>(o.status==="active"&&(r=s),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),q9=me(Et,e=>{const{model_list:t}=e;return ee.pickBy(t,(r,o)=>{if(r.format==="diffusers")return{name:o,...r}})},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Y9=me(Et,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),K9=me(Et,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),X9=()=>{const e=Y(),{t}=K(),n=A(Y9),{shouldShowLogViewer:r,hasError:o,wasErrorSeen:s}=A(K9),[c,u]=y.useState(!0),f=y.useRef(null);y.useLayoutEffect(()=>{f.current!==null&&c&&(f.current.scrollTop=f.current.scrollHeight)},[c,n,r]);const h=()=>{e(w1()),e(dd(!r))};de("`",()=>{e(dd(!r))},[r]),de("esc",()=>{e(dd(!1))});const m=()=>{f.current&&c&&f.current.scrollTop<f.current.scrollHeight-f.current.clientHeight&&u(!1)};return l.jsxs(l.Fragment,{children:[r&&l.jsx(zx,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",insetInlineStart:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:l.jsx(L,{sx:{flexDirection:"column",width:"100vw",overflow:"auto",direction:"column",fontFamily:"monospace",pt:0,pr:4,pb:4,pl:12,borderTopWidth:5,bg:"base.850",borderColor:"base.700"},ref:f,onScroll:m,children:n.map((v,x)=>{const{timestamp:S,message:C,level:j}=v,w=j==="info"?"base":j;return l.jsxs(L,{sx:{gap:2,color:`${w}.300`},children:[l.jsxs(Ce,{fontWeight:"600",children:[S,":"]}),l.jsx(Ce,{wordBreak:"break-all",children:C})]},x)})})}),r&&l.jsx(Gt,{hasArrow:!0,label:c?"Autoscroll On":"Autoscroll Off",children:l.jsx(se,{size:"sm","aria-label":t("accessibility.toggleAutoscroll"),icon:l.jsx(x9,{}),onClick:()=>u(!c),isChecked:c,sx:{position:"fixed",insetInlineStart:2,bottom:12,zIndex:"10000"}})}),l.jsx(Gt,{hasArrow:!0,label:r?"Hide Console":"Show Console",children:l.jsx(se,{size:"sm","aria-label":t("accessibility.toggleLogViewer"),icon:r?l.jsx(z9,{}):l.jsx(Bx,{}),onClick:h,sx:{position:"fixed",insetInlineStart:2,bottom:2,zIndex:"10000"},colorScheme:o||!s?"error":"base"})})]})},Q9="0px",Yx="calc(70px + 1rem)",dc=1.5,Z9=`calc(100vw - ${Q9})`,J9=`calc(100vh - ${dc*4}px)`,eP=`calc(100vh - ${Yx})`,tP=`calc(100vh - (${Yx} + 4.4rem))`,n0=384,nP=me(Et,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),rP=()=>{const{t:e}=K(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=A(nP),s=n?Math.round(n*100/r):0;return l.jsx(Zy,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!o,height:dc,zIndex:99})};function oP(e){const{title:t,hotkey:n,description:r}=e;return l.jsxs(ir,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs(ir,{children:[l.jsx(Ce,{fontWeight:600,children:t}),r&&l.jsx(Ce,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),l.jsx(Ye,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function iP({children:e}){const{isOpen:t,onOpen:n,onClose:r}=po(),{t:o}=K(),s=[{title:o("hotkeys.invoke.title"),desc:o("hotkeys.invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys.cancel.title"),desc:o("hotkeys.cancel.desc"),hotkey:"Shift+X"},{title:o("hotkeys.focusPrompt.title"),desc:o("hotkeys.focusPrompt.desc"),hotkey:"Alt+A"},{title:o("hotkeys.toggleOptions.title"),desc:o("hotkeys.toggleOptions.desc"),hotkey:"O"},{title:o("hotkeys.pinOptions.title"),desc:o("hotkeys.pinOptions.desc"),hotkey:"Shift+O"},{title:o("hotkeys.toggleViewer.title"),desc:o("hotkeys.toggleViewer.desc"),hotkey:"Z"},{title:o("hotkeys.toggleGallery.title"),desc:o("hotkeys.toggleGallery.desc"),hotkey:"G"},{title:o("hotkeys.maximizeWorkSpace.title"),desc:o("hotkeys.maximizeWorkSpace.desc"),hotkey:"F"},{title:o("hotkeys.changeTabs.title"),desc:o("hotkeys.changeTabs.desc"),hotkey:"1-5"},{title:o("hotkeys.consoleToggle.title"),desc:o("hotkeys.consoleToggle.desc"),hotkey:"`"}],c=[{title:o("hotkeys.setPrompt.title"),desc:o("hotkeys.setPrompt.desc"),hotkey:"P"},{title:o("hotkeys.setSeed.title"),desc:o("hotkeys.setSeed.desc"),hotkey:"S"},{title:o("hotkeys.setParameters.title"),desc:o("hotkeys.setParameters.desc"),hotkey:"A"},{title:o("hotkeys.restoreFaces.title"),desc:o("hotkeys.restoreFaces.desc"),hotkey:"Shift+R"},{title:o("hotkeys.upscale.title"),desc:o("hotkeys.upscale.desc"),hotkey:"Shift+U"},{title:o("hotkeys.showInfo.title"),desc:o("hotkeys.showInfo.desc"),hotkey:"I"},{title:o("hotkeys.sendToImageToImage.title"),desc:o("hotkeys.sendToImageToImage.desc"),hotkey:"Shift+I"},{title:o("hotkeys.deleteImage.title"),desc:o("hotkeys.deleteImage.desc"),hotkey:"Del"},{title:o("hotkeys.closePanels.title"),desc:o("hotkeys.closePanels.desc"),hotkey:"Esc"}],u=[{title:o("hotkeys.previousImage.title"),desc:o("hotkeys.previousImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextImage.title"),desc:o("hotkeys.nextImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.toggleGalleryPin.title"),desc:o("hotkeys.toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:o("hotkeys.increaseGalleryThumbSize.title"),desc:o("hotkeys.increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:o("hotkeys.decreaseGalleryThumbSize.title"),desc:o("hotkeys.decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],f=[{title:o("hotkeys.selectBrush.title"),desc:o("hotkeys.selectBrush.desc"),hotkey:"B"},{title:o("hotkeys.selectEraser.title"),desc:o("hotkeys.selectEraser.desc"),hotkey:"E"},{title:o("hotkeys.decreaseBrushSize.title"),desc:o("hotkeys.decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys.increaseBrushSize.title"),desc:o("hotkeys.increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys.decreaseBrushOpacity.title"),desc:o("hotkeys.decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys.increaseBrushOpacity.title"),desc:o("hotkeys.increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys.moveTool.title"),desc:o("hotkeys.moveTool.desc"),hotkey:"V"},{title:o("hotkeys.fillBoundingBox.title"),desc:o("hotkeys.fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys.eraseBoundingBox.title"),desc:o("hotkeys.eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys.colorPicker.title"),desc:o("hotkeys.colorPicker.desc"),hotkey:"C"},{title:o("hotkeys.toggleSnap.title"),desc:o("hotkeys.toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys.quickToggleMove.title"),desc:o("hotkeys.quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys.toggleLayer.title"),desc:o("hotkeys.toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys.clearMask.title"),desc:o("hotkeys.clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys.hideMask.title"),desc:o("hotkeys.hideMask.desc"),hotkey:"H"},{title:o("hotkeys.showHideBoundingBox.title"),desc:o("hotkeys.showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys.mergeVisible.title"),desc:o("hotkeys.mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys.saveToGallery.title"),desc:o("hotkeys.saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys.copyToClipboard.title"),desc:o("hotkeys.copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys.downloadImage.title"),desc:o("hotkeys.downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys.undoStroke.title"),desc:o("hotkeys.undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys.redoStroke.title"),desc:o("hotkeys.redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys.resetView.title"),desc:o("hotkeys.resetView.desc"),hotkey:"R"},{title:o("hotkeys.previousStagingImage.title"),desc:o("hotkeys.previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextStagingImage.title"),desc:o("hotkeys.nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.acceptStagingImage.title"),desc:o("hotkeys.acceptStagingImage.desc"),hotkey:"Enter"}],h=m=>l.jsx(L,{flexDir:"column",gap:4,children:m.map((v,x)=>l.jsxs(L,{flexDir:"column",px:2,gap:4,children:[l.jsx(oP,{title:v.title,description:v.desc,hotkey:v.hotkey}),x<m.length-1&&l.jsx(Sy,{})]},x))});return l.jsxs(l.Fragment,{children:[y.cloneElement(e,{onClick:n}),l.jsxs(mo,{isOpen:t,onClose:r,children:[l.jsx(Hr,{}),l.jsxs(vo,{children:[l.jsx(Br,{children:o("hotkeys.keyboardShortcuts")}),l.jsx(aa,{}),l.jsx(Wr,{children:l.jsx(ih,{allowMultiple:!0,children:l.jsxs(L,{flexDir:"column",gap:2,children:[l.jsxs(zi,{children:[l.jsx(Ai,{children:l.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:o("hotkeys.appHotkeys")}),l.jsx(Oi,{})]})}),l.jsx(Ri,{children:h(s)})]}),l.jsxs(zi,{children:[l.jsx(Ai,{children:l.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:o("hotkeys.generalHotkeys")}),l.jsx(Oi,{})]})}),l.jsx(Ri,{children:h(c)})]}),l.jsxs(zi,{children:[l.jsx(Ai,{children:l.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),l.jsx(Oi,{})]})}),l.jsx(Ri,{children:h(u)})]}),l.jsxs(zi,{children:[l.jsx(Ai,{children:l.jsxs(L,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),l.jsx(Oi,{})]})}),l.jsx(Ri,{children:h(f)})]})]})})}),l.jsx(Lr,{})]})]})]})}const aP=fe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:o,isChecked:s,...c}=e;return l.jsx(Gt,{label:r,...o,children:l.jsx(ni,{ref:t,"aria-checked":s,...c,children:n})})}),Je=y.memo(aP),sP=e=>{const{label:t="",isDisabled:n=!1,isInvalid:r,formControlProps:o,...s}=e;return l.jsxs(rt,{isInvalid:r,isDisabled:n,...o,children:[t!==""&&l.jsx(st,{children:t}),l.jsx(bh,{...s})]})},mt=y.memo(sP),r0=/^-?(0\.)?\.?$/,lP=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:c,min:u,max:f,isInteger:h=!0,formControlProps:m,formLabelProps:v,numberInputFieldProps:x,numberInputStepperProps:S,tooltipProps:C,...j}=e,[w,k]=y.useState(String(s));y.useEffect(()=>{!w.match(r0)&&s!==Number(w)&&k(String(s))},[s,w]);const M=I=>{k(I),I.match(r0)||c(h?Math.floor(Number(I)):Number(I))},P=I=>{const T=ee.clamp(h?Math.floor(Number(I.target.value)):Number(I.target.value),u,f);k(String(T)),c(T)};return l.jsx(Gt,{...C,children:l.jsxs(rt,{isDisabled:n,isInvalid:o,...m,children:[t&&l.jsx(st,{...v,children:t}),l.jsxs(Nh,{value:w,min:u,max:f,keepWithinRange:!0,clampValueOnBlur:!1,onChange:M,onBlur:P,...j,children:[l.jsx(Lh,{...x}),r&&l.jsxs(Fh,{children:[l.jsx(Hh,{...S}),l.jsx(Bh,{...S})]})]})]})})},Vr=y.memo(lP);var o0=Array.isArray,i0=Object.keys,cP=Object.prototype.hasOwnProperty,uP=typeof Element<"u";function Ff(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=o0(e),r=o0(t),o,s,c;if(n&&r){if(s=e.length,s!=t.length)return!1;for(o=s;o--!==0;)if(!Ff(e[o],t[o]))return!1;return!0}if(n!=r)return!1;var u=e instanceof Date,f=t instanceof Date;if(u!=f)return!1;if(u&&f)return e.getTime()==t.getTime();var h=e instanceof RegExp,m=t instanceof RegExp;if(h!=m)return!1;if(h&&m)return e.toString()==t.toString();var v=i0(e);if(s=v.length,s!==i0(t).length)return!1;for(o=s;o--!==0;)if(!cP.call(t,v[o]))return!1;if(uP&&e instanceof Element&&t instanceof Element)return e===t;for(o=s;o--!==0;)if(c=v[o],!(c==="_owner"&&e.$$typeof)&&!Ff(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}var ao=function(t,n){try{return Ff(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}},dP=function(t){return fP(t)&&!hP(t)};function fP(e){return!!e&&typeof e=="object"}function hP(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||vP(e)}var pP=typeof Symbol=="function"&&Symbol.for,mP=pP?Symbol.for("react.element"):60103;function vP(e){return e.$$typeof===mP}function gP(e){return Array.isArray(e)?[]:{}}function fc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ja(gP(e),e,t):e}function yP(e,t,n){return e.concat(t).map(function(r){return fc(r,n)})}function xP(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(o){r[o]=fc(e[o],n)}),Object.keys(t).forEach(function(o){!n.isMergeableObject(t[o])||!e[o]?r[o]=fc(t[o],n):r[o]=Ja(e[o],t[o],n)}),r}function Ja(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||yP,n.isMergeableObject=n.isMergeableObject||dP;var r=Array.isArray(t),o=Array.isArray(e),s=r===o;return s?r?n.arrayMerge(e,t,n):xP(e,t,n):fc(t,n)}Ja.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Ja(r,o,n)},{})};var Lf=Ja,bP=typeof global=="object"&&global&&global.Object===Object&&global;const Kx=bP;var SP=typeof self=="object"&&self&&self.Object===Object&&self,CP=Kx||SP||Function("return this")();const Ir=CP;var wP=Ir.Symbol;const go=wP;var Xx=Object.prototype,jP=Xx.hasOwnProperty,kP=Xx.toString,Da=go?go.toStringTag:void 0;function EP(e){var t=jP.call(e,Da),n=e[Da];try{e[Da]=void 0;var r=!0}catch{}var o=kP.call(e);return r&&(t?e[Da]=n:delete e[Da]),o}var PP=Object.prototype,IP=PP.toString;function MP(e){return IP.call(e)}var TP="[object Null]",_P="[object Undefined]",a0=go?go.toStringTag:void 0;function oi(e){return e==null?e===void 0?_P:TP:a0&&a0 in Object(e)?EP(e):MP(e)}function Qx(e,t){return function(n){return e(t(n))}}var DP=Qx(Object.getPrototypeOf,Object);const tp=DP;function ii(e){return e!=null&&typeof e=="object"}var AP="[object Object]",OP=Function.prototype,zP=Object.prototype,Zx=OP.toString,RP=zP.hasOwnProperty,NP=Zx.call(Object);function s0(e){if(!ii(e)||oi(e)!=AP)return!1;var t=tp(e);if(t===null)return!0;var n=RP.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Zx.call(n)==NP}function FP(){this.__data__=[],this.size=0}function Jx(e,t){return e===t||e!==e&&t!==t}function Nc(e,t){for(var n=e.length;n--;)if(Jx(e[n][0],t))return n;return-1}var LP=Array.prototype,BP=LP.splice;function HP(e){var t=this.__data__,n=Nc(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():BP.call(t,n,1),--this.size,!0}function WP(e){var t=this.__data__,n=Nc(t,e);return n<0?void 0:t[n][1]}function VP(e){return Nc(this.__data__,e)>-1}function UP(e,t){var n=this.__data__,r=Nc(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Gr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gr.prototype.clear=FP;Gr.prototype.delete=HP;Gr.prototype.get=WP;Gr.prototype.has=VP;Gr.prototype.set=UP;function $P(){this.__data__=new Gr,this.size=0}function GP(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function qP(e){return this.__data__.get(e)}function YP(e){return this.__data__.has(e)}function gs(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var KP="[object AsyncFunction]",XP="[object Function]",QP="[object GeneratorFunction]",ZP="[object Proxy]";function eb(e){if(!gs(e))return!1;var t=oi(e);return t==XP||t==QP||t==KP||t==ZP}var JP=Ir["__core-js_shared__"];const Fd=JP;var l0=function(){var e=/[^.]+$/.exec(Fd&&Fd.keys&&Fd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function eI(e){return!!l0&&l0 in e}var tI=Function.prototype,nI=tI.toString;function ai(e){if(e!=null){try{return nI.call(e)}catch{}try{return e+""}catch{}}return""}var rI=/[\\^$.*+?()[\]{}|]/g,oI=/^\[object .+?Constructor\]$/,iI=Function.prototype,aI=Object.prototype,sI=iI.toString,lI=aI.hasOwnProperty,cI=RegExp("^"+sI.call(lI).replace(rI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function uI(e){if(!gs(e)||eI(e))return!1;var t=eb(e)?cI:oI;return t.test(ai(e))}function dI(e,t){return e==null?void 0:e[t]}function si(e,t){var n=dI(e,t);return uI(n)?n:void 0}var fI=si(Ir,"Map");const es=fI;var hI=si(Object,"create");const ts=hI;function pI(){this.__data__=ts?ts(null):{},this.size=0}function mI(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var vI="__lodash_hash_undefined__",gI=Object.prototype,yI=gI.hasOwnProperty;function xI(e){var t=this.__data__;if(ts){var n=t[e];return n===vI?void 0:n}return yI.call(t,e)?t[e]:void 0}var bI=Object.prototype,SI=bI.hasOwnProperty;function CI(e){var t=this.__data__;return ts?t[e]!==void 0:SI.call(t,e)}var wI="__lodash_hash_undefined__";function jI(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ts&&t===void 0?wI:t,this}function Jo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Jo.prototype.clear=pI;Jo.prototype.delete=mI;Jo.prototype.get=xI;Jo.prototype.has=CI;Jo.prototype.set=jI;function kI(){this.size=0,this.__data__={hash:new Jo,map:new(es||Gr),string:new Jo}}function EI(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Fc(e,t){var n=e.__data__;return EI(t)?n[typeof t=="string"?"string":"hash"]:n.map}function PI(e){var t=Fc(this,e).delete(e);return this.size-=t?1:0,t}function II(e){return Fc(this,e).get(e)}function MI(e){return Fc(this,e).has(e)}function TI(e,t){var n=Fc(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Co(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Co.prototype.clear=kI;Co.prototype.delete=PI;Co.prototype.get=II;Co.prototype.has=MI;Co.prototype.set=TI;var _I=200;function DI(e,t){var n=this.__data__;if(n instanceof Gr){var r=n.__data__;if(!es||r.length<_I-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Co(r)}return n.set(e,t),this.size=n.size,this}function sa(e){var t=this.__data__=new Gr(e);this.size=t.size}sa.prototype.clear=$P;sa.prototype.delete=GP;sa.prototype.get=qP;sa.prototype.has=YP;sa.prototype.set=DI;function AI(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var OI=function(){try{var e=si(Object,"defineProperty");return e({},"",{}),e}catch{}}();const c0=OI;function tb(e,t,n){t=="__proto__"&&c0?c0(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var zI=Object.prototype,RI=zI.hasOwnProperty;function nb(e,t,n){var r=e[t];(!(RI.call(e,t)&&Jx(r,n))||n===void 0&&!(t in e))&&tb(e,t,n)}function Lc(e,t,n,r){var o=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var u=t[s],f=r?r(n[u],e[u],u,n,e):void 0;f===void 0&&(f=e[u]),o?tb(n,u,f):nb(n,u,f)}return n}function NI(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var FI="[object Arguments]";function u0(e){return ii(e)&&oi(e)==FI}var rb=Object.prototype,LI=rb.hasOwnProperty,BI=rb.propertyIsEnumerable,HI=u0(function(){return arguments}())?u0:function(e){return ii(e)&&LI.call(e,"callee")&&!BI.call(e,"callee")};const WI=HI;var VI=Array.isArray;const ys=VI;function UI(){return!1}var ob=typeof exports=="object"&&exports&&!exports.nodeType&&exports,d0=ob&&typeof module=="object"&&module&&!module.nodeType&&module,$I=d0&&d0.exports===ob,f0=$I?Ir.Buffer:void 0,GI=f0?f0.isBuffer:void 0,qI=GI||UI;const ib=qI;var YI=9007199254740991,KI=/^(?:0|[1-9]\d*)$/;function XI(e,t){var n=typeof e;return t=t??YI,!!t&&(n=="number"||n!="symbol"&&KI.test(e))&&e>-1&&e%1==0&&e<t}var QI=9007199254740991;function ab(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=QI}var ZI="[object Arguments]",JI="[object Array]",eM="[object Boolean]",tM="[object Date]",nM="[object Error]",rM="[object Function]",oM="[object Map]",iM="[object Number]",aM="[object Object]",sM="[object RegExp]",lM="[object Set]",cM="[object String]",uM="[object WeakMap]",dM="[object ArrayBuffer]",fM="[object DataView]",hM="[object Float32Array]",pM="[object Float64Array]",mM="[object Int8Array]",vM="[object Int16Array]",gM="[object Int32Array]",yM="[object Uint8Array]",xM="[object Uint8ClampedArray]",bM="[object Uint16Array]",SM="[object Uint32Array]",wt={};wt[hM]=wt[pM]=wt[mM]=wt[vM]=wt[gM]=wt[yM]=wt[xM]=wt[bM]=wt[SM]=!0;wt[ZI]=wt[JI]=wt[dM]=wt[eM]=wt[fM]=wt[tM]=wt[nM]=wt[rM]=wt[oM]=wt[iM]=wt[aM]=wt[sM]=wt[lM]=wt[cM]=wt[uM]=!1;function CM(e){return ii(e)&&ab(e.length)&&!!wt[oi(e)]}function np(e){return function(t){return e(t)}}var sb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ba=sb&&typeof module=="object"&&module&&!module.nodeType&&module,wM=Ba&&Ba.exports===sb,Ld=wM&&Kx.process,jM=function(){try{var e=Ba&&Ba.require&&Ba.require("util").types;return e||Ld&&Ld.binding&&Ld.binding("util")}catch{}}();const Qi=jM;var h0=Qi&&Qi.isTypedArray,kM=h0?np(h0):CM;const EM=kM;var PM=Object.prototype,IM=PM.hasOwnProperty;function lb(e,t){var n=ys(e),r=!n&&WI(e),o=!n&&!r&&ib(e),s=!n&&!r&&!o&&EM(e),c=n||r||o||s,u=c?NI(e.length,String):[],f=u.length;for(var h in e)(t||IM.call(e,h))&&!(c&&(h=="length"||o&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||XI(h,f)))&&u.push(h);return u}var MM=Object.prototype;function rp(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||MM;return e===n}var TM=Qx(Object.keys,Object);const _M=TM;var DM=Object.prototype,AM=DM.hasOwnProperty;function OM(e){if(!rp(e))return _M(e);var t=[];for(var n in Object(e))AM.call(e,n)&&n!="constructor"&&t.push(n);return t}function cb(e){return e!=null&&ab(e.length)&&!eb(e)}function op(e){return cb(e)?lb(e):OM(e)}function zM(e,t){return e&&Lc(t,op(t),e)}function RM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var NM=Object.prototype,FM=NM.hasOwnProperty;function LM(e){if(!gs(e))return RM(e);var t=rp(e),n=[];for(var r in e)r=="constructor"&&(t||!FM.call(e,r))||n.push(r);return n}function ip(e){return cb(e)?lb(e,!0):LM(e)}function BM(e,t){return e&&Lc(t,ip(t),e)}var ub=typeof exports=="object"&&exports&&!exports.nodeType&&exports,p0=ub&&typeof module=="object"&&module&&!module.nodeType&&module,HM=p0&&p0.exports===ub,m0=HM?Ir.Buffer:void 0,v0=m0?m0.allocUnsafe:void 0;function WM(e,t){if(t)return e.slice();var n=e.length,r=v0?v0(n):new e.constructor(n);return e.copy(r),r}function db(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function VM(e,t){for(var n=-1,r=e==null?0:e.length,o=0,s=[];++n<r;){var c=e[n];t(c,n,e)&&(s[o++]=c)}return s}function fb(){return[]}var UM=Object.prototype,$M=UM.propertyIsEnumerable,g0=Object.getOwnPropertySymbols,GM=g0?function(e){return e==null?[]:(e=Object(e),VM(g0(e),function(t){return $M.call(e,t)}))}:fb;const ap=GM;function qM(e,t){return Lc(e,ap(e),t)}function hb(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var YM=Object.getOwnPropertySymbols,KM=YM?function(e){for(var t=[];e;)hb(t,ap(e)),e=tp(e);return t}:fb;const pb=KM;function XM(e,t){return Lc(e,pb(e),t)}function mb(e,t,n){var r=t(e);return ys(e)?r:hb(r,n(e))}function QM(e){return mb(e,op,ap)}function ZM(e){return mb(e,ip,pb)}var JM=si(Ir,"DataView");const Bf=JM;var eT=si(Ir,"Promise");const Hf=eT;var tT=si(Ir,"Set");const Wf=tT;var nT=si(Ir,"WeakMap");const Vf=nT;var y0="[object Map]",rT="[object Object]",x0="[object Promise]",b0="[object Set]",S0="[object WeakMap]",C0="[object DataView]",oT=ai(Bf),iT=ai(es),aT=ai(Hf),sT=ai(Wf),lT=ai(Vf),Bo=oi;(Bf&&Bo(new Bf(new ArrayBuffer(1)))!=C0||es&&Bo(new es)!=y0||Hf&&Bo(Hf.resolve())!=x0||Wf&&Bo(new Wf)!=b0||Vf&&Bo(new Vf)!=S0)&&(Bo=function(e){var t=oi(e),n=t==rT?e.constructor:void 0,r=n?ai(n):"";if(r)switch(r){case oT:return C0;case iT:return y0;case aT:return x0;case sT:return b0;case lT:return S0}return t});const sp=Bo;var cT=Object.prototype,uT=cT.hasOwnProperty;function dT(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&uT.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var fT=Ir.Uint8Array;const w0=fT;function lp(e){var t=new e.constructor(e.byteLength);return new w0(t).set(new w0(e)),t}function hT(e,t){var n=t?lp(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var pT=/\w*$/;function mT(e){var t=new e.constructor(e.source,pT.exec(e));return t.lastIndex=e.lastIndex,t}var j0=go?go.prototype:void 0,k0=j0?j0.valueOf:void 0;function vT(e){return k0?Object(k0.call(e)):{}}function gT(e,t){var n=t?lp(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var yT="[object Boolean]",xT="[object Date]",bT="[object Map]",ST="[object Number]",CT="[object RegExp]",wT="[object Set]",jT="[object String]",kT="[object Symbol]",ET="[object ArrayBuffer]",PT="[object DataView]",IT="[object Float32Array]",MT="[object Float64Array]",TT="[object Int8Array]",_T="[object Int16Array]",DT="[object Int32Array]",AT="[object Uint8Array]",OT="[object Uint8ClampedArray]",zT="[object Uint16Array]",RT="[object Uint32Array]";function NT(e,t,n){var r=e.constructor;switch(t){case ET:return lp(e);case yT:case xT:return new r(+e);case PT:return hT(e,n);case IT:case MT:case TT:case _T:case DT:case AT:case OT:case zT:case RT:return gT(e,n);case bT:return new r;case ST:case jT:return new r(e);case CT:return mT(e);case wT:return new r;case kT:return vT(e)}}var E0=Object.create,FT=function(){function e(){}return function(t){if(!gs(t))return{};if(E0)return E0(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const LT=FT;function BT(e){return typeof e.constructor=="function"&&!rp(e)?LT(tp(e)):{}}var HT="[object Map]";function WT(e){return ii(e)&&sp(e)==HT}var P0=Qi&&Qi.isMap,VT=P0?np(P0):WT;const UT=VT;var $T="[object Set]";function GT(e){return ii(e)&&sp(e)==$T}var I0=Qi&&Qi.isSet,qT=I0?np(I0):GT;const YT=qT;var KT=1,XT=2,QT=4,vb="[object Arguments]",ZT="[object Array]",JT="[object Boolean]",e_="[object Date]",t_="[object Error]",gb="[object Function]",n_="[object GeneratorFunction]",r_="[object Map]",o_="[object Number]",yb="[object Object]",i_="[object RegExp]",a_="[object Set]",s_="[object String]",l_="[object Symbol]",c_="[object WeakMap]",u_="[object ArrayBuffer]",d_="[object DataView]",f_="[object Float32Array]",h_="[object Float64Array]",p_="[object Int8Array]",m_="[object Int16Array]",v_="[object Int32Array]",g_="[object Uint8Array]",y_="[object Uint8ClampedArray]",x_="[object Uint16Array]",b_="[object Uint32Array]",xt={};xt[vb]=xt[ZT]=xt[u_]=xt[d_]=xt[JT]=xt[e_]=xt[f_]=xt[h_]=xt[p_]=xt[m_]=xt[v_]=xt[r_]=xt[o_]=xt[yb]=xt[i_]=xt[a_]=xt[s_]=xt[l_]=xt[g_]=xt[y_]=xt[x_]=xt[b_]=!0;xt[t_]=xt[gb]=xt[c_]=!1;function Ha(e,t,n,r,o,s){var c,u=t&KT,f=t&XT,h=t&QT;if(n&&(c=o?n(e,r,o,s):n(e)),c!==void 0)return c;if(!gs(e))return e;var m=ys(e);if(m){if(c=dT(e),!u)return db(e,c)}else{var v=sp(e),x=v==gb||v==n_;if(ib(e))return WM(e,u);if(v==yb||v==vb||x&&!o){if(c=f||x?{}:BT(e),!u)return f?XM(e,BM(c,e)):qM(e,zM(c,e))}else{if(!xt[v])return o?e:{};c=NT(e,v,u)}}s||(s=new sa);var S=s.get(e);if(S)return S;s.set(e,c),YT(e)?e.forEach(function(w){c.add(Ha(w,t,n,w,e,s))}):UT(e)&&e.forEach(function(w,k){c.set(k,Ha(w,t,n,k,e,s))});var C=h?f?ZM:QM:f?ip:op,j=m?void 0:C(e);return AI(j||e,function(w,k){j&&(k=w,w=e[k]),nb(c,k,Ha(w,t,n,k,e,s))}),c}var S_=4;function M0(e){return Ha(e,S_)}function xb(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var C_="[object Symbol]";function cp(e){return typeof e=="symbol"||ii(e)&&oi(e)==C_}var w_="Expected a function";function up(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(w_);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var c=e.apply(this,r);return n.cache=s.set(o,c)||s,c};return n.cache=new(up.Cache||Co),n}up.Cache=Co;var j_=500;function k_(e){var t=up(e,function(r){return n.size===j_&&n.clear(),r}),n=t.cache;return t}var E_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,P_=/\\(\\)?/g,I_=k_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(E_,function(n,r,o,s){t.push(o?s.replace(P_,"$1"):r||n)}),t});const M_=I_;var T_=1/0;function __(e){if(typeof e=="string"||cp(e))return e;var t=e+"";return t=="0"&&1/e==-T_?"-0":t}var D_=1/0,T0=go?go.prototype:void 0,_0=T0?T0.toString:void 0;function bb(e){if(typeof e=="string")return e;if(ys(e))return xb(e,bb)+"";if(cp(e))return _0?_0.call(e):"";var t=e+"";return t=="0"&&1/e==-D_?"-0":t}function A_(e){return e==null?"":bb(e)}function Sb(e){return ys(e)?xb(e,__):cp(e)?[e]:db(M_(A_(e)))}var O_=!0;function z_(e,t){if(!O_){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}var R_=1,N_=4;function F_(e){return Ha(e,R_|N_)}function pt(){return pt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pt.apply(this,arguments)}function L_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Vo(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function D0(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var A0=function(t){return Array.isArray(t)&&t.length===0},jn=function(t){return typeof t=="function"},Bc=function(t){return t!==null&&typeof t=="object"},B_=function(t){return String(Math.floor(Number(t)))===t},Bd=function(t){return Object.prototype.toString.call(t)==="[object String]"},Cb=function(t){return y.Children.count(t)===0},Hd=function(t){return Bc(t)&&jn(t.then)};function en(e,t,n,r){r===void 0&&(r=0);for(var o=Sb(t);e&&r<o.length;)e=e[o[r++]];return e===void 0?n:e}function wr(e,t,n){for(var r=M0(e),o=r,s=0,c=Sb(t);s<c.length-1;s++){var u=c[s],f=en(e,c.slice(0,s+1));if(f&&(Bc(f)||Array.isArray(f)))o=o[u]=M0(f);else{var h=c[s+1];o=o[u]=B_(h)&&Number(h)>=0?[]:{}}}return(s===0?e:o)[c[s]]===n?e:(n===void 0?delete o[c[s]]:o[c[s]]=n,s===0&&n===void 0&&delete r[c[s]],r)}function wb(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var o=0,s=Object.keys(e);o<s.length;o++){var c=s[o],u=e[c];Bc(u)?n.get(u)||(n.set(u,!0),r[c]=Array.isArray(u)?[]:{},wb(u,t,n,r[c])):r[c]=t}return r}var Hc=y.createContext(void 0);Hc.displayName="FormikContext";var H_=Hc.Provider;Hc.Consumer;function jb(){var e=y.useContext(Hc);return e||z_(!1),e}function W_(e,t){switch(t.type){case"SET_VALUES":return pt({},e,{values:t.payload});case"SET_TOUCHED":return pt({},e,{touched:t.payload});case"SET_ERRORS":return ao(e.errors,t.payload)?e:pt({},e,{errors:t.payload});case"SET_STATUS":return pt({},e,{status:t.payload});case"SET_ISSUBMITTING":return pt({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return pt({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return pt({},e,{values:wr(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return pt({},e,{touched:wr(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return pt({},e,{errors:wr(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return pt({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return pt({},e,{touched:wb(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return pt({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return pt({},e,{isSubmitting:!1});default:return e}}var No={},Al={};function V_(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,o=r===void 0?!0:r,s=e.validateOnMount,c=s===void 0?!1:s,u=e.isInitialValid,f=e.enableReinitialize,h=f===void 0?!1:f,m=e.onSubmit,v=Vo(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),x=pt({validateOnChange:n,validateOnBlur:o,validateOnMount:c,onSubmit:m},v),S=y.useRef(x.initialValues),C=y.useRef(x.initialErrors||No),j=y.useRef(x.initialTouched||Al),w=y.useRef(x.initialStatus),k=y.useRef(!1),M=y.useRef({});y.useEffect(function(){return k.current=!0,function(){k.current=!1}},[]);var P=y.useReducer(W_,{values:x.initialValues,errors:x.initialErrors||No,touched:x.initialTouched||Al,status:x.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),I=P[0],T=P[1],_=y.useCallback(function(N,ue){return new Promise(function(xe,je){var q=x.validate(N,ue);q==null?xe(No):Hd(q)?q.then(function(ae){xe(ae||No)},function(ae){je(ae)}):xe(q)})},[x.validate]),D=y.useCallback(function(N,ue){var xe=x.validationSchema,je=jn(xe)?xe(ue):xe,q=ue&&je.validateAt?je.validateAt(ue,N):$_(N,je);return new Promise(function(ae,Oe){q.then(function(){ae(No)},function(Ze){Ze.name==="ValidationError"?ae(U_(Ze)):Oe(Ze)})})},[x.validationSchema]),z=y.useCallback(function(N,ue){return new Promise(function(xe){return xe(M.current[N].validate(ue))})},[]),W=y.useCallback(function(N){var ue=Object.keys(M.current).filter(function(je){return jn(M.current[je].validate)}),xe=ue.length>0?ue.map(function(je){return z(je,en(N,je))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(xe).then(function(je){return je.reduce(function(q,ae,Oe){return ae==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||ae&&(q=wr(q,ue[Oe],ae)),q},{})})},[z]),F=y.useCallback(function(N){return Promise.all([W(N),x.validationSchema?D(N):{},x.validate?_(N):{}]).then(function(ue){var xe=ue[0],je=ue[1],q=ue[2],ae=Lf.all([xe,je,q],{arrayMerge:G_});return ae})},[x.validate,x.validationSchema,W,_,D]),B=Bn(function(N){return N===void 0&&(N=I.values),T({type:"SET_ISVALIDATING",payload:!0}),F(N).then(function(ue){return k.current&&(T({type:"SET_ISVALIDATING",payload:!1}),T({type:"SET_ERRORS",payload:ue})),ue})});y.useEffect(function(){c&&k.current===!0&&ao(S.current,x.initialValues)&&B(S.current)},[c,B]);var Q=y.useCallback(function(N){var ue=N&&N.values?N.values:S.current,xe=N&&N.errors?N.errors:C.current?C.current:x.initialErrors||{},je=N&&N.touched?N.touched:j.current?j.current:x.initialTouched||{},q=N&&N.status?N.status:w.current?w.current:x.initialStatus;S.current=ue,C.current=xe,j.current=je,w.current=q;var ae=function(){T({type:"RESET_FORM",payload:{isSubmitting:!!N&&!!N.isSubmitting,errors:xe,touched:je,status:q,values:ue,isValidating:!!N&&!!N.isValidating,submitCount:N&&N.submitCount&&typeof N.submitCount=="number"?N.submitCount:0}})};if(x.onReset){var Oe=x.onReset(I.values,ve);Hd(Oe)?Oe.then(ae):ae()}else ae()},[x.initialErrors,x.initialStatus,x.initialTouched]);y.useEffect(function(){k.current===!0&&!ao(S.current,x.initialValues)&&(h&&(S.current=x.initialValues,Q()),c&&B(S.current))},[h,x.initialValues,Q,c,B]),y.useEffect(function(){h&&k.current===!0&&!ao(C.current,x.initialErrors)&&(C.current=x.initialErrors||No,T({type:"SET_ERRORS",payload:x.initialErrors||No}))},[h,x.initialErrors]),y.useEffect(function(){h&&k.current===!0&&!ao(j.current,x.initialTouched)&&(j.current=x.initialTouched||Al,T({type:"SET_TOUCHED",payload:x.initialTouched||Al}))},[h,x.initialTouched]),y.useEffect(function(){h&&k.current===!0&&!ao(w.current,x.initialStatus)&&(w.current=x.initialStatus,T({type:"SET_STATUS",payload:x.initialStatus}))},[h,x.initialStatus,x.initialTouched]);var U=Bn(function(N){if(M.current[N]&&jn(M.current[N].validate)){var ue=en(I.values,N),xe=M.current[N].validate(ue);return Hd(xe)?(T({type:"SET_ISVALIDATING",payload:!0}),xe.then(function(je){return je}).then(function(je){T({type:"SET_FIELD_ERROR",payload:{field:N,value:je}}),T({type:"SET_ISVALIDATING",payload:!1})})):(T({type:"SET_FIELD_ERROR",payload:{field:N,value:xe}}),Promise.resolve(xe))}else if(x.validationSchema)return T({type:"SET_ISVALIDATING",payload:!0}),D(I.values,N).then(function(je){return je}).then(function(je){T({type:"SET_FIELD_ERROR",payload:{field:N,value:je[N]}}),T({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),X=y.useCallback(function(N,ue){var xe=ue.validate;M.current[N]={validate:xe}},[]),te=y.useCallback(function(N){delete M.current[N]},[]),re=Bn(function(N,ue){T({type:"SET_TOUCHED",payload:N});var xe=ue===void 0?o:ue;return xe?B(I.values):Promise.resolve()}),$=y.useCallback(function(N){T({type:"SET_ERRORS",payload:N})},[]),Z=Bn(function(N,ue){var xe=jn(N)?N(I.values):N;T({type:"SET_VALUES",payload:xe});var je=ue===void 0?n:ue;return je?B(xe):Promise.resolve()}),oe=y.useCallback(function(N,ue){T({type:"SET_FIELD_ERROR",payload:{field:N,value:ue}})},[]),le=Bn(function(N,ue,xe){T({type:"SET_FIELD_VALUE",payload:{field:N,value:ue}});var je=xe===void 0?n:xe;return je?B(wr(I.values,N,ue)):Promise.resolve()}),ze=y.useCallback(function(N,ue){var xe=ue,je=N,q;if(!Bd(N)){N.persist&&N.persist();var ae=N.target?N.target:N.currentTarget,Oe=ae.type,Ze=ae.name,J=ae.id,Le=ae.value,nt=ae.checked,Nt=ae.outerHTML,he=ae.options,_e=ae.multiple;xe=ue||Ze||J,je=/number|range/.test(Oe)?(q=parseFloat(Le),isNaN(q)?"":q):/checkbox/.test(Oe)?Y_(en(I.values,xe),nt,Le):he&&_e?q_(he):Le}xe&&le(xe,je)},[le,I.values]),Re=Bn(function(N){if(Bd(N))return function(ue){return ze(ue,N)};ze(N)}),Ie=Bn(function(N,ue,xe){ue===void 0&&(ue=!0),T({type:"SET_FIELD_TOUCHED",payload:{field:N,value:ue}});var je=xe===void 0?o:xe;return je?B(I.values):Promise.resolve()}),pe=y.useCallback(function(N,ue){N.persist&&N.persist();var xe=N.target,je=xe.name,q=xe.id,ae=xe.outerHTML,Oe=ue||je||q;Ie(Oe,!0)},[Ie]),ce=Bn(function(N){if(Bd(N))return function(ue){return pe(ue,N)};pe(N)}),Ne=y.useCallback(function(N){jn(N)?T({type:"SET_FORMIK_STATE",payload:N}):T({type:"SET_FORMIK_STATE",payload:function(){return N}})},[]),Ve=y.useCallback(function(N){T({type:"SET_STATUS",payload:N})},[]),Ue=y.useCallback(function(N){T({type:"SET_ISSUBMITTING",payload:N})},[]),$e=Bn(function(){return T({type:"SUBMIT_ATTEMPT"}),B().then(function(N){var ue=N instanceof Error,xe=!ue&&Object.keys(N).length===0;if(xe){var je;try{if(je=Te(),je===void 0)return}catch(q){throw q}return Promise.resolve(je).then(function(q){return k.current&&T({type:"SUBMIT_SUCCESS"}),q}).catch(function(q){if(k.current)throw T({type:"SUBMIT_FAILURE"}),q})}else if(k.current&&(T({type:"SUBMIT_FAILURE"}),ue))throw N})}),Qe=Bn(function(N){N&&N.preventDefault&&jn(N.preventDefault)&&N.preventDefault(),N&&N.stopPropagation&&jn(N.stopPropagation)&&N.stopPropagation(),$e().catch(function(ue){console.warn("Warning: An unhandled error was caught from submitForm()",ue)})}),ve={resetForm:Q,validateForm:B,validateField:U,setErrors:$,setFieldError:oe,setFieldTouched:Ie,setFieldValue:le,setStatus:Ve,setSubmitting:Ue,setTouched:re,setValues:Z,setFormikState:Ne,submitForm:$e},Te=Bn(function(){return m(I.values,ve)}),Ge=Bn(function(N){N&&N.preventDefault&&jn(N.preventDefault)&&N.preventDefault(),N&&N.stopPropagation&&jn(N.stopPropagation)&&N.stopPropagation(),Q()}),ye=y.useCallback(function(N){return{value:en(I.values,N),error:en(I.errors,N),touched:!!en(I.touched,N),initialValue:en(S.current,N),initialTouched:!!en(j.current,N),initialError:en(C.current,N)}},[I.errors,I.touched,I.values]),Pe=y.useCallback(function(N){return{setValue:function(xe,je){return le(N,xe,je)},setTouched:function(xe,je){return Ie(N,xe,je)},setError:function(xe){return oe(N,xe)}}},[le,Ie,oe]),et=y.useCallback(function(N){var ue=Bc(N),xe=ue?N.name:N,je=en(I.values,xe),q={name:xe,value:je,onChange:Re,onBlur:ce};if(ue){var ae=N.type,Oe=N.value,Ze=N.as,J=N.multiple;ae==="checkbox"?Oe===void 0?q.checked=!!je:(q.checked=!!(Array.isArray(je)&&~je.indexOf(Oe)),q.value=Oe):ae==="radio"?(q.checked=je===Oe,q.value=Oe):Ze==="select"&&J&&(q.value=q.value||[],q.multiple=!0)}return q},[ce,Re,I.values]),Be=y.useMemo(function(){return!ao(S.current,I.values)},[S.current,I.values]),vt=y.useMemo(function(){return typeof u<"u"?Be?I.errors&&Object.keys(I.errors).length===0:u!==!1&&jn(u)?u(x):u:I.errors&&Object.keys(I.errors).length===0},[u,Be,I.errors,x]),Rt=pt({},I,{initialValues:S.current,initialErrors:C.current,initialTouched:j.current,initialStatus:w.current,handleBlur:ce,handleChange:Re,handleReset:Ge,handleSubmit:Qe,resetForm:Q,setErrors:$,setFormikState:Ne,setFieldTouched:Ie,setFieldValue:le,setFieldError:oe,setStatus:Ve,setSubmitting:Ue,setTouched:re,setValues:Z,submitForm:$e,validateForm:B,validateField:U,isValid:vt,dirty:Be,unregisterField:te,registerField:X,getFieldProps:et,getFieldMeta:ye,getFieldHelpers:Pe,validateOnBlur:o,validateOnChange:n,validateOnMount:c});return Rt}function xs(e){var t=V_(e),n=e.component,r=e.children,o=e.render,s=e.innerRef;return y.useImperativeHandle(s,function(){return t}),y.createElement(H_,{value:t},n?y.createElement(n,t):o?o(t):r?jn(r)?r(t):Cb(r)?null:y.Children.only(r):null)}function U_(e){var t={};if(e.inner){if(e.inner.length===0)return wr(t,e.path,e.message);for(var o=e.inner,n=Array.isArray(o),r=0,o=n?o:o[Symbol.iterator]();;){var s;if(n){if(r>=o.length)break;s=o[r++]}else{if(r=o.next(),r.done)break;s=r.value}var c=s;en(t,c.path)||(t=wr(t,c.path,c.message))}}return t}function $_(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var o=Uf(e);return t[n?"validateSync":"validate"](o,{abortEarly:!1,context:r})}function Uf(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(o){return Array.isArray(o)===!0||s0(o)?Uf(o):o!==""?o:void 0}):s0(e[r])?t[r]=Uf(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function G_(e,t,n){var r=e.slice();return t.forEach(function(s,c){if(typeof r[c]>"u"){var u=n.clone!==!1,f=u&&n.isMergeableObject(s);r[c]=f?Lf(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[c]=Lf(e[c],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function q_(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function Y_(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],o=!1,s=-1;if(Array.isArray(e))r=e,s=e.indexOf(n),o=s>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!o?r.concat(n):o?r.slice(0,s).concat(r.slice(s+1)):r}var K_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?y.useLayoutEffect:y.useEffect;function Bn(e){var t=y.useRef(e);return K_(function(){t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current.apply(void 0,r)},[])}function jt(e){var t=e.validate,n=e.name,r=e.render,o=e.children,s=e.as,c=e.component,u=Vo(e,["validate","name","render","children","as","component"]),f=jb(),h=Vo(f,["validate","validationSchema"]),m=h.registerField,v=h.unregisterField;y.useEffect(function(){return m(n,{validate:t}),function(){v(n)}},[m,v,n,t]);var x=h.getFieldProps(pt({name:n},u)),S=h.getFieldMeta(n),C={field:x,form:h};if(r)return r(pt({},C,{meta:S}));if(jn(o))return o(pt({},C,{meta:S}));if(c){if(typeof c=="string"){var j=u.innerRef,w=Vo(u,["innerRef"]);return y.createElement(c,pt({ref:j},x,w),o)}return y.createElement(c,pt({field:x,form:h},u),o)}var k=s||"input";if(typeof k=="string"){var M=u.innerRef,P=Vo(u,["innerRef"]);return y.createElement(k,pt({ref:M},x,P),o)}return y.createElement(k,pt({},x,u),o)}var X_=y.forwardRef(function(e,t){var n=e.action,r=Vo(e,["action"]),o=n??"#",s=jb(),c=s.handleReset,u=s.handleSubmit;return y.createElement("form",Object.assign({onSubmit:u,ref:t,onReset:c,action:o},r))});X_.displayName="Form";var Q_=function(t,n,r){var o=Zi(t),s=o[n];return o.splice(n,1),o.splice(r,0,s),o},Z_=function(t,n,r){var o=Zi(t),s=o[n];return o[n]=o[r],o[r]=s,o},Wd=function(t,n,r){var o=Zi(t);return o.splice(n,0,r),o},J_=function(t,n,r){var o=Zi(t);return o[n]=r,o},Zi=function(t){if(t){if(Array.isArray(t))return[].concat(t);var n=Object.keys(t).map(function(r){return parseInt(r)}).reduce(function(r,o){return o>r?o:r},0);return Array.from(pt({},t,{length:n+1}))}else return[]},eD=function(e){L_(t,e);function t(r){var o;return o=e.call(this,r)||this,o.updateArrayField=function(s,c,u){var f=o.props,h=f.name,m=f.formik.setFormikState;m(function(v){var x=typeof u=="function"?u:s,S=typeof c=="function"?c:s,C=wr(v.values,h,s(en(v.values,h))),j=u?x(en(v.errors,h)):void 0,w=c?S(en(v.touched,h)):void 0;return A0(j)&&(j=void 0),A0(w)&&(w=void 0),pt({},v,{values:C,errors:u?wr(v.errors,h,j):v.errors,touched:c?wr(v.touched,h,w):v.touched})})},o.push=function(s){return o.updateArrayField(function(c){return[].concat(Zi(c),[F_(s)])},!1,!1)},o.handlePush=function(s){return function(){return o.push(s)}},o.swap=function(s,c){return o.updateArrayField(function(u){return Z_(u,s,c)},!0,!0)},o.handleSwap=function(s,c){return function(){return o.swap(s,c)}},o.move=function(s,c){return o.updateArrayField(function(u){return Q_(u,s,c)},!0,!0)},o.handleMove=function(s,c){return function(){return o.move(s,c)}},o.insert=function(s,c){return o.updateArrayField(function(u){return Wd(u,s,c)},function(u){return Wd(u,s,null)},function(u){return Wd(u,s,null)})},o.handleInsert=function(s,c){return function(){return o.insert(s,c)}},o.replace=function(s,c){return o.updateArrayField(function(u){return J_(u,s,c)},!1,!1)},o.handleReplace=function(s,c){return function(){return o.replace(s,c)}},o.unshift=function(s){var c=-1;return o.updateArrayField(function(u){var f=u?[s].concat(u):[s];return c<0&&(c=f.length),f},function(u){var f=u?[null].concat(u):[null];return c<0&&(c=f.length),f},function(u){var f=u?[null].concat(u):[null];return c<0&&(c=f.length),f}),c},o.handleUnshift=function(s){return function(){return o.unshift(s)}},o.handleRemove=function(s){return function(){return o.remove(s)}},o.handlePop=function(){return function(){return o.pop()}},o.remove=o.remove.bind(D0(o)),o.pop=o.pop.bind(D0(o)),o}var n=t.prototype;return n.componentDidUpdate=function(o){this.props.validateOnChange&&this.props.formik.validateOnChange&&!ao(en(o.formik.values,o.name),en(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(o){var s;return this.updateArrayField(function(c){var u=c?Zi(c):[];return s||(s=u[o]),jn(u.splice)&&u.splice(o,1),u},!0,!0),s},n.pop=function(){var o;return this.updateArrayField(function(s){var c=s;return o||(o=c&&c.pop&&c.pop()),c},!0,!0),o},n.render=function(){var o={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},s=this.props,c=s.component,u=s.render,f=s.children,h=s.name,m=s.formik,v=Vo(m,["validate","validationSchema"]),x=pt({},o,{form:v,name:h});return c?y.createElement(c,x):u?u(x):f?typeof f=="function"?f(x):Cb(f)?null:y.Children.only(f):null},t}(y.Component);eD.defaultProps={validateOnChange:!0};const tD=fe((e,t)=>{const{t:n}=K(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:c,children:u,title:f,triggerComponent:h}=e,{isOpen:m,onOpen:v,onClose:x}=po(),S=y.useRef(null),C=()=>{o(),x()},j=()=>{c&&c(),x()};return l.jsxs(l.Fragment,{children:[y.cloneElement(h,{onClick:v,ref:t}),l.jsx(qy,{isOpen:m,leastDestructiveRef:S,onClose:x,isCentered:!0,children:l.jsx(Hr,{children:l.jsxs(Yy,{children:[l.jsx(Br,{fontSize:"lg",fontWeight:"bold",children:f}),l.jsx(Wr,{children:u}),l.jsxs(Lr,{children:[l.jsx(Je,{ref:S,onClick:j,children:s}),l.jsx(Je,{colorScheme:"error",onClick:C,ml:3,children:r})]})]})})})]})}),Wc=y.memo(tD);function nD(e){const{model:t}=e,r=A(C=>C.system.model_list)[t],o=Y(),{t:s}=K(),c=A(C=>C.system.isProcessing),u=A(C=>C.system.isConnected),[f,h]=y.useState("same"),[m,v]=y.useState("");y.useEffect(()=>{h("same")},[t]);const x=()=>{h("same")},S=()=>{o(US({model_name:t,save_location:f,custom_location:f==="custom"&&m!==""?m:null}))};return l.jsxs(Wc,{title:`${s("modelManager.convert")} ${t}`,acceptCallback:S,cancelCallback:x,acceptButtonText:`${s("modelManager.convert")}`,triggerComponent:l.jsxs(Je,{size:"sm","aria-label":s("modelManager.convertToDiffusers"),isDisabled:r.status==="active"||c||!u,className:" modal-close-btn",marginInlineEnd:8,children:["🧨 ",s("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[l.jsxs(L,{flexDirection:"column",rowGap:4,children:[l.jsx(Ce,{children:s("modelManager.convertToDiffusersHelpText1")}),l.jsxs(my,{children:[l.jsx(Ra,{children:s("modelManager.convertToDiffusersHelpText2")}),l.jsx(Ra,{children:s("modelManager.convertToDiffusersHelpText3")}),l.jsx(Ra,{children:s("modelManager.convertToDiffusersHelpText4")}),l.jsx(Ra,{children:s("modelManager.convertToDiffusersHelpText5")})]}),l.jsx(Ce,{children:s("modelManager.convertToDiffusersHelpText6")})]}),l.jsxs(L,{flexDir:"column",gap:4,children:[l.jsxs(L,{marginTop:4,flexDir:"column",gap:2,children:[l.jsx(Ce,{fontWeight:"600",children:s("modelManager.convertToDiffusersSaveLocation")}),l.jsx(Qa,{value:f,onChange:C=>h(C),children:l.jsxs(L,{gap:4,children:[l.jsx(vn,{value:"same",children:l.jsx(Gt,{label:"Save converted model in the same folder",children:s("modelManager.sameFolder")})}),l.jsx(vn,{value:"root",children:l.jsx(Gt,{label:"Save converted model in the InvokeAI root folder",children:s("modelManager.invokeRoot")})}),l.jsx(vn,{value:"custom",children:l.jsx(Gt,{label:"Save converted model in a custom folder",children:s("modelManager.custom")})})]})})]}),f==="custom"&&l.jsxs(L,{flexDirection:"column",rowGap:2,children:[l.jsx(Ce,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:s("modelManager.customSaveLocation")}),l.jsx(mt,{value:m,onChange:C=>{C.target.value!==""&&v(C.target.value)},width:"full"})]})]})]})}function tr(e){const{children:t,...n}=e;return l.jsx(pn,{margin:0,color:"base.400",...n,children:t})}function nr(e){const{children:t,...n}=e;return l.jsx(mn,{color:"error.400",...n,children:t})}const bs=ne.form,rD=me([Et],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),O0=64,z0=2048;function oD(){const{openModel:e,model_list:t}=A(rD),n=A(f=>f.system.isProcessing),r=Y(),{t:o}=K(),[s,c]=y.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});y.useEffect(()=>{var f,h,m,v,x,S,C;if(e){const j=ee.pickBy(t,(w,k)=>ee.isEqual(k,e));c({name:e,description:(f=j[e])==null?void 0:f.description,config:(h=j[e])==null?void 0:h.config,weights:(m=j[e])==null?void 0:m.weights,vae:(v=j[e])==null?void 0:v.vae,width:(x=j[e])==null?void 0:x.width,height:(S=j[e])==null?void 0:S.height,default:(C=j[e])==null?void 0:C.default,format:"ckpt"})}},[t,e]);const u=f=>{r(os({...f,width:Number(f.width),height:Number(f.height)}))};return e?l.jsxs(L,{flexDirection:"column",rowGap:4,width:"100%",children:[l.jsxs(L,{alignItems:"center",gap:4,justifyContent:"space-between",children:[l.jsx(Ce,{fontSize:"lg",fontWeight:"bold",children:e}),l.jsx(nD,{model:e})]}),l.jsx(L,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingInlineEnd:8,children:l.jsx(xs,{enableReinitialize:!0,initialValues:s,onSubmit:u,children:({handleSubmit:f,errors:h,touched:m})=>l.jsx(bs,{onSubmit:f,children:l.jsxs(Fe,{rowGap:2,alignItems:"start",children:[l.jsxs(rt,{isInvalid:!!h.description&&m.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:o("modelManager.description")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"description",name:"description",type:"text",width:"full"}),h.description&&m.description?l.jsx(nr,{children:h.description}):l.jsx(tr,{children:o("modelManager.descriptionValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.config&&m.config,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:o("modelManager.config")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"config",name:"config",type:"text",width:"full"}),h.config&&m.config?l.jsx(nr,{children:h.config}):l.jsx(tr,{children:o("modelManager.configValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.weights&&m.weights,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:o("modelManager.modelLocation")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"weights",name:"weights",type:"text",width:"full"}),h.weights&&m.weights?l.jsx(nr,{children:h.weights}):l.jsx(tr,{children:o("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.vae&&m.vae,children:[l.jsx(st,{htmlFor:"vae",fontSize:"sm",children:o("modelManager.vaeLocation")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae",name:"vae",type:"text",width:"full"}),h.vae&&m.vae?l.jsx(nr,{children:h.vae}):l.jsx(tr,{children:o("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(oa,{width:"100%",children:[l.jsxs(rt,{isInvalid:!!h.width&&m.width,children:[l.jsx(st,{htmlFor:"width",fontSize:"sm",children:o("modelManager.width")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{id:"width",name:"width",children:({field:v,form:x})=>l.jsx(Vr,{id:"width",name:"width",min:O0,max:z0,step:64,value:x.values.width,onChange:S=>x.setFieldValue(v.name,Number(S))})}),h.width&&m.width?l.jsx(nr,{children:h.width}):l.jsx(tr,{children:o("modelManager.widthValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.height&&m.height,children:[l.jsx(st,{htmlFor:"height",fontSize:"sm",children:o("modelManager.height")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{id:"height",name:"height",children:({field:v,form:x})=>l.jsx(Vr,{id:"height",name:"height",min:O0,max:z0,step:64,value:x.values.height,onChange:S=>x.setFieldValue(v.name,Number(S))})}),h.height&&m.height?l.jsx(nr,{children:h.height}):l.jsx(tr,{children:o("modelManager.heightValidationMsg")})]})]})]}),l.jsx(Je,{type:"submit",className:"modal-close-btn",isLoading:n,children:o("modelManager.updateModel")})]})})})})]}):l.jsx(L,{sx:{width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"base",bg:"base.900"},children:l.jsx(Ce,{fontWeight:500,children:"Pick A Model To Edit"})})}const iD=me([Et],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function aD(){const{openModel:e,model_list:t}=A(iD),n=A(f=>f.system.isProcessing),r=Y(),{t:o}=K(),[s,c]=y.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});y.useEffect(()=>{var f,h,m,v,x,S,C,j,w,k,M,P,I,T,_,D;if(e){const z=ee.pickBy(t,(W,F)=>ee.isEqual(F,e));c({name:e,description:(f=z[e])==null?void 0:f.description,path:(h=z[e])!=null&&h.path&&((m=z[e])==null?void 0:m.path)!=="None"?(v=z[e])==null?void 0:v.path:"",repo_id:(x=z[e])!=null&&x.repo_id&&((S=z[e])==null?void 0:S.repo_id)!=="None"?(C=z[e])==null?void 0:C.repo_id:"",vae:{repo_id:(w=(j=z[e])==null?void 0:j.vae)!=null&&w.repo_id?(M=(k=z[e])==null?void 0:k.vae)==null?void 0:M.repo_id:"",path:(I=(P=z[e])==null?void 0:P.vae)!=null&&I.path?(_=(T=z[e])==null?void 0:T.vae)==null?void 0:_.path:""},default:(D=z[e])==null?void 0:D.default,format:"diffusers"})}},[t,e]);const u=f=>{const h=f;f.path===""&&delete h.path,f.repo_id===""&&delete h.repo_id,f.vae.path===""&&delete h.vae.path,f.vae.repo_id===""&&delete h.vae.repo_id,r(os(f))};return e?l.jsxs(L,{flexDirection:"column",rowGap:4,width:"100%",children:[l.jsx(L,{alignItems:"center",children:l.jsx(Ce,{fontSize:"lg",fontWeight:"bold",children:e})}),l.jsx(L,{flexDirection:"column",overflowY:"scroll",paddingInlineEnd:8,children:l.jsx(xs,{enableReinitialize:!0,initialValues:s,onSubmit:u,children:({handleSubmit:f,errors:h,touched:m})=>{var v,x,S,C,j,w,k,M,P,I;return l.jsx(bs,{onSubmit:f,children:l.jsxs(Fe,{rowGap:2,alignItems:"start",children:[l.jsxs(rt,{isInvalid:!!h.description&&m.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:o("modelManager.description")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"description",name:"description",type:"text",width:"full"}),h.description&&m.description?l.jsx(nr,{children:h.description}):l.jsx(tr,{children:o("modelManager.descriptionValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.path&&m.path,isRequired:!0,children:[l.jsx(st,{htmlFor:"path",fontSize:"sm",children:o("modelManager.modelLocation")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"path",name:"path",type:"text",width:"full"}),h.path&&m.path?l.jsx(nr,{children:h.path}):l.jsx(tr,{children:o("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.repo_id&&m.repo_id,children:[l.jsx(st,{htmlFor:"repo_id",fontSize:"sm",children:o("modelManager.repo_id")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"repo_id",name:"repo_id",type:"text",width:"full"}),h.repo_id&&m.repo_id?l.jsx(nr,{children:h.repo_id}):l.jsx(tr,{children:o("modelManager.repoIDValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((v=h.vae)!=null&&v.path)&&((x=m.vae)==null?void 0:x.path),children:[l.jsx(st,{htmlFor:"vae.path",fontSize:"sm",children:o("modelManager.vaeLocation")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae.path",name:"vae.path",type:"text",width:"full"}),(S=h.vae)!=null&&S.path&&((C=m.vae)!=null&&C.path)?l.jsx(nr,{children:(j=h.vae)==null?void 0:j.path}):l.jsx(tr,{children:o("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((w=h.vae)!=null&&w.repo_id)&&((k=m.vae)==null?void 0:k.repo_id),children:[l.jsx(st,{htmlFor:"vae.repo_id",fontSize:"sm",children:o("modelManager.vaeRepoID")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"full"}),(M=h.vae)!=null&&M.repo_id&&((P=m.vae)!=null&&P.repo_id)?l.jsx(nr,{children:(I=h.vae)==null?void 0:I.repo_id}):l.jsx(tr,{children:o("modelManager.vaeRepoIDValidationMsg")})]})]}),l.jsx(Je,{type:"submit",className:"modal-close-btn",isLoading:n,children:o("modelManager.updateModel")})]})})}})})]}):l.jsx(L,{sx:{width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"base",bg:"base.900"},children:l.jsx(Ce,{fontWeight:"500",children:"Pick A Model To Edit"})})}const sD=e=>{const{label:t,...n}=e;return l.jsx(k2,{colorScheme:"accent",...n,children:t})},ft=y.memo(sD),kb=me([Et],e=>{const{model_list:t}=e,n=[];return ee.forEach(t,r=>{n.push(r.weights)}),n});function R0({model:e,modelsToAdd:t,setModelsToAdd:n}){const{t:r}=K(),o=A(kb),s=c=>{t.includes(c.target.value)?n(ee.remove(t,u=>u!==c.target.value)):n([...t,c.target.value])};return l.jsxs(L,{flexDirection:"column",gap:2,backgroundColor:t.includes(e.name)?"accent.650":"base.800",paddingX:4,paddingY:2,borderRadius:4,children:[l.jsxs(L,{gap:4,alignItems:"center",justifyContent:"space-between",children:[l.jsx(ft,{value:e.name,label:l.jsx(Ce,{fontWeight:500,children:e.name}),isChecked:t.includes(e.name),isDisabled:o.includes(e.location),onChange:s}),o.includes(e.location)&&l.jsx(xy,{colorScheme:"accent",children:r("modelManager.modelExists")})]}),l.jsx(Ce,{fontStyle:"italic",variant:"subtext",children:e.location})]})}function lD(){const e=Y(),{t}=K(),n=A(P=>P.system.searchFolder),r=A(P=>P.system.foundModels),o=A(kb),s=A(P=>P.ui.shouldShowExistingModelsInSearch),c=A(P=>P.system.isProcessing),[u,f]=Me.useState([]),[h,m]=Me.useState("v1"),[v,x]=Me.useState(""),S=()=>{e(GS(null)),e(qS(null)),f([])},C=P=>{e(Pv(P.checkpointFolder))},j=()=>{f([]),r&&r.forEach(P=>{o.includes(P.location)||f(I=>[...I,P.name])})},w=()=>{f([])},k=()=>{const P=r==null?void 0:r.filter(T=>u.includes(T.name)),I={v1:"configs/stable-diffusion/v1-inference.yaml",v2_base:"configs/stable-diffusion/v2-inference-v.yaml",v2_768:"configs/stable-diffusion/v2-inference-v.yaml",inpainting:"configs/stable-diffusion/v1-inpainting-inference.yaml",custom:v};P==null||P.forEach(T=>{const _={name:T.name,description:"",config:I[h],weights:T.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(os(_))}),f([])},M=()=>{const P=[],I=[];return r&&r.forEach((T,_)=>{o.includes(T.location)?I.push(l.jsx(R0,{model:T,modelsToAdd:u,setModelsToAdd:f},_)):P.push(l.jsx(R0,{model:T,modelsToAdd:u,setModelsToAdd:f},_))}),l.jsxs(L,{flexDirection:"column",rowGap:4,children:[P,s&&I]})};return l.jsxs(l.Fragment,{children:[n?l.jsxs(L,{sx:{padding:4,gap:2,position:"relative",borderRadius:"base",alignItems:"center",w:"full",bg:"base.900"},children:[l.jsxs(L,{sx:{flexDir:"column",gap:2},children:[l.jsx(Ce,{sx:{fontWeight:500},variant:"subtext",children:t("modelManager.checkpointFolder")}),l.jsx(Ce,{sx:{fontWeight:500},children:n})]}),l.jsx(kc,{}),l.jsx(se,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:l.jsx(e0,{}),fontSize:18,disabled:c,onClick:()=>e(Pv(n))}),l.jsx(se,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:l.jsx(So,{}),onClick:S})]}):l.jsx(xs,{initialValues:{checkpointFolder:""},onSubmit:P=>{C(P)},children:({handleSubmit:P})=>l.jsx(bs,{onSubmit:P,width:"100%",children:l.jsxs(oa,{columnGap:2,alignItems:"flex-end",children:[l.jsx(rt,{flexGrow:1,children:l.jsx(jt,{as:mt,id:"checkpointFolder",name:"checkpointFolder",type:"text",size:"md",label:t("modelManager.checkpointFolder")})}),l.jsx(Je,{leftIcon:l.jsx(e0,{}),"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),type:"submit",disabled:c,px:8,children:t("modelManager.findModels")})]})})}),r&&l.jsxs(L,{flexDirection:"column",rowGap:4,width:"full",children:[l.jsxs(L,{justifyContent:"space-between",alignItems:"center",children:[l.jsxs("p",{children:[t("modelManager.modelsFound"),": ",r.length]}),l.jsxs("p",{children:[t("modelManager.selected"),": ",u.length]})]}),l.jsxs(L,{columnGap:2,justifyContent:"space-between",children:[l.jsxs(L,{columnGap:2,children:[l.jsx(Je,{isDisabled:u.length===r.length,onClick:j,children:t("modelManager.selectAll")}),l.jsx(Je,{isDisabled:u.length===0,onClick:w,children:t("modelManager.deselectAll")}),l.jsx(ft,{label:t("modelManager.showExisting"),isChecked:s,onChange:()=>e($S(!s))})]}),l.jsx(Je,{isDisabled:u.length===0,onClick:k,colorScheme:"accent",children:t("modelManager.addSelected")})]}),l.jsxs(L,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:[l.jsxs(L,{gap:4,children:[l.jsx(Ce,{fontWeight:500,variant:"subtext",children:t("modelManager.pickModelType")}),l.jsx(Qa,{value:h,onChange:P=>m(P),defaultValue:"v1",name:"model_type",children:l.jsxs(L,{gap:4,children:[l.jsx(vn,{value:"v1",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.v1")})}),l.jsx(vn,{value:"v2_base",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.v2_base")})}),l.jsx(vn,{value:"v2_768",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.v2_768")})}),l.jsx(vn,{value:"inpainting",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.inpainting")})}),l.jsx(vn,{value:"custom",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.customConfig")})})]})})]}),h==="custom"&&l.jsxs(L,{flexDirection:"column",rowGap:2,children:[l.jsx(Ce,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:t("modelManager.pathToCustomConfig")}),l.jsx(mt,{value:v,onChange:P=>{P.target.value!==""&&x(P.target.value)},width:"full"})]})]}),l.jsx(L,{flexDirection:"column",maxHeight:72,overflowY:"scroll",borderRadius:"sm",gap:2,children:r.length>0?M():l.jsx(Ce,{fontWeight:"500",padding:2,borderRadius:"sm",textAlign:"center",variant:"subtext",children:t("modelManager.noModelsFound")})})]})]})}function er({children:e}){return l.jsx(L,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:e})}const N0=64,F0=2048;function cD(){const e=Y(),{t}=K(),n=A(h=>h.system.isProcessing);function r(h){return/\s/.test(h)}function o(h){let m;return r(h)&&(m=t("modelManager.cannotUseSpaces")),m}const s={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},c=h=>{e(os(h)),e(Di(null))},[u,f]=Me.useState(!1);return l.jsxs(Fe,{gap:2,alignItems:"flex-start",children:[l.jsxs(L,{columnGap:4,children:[l.jsx(ft,{isChecked:!u,label:t("modelManager.scanForModels"),onChange:()=>f(!u)}),l.jsx(ft,{label:t("modelManager.addManually"),isChecked:u,onChange:()=>f(!u)})]}),u?l.jsx(xs,{initialValues:s,onSubmit:c,children:({handleSubmit:h,errors:m,touched:v})=>l.jsx(bs,{onSubmit:h,sx:{w:"full"},children:l.jsxs(Fe,{rowGap:2,children:[l.jsx(Ce,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelManager.manual")}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!m.name&&v.name,isRequired:!0,children:[l.jsx(st,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"name",name:"name",type:"text",validate:o,width:"full"}),m.name&&v.name?l.jsx(mn,{children:m.name}):l.jsx(pn,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!m.description&&v.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"description",name:"description",type:"text",width:"full"}),m.description&&v.description?l.jsx(mn,{children:m.description}):l.jsx(pn,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!m.config&&v.config,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:t("modelManager.config")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"config",name:"config",type:"text",width:"full"}),m.config&&v.config?l.jsx(mn,{children:m.config}):l.jsx(pn,{margin:0,children:t("modelManager.configValidationMsg")})]})]})}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!m.weights&&v.weights,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:t("modelManager.modelLocation")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"weights",name:"weights",type:"text",width:"full"}),m.weights&&v.weights?l.jsx(mn,{children:m.weights}):l.jsx(pn,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]})}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!m.vae&&v.vae,children:[l.jsx(st,{htmlFor:"vae",fontSize:"sm",children:t("modelManager.vaeLocation")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae",name:"vae",type:"text",width:"full"}),m.vae&&v.vae?l.jsx(mn,{children:m.vae}):l.jsx(pn,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]})}),l.jsxs(oa,{width:"100%",children:[l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!m.width&&v.width,children:[l.jsx(st,{htmlFor:"width",fontSize:"sm",children:t("modelManager.width")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{id:"width",name:"width",children:({field:x,form:S})=>l.jsx(Vr,{id:"width",name:"width",min:N0,max:F0,step:64,value:S.values.width,onChange:C=>S.setFieldValue(x.name,Number(C))})}),m.width&&v.width?l.jsx(mn,{children:m.width}):l.jsx(pn,{margin:0,children:t("modelManager.widthValidationMsg")})]})]})}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!m.height&&v.height,children:[l.jsx(st,{htmlFor:"height",fontSize:"sm",children:t("modelManager.height")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{id:"height",name:"height",children:({field:x,form:S})=>l.jsx(Vr,{id:"height",name:"height",min:N0,max:F0,step:64,value:S.values.height,onChange:C=>S.setFieldValue(x.name,Number(C))})}),m.height&&v.height?l.jsx(mn,{children:m.height}):l.jsx(pn,{margin:0,children:t("modelManager.heightValidationMsg")})]})]})})]}),l.jsx(Je,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelManager.addModel")})]})})}):l.jsx(lD,{})]})}function uD(){const e=Y(),{t}=K(),n=A(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function o(u){let f;return r(u)&&(f=t("modelManager.cannotUseSpaces")),f}const s={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},c=u=>{const f=u;u.path===""&&delete f.path,u.repo_id===""&&delete f.repo_id,u.vae.path===""&&delete f.vae.path,u.vae.repo_id===""&&delete f.vae.repo_id,e(os(f)),e(Di(null))};return l.jsx(L,{children:l.jsx(xs,{initialValues:s,onSubmit:c,children:({handleSubmit:u,errors:f,touched:h})=>{var m,v,x,S,C,j,w,k,M,P;return l.jsx(bs,{onSubmit:u,children:l.jsxs(Fe,{rowGap:2,children:[l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!f.name&&h.name,isRequired:!0,children:[l.jsx(st,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"name",name:"name",type:"text",validate:o,width:"2xl",isRequired:!0}),f.name&&h.name?l.jsx(mn,{children:f.name}):l.jsx(pn,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!f.description&&h.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),f.description&&h.description?l.jsx(mn,{children:f.description}):l.jsx(pn,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),l.jsxs(er,{children:[l.jsx(Ce,{fontWeight:"bold",fontSize:"sm",children:t("modelManager.formMessageDiffusersModelLocation")}),l.jsx(Ce,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersModelLocationDesc")}),l.jsxs(rt,{isInvalid:!!f.path&&h.path,children:[l.jsx(st,{htmlFor:"path",fontSize:"sm",children:t("modelManager.modelLocation")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"path",name:"path",type:"text",width:"2xl"}),f.path&&h.path?l.jsx(mn,{children:f.path}):l.jsx(pn,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!f.repo_id&&h.repo_id,children:[l.jsx(st,{htmlFor:"repo_id",fontSize:"sm",children:t("modelManager.repo_id")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),f.repo_id&&h.repo_id?l.jsx(mn,{children:f.repo_id}):l.jsx(pn,{margin:0,children:t("modelManager.repoIDValidationMsg")})]})]})]}),l.jsxs(er,{children:[l.jsx(Ce,{fontWeight:"bold",children:t("modelManager.formMessageDiffusersVAELocation")}),l.jsx(Ce,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersVAELocationDesc")}),l.jsxs(rt,{isInvalid:!!((m=f.vae)!=null&&m.path)&&((v=h.vae)==null?void 0:v.path),children:[l.jsx(st,{htmlFor:"vae.path",fontSize:"sm",children:t("modelManager.vaeLocation")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(x=f.vae)!=null&&x.path&&((S=h.vae)!=null&&S.path)?l.jsx(mn,{children:(C=f.vae)==null?void 0:C.path}):l.jsx(pn,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((j=f.vae)!=null&&j.repo_id)&&((w=h.vae)==null?void 0:w.repo_id),children:[l.jsx(st,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelManager.vaeRepoID")}),l.jsxs(Fe,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(k=f.vae)!=null&&k.repo_id&&((M=h.vae)!=null&&M.repo_id)?l.jsx(mn,{children:(P=f.vae)==null?void 0:P.repo_id}):l.jsx(pn,{margin:0,children:t("modelManager.vaeRepoIDValidationMsg")})]})]})]}),l.jsx(Je,{type:"submit",isLoading:n,children:t("modelManager.addModel")})]})})}})})}function L0({text:e,onClick:t}){return l.jsx(L,{position:"relative",width:"50%",height:40,justifyContent:"center",alignItems:"center",onClick:t,as:ni,children:l.jsx(Ce,{fontWeight:"bold",children:e})})}function dD(){const{isOpen:e,onOpen:t,onClose:n}=po(),r=A(u=>u.ui.addNewModelUIOption),o=Y(),{t:s}=K(),c=()=>{n(),o(Di(null))};return l.jsxs(l.Fragment,{children:[l.jsx(Je,{"aria-label":s("modelManager.addNewModel"),tooltip:s("modelManager.addNewModel"),onClick:t,size:"sm",children:l.jsxs(L,{columnGap:2,alignItems:"center",children:[l.jsx(zc,{}),s("modelManager.addNew")]})}),l.jsxs(mo,{isOpen:e,onClose:c,size:"3xl",closeOnOverlayClick:!1,children:[l.jsx(Hr,{}),l.jsxs(vo,{margin:"auto",children:[l.jsxs(Br,{children:[s("modelManager.addNewModel")," "]}),r!==null&&l.jsx(se,{"aria-label":s("common.back"),tooltip:s("common.back"),onClick:()=>o(Di(null)),position:"absolute",variant:"ghost",zIndex:1,size:"sm",insetInlineEnd:12,top:2,icon:l.jsx(Fx,{})}),l.jsx(aa,{}),l.jsxs(Wr,{children:[r==null&&l.jsxs(L,{columnGap:4,children:[l.jsx(L0,{text:s("modelManager.addCheckpointModel"),onClick:()=>o(Di("ckpt"))}),l.jsx(L0,{text:s("modelManager.addDiffuserModel"),onClick:()=>o(Di("diffusers"))})]}),r=="ckpt"&&l.jsx(cD,{}),r=="diffusers"&&l.jsx(uD,{})]}),l.jsx(Lr,{})]})]})]})}var fD=eh({displayName:"EditIcon",path:l.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[l.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),l.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),Eb=eh({displayName:"ExternalLinkIcon",path:l.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[l.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),l.jsx("path",{d:"M15 3h6v6"}),l.jsx("path",{d:"M10 14L21 3"})]})}),hD=eh({displayName:"DeleteIcon",path:l.jsx("g",{fill:"currentColor",children:l.jsx("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"})})});function Ol(e){const{isProcessing:t,isConnected:n}=A(S=>S.system),r=A(S=>S.system.openModel),{t:o}=K(),s=Y(),{name:c,status:u,description:f}=e,h=()=>{s(j1(c))},m=()=>{s(Iv(c))},v=()=>{s(YS(c)),s(Iv(null))},x=()=>{switch(u){case"active":return"ok.500";case"cached":return"warning.500";case"not loaded":return"inherit"}};return l.jsxs(L,{alignItems:"center",p:2,borderRadius:"base",sx:c===r?{bg:"accent.750",_hover:{bg:"accent.750"}}:{_hover:{bg:"base.750"}},children:[l.jsx(Ye,{onClick:m,cursor:"pointer",children:l.jsx(Gt,{label:f,hasArrow:!0,placement:"bottom",children:l.jsx(Ce,{fontWeight:"600",children:c})})}),l.jsx(kc,{onClick:m,cursor:"pointer"}),l.jsxs(L,{gap:2,alignItems:"center",children:[l.jsx(Ce,{color:x(),children:u}),l.jsx(ni,{size:"sm",onClick:h,isDisabled:u==="active"||t||!n,children:o("modelManager.load")}),l.jsx(se,{icon:l.jsx(fD,{}),size:"sm",onClick:m,"aria-label":o("accessibility.modifyConfig"),isDisabled:u==="active"||t||!n}),l.jsx(Wc,{title:o("modelManager.deleteModel"),acceptCallback:v,acceptButtonText:o("modelManager.delete"),triggerComponent:l.jsx(se,{icon:l.jsx(hD,{}),size:"sm","aria-label":o("modelManager.deleteConfig"),isDisabled:u==="active"||t||!n,colorScheme:"error"}),children:l.jsxs(L,{rowGap:4,flexDirection:"column",children:[l.jsx("p",{style:{fontWeight:"bold"},children:o("modelManager.deleteMsg1")}),l.jsx("p",{children:o("modelManager.deleteMsg2")})]})})]})]})}function B0(e){const{children:t,value:n}=e,[r,o]=k1("colors",["base.800","base.200"]);return l.jsx("option",{value:n,style:{background:r,color:o},children:t})}const pD=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:o,tooltipProps:s,...c}=e;return l.jsxs(rt,{isDisabled:n,onClick:u=>{u.stopPropagation(),u.nativeEvent.stopImmediatePropagation(),u.nativeEvent.stopPropagation(),u.nativeEvent.cancelBubble=!0},children:[t&&l.jsx(st,{children:t}),l.jsx(Gt,{label:o,...s,children:l.jsx(tx,{...c,children:r.map(u=>typeof u=="string"||typeof u=="number"?l.jsx(B0,{value:u,children:u},u):l.jsx(B0,{value:u.value,children:u.key},u.value))})})]})},Mn=y.memo(pD);function mD(e){return ge({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 Pb(e){return ge({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 vD(e){return ge({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 gD(e){return ge({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 yD(e){return ge({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 xD(e){return ge({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)}const bD=e=>{const[t,n]=y.useState(!1),{label:r,value:o,min:s=1,max:c=100,step:u=1,onChange:f,tooltipSuffix:h="",withSliderMarks:m=!1,withInput:v=!1,isInteger:x=!1,inputWidth:S=16,inputReadOnly:C=!1,withReset:j=!1,hideTooltip:w=!1,isCompact:k=!1,handleReset:M,isResetDisabled:P,isSliderDisabled:I,isInputDisabled:T,sliderFormControlProps:_,sliderFormLabelProps:D,sliderMarkProps:z,sliderTrackProps:W,sliderThumbProps:F,sliderNumberInputProps:B,sliderNumberInputFieldProps:Q,sliderNumberInputStepperProps:U,sliderTooltipProps:X,sliderIAIIconButtonProps:te,...re}=e,{t:$}=K(),[Z,oe]=y.useState(String(o));y.useEffect(()=>{oe(o)},[o]);const le=y.useMemo(()=>B!=null&&B.max?B.max:c,[c,B==null?void 0:B.max]),ze=ce=>{f(ce)},Re=ce=>{ce.target.value===""&&(ce.target.value=String(s));const Ne=ee.clamp(x?Math.floor(Number(ce.target.value)):Number(Z),s,le);f(Ne)},Ie=ce=>{oe(ce)},pe=()=>{M&&M()};return l.jsxs(rt,{sx:k?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},..._,children:[l.jsx(st,{...D,mb:-1,children:r}),l.jsxs(oa,{w:"100%",gap:2,alignItems:"center",children:[l.jsxs(ax,{"aria-label":r,value:o,min:s,max:c,step:u,onChange:ze,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:I,...re,children:[m&&l.jsxs(l.Fragment,{children:[l.jsx(Tf,{value:s,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...z,children:s}),l.jsx(Tf,{value:c,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...z,children:c})]}),l.jsx(lx,{...W,children:l.jsx(cx,{})}),l.jsx(Gt,{hasArrow:!0,placement:"top",isOpen:t,label:`${o}${h}`,hidden:w,...X,children:l.jsx(sx,{...F})})]}),v&&l.jsxs(Nh,{min:s,max:le,step:u,value:Z,onChange:Ie,onBlur:Re,isDisabled:T,...B,children:[l.jsx(Lh,{readOnly:C,minWidth:S,...Q}),l.jsxs(Fh,{...U,children:[l.jsx(Hh,{onClick:()=>f(Number(Z))}),l.jsx(Bh,{onClick:()=>f(Number(Z))})]})]}),j&&l.jsx(se,{size:"sm","aria-label":$("accessibility.reset"),tooltip:"Reset",icon:l.jsx(Pb,{}),onClick:pe,isDisabled:P,...te})]})]})},ut=y.memo(bD);function SD(){const e=Y(),{isOpen:t,onOpen:n,onClose:r}=po(),o=A(q9),{t:s}=K(),[c,u]=y.useState(Object.keys(o)[0]),[f,h]=y.useState(Object.keys(o)[1]),[m,v]=y.useState("none"),[x,S]=y.useState(""),[C,j]=y.useState(.5),[w,k]=y.useState("weighted_sum"),[M,P]=y.useState("root"),[I,T]=y.useState(""),[_,D]=y.useState(!1),z=Object.keys(o).filter(U=>U!==f&&U!==m),W=Object.keys(o).filter(U=>U!==c&&U!==m),F=[{key:s("modelManager.none"),value:"none"},...Object.keys(o).filter(U=>U!==c&&U!==f).map(U=>({key:U,value:U}))],B=A(U=>U.system.isProcessing),Q=()=>{let U=[c,f,m];U=U.filter(te=>te!=="none");const X={models_to_merge:U,merged_model_name:x!==""?x:U.join("-"),alpha:C,interp:w,model_merge_save_path:M==="root"?null:I,force:_};e(KS(X))};return l.jsxs(l.Fragment,{children:[l.jsx(Je,{onClick:n,size:"sm",children:l.jsx(L,{columnGap:2,alignItems:"center",children:s("modelManager.mergeModels")})}),l.jsxs(mo,{isOpen:t,onClose:r,size:"4xl",closeOnOverlayClick:!1,children:[l.jsx(Hr,{}),l.jsxs(vo,{fontFamily:"Inter",margin:"auto",paddingInlineEnd:4,children:[l.jsx(Br,{children:s("modelManager.mergeModels")}),l.jsx(aa,{}),l.jsx(Wr,{children:l.jsxs(L,{flexDirection:"column",rowGap:4,children:[l.jsxs(L,{sx:{flexDirection:"column",marginBottom:4,padding:4,borderRadius:"base",rowGap:1,bg:"base.900"},children:[l.jsx(Ce,{children:s("modelManager.modelMergeHeaderHelp1")}),l.jsx(Ce,{fontSize:"sm",variant:"subtext",children:s("modelManager.modelMergeHeaderHelp2")})]}),l.jsxs(L,{columnGap:4,children:[l.jsx(Mn,{label:s("modelManager.modelOne"),validValues:z,onChange:U=>u(U.target.value)}),l.jsx(Mn,{label:s("modelManager.modelTwo"),validValues:W,onChange:U=>h(U.target.value)}),l.jsx(Mn,{label:s("modelManager.modelThree"),validValues:F,onChange:U=>{U.target.value!=="none"?(v(U.target.value),k("add_difference")):(v("none"),k("weighted_sum"))}})]}),l.jsx(mt,{label:s("modelManager.mergedModelName"),value:x,onChange:U=>S(U.target.value)}),l.jsxs(L,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[l.jsx(ut,{label:s("modelManager.alpha"),min:.01,max:.99,step:.01,value:C,onChange:U=>j(U),withInput:!0,withReset:!0,handleReset:()=>j(.5),withSliderMarks:!0}),l.jsx(Ce,{variant:"subtext",fontSize:"sm",children:s("modelManager.modelMergeAlphaHelp")})]}),l.jsxs(L,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[l.jsx(Ce,{fontWeight:500,fontSize:"sm",variant:"subtext",children:s("modelManager.interpolationType")}),l.jsx(Qa,{value:w,onChange:U=>k(U),children:l.jsx(L,{columnGap:4,children:m==="none"?l.jsxs(l.Fragment,{children:[l.jsx(vn,{value:"weighted_sum",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.weightedSum")})}),l.jsx(vn,{value:"sigmoid",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.sigmoid")})}),l.jsx(vn,{value:"inv_sigmoid",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.inverseSigmoid")})})]}):l.jsx(vn,{value:"add_difference",children:l.jsx(Gt,{label:s("modelManager.modelMergeInterpAddDifferenceHelp"),children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.addDifference")})})})})})]}),l.jsxs(L,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[l.jsxs(L,{columnGap:4,children:[l.jsx(Ce,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:s("modelManager.mergedModelSaveLocation")}),l.jsx(Qa,{value:M,onChange:U=>P(U),children:l.jsxs(L,{columnGap:4,children:[l.jsx(vn,{value:"root",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.invokeAIFolder")})}),l.jsx(vn,{value:"custom",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.custom")})})]})})]}),M==="custom"&&l.jsx(mt,{label:s("modelManager.mergedModelCustomSaveLocation"),value:I,onChange:U=>T(U.target.value)})]}),l.jsx(ft,{label:s("modelManager.ignoreMismatch"),isChecked:_,onChange:U=>D(U.target.checked),fontWeight:"500"}),l.jsx(Je,{onClick:Q,isLoading:B,isDisabled:M==="custom"&&I==="",children:s("modelManager.merge")})]})}),l.jsx(Lr,{})]})]})]})}const CD=me(Et,e=>ee.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function Vd({label:e,isActive:t,onClick:n}){return l.jsx(Je,{onClick:n,isActive:t,sx:{_active:{bg:"accent.750"}},size:"sm",children:e})}const wD=()=>{const e=A(CD),[t,n]=Me.useState(!1);Me.useEffect(()=>{const x=setTimeout(()=>{n(!0)},200);return()=>clearTimeout(x)},[]);const[r,o]=y.useState(""),[s,c]=y.useState("all"),[u,f]=y.useTransition(),{t:h}=K(),m=x=>{f(()=>{o(x.target.value)})},v=y.useMemo(()=>{const x=[],S=[],C=[],j=[];return e.forEach((w,k)=>{w.name.toLowerCase().includes(r.toLowerCase())&&(C.push(l.jsx(Ol,{name:w.name,status:w.status,description:w.description},k)),w.format===s&&j.push(l.jsx(Ol,{name:w.name,status:w.status,description:w.description},k))),w.format!=="diffusers"?x.push(l.jsx(Ol,{name:w.name,status:w.status,description:w.description},k)):S.push(l.jsx(Ol,{name:w.name,status:w.status,description:w.description},k))}),r!==""?s==="all"?l.jsx(Ye,{marginTop:4,children:C}):l.jsx(Ye,{marginTop:4,children:j}):l.jsxs(L,{flexDirection:"column",rowGap:6,children:[s==="all"&&l.jsxs(l.Fragment,{children:[l.jsxs(Ye,{children:[l.jsx(Ce,{sx:{fontWeight:"500",py:2,px:4,my:4,mx:0,borderRadius:"base",width:"max-content",fontSize:"sm",bg:"base.750"},children:h("modelManager.checkpointModels")}),x]}),l.jsxs(Ye,{children:[l.jsx(Ce,{sx:{fontWeight:"500",py:2,px:4,mb:4,borderRadius:"base",width:"max-content",fontSize:"sm",bg:"base.750"},children:h("modelManager.diffusersModels")}),S]})]}),s==="ckpt"&&l.jsx(L,{flexDirection:"column",marginTop:4,children:x}),s==="diffusers"&&l.jsx(L,{flexDirection:"column",marginTop:4,children:S})]})},[e,r,h,s]);return l.jsxs(L,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:[l.jsxs(L,{justifyContent:"space-between",alignItems:"center",gap:2,children:[l.jsx(Wn,{size:"md",children:h("modelManager.availableModels")}),l.jsx(kc,{}),l.jsx(dD,{}),l.jsx(SD,{})]}),l.jsx(mt,{onChange:m,label:h("modelManager.search")}),l.jsxs(L,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-240,overflow:"scroll",paddingInlineEnd:4,children:[l.jsxs(L,{columnGap:2,children:[l.jsx(Vd,{label:h("modelManager.allModels"),onClick:()=>c("all"),isActive:s==="all"}),l.jsx(Vd,{label:h("modelManager.checkpointModels"),onClick:()=>c("ckpt"),isActive:s==="ckpt"}),l.jsx(Vd,{label:h("modelManager.diffusersModels"),onClick:()=>c("diffusers"),isActive:s==="diffusers"})]}),t?v:l.jsx(L,{width:"100%",minHeight:96,justifyContent:"center",alignItems:"center",children:l.jsx(yc,{})})]})]})};function jD({children:e}){const{isOpen:t,onOpen:n,onClose:r}=po(),o=A(u=>u.system.model_list),s=A(u=>u.system.openModel),{t:c}=K();return l.jsxs(l.Fragment,{children:[y.cloneElement(e,{onClick:n}),l.jsxs(mo,{isOpen:t,onClose:r,size:"full",children:[l.jsx(Hr,{}),l.jsxs(vo,{children:[l.jsx(aa,{}),l.jsx(Br,{children:c("modelManager.modelManager")}),l.jsx(Wr,{children:l.jsxs(L,{width:"100%",columnGap:8,children:[l.jsx(wD,{}),s&&o[s].format==="diffusers"?l.jsx(aD,{}):l.jsx(oD,{})]})}),l.jsx(Lr,{})]})]})]})}const kD=me([Et],e=>{const{isProcessing:t,model_list:n}=e;return{models:ee.map(n,(o,s)=>s),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),ED=()=>{const e=Y(),{t}=K(),{models:n,isProcessing:r}=A(kD),o=A(qx),s=c=>{e(j1(c.target.value))};return l.jsx(L,{style:{paddingInlineStart:1.5},children:l.jsx(Mn,{style:{fontSize:"sm"},"aria-label":t("accessibility.modelSelect"),tooltip:o.description,isDisabled:r,value:o.name,validValues:n,onChange:s})})},PD=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,...c}=e;return l.jsxs(rt,{isDisabled:n,width:r,display:"flex",gap:4,alignItems:"center",justifyContent:"space-between",...o,children:[l.jsx(st,{my:1,...s,children:t}),l.jsx(ux,{...c})]})},En=y.memo(PD),ID=me([Et,Pr],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,model_list:s,saveIntermediatesInterval:c,enableImageDebugging:u}=e,{shouldUseCanvasBetaLayout:f,shouldUseSliders:h}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,models:ee.map(s,(m,v)=>v),saveIntermediatesInterval:c,enableImageDebugging:u,shouldUseCanvasBetaLayout:f,shouldUseSliders:h}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Ud={flexDirection:"column",gap:2,p:4,bg:"base.900"},MD=({children:e})=>{const t=Y(),{t:n}=K(),r=A(P=>P.generation.steps),{isOpen:o,onOpen:s,onClose:c}=po(),{isOpen:u,onOpen:f,onClose:h}=po(),{shouldDisplayInProgressType:m,shouldConfirmOnDelete:v,shouldDisplayGuides:x,saveIntermediatesInterval:S,enableImageDebugging:C,shouldUseCanvasBetaLayout:j,shouldUseSliders:w}=A(ID),k=()=>{n3.purge().then(()=>{c(),f()})},M=P=>{P>r&&(P=r),P<1&&(P=1),t(r3(P))};return l.jsxs(l.Fragment,{children:[y.cloneElement(e,{onClick:s}),l.jsxs(mo,{isOpen:o,onClose:c,size:"xl",children:[l.jsx(Hr,{}),l.jsxs(vo,{paddingInlineEnd:4,children:[l.jsx(Br,{children:n("common.settingsLabel")}),l.jsx(aa,{}),l.jsx(Wr,{children:l.jsxs(ir,{gap:4,children:[l.jsxs(L,{sx:Ud,children:[l.jsx(Mn,{label:n("settings.displayInProgress"),validValues:XS,value:m,onChange:P=>t(QS(P.target.value))}),m==="full-res"&&l.jsx(Vr,{label:n("settings.saveSteps"),min:1,max:r,step:1,onChange:M,value:S,width:"auto",textAlign:"center"}),l.jsx(En,{label:n("settings.confirmOnDelete"),isChecked:v,onChange:P=>t(E1(P.target.checked))}),l.jsx(En,{label:n("settings.displayHelpIcons"),isChecked:x,onChange:P=>t(ZS(P.target.checked))}),l.jsx(En,{label:n("settings.useCanvasBeta"),isChecked:j,onChange:P=>t(JS(P.target.checked))}),l.jsx(En,{label:n("settings.useSlidersForAll"),isChecked:w,onChange:P=>t(e3(P.target.checked))})]}),l.jsxs(L,{sx:Ud,children:[l.jsx(Wn,{size:"sm",style:{fontWeight:"bold"},children:"Developer"}),l.jsx(En,{label:n("settings.enableImageDebugging"),isChecked:C,onChange:P=>t(t3(P.target.checked))})]}),l.jsxs(L,{sx:Ud,children:[l.jsx(Wn,{size:"sm",children:n("settings.resetWebUI")}),l.jsx(Je,{colorScheme:"error",onClick:k,children:n("settings.resetWebUI")}),l.jsx(Ce,{children:n("settings.resetWebUIDesc1")}),l.jsx(Ce,{children:n("settings.resetWebUIDesc2")})]})]})}),l.jsx(Lr,{children:l.jsx(Je,{onClick:c,children:n("common.close")})})]})]}),l.jsxs(mo,{closeOnOverlayClick:!1,isOpen:u,onClose:h,isCentered:!0,children:[l.jsx(Hr,{backdropFilter:"blur(40px)"}),l.jsxs(vo,{children:[l.jsx(Br,{}),l.jsx(Wr,{children:l.jsx(L,{justifyContent:"center",children:l.jsx(Ce,{fontSize:"lg",children:l.jsx(Ce,{children:n("settings.resetComplete")})})})}),l.jsx(Lr,{})]})]})]})},TD=me(Et,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),_D=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:o,hasError:s,wasErrorSeen:c}=A(TD),u=Y(),{t:f}=K();let h;e&&!s?h="ok":h="error";let m=o;t&&(h="working"),m&&t&&r>1&&(m=`${f(m)} (${n}/${r})`);const v=s&&!c?"Click to clear, check logs for details":void 0,x=s&&!c?"pointer":"initial",S=()=>{(s||!c)&&u(w1())};return l.jsx(Gt,{label:v,children:l.jsx(Ce,{cursor:x,onClick:S,sx:{fontSize:"xs",fontWeight:"600",color:`${h}.400`},children:f(m)})})},DD=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return l.jsxs(Uh,{isLazy:o,...s,children:[l.jsx(Vh,{children:t}),l.jsxs(Gh,{children:[r&&l.jsx($h,{}),n]})]})},or=y.memo(DD);function AD(){const{t:e}=K(),t=Y(),n=A(c=>c.ui.currentTheme),r={dark:e("common.darkTheme"),light:e("common.lightTheme"),green:e("common.greenTheme"),ocean:e("common.oceanTheme")},o=c=>{t(o3(c))},s=()=>{const c=[];return Object.keys(r).forEach(u=>{c.push(l.jsx(Je,{isChecked:n===u,leftIcon:n===u?l.jsx(Oc,{}):void 0,size:"sm",onClick:()=>o(u),children:r[u]},u))}),c};return l.jsx(or,{triggerComponent:l.jsx(se,{"aria-label":e("common.themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(R9,{})}),children:l.jsx(Fe,{align:"stretch",children:s()})})}function OD(){const{t:e,i18n:t}=K(),n={ar:e("common.langArabic",{lng:"ar"}),nl:e("common.langDutch",{lng:"nl"}),en:e("common.langEnglish",{lng:"en"}),fr:e("common.langFrench",{lng:"fr"}),de:e("common.langGerman",{lng:"de"}),he:e("common.langHebrew",{lng:"he"}),it:e("common.langItalian",{lng:"it"}),ja:e("common.langJapanese",{lng:"ja"}),ko:e("common.langKorean",{lng:"ko"}),pl:e("common.langPolish",{lng:"pl"}),pt_BR:e("common.langBrPortuguese",{lng:"pt_BR"}),pt:e("common.langPortuguese",{lng:"pt"}),ru:e("common.langRussian",{lng:"ru"}),zh_CN:e("common.langSimplifiedChinese",{lng:"zh_CN"}),es:e("common.langSpanish",{lng:"es"}),uk:e("common.langUkranian",{lng:"ua"})},r=()=>{const o=[];return Object.keys(n).forEach(s=>{o.push(l.jsx(Je,{isChecked:localStorage.getItem("i18nextLng")===s,leftIcon:localStorage.getItem("i18nextLng")===s?l.jsx(Oc,{}):void 0,onClick:()=>t.changeLanguage(s),"aria-label":n[s],size:"sm",minWidth:"200px",children:n[s]},s))}),o};return l.jsx(or,{triggerComponent:l.jsx(se,{"aria-label":e("common.languagePickerLabel"),tooltip:e("common.languagePickerLabel"),icon:l.jsx(A9,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:l.jsx(Fe,{children:r()})})}function zD(e){return ge({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.5 9c-.42 0-.83.04-1.24.11L1.01 3 1 10l9 2-9 2 .01 7 8.07-3.46C9.59 21.19 12.71 24 16.5 24c4.14 0 7.5-3.36 7.5-7.5S20.64 9 16.5 9zm0 13c-3.03 0-5.5-2.47-5.5-5.5s2.47-5.5 5.5-5.5 5.5 2.47 5.5 5.5-2.47 5.5-5.5 5.5z"}},{tag:"path",attr:{d:"M18.27 14.03l-1.77 1.76-1.77-1.76-.7.7 1.76 1.77-1.76 1.77.7.7 1.77-1.76 1.77 1.76.7-.7-1.76-1.77 1.76-1.77z"}}]})(e)}function RD(e){return ge({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 ND(e){return ge({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function FD(e){return ge({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}}]})(e)}function LD(e){return ge({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M17 16l-4-4V8.82C14.16 8.4 15 7.3 15 6c0-1.66-1.34-3-3-3S9 4.34 9 6c0 1.3.84 2.4 2 2.82V12l-4 4H3v5h5v-3.05l4-4.2 4 4.2V21h5v-5h-4z"}}]})(e)}function BD(e){return ge({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 2v11h3v9l7-12h-4l4-8z"}}]})(e)}function H0(e){return ge({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 HD(e){return ge({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z"}}]})(e)}function WD(e){return ge({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.02 10v9H5V5h9V3H5.02c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2zM17 10l.94-2.06L20 7l-2.06-.94L17 4l-.94 2.06L14 7l2.06.94zm-3.75.75L12 8l-1.25 2.75L8 12l2.75 1.25L12 16l1.25-2.75L16 12z"}}]})(e)}function dp(e){return ge({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 VD(e){return ge({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 UD(e){return ge({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 10l5 5 5-5z"}}]})(e)}function $D(e){return ge({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 14l5-5 5 5z"}}]})(e)}function GD(e){return ge({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 qD=""+new URL("logo-13003d72.png",import.meta.url).href,Ib=()=>{const e=A(t=>t.system.app_version);return l.jsxs(L,{alignItems:"center",gap:3,ps:1,children:[l.jsx(cs,{src:qD,alt:"invoke-ai-logo",w:"32px",h:"32px"}),l.jsxs(Ce,{fontSize:"xl",children:["invoke ",l.jsx("strong",{children:"ai"})]}),l.jsx(Ce,{sx:{fontWeight:300,marginTop:1},variant:"subtext",children:e})]})},Mb=()=>{const{t:e}=K();return l.jsxs(ir,{gridTemplateColumns:"auto max-content",children:[l.jsx(Ib,{}),l.jsxs(L,{alignItems:"center",gap:2,children:[l.jsx(_D,{}),l.jsx(ED,{}),l.jsx(jD,{children:l.jsx(se,{"aria-label":e("modelManager.modelManager"),tooltip:e("modelManager.modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(k9,{})})}),l.jsx(iP,{children:l.jsx(se,{"aria-label":e("common.hotkeysLabel"),tooltip:e("common.hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(D9,{})})}),l.jsx(AD,{}),l.jsx(OD,{}),l.jsx(qo,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",marginBottom:"-0.25rem",children:l.jsx(se,{"aria-label":e("common.reportBugLabel"),tooltip:e("common.reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx(j9,{})})}),l.jsx(qo,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",marginBottom:"-0.25rem",children:l.jsx(se,{"aria-label":e("common.githubLabel"),tooltip:e("common.githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx(y9,{})})}),l.jsx(qo,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",marginBottom:"-0.25rem",children:l.jsx(se,{"aria-label":e("common.discordLabel"),tooltip:e("common.discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx(g9,{})})}),l.jsx(MD,{children:l.jsx(se,{"aria-label":e("common.settingsLabel"),tooltip:e("common.settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:l.jsx(ND,{})})})]})]})};Mb.displayName="SiteHeader";const fp=e=>{const{children:t}=e;return l.jsx(L,{sx:{width:"100%",height:"100%",bg:"base.850"},children:t})};function YD(){const{t:e}=K();return l.jsx(fp,{children:l.jsxs(L,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",w:"100%",h:"100%",gap:4,textAlign:"center"},children:[l.jsx(Wn,{children:e("common.nodes")}),l.jsx(Fe,{maxW:"50rem",gap:4,children:l.jsx(Ce,{children:e("common.nodesDesc")})})]})})}const KD=()=>{const{t:e}=K();return l.jsx(fp,{children:l.jsxs(L,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",w:"100%",h:"100%",gap:4,textAlign:"center"},children:[l.jsx(Wn,{children:e("common.postProcessing")}),l.jsxs(Fe,{maxW:"50rem",gap:4,children:[l.jsx(Ce,{children:e("common.postProcessDesc1")}),l.jsx(Ce,{children:e("common.postProcessDesc2")}),l.jsx(Ce,{children:e("common.postProcessDesc3")})]})]})})};function XD(){const{t:e}=K();return l.jsx(fp,{children:l.jsxs(L,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",w:"100%",h:"100%",gap:4,textAlign:"center"},children:[l.jsx(Wn,{children:e("common.training")}),l.jsxs(Fe,{maxW:"50rem",gap:4,children:[l.jsx(Ce,{children:e("common.trainingDesc1")}),l.jsx(Ce,{children:e("common.trainingDesc2")})]})]})})}const Ss=me(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:ee.isEqual}}),qr=e=>e.gallery,QD=me([qr,Pr,Ss,bt],(e,t,n,r)=>{const{categories:o,currentCategory:s,currentImageUuid:c,galleryImageMinimumWidth:u,galleryImageObjectFit:f,shouldAutoSwitchToNewImages:h,galleryWidth:m,shouldUseSingleGalleryColumn:v}=e,{shouldPinGallery:x}=t,{isLightboxOpen:S}=n;return{currentImageUuid:c,shouldPinGallery:x,galleryImageMinimumWidth:u,galleryImageObjectFit:f,galleryGridTemplateColumns:v?"auto":`repeat(auto-fill, minmax(${u}px, auto))`,shouldAutoSwitchToNewImages:h,currentCategory:s,images:o[s].images,areMoreImagesAvailable:o[s].areMoreImagesAvailable,galleryWidth:m,shouldEnableResize:!(S||r==="unifiedCanvas"&&x),shouldUseSingleGalleryColumn:v}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),ZD=me([qr,Et,Ss,bt],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),JD=me(qr,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),eA=()=>{const{resultImages:e,userImages:t}=A(JD);return n=>{const r=e.find(s=>s.uuid===n);if(r)return r;const o=t.find(s=>s.uuid===n);if(o)return o}},tA=({direction:e,langDirection:t})=>({top:e==="bottom",right:t!=="rtl"&&e==="left"||t==="rtl"&&e==="right",bottom:e==="top",left:t!=="rtl"&&e==="right"||t==="rtl"&&e==="left"}),nA=({direction:e,minWidth:t,maxWidth:n,minHeight:r,maxHeight:o})=>{const s=t??(["left","right"].includes(e)?10:void 0),c=n??(["left","right"].includes(e)?"95vw":void 0),u=r??(["top","bottom"].includes(e)?10:void 0),f=o??(["top","bottom"].includes(e)?"95vh":void 0);return{...s?{minWidth:s}:{},...c?{maxWidth:c}:{},...u?{minHeight:u}:{},...f?{maxHeight:f}:{}}},Rr="0.75rem",zl="1rem",rA="2px",oA="5px",iA=({isPinned:e,isResizable:t,direction:n})=>{if(!t)return{containerStyles:{},handleStyles:{}};const r=e?rA:oA,o=`calc((2 * ${Rr} + ${r}) / -2)`;return n==="top"?{containerStyles:{borderBottomWidth:r,paddingBottom:zl},handleStyles:{top:{paddingTop:Rr,paddingBottom:Rr,bottom:o}}}:n==="left"?{containerStyles:{borderInlineEndWidth:r,paddingInlineEnd:zl},handleStyles:{right:{paddingInlineStart:Rr,paddingInlineEnd:Rr,insetInlineEnd:o}}}:n==="bottom"?{containerStyles:{borderTopWidth:r,paddingTop:zl},handleStyles:{bottom:{paddingTop:Rr,paddingBottom:Rr,top:o}}}:n==="right"?{containerStyles:{borderInlineStartWidth:r,paddingInlineStart:zl},handleStyles:{left:{paddingInlineStart:Rr,paddingInlineEnd:Rr,insetInlineStart:o}}}:{containerStyles:{},handleStyles:{}}},aA=(e,t)=>["top","bottom"].includes(e)?e:e==="left"?t==="rtl"?"right":"left":e==="right"?t==="rtl"?"left":"right":"left",oo=(e,t)=>{if(e)return t?e+t:e},sA=ne(zx,{shouldForwardProp:e=>!["sx"].includes(e)}),Tb=({direction:e="left",isResizable:t,isPinned:n,isOpen:r,onClose:o,children:s,initialWidth:c,minWidth:u,maxWidth:f,initialHeight:h,minHeight:m,maxHeight:v,onResizeStart:x,onResizeStop:S,onResize:C,sx:j={}})=>{const w=ta().direction,k=y.useRef(null),M=y.useMemo(()=>c??u??(["left","right"].includes(e)?500:"100%"),[c,u,e]),P=y.useMemo(()=>h??m??(["top","bottom"].includes(e)?500:"100%"),[h,m,e]),[I,T]=y.useState(M),[_,D]=y.useState(P);E6({ref:k,handler:()=>{o()},enabled:r&&!n});const z=y.useMemo(()=>t?tA({direction:e,langDirection:w}):{},[t,w,e]),W=y.useMemo(()=>nA({direction:e,minWidth:t?oo(u,18):oo(u),maxWidth:t?oo(f,18):oo(f),minHeight:t?oo(m,18):oo(m),maxHeight:t?oo(v,18):oo(v)}),[u,f,m,v,e,t]),{containerStyles:F,handleStyles:B}=y.useMemo(()=>iA({isPinned:n,isResizable:t,direction:e}),[n,t,e]),Q=y.useMemo(()=>aA(e,w),[e,w]);return y.useEffect(()=>{["left","right"].includes(e)&&D(n?"100%":"100vh"),["top","bottom"].includes(e)&&T(n?"100%":"100vw")},[n,e]),l.jsx(x2,{direction:Q,in:r,unmountOnExit:n,motionProps:{initial:n},...n?{style:{position:void 0,left:void 0,right:void 0,top:void 0,bottom:void 0,width:void 0}}:{style:{zIndex:99,width:"full"}},children:l.jsx(Ye,{ref:k,sx:{width:"full",height:"full"},children:l.jsx(sA,{size:{width:t?I:M,height:t?_:P},enable:z,handleStyles:B,...W,sx:{borderColor:"base.800",p:n?0:4,bg:"base.900",height:"full",boxShadow:n?"":"0 0 4rem 0 rgba(0, 0, 0, 0.8)",...F,...j},onResizeStart:(U,X,te)=>{x&&x(U,X,te)},onResize:(U,X,te,re)=>{C&&C(U,X,te,re)},onResizeStop:(U,X,te,re)=>{["left","right"].includes(X)&&T(Number(I)+re.width),["top","bottom"].includes(X)&&D(Number(_)+re.height),S&&S(U,X,te,re)},children:s})})})},W0={position:"absolute",width:"full",height:24,left:0,pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},_b=({children:e})=>{const t=y.useRef(null),n=y.useRef(null),r=y.useRef(null),o=ee.throttle(()=>{if(!t.current||!n.current||!r.current)return;const{scrollTop:s,scrollHeight:c,offsetHeight:u}=t.current;s>0?n.current.style.opacity="1":n.current.style.opacity="0",s>=c-u?r.current.style.opacity="0":r.current.style.opacity="1"},33,{leading:!0});return y.useEffect(()=>{o()},[o]),l.jsxs(Ye,{position:"relative",w:"full",h:"full",children:[l.jsx(Ye,{ref:t,position:"absolute",w:"full",h:"full",overflowY:"scroll",onScroll:o,children:e}),l.jsx(Ye,{ref:r,sx:{...W0,bottom:0,boxShadow:"inset 0 -3.5rem 2rem -2rem var(--invokeai-colors-base-900)"}}),l.jsx(Ye,{ref:n,sx:{...W0,top:0,boxShadow:"inset 0 3.5rem 2rem -2rem var(--invokeai-colors-base-900)"}})]})},lA=ee.debounce(e=>{e(P1(!0))},300),cn=()=>(e,t)=>{bt(t())==="unifiedCanvas"&&lA(e)};function Db(e){return ge({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 Ab(e){return ge({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)}const V0=e=>{const{sx:t}=e,n=Y(),r=A(c=>c.ui.shouldPinParametersPanel),{t:o}=K(),s=()=>{n(i3(!r)),n(cn())};return l.jsx(Gt,{label:o("common.pinOptionsPanel"),children:l.jsx(se,{...e,"aria-label":o("common.pinOptionsPanel"),onClick:s,icon:r?l.jsx(Db,{}):l.jsx(Ab,{}),variant:"ghost",size:"sm",sx:{color:"base.700",_hover:{color:"base.550"},_active:{color:"base.500"},...t}})})},cA=me([Pr,bt,Ss],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:o}=e,{isLightboxOpen:s}=n;return{shouldPinParametersPanel:r,shouldShowParametersPanel:o,isResizable:t!=="unifiedCanvas",isLightboxOpen:s}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),uA=({children:e})=>{const t=Y(),{shouldPinParametersPanel:n,shouldShowParametersPanel:r,isResizable:o,isLightboxOpen:s}=A(cA),c=()=>{t(ql(!1))};return de("o",()=>{t(a3()),n&&t(cn())},{enabled:()=>!s},[n,s]),de("esc",()=>{t(ql(!1))},{enabled:()=>!n,preventDefault:!0},[n]),de("shift+o",()=>{t(s3()),t(cn())},[]),l.jsx(Tb,{direction:"left",isResizable:o||!n,isOpen:r,onClose:c,isPinned:n||s,sx:{borderColor:"base.700",p:n?0:4,bg:"base.900"},initialWidth:n0,minWidth:n0,children:l.jsxs(L,{flexDir:"column",position:"relative",h:"full",w:"full",children:[!n&&l.jsxs(L,{paddingTop:1.5,paddingBottom:4,justifyContent:"space-between",alignItems:"center",children:[l.jsx(Ib,{}),l.jsx(V0,{})]}),l.jsx(_b,{children:e}),n&&l.jsx(V0,{sx:{position:"absolute",top:0,insetInlineEnd:0}})]})})},dA=y.memo(uA),fA=me([Pr,bt],(e,t)=>{const{shouldPinParametersPanel:n}=e;return{shouldPinParametersPanel:n,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),hp=e=>{const{parametersPanelContent:t,children:n,...r}=e,o=Y(),{activeTabName:s}=A(fA),c=eA(),u=f=>{const h=f.dataTransfer.getData("invokeai/imageUuid"),m=c(h);m&&(s==="img2img"?o(rs(m)):s==="unifiedCanvas"&&o(bc(m)))};return l.jsxs(L,{...r,pos:"relative",w:"full",h:eP,gap:4,children:[l.jsx(dA,{children:t}),l.jsx(Ye,{pos:"relative",w:"100%",h:"100%",onDrop:u,children:n})]})},hA=e=>{const{styleClass:t}=e,n=y.useContext(Yh),r=()=>{n&&n()};return l.jsx(L,{sx:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center"},className:t,children:l.jsxs(L,{onClick:r,sx:{display:"flex",flexDirection:"column",rowGap:8,p:8,borderRadius:"base",alignItems:"center",justifyContent:"center",textAlign:"center",cursor:"pointer",color:"base.600",bg:"base.800",_hover:{bg:"base.700"}},children:[l.jsx(tn,{as:Rc,boxSize:24}),l.jsx(Wn,{size:"md",children:"Click or Drag and Drop"})]})})};function pA(){const e=A(o=>o.postprocessing.facetoolType),t=Y(),{t:n}=K(),r=o=>t(Nl(o.target.value));return l.jsx(Mn,{label:n("parameters.type"),validValues:l3.concat(),value:e,onChange:r})}function mA(){const e=A(o=>o.system.isGFPGANAvailable),t=A(o=>o.postprocessing.facetoolStrength),{t:n}=K(),r=Y();return l.jsx(ut,{isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,label:n("parameters.strength"),step:.05,min:0,max:1,onChange:o=>r(Yl(o)),handleReset:()=>r(Yl(.75)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}function vA(){const e=A(o=>o.system.isGFPGANAvailable),t=A(o=>o.postprocessing.codeformerFidelity),{t:n}=K(),r=Y();return l.jsx(ut,{isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,label:n("parameters.codeformerFidelity"),step:.05,min:0,max:1,onChange:o=>r(Zd(o)),handleReset:()=>r(Zd(1)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}const pp=()=>{const e=A(t=>t.postprocessing.facetoolType);return l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(pA,{}),l.jsx(mA,{}),e==="codeformer"&&l.jsx(vA,{})]})};function gA(){const e=A(o=>o.system.isESRGANAvailable),t=A(o=>o.postprocessing.upscalingDenoising),{t:n}=K(),r=Y();return l.jsx(ut,{label:n("parameters.denoisingStrength"),value:t,min:0,max:1,step:.01,onChange:o=>{r(Jd(o))},handleReset:()=>r(Jd(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})}function yA(){const e=A(o=>o.system.isESRGANAvailable),t=A(o=>o.postprocessing.upscalingStrength),{t:n}=K(),r=Y();return l.jsx(ut,{label:`${n("parameters.upscale")} ${n("parameters.strength")}`,value:t,min:0,max:1,step:.05,onChange:o=>r(ef(o)),handleReset:()=>r(ef(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})}function xA(){const e=A(s=>s.system.isESRGANAvailable),t=A(s=>s.postprocessing.upscalingLevel),{t:n}=K(),r=Y(),o=s=>r(I1(Number(s.target.value)));return l.jsx(Mn,{isDisabled:!e,label:n("parameters.scale"),value:t,onChange:o,validValues:c3})}const mp=()=>l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(xA,{}),l.jsx(gA,{}),l.jsx(yA,{})]}),vp=e=>e.postprocessing,bA=me(Et,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),hc=fe(({image:e,children:t},n)=>{const{isOpen:r,onOpen:o,onClose:s}=po(),c=Y(),{shouldConfirmOnDelete:u,isConnected:f,isProcessing:h}=A(bA),m=y.useRef(null),v=C=>{C.stopPropagation(),u?o():x()},x=()=>{f&&!h&&e&&c(u3(e)),s()};de("delete",()=>{u?o():x()},[e,u,f,h]);const S=C=>c(E1(!C.target.checked));return l.jsxs(l.Fragment,{children:[y.cloneElement(t,{onClick:e?v:void 0,ref:n}),l.jsx(qy,{isOpen:r,leastDestructiveRef:m,onClose:s,children:l.jsx(Hr,{children:l.jsxs(Yy,{children:[l.jsx(Br,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),l.jsx(Wr,{children:l.jsxs(L,{direction:"column",gap:5,children:[l.jsx(Ce,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),l.jsx(En,{label:"Don't ask me again",isChecked:!u,onChange:S})]})}),l.jsxs(Lr,{children:[l.jsx(Je,{ref:m,onClick:s,children:"Cancel"}),l.jsx(Je,{colorScheme:"error",onClick:x,ml:3,children:"Delete"})]})]})})})]})});hc.displayName="DeleteImageModal";const gp=()=>{const e=Y();return t=>{const n=typeof t=="string"?t:M1(t),[r,o]=d3(n);e(T1(r)),e(_1(o))}},SA=me([Et,qr,vp,Pr,Ss,bt],(e,t,n,r,o,s)=>{const{isProcessing:c,isConnected:u,isGFPGANAvailable:f,isESRGANAvailable:h}=e,{upscalingLevel:m,facetoolStrength:v}=n,{isLightboxOpen:x}=o,{shouldShowImageDetails:S}=r,{intermediateImage:C,currentImage:j}=t;return{isProcessing:c,isConnected:u,isGFPGANAvailable:f,isESRGANAvailable:h,upscalingLevel:m,facetoolStrength:v,shouldDisableToolbarButtons:Boolean(C)||!j,currentImage:j,shouldShowImageDetails:S,activeTabName:s,isLightboxOpen:x}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Ob=e=>{var B,Q,U,X,te,re,$,Z;const t=Y(),{isProcessing:n,isConnected:r,isGFPGANAvailable:o,isESRGANAvailable:s,upscalingLevel:c,facetoolStrength:u,shouldDisableToolbarButtons:f,shouldShowImageDetails:h,currentImage:m,isLightboxOpen:v,activeTabName:x}=A(SA),S=ls(),{t:C}=K(),j=gp(),w=()=>{m&&(v&&t(Uo(!1)),t(rs(m)),t(kn("img2img")))},k=async()=>{if(!m)return;const oe=await fetch(m.url).then(ze=>ze.blob()),le=[new ClipboardItem({[oe.type]:oe})];await navigator.clipboard.write(le),S({title:C("toast.imageCopied"),status:"success",duration:2500,isClosable:!0})},M=()=>{navigator.clipboard.writeText(m?window.location.toString()+m.url:"").then(()=>{S({title:C("toast.imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};de("shift+i",()=>{m?(w(),S({title:C("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.imageNotLoaded"),description:C("toast.imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[m]);const P=()=>{var oe,le;m&&(m.metadata&&t(D1(m.metadata)),((oe=m.metadata)==null?void 0:oe.image.type)==="img2img"?t(kn("img2img")):((le=m.metadata)==null?void 0:le.image.type)==="txt2img"&&t(kn("txt2img")))};de("a",()=>{var oe,le;["txt2img","img2img"].includes((le=(oe=m==null?void 0:m.metadata)==null?void 0:oe.image)==null?void 0:le.type)?(P(),S({title:C("toast.parametersSet"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.parametersNotSet"),description:C("toast.parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[m]);const I=()=>{m!=null&&m.metadata&&t(is(m.metadata.image.seed))};de("s",()=>{var oe,le;(le=(oe=m==null?void 0:m.metadata)==null?void 0:oe.image)!=null&&le.seed?(I(),S({title:C("toast.seedSet"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.seedNotSet"),description:C("toast.seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[m]);const T=y.useCallback(()=>{var oe,le,ze,Re;(le=(oe=m==null?void 0:m.metadata)==null?void 0:oe.image)!=null&&le.prompt&&j((Re=(ze=m==null?void 0:m.metadata)==null?void 0:ze.image)==null?void 0:Re.prompt)},[(Q=(B=m==null?void 0:m.metadata)==null?void 0:B.image)==null?void 0:Q.prompt,j]);de("p",()=>{var oe,le;(le=(oe=m==null?void 0:m.metadata)==null?void 0:oe.image)!=null&&le.prompt?(T(),S({title:C("toast.promptSet"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.promptNotSet"),description:C("toast.promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[m]);const _=()=>{m&&t(f3(m))};de("Shift+U",()=>{s&&!f&&r&&!n&&c?_():S({title:C("toast.upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[m,s,f,r,n,c]);const D=()=>{m&&t(h3(m))};de("Shift+R",()=>{o&&!f&&r&&!n&&u?D():S({title:C("toast.faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[m,o,f,r,n,u]);const z=()=>t(A1(!h)),W=()=>{m&&(v&&t(Uo(!1)),t(bc(m)),t(cn()),x!=="unifiedCanvas"&&t(kn("unifiedCanvas")),S({title:C("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};de("i",()=>{m?z():S({title:C("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[m,h]);const F=()=>{t(Uo(!v))};return l.jsxs(L,{sx:{justifyContent:"center",alignItems:"center",columnGap:"0.5em"},...e,children:[l.jsxs(Qt,{isAttached:!0,children:[l.jsx(or,{triggerComponent:l.jsx(se,{"aria-label":`${C("parameters.sendTo")}...`,icon:l.jsx(W9,{})}),children:l.jsxs(L,{sx:{flexDirection:"column",rowGap:2},children:[l.jsx(Je,{size:"sm",onClick:w,leftIcon:l.jsx(t0,{}),children:C("parameters.sendToImg2Img")}),l.jsx(Je,{size:"sm",onClick:W,leftIcon:l.jsx(t0,{}),children:C("parameters.sendToUnifiedCanvas")}),l.jsx(Je,{size:"sm",onClick:k,leftIcon:l.jsx(Xi,{}),children:C("parameters.copyImage")}),l.jsx(Je,{size:"sm",onClick:M,leftIcon:l.jsx(Xi,{}),children:C("parameters.copyImageToLink")}),l.jsx(qo,{download:!0,href:m==null?void 0:m.url,children:l.jsx(Je,{leftIcon:l.jsx(Qh,{}),size:"sm",w:"100%",children:C("parameters.downloadImage")})})]})}),l.jsx(se,{icon:l.jsx(P9,{}),tooltip:v?`${C("parameters.closeViewer")} (Z)`:`${C("parameters.openInViewer")} (Z)`,"aria-label":v?`${C("parameters.closeViewer")} (Z)`:`${C("parameters.openInViewer")} (Z)`,isChecked:v,onClick:F})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{icon:l.jsx(F9,{}),tooltip:`${C("parameters.usePrompt")} (P)`,"aria-label":`${C("parameters.usePrompt")} (P)`,isDisabled:!((X=(U=m==null?void 0:m.metadata)==null?void 0:U.image)!=null&&X.prompt),onClick:T}),l.jsx(se,{icon:l.jsx(H9,{}),tooltip:`${C("parameters.useSeed")} (S)`,"aria-label":`${C("parameters.useSeed")} (S)`,isDisabled:!((re=(te=m==null?void 0:m.metadata)==null?void 0:te.image)!=null&&re.seed),onClick:I}),l.jsx(se,{icon:l.jsx(w9,{}),tooltip:`${C("parameters.useAll")} (A)`,"aria-label":`${C("parameters.useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((Z=($=m==null?void 0:m.metadata)==null?void 0:$.image)==null?void 0:Z.type),onClick:P})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(or,{triggerComponent:l.jsx(se,{icon:l.jsx(T9,{}),"aria-label":C("parameters.restoreFaces")}),children:l.jsxs(L,{sx:{flexDirection:"column",rowGap:4},children:[l.jsx(pp,{}),l.jsx(Je,{isDisabled:!o||!m||!(r&&!n)||!u,onClick:D,children:C("parameters.restoreFaces")})]})}),l.jsx(or,{triggerComponent:l.jsx(se,{icon:l.jsx(E9,{}),"aria-label":C("parameters.upscale")}),children:l.jsxs(L,{sx:{flexDirection:"column",gap:4},children:[l.jsx(mp,{}),l.jsx(Je,{isDisabled:!s||!m||!(r&&!n)||!c,onClick:_,children:C("parameters.upscaleImage")})]})})]}),l.jsx(Qt,{isAttached:!0,children:l.jsx(se,{icon:l.jsx(Bx,{}),tooltip:`${C("parameters.info")} (I)`,"aria-label":`${C("parameters.info")} (I)`,isChecked:h,onClick:z})}),l.jsx(hc,{image:m,children:l.jsx(se,{icon:l.jsx(So,{}),tooltip:`${C("parameters.deleteImage")} (Del)`,"aria-label":`${C("parameters.deleteImage")} (Del)`,isDisabled:!m||!r||n,colorScheme:"error"})})]})},CA=e=>{const{size:t="xl",...n}=e;return l.jsx(L,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",position:"absolute",color:"base.400"},children:l.jsx(yc,{size:t,...n})})};function wA(e){return ge({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 yt=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:c}=K();return l.jsxs(L,{gap:2,children:[n&&l.jsx(Gt,{label:`Recall ${e}`,children:l.jsx(ho,{"aria-label":c("accessibility.useThisParameter"),icon:l.jsx(wA,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&l.jsx(Gt,{label:`Copy ${e}`,children:l.jsx(ho,{"aria-label":`Copy ${e}`,icon:l.jsx(Xi,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),l.jsxs(L,{direction:o?"column":"row",children:[l.jsxs(Ce,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?l.jsxs(qo,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",l.jsx(Eb,{mx:"2px"})]}):l.jsx(Ce,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]})},jA=(e,t)=>e.image.uuid===t.image.uuid,yp=y.memo(({image:e})=>{var F,B;const t=Y(),n=gp();de("esc",()=>{t(A1(!1))});const r=((F=e==null?void 0:e.metadata)==null?void 0:F.image)||{},o=e==null?void 0:e.dreamPrompt,{cfg_scale:s,fit:c,height:u,hires_fix:f,init_image_path:h,mask_image_path:m,orig_path:v,perlin:x,postprocessing:S,prompt:C,sampler:j,seamless:w,seed:k,steps:M,strength:P,threshold:I,type:T,variations:_,width:D}=r,{t:z}=K(),W=JSON.stringify(e.metadata,null,2);return l.jsxs(L,{sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",backdropFilter:"blur(20px)",bg:"whiteAlpha.600",_dark:{bg:"blackAlpha.600"}},children:[l.jsxs(L,{gap:2,children:[l.jsx(Ce,{fontWeight:"semibold",children:"File:"}),l.jsxs(qo,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,l.jsx(Eb,{mx:"2px"})]})]}),Object.keys(r).length>0?l.jsxs(l.Fragment,{children:[T&&l.jsx(yt,{label:"Generation type",value:T}),((B=e.metadata)==null?void 0:B.model_weights)&&l.jsx(yt,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(T)&&l.jsx(yt,{label:"Original image",value:v}),C&&l.jsx(yt,{label:"Prompt",labelPosition:"top",value:typeof C=="string"?C:M1(C),onClick:()=>n(C)}),k!==void 0&&l.jsx(yt,{label:"Seed",value:k,onClick:()=>t(is(k))}),I!==void 0&&l.jsx(yt,{label:"Noise Threshold",value:I,onClick:()=>t(tf(I))}),x!==void 0&&l.jsx(yt,{label:"Perlin Noise",value:x,onClick:()=>t(nf(x))}),j&&l.jsx(yt,{label:"Sampler",value:j,onClick:()=>t(O1(j))}),M&&l.jsx(yt,{label:"Steps",value:M,onClick:()=>t(rf(M))}),s!==void 0&&l.jsx(yt,{label:"CFG scale",value:s,onClick:()=>t(of(s))}),_&&_.length>0&&l.jsx(yt,{label:"Seed-weight pairs",value:Mv(_),onClick:()=>t(z1(Mv(_)))}),w&&l.jsx(yt,{label:"Seamless",value:w,onClick:()=>t(R1(w))}),f&&l.jsx(yt,{label:"High Resolution Optimization",value:f,onClick:()=>t(N1(f))}),D&&l.jsx(yt,{label:"Width",value:D,onClick:()=>t(Fl(D))}),u&&l.jsx(yt,{label:"Height",value:u,onClick:()=>t(Ll(u))}),h&&l.jsx(yt,{label:"Initial image",value:h,isLink:!0,onClick:()=>t(rs(h))}),m&&l.jsx(yt,{label:"Mask image",value:m,isLink:!0,onClick:()=>t(p3(m))}),T==="img2img"&&P&&l.jsx(yt,{label:"Image to image strength",value:P,onClick:()=>t(af(P))}),c&&l.jsx(yt,{label:"Image to image fit",value:c,onClick:()=>t(F1(c))}),S&&S.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(Wn,{size:"sm",children:"Postprocessing"}),S.map((Q,U)=>{if(Q.type==="esrgan"){const{scale:X,strength:te,denoise_str:re}=Q;return l.jsxs(L,{pl:8,gap:1,direction:"column",children:[l.jsx(Ce,{size:"md",children:`${U+1}: Upscale (ESRGAN)`}),l.jsx(yt,{label:"Scale",value:X,onClick:()=>t(I1(X))}),l.jsx(yt,{label:"Strength",value:te,onClick:()=>t(ef(te))}),re!==void 0&&l.jsx(yt,{label:"Denoising strength",value:re,onClick:()=>t(Jd(re))})]},U)}else if(Q.type==="gfpgan"){const{strength:X}=Q;return l.jsxs(L,{pl:8,gap:1,direction:"column",children:[l.jsx(Ce,{size:"md",children:`${U+1}: Face restoration (GFPGAN)`}),l.jsx(yt,{label:"Strength",value:X,onClick:()=>{t(Yl(X)),t(Nl("gfpgan"))}})]},U)}else if(Q.type==="codeformer"){const{strength:X,fidelity:te}=Q;return l.jsxs(L,{pl:8,gap:1,direction:"column",children:[l.jsx(Ce,{size:"md",children:`${U+1}: Face restoration (Codeformer)`}),l.jsx(yt,{label:"Strength",value:X,onClick:()=>{t(Yl(X)),t(Nl("codeformer"))}}),te&&l.jsx(yt,{label:"Fidelity",value:te,onClick:()=>{t(Zd(te)),t(Nl("codeformer"))}})]},U)}})]}),o&&l.jsx(yt,{withCopy:!0,label:"Dream Prompt",value:o}),l.jsxs(L,{gap:2,direction:"column",children:[l.jsxs(L,{gap:2,children:[l.jsx(Gt,{label:"Copy metadata JSON",children:l.jsx(ho,{"aria-label":z("accessibility.copyMetadataJson"),icon:l.jsx(Xi,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(W)})}),l.jsx(Ce,{fontWeight:"semibold",children:"Metadata JSON:"})]}),l.jsx(Ye,{sx:{mt:0,mr:2,mb:4,ml:2,padding:4,borderRadius:"base",overflowX:"scroll",wordBreak:"break-all",bg:"whiteAlpha.500",_dark:{bg:"blackAlpha.500"}},children:l.jsx("pre",{children:W})})]})]}):l.jsx(by,{width:"100%",pt:10,children:l.jsx(Ce,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})},jA);yp.displayName="ImageMetadataViewer";const U0={height:"100%",width:"15%",alignItems:"center",pointerEvents:"auto"},$0={color:"base.100"},kA=me(qr,e=>{const{currentImage:t}=e,n=e.categories[t?t.category:"result"].images,r=n.findIndex(s=>{var c;return s.uuid===((c=e==null?void 0:e.currentImage)==null?void 0:c.uuid)}),o=n.length;return{isOnFirstImage:r===0,isOnLastImage:!isNaN(r)&&r===o-1}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),zb=()=>{const e=Y(),{t}=K(),{isOnFirstImage:n,isOnLastImage:r}=A(kA),[o,s]=y.useState(!1),c=()=>{s(!0)},u=()=>{s(!1)},f=()=>{e(L1())},h=()=>{e(B1())};return l.jsxs(L,{sx:{justifyContent:"space-between",zIndex:1,height:"100%",width:"100%",pointerEvents:"none"},children:[l.jsx(ir,{sx:{...U0,justifyContent:"flex-start"},onMouseOver:c,onMouseOut:u,children:o&&!n&&l.jsx(ho,{"aria-label":t("accessibility.previousImage"),icon:l.jsx(b9,{size:64}),variant:"unstyled",onClick:f,boxSize:16,sx:$0})}),l.jsx(ir,{sx:{...U0,justifyContent:"flex-end"},onMouseOver:c,onMouseOut:u,children:o&&!r&&l.jsx(ho,{"aria-label":t("accessibility.nextImage"),icon:l.jsx(S9,{size:64}),variant:"unstyled",onClick:h,boxSize:16,sx:$0})})]})},EA=me([qr,Pr],(e,t)=>{const{currentImage:n,intermediateImage:r}=e,{shouldShowImageDetails:o}=t;return{imageToDisplay:r||n,isIntermediate:Boolean(r),shouldShowImageDetails:o}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function PA(){const{shouldShowImageDetails:e,imageToDisplay:t,isIntermediate:n}=A(EA);return l.jsxs(L,{sx:{position:"relative",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:[t&&l.jsx(cs,{src:t.url,width:t.width,height:t.height,fallback:n?void 0:l.jsx(CA,{}),sx:{objectFit:"contain",maxWidth:"100%",maxHeight:"100%",height:"auto",position:"absolute",imageRendering:n?"pixelated":"initial",borderRadius:"base"}}),!e&&l.jsx(zb,{}),e&&t&&l.jsx(Ye,{sx:{position:"absolute",top:"0",width:"100%",height:"100%",borderRadius:"base",overflow:"scroll",maxHeight:tP},children:l.jsx(yp,{image:t})})]})}const IA=me([qr],e=>{const{currentImage:t,intermediateImage:n}=e;return{hasAnImageToDisplay:t||n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Rb=()=>{const{hasAnImageToDisplay:e}=A(IA);return l.jsx(L,{sx:{flexDirection:"column",height:"100%",width:"100%",rowGap:4,borderRadius:"base"},children:e?l.jsxs(l.Fragment,{children:[l.jsx(Ob,{}),l.jsx(PA,{})]}):l.jsx(L,{sx:{alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:l.jsx(tn,{as:VD,sx:{boxSize:24,color:"base.500"}})})})},MA=()=>{const{t:e}=K(),t=y.useContext(Yh);return l.jsx(se,{"aria-label":e("accessibility.uploadImage"),tooltip:"Upload Image",icon:l.jsx(Rc,{}),onClick:t||void 0})};function TA(){const e=A(s=>s.generation.initialImage),{t}=K(),n=Y(),r=ls(),o=()=>{r({title:t("toast.parametersFailed"),description:t("toast.parametersFailedDesc"),status:"error",isClosable:!0}),n(m3())};return l.jsxs(l.Fragment,{children:[l.jsxs(L,{sx:{alignItems:"center",justifyContent:"center",w:"100%",gap:4},children:[l.jsx(Ce,{sx:{fontSize:"lg"},variant:"subtext",children:t("parameters.initialImage")}),l.jsx(MA,{})]}),e&&l.jsx(L,{sx:{position:"relative",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},children:l.jsx(cs,{sx:{fit:"contain",maxWidth:"100%",maxHeight:"100%",borderRadius:"base",objectFit:"contain",position:"absolute"},src:typeof e=="string"?e:e.url,onError:o})})]})}const G0={flexDirection:"column",height:"100%",width:"100%",gap:4,padding:4},_A=()=>{const t=A(n=>n.generation.initialImage)?l.jsx(L,{flexDirection:"column",gap:4,w:"100%",h:"100%",children:l.jsx(TA,{})}):l.jsx(hA,{});return l.jsxs(ir,{sx:{w:"100%",h:"100%",gridTemplateColumns:"1fr 1fr",borderRadius:"base",bg:"base.850"},children:[l.jsx(L,{sx:{...G0,paddingInlineEnd:2},children:t}),l.jsx(L,{sx:{...G0,paddingInlineStart:2},children:l.jsx(Rb,{})})]})};var ln=(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))(ln||{});const DA=()=>{const{t:e}=K();return y.useMemo(()=>({[0]:{text:e("tooltip.feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip.feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip.feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip.feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip.feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip.feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip.feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip.feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip.feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip.feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip.feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},AA=e=>DA()[e];function Nb(){const e=A(o=>o.system.isGFPGANAvailable),t=A(o=>o.postprocessing.shouldRunFacetool),n=Y(),r=o=>n(v3(o.target.checked));return l.jsx(En,{isDisabled:!e,isChecked:t,onChange:r})}const Fb=()=>{const e=Y(),t=A(o=>o.generation.seamless),n=o=>e(R1(o.target.checked)),{t:r}=K();return l.jsx(En,{label:r("parameters.seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})},OA=()=>l.jsx(Fe,{gap:2,alignItems:"stretch",children:l.jsx(Fb,{})});function xp(){const e=A(s=>s.generation.horizontalSymmetrySteps),t=A(s=>s.generation.verticalSymmetrySteps),n=A(s=>s.generation.steps),r=Y(),{t:o}=K();return l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(ut,{label:o("parameters.hSymmetryStep"),value:e,onChange:s=>r(Tv(s)),min:0,max:n,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>r(Tv(0))}),l.jsx(ut,{label:o("parameters.vSymmetryStep"),value:t,onChange:s=>r(_v(s)),min:0,max:n,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>r(_v(0))})]})}function bp(){const e=A(n=>n.generation.shouldUseSymmetry),t=Y();return l.jsx(En,{isChecked:e,onChange:n=>t(g3(n.target.checked))})}function zA(){const e=Y(),t=A(r=>r.generation.perlin),{t:n}=K();return l.jsx(ut,{label:n("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:r=>e(nf(r)),handleReset:()=>e(nf(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}function RA(){const e=Y(),{t}=K(),n=A(o=>o.generation.shouldRandomizeSeed),r=o=>e(y3(o.target.checked));return l.jsx(En,{label:t("parameters.randomizeSeed"),isChecked:n,onChange:r})}function NA(){const e=Y(),t=A(o=>o.generation.shouldRandomizeSeed),{t:n}=K(),r=()=>e(is(x3(W1,H1)));return l.jsx(ni,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:l.jsx("p",{children:n("parameters.shuffle")})})}function FA(){const e=A(c=>c.generation.seed),t=A(c=>c.generation.shouldRandomizeSeed),n=A(c=>c.generation.shouldGenerateVariations),{t:r}=K(),o=Y(),s=c=>o(is(c));return l.jsxs(oa,{gap:2,children:[l.jsx(Vr,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:W1,max:H1,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e,formControlProps:{display:"flex",alignItems:"center",gap:3}}),l.jsx(NA,{})]})}function LA(){const e=Y(),t=A(r=>r.generation.threshold),{t:n}=K();return l.jsx(ut,{label:n("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:r=>e(tf(r)),handleReset:()=>e(tf(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const Sp=()=>l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(RA,{}),l.jsx(FA,{}),l.jsx(LA,{}),l.jsx(zA,{})]});function Lb(){const e=A(o=>o.system.isESRGANAvailable),t=A(o=>o.postprocessing.shouldRunESRGAN),n=Y(),r=o=>n(b3(o.target.checked));return l.jsx(En,{isDisabled:!e,isChecked:t,onChange:r})}function Cp(){const e=A(r=>r.generation.shouldGenerateVariations),t=Y(),n=r=>t(S3(r.target.checked));return l.jsx(En,{isChecked:e,width:"auto",onChange:n})}function BA(){const e=A(s=>s.generation.seedWeights),t=A(s=>s.generation.shouldGenerateVariations),{t:n}=K(),r=Y(),o=s=>r(z1(s.target.value));return l.jsx(mt,{label:n("parameters.seedWeights"),value:e,isInvalid:t&&!(V1(e)||e===""),isDisabled:!t,onChange:o})}function HA(){const e=A(o=>o.generation.variationAmount),t=A(o=>o.generation.shouldGenerateVariations),{t:n}=K(),r=Y();return l.jsx(ut,{label:n("parameters.variationAmount"),value:e,step:.01,min:0,max:1,isSliderDisabled:!t,isInputDisabled:!t,isResetDisabled:!t,onChange:o=>r(Dv(o)),handleReset:()=>r(Dv(.1)),withInput:!0,withReset:!0,withSliderMarks:!0})}const wp=()=>l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(HA,{}),l.jsx(BA,{})]});function q0(){const e=Y(),t=A(s=>s.generation.cfgScale),n=A(s=>s.ui.shouldUseSliders),{t:r}=K(),o=s=>e(of(s));return n?l.jsx(ut,{label:r("parameters.cfgScale"),step:.5,min:1.01,max:30,onChange:o,handleReset:()=>e(of(7.5)),value:t,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0}):l.jsx(Vr,{label:r("parameters.cfgScale"),step:.5,min:1.01,max:200,onChange:o,value:t,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})}function Y0(){const e=A(s=>s.generation.height),t=A(s=>s.ui.shouldUseSliders),n=A(bt),r=Y(),{t:o}=K();return t?l.jsx(ut,{isSliderDisabled:n==="unifiedCanvas",isInputDisabled:n==="unifiedCanvas",isResetDisabled:n==="unifiedCanvas",label:o("parameters.height"),value:e,min:64,step:64,max:2048,onChange:s=>r(Ll(s)),handleReset:()=>r(Ll(512)),withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:15360}}):l.jsx(Mn,{isDisabled:n==="unifiedCanvas",label:o("parameters.height"),value:e,flexGrow:1,onChange:s=>r(Ll(Number(s.target.value))),validValues:C3})}function K0(){const e=A(s=>s.generation.iterations),t=A(s=>s.ui.shouldUseSliders),n=Y(),{t:r}=K(),o=s=>n(Av(s));return t?l.jsx(ut,{label:r("parameters.images"),step:1,min:1,max:16,onChange:o,handleReset:()=>n(Av(1)),value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:9999}}):l.jsx(Vr,{label:r("parameters.images"),step:1,min:1,max:9999,onChange:o,value:e,numberInputFieldProps:{textAlign:"center"}})}function X0(){const e=A(s=>s.generation.sampler),t=A(qx),n=Y(),{t:r}=K(),o=s=>n(O1(s.target.value));return l.jsx(Mn,{label:r("parameters.sampler"),value:e,onChange:o,validValues:t.format==="diffusers"?w3:j3,minWidth:36})}function Q0(){const e=Y(),t=A(c=>c.generation.steps),n=A(c=>c.ui.shouldUseSliders),{t:r}=K(),o=c=>{e(rf(c))},s=()=>{e(U1())};return n?l.jsx(ut,{label:r("parameters.steps"),min:1,step:1,onChange:o,handleReset:()=>e(rf(20)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:9999}}):l.jsx(Vr,{label:r("parameters.steps"),min:1,max:9999,step:1,onChange:o,value:t,numberInputFieldProps:{textAlign:"center"},onBlur:s})}function Z0(){const e=A(s=>s.generation.width),t=A(s=>s.ui.shouldUseSliders),n=A(bt),{t:r}=K(),o=Y();return t?l.jsx(ut,{isSliderDisabled:n==="unifiedCanvas",isInputDisabled:n==="unifiedCanvas",isResetDisabled:n==="unifiedCanvas",label:r("parameters.width"),value:e,min:64,step:64,max:2048,onChange:s=>o(Fl(s)),handleReset:()=>o(Fl(512)),withInput:!0,withReset:!0,withSliderMarks:!0,inputReadOnly:!0,sliderNumberInputProps:{max:15360}}):l.jsx(Mn,{isDisabled:n==="unifiedCanvas",label:r("parameters.width"),value:e,flexGrow:1,onChange:s=>o(Fl(Number(s.target.value))),validValues:k3})}function jp(){return A(t=>t.ui.shouldUseSliders)?l.jsxs(Fe,{gap:2,children:[l.jsx(K0,{}),l.jsx(Q0,{}),l.jsx(q0,{}),l.jsx(Z0,{}),l.jsx(Y0,{}),l.jsx(X0,{})]}):l.jsxs(L,{rowGap:2,flexDirection:"column",children:[l.jsxs(L,{columnGap:1,children:[l.jsx(K0,{}),l.jsx(Q0,{}),l.jsx(q0,{})]}),l.jsxs(L,{columnGap:1,children:[l.jsx(Z0,{}),l.jsx(Y0,{}),l.jsx(X0,{})]})]})}const WA=me(Et,e=>e.shouldDisplayGuides),VA=({children:e,feature:t})=>{const n=A(WA),{text:r}=AA(t);return n?l.jsxs(Uh,{trigger:"hover",isLazy:!0,children:[l.jsx(Vh,{children:l.jsx(Ye,{children:e})}),l.jsxs(Gh,{maxWidth:"400px",onClick:o=>o.preventDefault(),cursor:"initial",children:[l.jsx($h,{}),l.jsx(Xy,{children:r})]})]}):null},UA=y.memo(VA),$A=fe(({feature:e,icon:t=RD},n)=>l.jsx(UA,{feature:e,children:l.jsx(Ye,{ref:n,children:l.jsx(tn,{marginBottom:"-.15rem",as:t})})})),GA=y.memo($A);function qA(e){const{header:t,feature:n,content:r,additionalHeaderComponents:o}=e;return l.jsxs(zi,{children:[l.jsx(Ai,{children:l.jsxs(L,{width:"100%",gap:2,align:"center",children:[l.jsx(Ye,{flexGrow:1,textAlign:"start",children:t}),o,n&&l.jsx(GA,{feature:n}),l.jsx(Oi,{})]})}),l.jsx(Ri,{children:r})]})}const kp=e=>{const{accordionInfo:t}=e,n=A(c=>c.system.openAccordions),r=Y(),o=c=>r(E3(c)),s=()=>{const c=[];return t&&Object.keys(t).forEach(u=>{const{header:f,feature:h,content:m,additionalHeaderComponents:v}=t[u];c.push(l.jsx(qA,{header:f,feature:h,content:m,additionalHeaderComponents:v},u))}),c};return l.jsx(ih,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:o,sx:{display:"flex",flexDirection:"column",gap:2},children:s()})},YA=e=>{const{menuType:t="icon",iconTooltip:n,buttonText:r,isLazy:o=!0,menuItems:s,menuProps:c,menuButtonProps:u,menuListProps:f,menuItemProps:h}=e,m=()=>{const v=[];return s.forEach((x,S)=>{v.push(l.jsx(gr,{onClick:x.onClick,fontSize:"sm",...h,children:x.item},S))}),v};return l.jsx(Ah,{...c,isLazy:o,children:({isOpen:v})=>l.jsxs(l.Fragment,{children:[l.jsx(zh,{as:t==="icon"?ho:ni,tooltip:n,"aria-label":n,icon:v?l.jsx($D,{}):l.jsx(UD,{}),paddingX:0,paddingY:t==="regular"?2:0,...u,children:t==="regular"&&r}),l.jsx(Oh,{zIndex:15,padding:0,...f,children:m()})]})})},KA=y.memo(YA),XA=me(Et,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable,currentIteration:e.currentIteration,totalIterations:e.totalIterations,cancelType:e.cancelOptions.cancelType,cancelAfter:e.cancelOptions.cancelAfter}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),QA=e=>{const t=Y(),{btnGroupWidth:n="auto",...r}=e,{isProcessing:o,isConnected:s,isCancelable:c,currentIteration:u,totalIterations:f,cancelType:h,cancelAfter:m}=A(XA),v=y.useCallback(()=>{t(P3()),t(fd(null))},[t]),{t:x}=K(),S=m!==null;de("shift+x",()=>{(s||o)&&c&&v()},[s,o,c]),y.useEffect(()=>{m!==null&&m<u&&v()},[m,u,v]);const C=[{item:x("parameters.cancel.immediate"),onClick:()=>t(Ov("immediate"))},{item:x("parameters.cancel.schedule"),onClick:()=>t(Ov("scheduled"))}];return l.jsxs(Qt,{isAttached:!0,width:n,children:[h==="immediate"?l.jsx(se,{icon:l.jsx(GD,{}),tooltip:x("parameters.cancel.immediate"),"aria-label":x("parameters.cancel.immediate"),isDisabled:!s||!o||!c,onClick:v,colorScheme:"error",...r}):l.jsx(se,{icon:S?l.jsx(tc,{}):l.jsx(zD,{}),tooltip:x(S?"parameters.cancel.isScheduled":"parameters.cancel.schedule"),"aria-label":x(S?"parameters.cancel.isScheduled":"parameters.cancel.schedule"),isDisabled:!s||!o||!c||u===f,onClick:()=>{t(S?fd(null):fd(u))},colorScheme:"error",...r}),l.jsx(KA,{menuItems:C,iconTooltip:x("parameters.cancel.setType"),menuButtonProps:{colorScheme:"error",minWidth:5}})]})},Ep=y.memo(QA),tt=e=>e.canvas,Ot=me([tt,bt,Et],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Bb=e=>e.canvas.layerState.objects.find($1),Pp=e=>e.generation;me(Pp,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:ee.isEqual}});const Hb=me([Pp,Et,Bb,bt],(e,t,n,r)=>{const{prompt:o,shouldGenerateVariations:s,seedWeights:c,initialImage:u,seed:f}=e,{isProcessing:h,isConnected:m}=t;let v=!0;const x=[];return(!o||Boolean(o.match(/^[\s\r\n]+$/)))&&(v=!1,x.push("Missing prompt")),r==="img2img"&&!u&&(v=!1,x.push("No initial image selected")),h&&(v=!1,x.push("System Busy")),m||(v=!1,x.push("System Disconnected")),s&&(!(V1(c)||c==="")||f===-1)&&(v=!1,x.push("Seed-Weights badly formatted.")),{isReady:v,reasonsWhyNotReady:x}},{memoizeOptions:{equalityCheck:ee.isEqual,resultEqualityCheck:ee.isEqual}});function Ip(e){const{iconButton:t=!1,...n}=e,r=Y(),{isReady:o}=A(Hb),s=A(bt),c=()=>{r(sf(s))},{t:u}=K();return de(["ctrl+enter","meta+enter"],()=>{r(U1()),r(sf(s))},{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,s]),l.jsx(Ye,{style:{flexGrow:4},children:t?l.jsx(se,{"aria-label":u("parameters.invoke"),type:"submit",icon:l.jsx(N9,{}),isDisabled:!o,onClick:c,flexGrow:1,w:"100%",tooltip:u("parameters.invoke"),tooltipProps:{placement:"bottom"},colorScheme:"accent",...n}):l.jsx(Je,{"aria-label":u("parameters.invoke"),type:"submit",isDisabled:!o,onClick:c,flexGrow:1,w:"100%",colorScheme:"accent",fontWeight:700,...n,children:"Invoke"})})}const ZA=me(vp,({shouldLoopback:e})=>e),JA=()=>{const e=Y(),t=A(ZA),{t:n}=K();return l.jsx(se,{"aria-label":n("parameters.toggleLoopback"),tooltip:n("parameters.toggleLoopback"),isChecked:t,icon:l.jsx(L9,{}),onClick:()=>{e(I3(!t))}})},Mp=()=>{const e=A(bt);return l.jsxs(L,{gap:2,children:[l.jsx(Ip,{}),e==="img2img"&&l.jsx(JA,{}),l.jsx(Ep,{})]})},Tp=()=>{const e=A(r=>r.generation.negativePrompt),t=Y(),{t:n}=K();return l.jsx(rt,{children:l.jsx(qh,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(_1(r.target.value)),placeholder:n("parameters.negativePrompts"),_focusVisible:{borderColor:"error.600"},fontSize:"sm"})})},eO=me([e=>e.generation,bt],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),_p=()=>{const e=Y(),{prompt:t,activeTabName:n}=A(eO),{isReady:r}=A(Hb),o=y.useRef(null),{t:s}=K(),c=f=>{e(T1(f.target.value))};de("alt+a",()=>{var f;(f=o.current)==null||f.focus()},[]);const u=f=>{f.key==="Enter"&&f.shiftKey===!1&&r&&(f.preventDefault(),e(sf(n)))};return l.jsx(Ye,{children:l.jsx(rt,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:l.jsx(qh,{id:"prompt",name:"prompt",placeholder:s("parameters.promptPlaceholder"),value:t,onChange:c,onKeyDown:u,resize:"vertical",ref:o,minH:40})})})};function tO(){const e=Y(),t=A(o=>o.generation.shouldFitToWidthHeight),n=o=>e(F1(o.target.checked)),{t:r}=K();return l.jsx(En,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function Wb(e){const{t}=K(),{label:n=`${t("parameters.strength")}`}=e,r=A(u=>u.generation.img2imgStrength),o=Y(),s=u=>o(af(u)),c=()=>{o(af(.75))};return l.jsx(ut,{label:n,step:.01,min:.01,max:1,onChange:s,value:r,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:22,withReset:!0,handleReset:c})}function nO(){const{t:e}=K();return l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(Wb,{label:e("parameters.img2imgStrength")}),l.jsx(tO,{})]})}const rO=()=>{const{t:e}=K(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(jp,{})},imageToImage:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:l.jsx(nO,{})},seed:{header:`${e("parameters.seed")}`,feature:ln.SEED,content:l.jsx(Sp,{})},variations:{header:`${e("parameters.variations")}`,feature:ln.VARIATIONS,content:l.jsx(wp,{}),additionalHeaderComponents:l.jsx(Cp,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:ln.FACE_CORRECTION,content:l.jsx(pp,{}),additionalHeaderComponents:l.jsx(Nb,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:ln.UPSCALE,content:l.jsx(mp,{}),additionalHeaderComponents:l.jsx(Lb,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(xp,{}),additionalHeaderComponents:l.jsx(bp,{})},other:{header:`${e("parameters.otherOptions")}`,feature:ln.OTHER,content:l.jsx(OA,{})}};return l.jsxs(L,{flexDir:"column",gap:2,position:"relative",children:[l.jsx(_p,{}),l.jsx(Tp,{}),l.jsx(Mp,{}),l.jsx(kp,{accordionInfo:t})]})},oO=y.memo(rO);function iO(){return l.jsx(hp,{parametersPanelContent:l.jsx(oO,{}),children:l.jsx(_A,{})})}const aO=()=>l.jsx(Ye,{sx:{width:"100%",height:"100%",borderRadius:"base",bg:"base.850"},children:l.jsx(L,{sx:{p:4,width:"100%",height:"100%"},children:l.jsx(Rb,{})})}),sO=me([vp],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),lO=()=>{const{hiresFix:e,hiresStrength:t}=A(sO),n=Y(),{t:r}=K(),o=c=>{n(zv(c))},s=()=>{n(zv(.75))};return l.jsx(ut,{label:r("parameters.hiresStrength"),step:.01,min:.01,max:.99,onChange:o,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})},cO=()=>{const e=Y(),t=A(o=>o.postprocessing.hiresFix),{t:n}=K(),r=o=>e(N1(o.target.checked));return l.jsx(En,{label:n("parameters.hiresOptim"),fontSize:"md",isChecked:t,onChange:r})},uO=()=>l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(Fb,{}),l.jsx(cO,{}),l.jsx(lO,{})]}),dO=()=>{const{t:e}=K(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(jp,{})},seed:{header:`${e("parameters.seed")}`,feature:ln.SEED,content:l.jsx(Sp,{})},variations:{header:`${e("parameters.variations")}`,feature:ln.VARIATIONS,content:l.jsx(wp,{}),additionalHeaderComponents:l.jsx(Cp,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:ln.FACE_CORRECTION,content:l.jsx(pp,{}),additionalHeaderComponents:l.jsx(Nb,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:ln.UPSCALE,content:l.jsx(mp,{}),additionalHeaderComponents:l.jsx(Lb,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(xp,{}),additionalHeaderComponents:l.jsx(bp,{})},other:{header:`${e("parameters.otherOptions")}`,feature:ln.OTHER,content:l.jsx(uO,{})}};return l.jsxs(L,{flexDir:"column",gap:2,children:[l.jsx(_p,{}),l.jsx(Tp,{}),l.jsx(Mp,{}),l.jsx(kp,{accordionInfo:t})]})},fO=y.memo(dO);function hO(){return l.jsx(hp,{parametersPanelContent:l.jsx(fO,{}),children:l.jsx(aO,{})})}var $f={},pO={get exports(){return $f},set exports(e){$f=e}};/**
|
||
* @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 mO=function(t){var n={},r=y,o=Bl,s=Object.assign;function c(i){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+i,d=1;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=Symbol.for("react.element"),h=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),T=Symbol.iterator;function _(i){return i===null||typeof i!="object"?null:(i=T&&i[T]||i["@@iterator"],typeof i=="function"?i:null)}function D(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case m:return"Fragment";case h:return"Portal";case x:return"Profiler";case v:return"StrictMode";case w:return"Suspense";case k:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case C:return(i.displayName||"Context")+".Consumer";case S:return(i._context.displayName||"Context")+".Provider";case j:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case M:return a=i.displayName||null,a!==null?a:D(i.type)||"Memo";case P:a=i._payload,i=i._init;try{return D(i(a))}catch{}}return null}function z(i){var a=i.type;switch(i.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=a.render,i=i.displayName||i.name||"",a.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return D(a);case 8:return a===v?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function W(i){var a=i,d=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,a.flags&4098&&(d=a.return),i=a.return;while(i)}return a.tag===3?d:null}function F(i){if(W(i)!==i)throw Error(c(188))}function B(i){var a=i.alternate;if(!a){if(a=W(i),a===null)throw Error(c(188));return a!==i?null:i}for(var d=i,p=a;;){var g=d.return;if(g===null)break;var b=g.alternate;if(b===null){if(p=g.return,p!==null){d=p;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===d)return F(g),i;if(b===p)return F(g),a;b=b.sibling}throw Error(c(188))}if(d.return!==p.return)d=g,p=b;else{for(var E=!1,O=g.child;O;){if(O===d){E=!0,d=g,p=b;break}if(O===p){E=!0,p=g,d=b;break}O=O.sibling}if(!E){for(O=b.child;O;){if(O===d){E=!0,d=b,p=g;break}if(O===p){E=!0,p=b,d=g;break}O=O.sibling}if(!E)throw Error(c(189))}}if(d.alternate!==p)throw Error(c(190))}if(d.tag!==3)throw Error(c(188));return d.stateNode.current===d?i:a}function Q(i){return i=B(i),i!==null?U(i):null}function U(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var a=U(i);if(a!==null)return a;i=i.sibling}return null}function X(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){if(i.tag!==4){var a=X(i);if(a!==null)return a}i=i.sibling}return null}var te=Array.isArray,re=t.getPublicInstance,$=t.getRootHostContext,Z=t.getChildHostContext,oe=t.prepareForCommit,le=t.resetAfterCommit,ze=t.createInstance,Re=t.appendInitialChild,Ie=t.finalizeInitialChildren,pe=t.prepareUpdate,ce=t.shouldSetTextContent,Ne=t.createTextInstance,Ve=t.scheduleTimeout,Ue=t.cancelTimeout,$e=t.noTimeout,Qe=t.isPrimaryRenderer,ve=t.supportsMutation,Te=t.supportsPersistence,Ge=t.supportsHydration,ye=t.getInstanceFromNode,Pe=t.preparePortalMount,et=t.getCurrentEventPriority,Be=t.detachDeletedInstance,vt=t.supportsMicrotasks,Rt=t.scheduleMicrotask,N=t.supportsTestSelectors,ue=t.findFiberRoot,xe=t.getBoundingRect,je=t.getTextContent,q=t.isHiddenSubtree,ae=t.matchAccessibilityRole,Oe=t.setFocusIfFocusable,Ze=t.setupIntersectionObserver,J=t.appendChild,Le=t.appendChildToContainer,nt=t.commitTextUpdate,Nt=t.commitMount,he=t.commitUpdate,_e=t.insertBefore,dn=t.insertInContainerBefore,Vt=t.removeChild,fn=t.removeChildFromContainer,sr=t.resetTextContent,ko=t.hideInstance,la=t.hideTextInstance,Xc=t.unhideInstance,ca=t.unhideTextInstance,Eo=t.clearContainer,j4=t.cloneInstance,Lp=t.createContainerChildSet,Bp=t.appendChildToContainerChildSet,k4=t.finalizeContainerChildren,Qc=t.replaceContainerChildren,Hp=t.cloneHiddenInstance,Wp=t.cloneHiddenTextInstance,E4=t.canHydrateInstance,P4=t.canHydrateTextInstance,I4=t.canHydrateSuspenseInstance,Vp=t.isSuspenseInstancePending,Zc=t.isSuspenseInstanceFallback,M4=t.getSuspenseInstanceFallbackErrorDetails,T4=t.registerSuspenseInstanceRetry,ws=t.getNextHydratableSibling,_4=t.getFirstHydratableChild,D4=t.getFirstHydratableChildWithinContainer,A4=t.getFirstHydratableChildWithinSuspenseInstance,O4=t.hydrateInstance,z4=t.hydrateTextInstance,R4=t.hydrateSuspenseInstance,N4=t.getNextHydratableInstanceAfterSuspenseInstance,F4=t.commitHydratedContainer,L4=t.commitHydratedSuspenseInstance,B4=t.clearSuspenseBoundary,H4=t.clearSuspenseBoundaryFromContainer,W4=t.shouldDeleteUnhydratedTailInstances,V4=t.didNotMatchHydratedContainerTextInstance,U4=t.didNotMatchHydratedTextInstance,Jc;function ua(i){if(Jc===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);Jc=a&&a[1]||""}return`
|
||
`+Jc+i}var eu=!1;function tu(i,a){if(!i||eu)return"";eu=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(ie){var p=ie}Reflect.construct(i,[],a)}else{try{a.call()}catch(ie){p=ie}i.call(a.prototype)}else{try{throw Error()}catch(ie){p=ie}i()}}catch(ie){if(ie&&p&&typeof ie.stack=="string"){for(var g=ie.stack.split(`
|
||
`),b=p.stack.split(`
|
||
`),E=g.length-1,O=b.length-1;1<=E&&0<=O&&g[E]!==b[O];)O--;for(;1<=E&&0<=O;E--,O--)if(g[E]!==b[O]){if(E!==1||O!==1)do if(E--,O--,0>O||g[E]!==b[O]){var V=`
|
||
`+g[E].replace(" at new "," at ");return i.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",i.displayName)),V}while(1<=E&&0<=O);break}}}finally{eu=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?ua(i):""}var $4=Object.prototype.hasOwnProperty,nu=[],ci=-1;function Yr(i){return{current:i}}function St(i){0>ci||(i.current=nu[ci],nu[ci]=null,ci--)}function gt(i,a){ci++,nu[ci]=i.current,i.current=a}var Kr={},nn=Yr(Kr),yn=Yr(!1),Po=Kr;function ui(i,a){var d=i.type.contextTypes;if(!d)return Kr;var p=i.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===a)return p.__reactInternalMemoizedMaskedChildContext;var g={},b;for(b in d)g[b]=a[b];return p&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=a,i.__reactInternalMemoizedMaskedChildContext=g),g}function xn(i){return i=i.childContextTypes,i!=null}function js(){St(yn),St(nn)}function Up(i,a,d){if(nn.current!==Kr)throw Error(c(168));gt(nn,a),gt(yn,d)}function $p(i,a,d){var p=i.stateNode;if(a=a.childContextTypes,typeof p.getChildContext!="function")return d;p=p.getChildContext();for(var g in p)if(!(g in a))throw Error(c(108,z(i)||"Unknown",g));return s({},d,p)}function ks(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Kr,Po=nn.current,gt(nn,i),gt(yn,yn.current),!0}function Gp(i,a,d){var p=i.stateNode;if(!p)throw Error(c(169));d?(i=$p(i,a,Po),p.__reactInternalMemoizedMergedChildContext=i,St(yn),St(nn),gt(nn,i)):St(yn),gt(yn,d)}var qn=Math.clz32?Math.clz32:Y4,G4=Math.log,q4=Math.LN2;function Y4(i){return i>>>=0,i===0?32:31-(G4(i)/q4|0)|0}var Es=64,Ps=4194304;function da(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Is(i,a){var d=i.pendingLanes;if(d===0)return 0;var p=0,g=i.suspendedLanes,b=i.pingedLanes,E=d&268435455;if(E!==0){var O=E&~g;O!==0?p=da(O):(b&=E,b!==0&&(p=da(b)))}else E=d&~g,E!==0?p=da(E):b!==0&&(p=da(b));if(p===0)return 0;if(a!==0&&a!==p&&!(a&g)&&(g=p&-p,b=a&-a,g>=b||g===16&&(b&4194240)!==0))return a;if(p&4&&(p|=d&16),a=i.entangledLanes,a!==0)for(i=i.entanglements,a&=p;0<a;)d=31-qn(a),g=1<<d,p|=i[d],a&=~g;return p}function K4(i,a){switch(i){case 1:case 2:case 4:return a+250;case 8:case 16:case 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 a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function X4(i,a){for(var d=i.suspendedLanes,p=i.pingedLanes,g=i.expirationTimes,b=i.pendingLanes;0<b;){var E=31-qn(b),O=1<<E,V=g[E];V===-1?(!(O&d)||O&p)&&(g[E]=K4(O,a)):V<=a&&(i.expiredLanes|=O),b&=~O}}function ru(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function qp(){var i=Es;return Es<<=1,!(Es&4194240)&&(Es=64),i}function ou(i){for(var a=[],d=0;31>d;d++)a.push(i);return a}function fa(i,a,d){i.pendingLanes|=a,a!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,a=31-qn(a),i[a]=d}function Q4(i,a){var d=i.pendingLanes&~a;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=a,i.mutableReadLanes&=a,i.entangledLanes&=a,a=i.entanglements;var p=i.eventTimes;for(i=i.expirationTimes;0<d;){var g=31-qn(d),b=1<<g;a[g]=0,p[g]=-1,i[g]=-1,d&=~b}}function iu(i,a){var d=i.entangledLanes|=a;for(i=i.entanglements;d;){var p=31-qn(d),g=1<<p;g&a|i[p]&a&&(i[p]|=a),d&=~g}}var ot=0;function Yp(i){return i&=-i,1<i?4<i?i&268435455?16:536870912:4:1}var au=o.unstable_scheduleCallback,Kp=o.unstable_cancelCallback,Z4=o.unstable_shouldYield,J4=o.unstable_requestPaint,qt=o.unstable_now,su=o.unstable_ImmediatePriority,eS=o.unstable_UserBlockingPriority,lu=o.unstable_NormalPriority,tS=o.unstable_IdlePriority,Ms=null,lr=null;function nS(i){if(lr&&typeof lr.onCommitFiberRoot=="function")try{lr.onCommitFiberRoot(Ms,i,void 0,(i.current.flags&128)===128)}catch{}}function rS(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var Yn=typeof Object.is=="function"?Object.is:rS,Mr=null,Ts=!1,cu=!1;function Xp(i){Mr===null?Mr=[i]:Mr.push(i)}function oS(i){Ts=!0,Xp(i)}function cr(){if(!cu&&Mr!==null){cu=!0;var i=0,a=ot;try{var d=Mr;for(ot=1;i<d.length;i++){var p=d[i];do p=p(!0);while(p!==null)}Mr=null,Ts=!1}catch(g){throw Mr!==null&&(Mr=Mr.slice(i+1)),au(su,cr),g}finally{ot=a,cu=!1}}return null}var di=[],fi=0,_s=null,Ds=0,Dn=[],An=0,Io=null,Tr=1,_r="";function Mo(i,a){di[fi++]=Ds,di[fi++]=_s,_s=i,Ds=a}function Qp(i,a,d){Dn[An++]=Tr,Dn[An++]=_r,Dn[An++]=Io,Io=i;var p=Tr;i=_r;var g=32-qn(p)-1;p&=~(1<<g),d+=1;var b=32-qn(a)+g;if(30<b){var E=g-g%5;b=(p&(1<<E)-1).toString(32),p>>=E,g-=E,Tr=1<<32-qn(a)+g|d<<g|p,_r=b+i}else Tr=1<<b|d<<g|p,_r=i}function uu(i){i.return!==null&&(Mo(i,1),Qp(i,1,0))}function du(i){for(;i===_s;)_s=di[--fi],di[fi]=null,Ds=di[--fi],di[fi]=null;for(;i===Io;)Io=Dn[--An],Dn[An]=null,_r=Dn[--An],Dn[An]=null,Tr=Dn[--An],Dn[An]=null}var Tn=null,On=null,Pt=!1,ha=!1,Kn=null;function Zp(i,a){var d=Ln(5,null,null,0);d.elementType="DELETED",d.stateNode=a,d.return=i,a=i.deletions,a===null?(i.deletions=[d],i.flags|=16):a.push(d)}function Jp(i,a){switch(i.tag){case 5:return a=E4(a,i.type,i.pendingProps),a!==null?(i.stateNode=a,Tn=i,On=_4(a),!0):!1;case 6:return a=P4(a,i.pendingProps),a!==null?(i.stateNode=a,Tn=i,On=null,!0):!1;case 13:if(a=I4(a),a!==null){var d=Io!==null?{id:Tr,overflow:_r}:null;return i.memoizedState={dehydrated:a,treeContext:d,retryLane:1073741824},d=Ln(18,null,null,0),d.stateNode=a,d.return=i,i.child=d,Tn=i,On=null,!0}return!1;default:return!1}}function fu(i){return(i.mode&1)!==0&&(i.flags&128)===0}function hu(i){if(Pt){var a=On;if(a){var d=a;if(!Jp(i,a)){if(fu(i))throw Error(c(418));a=ws(d);var p=Tn;a&&Jp(i,a)?Zp(p,d):(i.flags=i.flags&-4097|2,Pt=!1,Tn=i)}}else{if(fu(i))throw Error(c(418));i.flags=i.flags&-4097|2,Pt=!1,Tn=i}}}function em(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Tn=i}function As(i){if(!Ge||i!==Tn)return!1;if(!Pt)return em(i),Pt=!0,!1;if(i.tag!==3&&(i.tag!==5||W4(i.type)&&!ce(i.type,i.memoizedProps))){var a=On;if(a){if(fu(i))throw tm(),Error(c(418));for(;a;)Zp(i,a),a=ws(a)}}if(em(i),i.tag===13){if(!Ge)throw Error(c(316));if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));On=N4(i)}else On=Tn?ws(i.stateNode):null;return!0}function tm(){for(var i=On;i;)i=ws(i)}function hi(){Ge&&(On=Tn=null,ha=Pt=!1)}function pu(i){Kn===null?Kn=[i]:Kn.push(i)}var iS=u.ReactCurrentBatchConfig;function Os(i,a){if(Yn(i,a))return!0;if(typeof i!="object"||i===null||typeof a!="object"||a===null)return!1;var d=Object.keys(i),p=Object.keys(a);if(d.length!==p.length)return!1;for(p=0;p<d.length;p++){var g=d[p];if(!$4.call(a,g)||!Yn(i[g],a[g]))return!1}return!0}function aS(i){switch(i.tag){case 5:return ua(i.type);case 16:return ua("Lazy");case 13:return ua("Suspense");case 19:return ua("SuspenseList");case 0:case 2:case 15:return i=tu(i.type,!1),i;case 11:return i=tu(i.type.render,!1),i;case 1:return i=tu(i.type,!0),i;default:return""}}function Xn(i,a){if(i&&i.defaultProps){a=s({},a),i=i.defaultProps;for(var d in i)a[d]===void 0&&(a[d]=i[d]);return a}return a}var zs=Yr(null),Rs=null,pi=null,mu=null;function vu(){mu=pi=Rs=null}function nm(i,a,d){Qe?(gt(zs,a._currentValue),a._currentValue=d):(gt(zs,a._currentValue2),a._currentValue2=d)}function gu(i){var a=zs.current;St(zs),Qe?i._currentValue=a:i._currentValue2=a}function yu(i,a,d){for(;i!==null;){var p=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,p!==null&&(p.childLanes|=a)):p!==null&&(p.childLanes&a)!==a&&(p.childLanes|=a),i===d)break;i=i.return}}function mi(i,a){Rs=i,mu=pi=null,i=i.dependencies,i!==null&&i.firstContext!==null&&(i.lanes&a&&(bn=!0),i.firstContext=null)}function zn(i){var a=Qe?i._currentValue:i._currentValue2;if(mu!==i)if(i={context:i,memoizedValue:a,next:null},pi===null){if(Rs===null)throw Error(c(308));pi=i,Rs.dependencies={lanes:0,firstContext:i}}else pi=pi.next=i;return a}var To=null;function xu(i){To===null?To=[i]:To.push(i)}function rm(i,a,d,p){var g=a.interleaved;return g===null?(d.next=d,xu(a)):(d.next=g.next,g.next=d),a.interleaved=d,ur(i,p)}function ur(i,a){i.lanes|=a;var d=i.alternate;for(d!==null&&(d.lanes|=a),d=i,i=i.return;i!==null;)i.childLanes|=a,d=i.alternate,d!==null&&(d.childLanes|=a),d=i,i=i.return;return d.tag===3?d.stateNode:null}var Xr=!1;function bu(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function om(i,a){i=i.updateQueue,a.updateQueue===i&&(a.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Dr(i,a){return{eventTime:i,lane:a,tag:0,payload:null,callback:null,next:null}}function Qr(i,a,d){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,Xe&2){var g=p.pending;return g===null?a.next=a:(a.next=g.next,g.next=a),p.pending=a,ur(i,d)}return g=p.interleaved,g===null?(a.next=a,xu(p)):(a.next=g.next,g.next=a),p.interleaved=a,ur(i,d)}function Ns(i,a,d){if(a=a.updateQueue,a!==null&&(a=a.shared,(d&4194240)!==0)){var p=a.lanes;p&=i.pendingLanes,d|=p,a.lanes=d,iu(i,d)}}function im(i,a){var d=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var g=null,b=null;if(d=d.firstBaseUpdate,d!==null){do{var E={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};b===null?g=b=E:b=b.next=E,d=d.next}while(d!==null);b===null?g=b=a:b=b.next=a}else g=b=a;d={baseState:p.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:p.shared,effects:p.effects},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=a:i.next=a,d.lastBaseUpdate=a}function Fs(i,a,d,p){var g=i.updateQueue;Xr=!1;var b=g.firstBaseUpdate,E=g.lastBaseUpdate,O=g.shared.pending;if(O!==null){g.shared.pending=null;var V=O,ie=V.next;V.next=null,E===null?b=ie:E.next=ie,E=V;var ke=i.alternate;ke!==null&&(ke=ke.updateQueue,O=ke.lastBaseUpdate,O!==E&&(O===null?ke.firstBaseUpdate=ie:O.next=ie,ke.lastBaseUpdate=V))}if(b!==null){var He=g.baseState;E=0,ke=ie=V=null,O=b;do{var be=O.lane,Ct=O.eventTime;if((p&be)===be){ke!==null&&(ke=ke.next={eventTime:Ct,lane:0,tag:O.tag,payload:O.payload,callback:O.callback,next:null});e:{var ht=i,wn=O;switch(be=a,Ct=d,wn.tag){case 1:if(ht=wn.payload,typeof ht=="function"){He=ht.call(Ct,He,be);break e}He=ht;break e;case 3:ht.flags=ht.flags&-65537|128;case 0:if(ht=wn.payload,be=typeof ht=="function"?ht.call(Ct,He,be):ht,be==null)break e;He=s({},He,be);break e;case 2:Xr=!0}}O.callback!==null&&O.lane!==0&&(i.flags|=64,be=g.effects,be===null?g.effects=[O]:be.push(O))}else Ct={eventTime:Ct,lane:be,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ke===null?(ie=ke=Ct,V=He):ke=ke.next=Ct,E|=be;if(O=O.next,O===null){if(O=g.shared.pending,O===null)break;be=O,O=be.next,be.next=null,g.lastBaseUpdate=be,g.shared.pending=null}}while(1);if(ke===null&&(V=He),g.baseState=V,g.firstBaseUpdate=ie,g.lastBaseUpdate=ke,a=g.shared.interleaved,a!==null){g=a;do E|=g.lane,g=g.next;while(g!==a)}else b===null&&(g.shared.lanes=0);Do|=E,i.lanes=E,i.memoizedState=He}}function am(i,a,d){if(i=a.effects,a.effects=null,i!==null)for(a=0;a<i.length;a++){var p=i[a],g=p.callback;if(g!==null){if(p.callback=null,p=d,typeof g!="function")throw Error(c(191,g));g.call(p)}}}var sm=new r.Component().refs;function Su(i,a,d,p){a=i.memoizedState,d=d(p,a),d=d==null?a:s({},a,d),i.memoizedState=d,i.lanes===0&&(i.updateQueue.baseState=d)}var Ls={isMounted:function(i){return(i=i._reactInternals)?W(i)===i:!1},enqueueSetState:function(i,a,d){i=i._reactInternals;var p=sn(),g=eo(i),b=Dr(p,g);b.payload=a,d!=null&&(b.callback=d),a=Qr(i,b,g),a!==null&&(Fn(a,i,g,p),Ns(a,i,g))},enqueueReplaceState:function(i,a,d){i=i._reactInternals;var p=sn(),g=eo(i),b=Dr(p,g);b.tag=1,b.payload=a,d!=null&&(b.callback=d),a=Qr(i,b,g),a!==null&&(Fn(a,i,g,p),Ns(a,i,g))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var d=sn(),p=eo(i),g=Dr(d,p);g.tag=2,a!=null&&(g.callback=a),a=Qr(i,g,p),a!==null&&(Fn(a,i,p,d),Ns(a,i,p))}};function lm(i,a,d,p,g,b,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,b,E):a.prototype&&a.prototype.isPureReactComponent?!Os(d,p)||!Os(g,b):!0}function cm(i,a,d){var p=!1,g=Kr,b=a.contextType;return typeof b=="object"&&b!==null?b=zn(b):(g=xn(a)?Po:nn.current,p=a.contextTypes,b=(p=p!=null)?ui(i,g):Kr),a=new a(d,b),i.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ls,i.stateNode=a,a._reactInternals=i,p&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=g,i.__reactInternalMemoizedMaskedChildContext=b),a}function um(i,a,d,p){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(d,p),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(d,p),a.state!==i&&Ls.enqueueReplaceState(a,a.state,null)}function Cu(i,a,d,p){var g=i.stateNode;g.props=d,g.state=i.memoizedState,g.refs=sm,bu(i);var b=a.contextType;typeof b=="object"&&b!==null?g.context=zn(b):(b=xn(a)?Po:nn.current,g.context=ui(i,b)),g.state=i.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(Su(i,a,b,d),g.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(a=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),a!==g.state&&Ls.enqueueReplaceState(g,g.state,null),Fs(i,d,g,p),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308)}function pa(i,a,d){if(i=d.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(c(309));var p=d.stateNode}if(!p)throw Error(c(147,i));var g=p,b=""+i;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===b?a.ref:(a=function(E){var O=g.refs;O===sm&&(O=g.refs={}),E===null?delete O[b]:O[b]=E},a._stringRef=b,a)}if(typeof i!="string")throw Error(c(284));if(!d._owner)throw Error(c(290,i))}return i}function Bs(i,a){throw i=Object.prototype.toString.call(a),Error(c(31,i==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":i))}function dm(i){var a=i._init;return a(i._payload)}function fm(i){function a(H,R){if(i){var G=H.deletions;G===null?(H.deletions=[R],H.flags|=16):G.push(R)}}function d(H,R){if(!i)return null;for(;R!==null;)a(H,R),R=R.sibling;return null}function p(H,R){for(H=new Map;R!==null;)R.key!==null?H.set(R.key,R):H.set(R.index,R),R=R.sibling;return H}function g(H,R){return H=no(H,R),H.index=0,H.sibling=null,H}function b(H,R,G){return H.index=G,i?(G=H.alternate,G!==null?(G=G.index,G<R?(H.flags|=2,R):G):(H.flags|=2,R)):(H.flags|=1048576,R)}function E(H){return i&&H.alternate===null&&(H.flags|=2),H}function O(H,R,G,Se){return R===null||R.tag!==6?(R=cd(G,H.mode,Se),R.return=H,R):(R=g(R,G),R.return=H,R)}function V(H,R,G,Se){var De=G.type;return De===m?ke(H,R,G.props.children,Se,G.key):R!==null&&(R.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===P&&dm(De)===R.type)?(Se=g(R,G.props),Se.ref=pa(H,R,G),Se.return=H,Se):(Se=fl(G.type,G.key,G.props,null,H.mode,Se),Se.ref=pa(H,R,G),Se.return=H,Se)}function ie(H,R,G,Se){return R===null||R.tag!==4||R.stateNode.containerInfo!==G.containerInfo||R.stateNode.implementation!==G.implementation?(R=ud(G,H.mode,Se),R.return=H,R):(R=g(R,G.children||[]),R.return=H,R)}function ke(H,R,G,Se,De){return R===null||R.tag!==7?(R=Ro(G,H.mode,Se,De),R.return=H,R):(R=g(R,G),R.return=H,R)}function He(H,R,G){if(typeof R=="string"&&R!==""||typeof R=="number")return R=cd(""+R,H.mode,G),R.return=H,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case f:return G=fl(R.type,R.key,R.props,null,H.mode,G),G.ref=pa(H,null,R),G.return=H,G;case h:return R=ud(R,H.mode,G),R.return=H,R;case P:var Se=R._init;return He(H,Se(R._payload),G)}if(te(R)||_(R))return R=Ro(R,H.mode,G,null),R.return=H,R;Bs(H,R)}return null}function be(H,R,G,Se){var De=R!==null?R.key:null;if(typeof G=="string"&&G!==""||typeof G=="number")return De!==null?null:O(H,R,""+G,Se);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case f:return G.key===De?V(H,R,G,Se):null;case h:return G.key===De?ie(H,R,G,Se):null;case P:return De=G._init,be(H,R,De(G._payload),Se)}if(te(G)||_(G))return De!==null?null:ke(H,R,G,Se,null);Bs(H,G)}return null}function Ct(H,R,G,Se,De){if(typeof Se=="string"&&Se!==""||typeof Se=="number")return H=H.get(G)||null,O(R,H,""+Se,De);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case f:return H=H.get(Se.key===null?G:Se.key)||null,V(R,H,Se,De);case h:return H=H.get(Se.key===null?G:Se.key)||null,ie(R,H,Se,De);case P:var Ke=Se._init;return Ct(H,R,G,Ke(Se._payload),De)}if(te(Se)||_(Se))return H=H.get(G)||null,ke(R,H,Se,De,null);Bs(R,Se)}return null}function ht(H,R,G,Se){for(var De=null,Ke=null,We=R,it=R=0,Xt=null;We!==null&&it<G.length;it++){We.index>it?(Xt=We,We=null):Xt=We.sibling;var at=be(H,We,G[it],Se);if(at===null){We===null&&(We=Xt);break}i&&We&&at.alternate===null&&a(H,We),R=b(at,R,it),Ke===null?De=at:Ke.sibling=at,Ke=at,We=Xt}if(it===G.length)return d(H,We),Pt&&Mo(H,it),De;if(We===null){for(;it<G.length;it++)We=He(H,G[it],Se),We!==null&&(R=b(We,R,it),Ke===null?De=We:Ke.sibling=We,Ke=We);return Pt&&Mo(H,it),De}for(We=p(H,We);it<G.length;it++)Xt=Ct(We,H,it,G[it],Se),Xt!==null&&(i&&Xt.alternate!==null&&We.delete(Xt.key===null?it:Xt.key),R=b(Xt,R,it),Ke===null?De=Xt:Ke.sibling=Xt,Ke=Xt);return i&&We.forEach(function(ro){return a(H,ro)}),Pt&&Mo(H,it),De}function wn(H,R,G,Se){var De=_(G);if(typeof De!="function")throw Error(c(150));if(G=De.call(G),G==null)throw Error(c(151));for(var Ke=De=null,We=R,it=R=0,Xt=null,at=G.next();We!==null&&!at.done;it++,at=G.next()){We.index>it?(Xt=We,We=null):Xt=We.sibling;var ro=be(H,We,at.value,Se);if(ro===null){We===null&&(We=Xt);break}i&&We&&ro.alternate===null&&a(H,We),R=b(ro,R,it),Ke===null?De=ro:Ke.sibling=ro,Ke=ro,We=Xt}if(at.done)return d(H,We),Pt&&Mo(H,it),De;if(We===null){for(;!at.done;it++,at=G.next())at=He(H,at.value,Se),at!==null&&(R=b(at,R,it),Ke===null?De=at:Ke.sibling=at,Ke=at);return Pt&&Mo(H,it),De}for(We=p(H,We);!at.done;it++,at=G.next())at=Ct(We,H,it,at.value,Se),at!==null&&(i&&at.alternate!==null&&We.delete(at.key===null?it:at.key),R=b(at,R,it),Ke===null?De=at:Ke.sibling=at,Ke=at);return i&&We.forEach(function(RS){return a(H,RS)}),Pt&&Mo(H,it),De}function zr(H,R,G,Se){if(typeof G=="object"&&G!==null&&G.type===m&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case f:e:{for(var De=G.key,Ke=R;Ke!==null;){if(Ke.key===De){if(De=G.type,De===m){if(Ke.tag===7){d(H,Ke.sibling),R=g(Ke,G.props.children),R.return=H,H=R;break e}}else if(Ke.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===P&&dm(De)===Ke.type){d(H,Ke.sibling),R=g(Ke,G.props),R.ref=pa(H,Ke,G),R.return=H,H=R;break e}d(H,Ke);break}else a(H,Ke);Ke=Ke.sibling}G.type===m?(R=Ro(G.props.children,H.mode,Se,G.key),R.return=H,H=R):(Se=fl(G.type,G.key,G.props,null,H.mode,Se),Se.ref=pa(H,R,G),Se.return=H,H=Se)}return E(H);case h:e:{for(Ke=G.key;R!==null;){if(R.key===Ke)if(R.tag===4&&R.stateNode.containerInfo===G.containerInfo&&R.stateNode.implementation===G.implementation){d(H,R.sibling),R=g(R,G.children||[]),R.return=H,H=R;break e}else{d(H,R);break}else a(H,R);R=R.sibling}R=ud(G,H.mode,Se),R.return=H,H=R}return E(H);case P:return Ke=G._init,zr(H,R,Ke(G._payload),Se)}if(te(G))return ht(H,R,G,Se);if(_(G))return wn(H,R,G,Se);Bs(H,G)}return typeof G=="string"&&G!==""||typeof G=="number"?(G=""+G,R!==null&&R.tag===6?(d(H,R.sibling),R=g(R,G),R.return=H,H=R):(d(H,R),R=cd(G,H.mode,Se),R.return=H,H=R),E(H)):d(H,R)}return zr}var vi=fm(!0),hm=fm(!1),ma={},Rn=Yr(ma),va=Yr(ma),gi=Yr(ma);function dr(i){if(i===ma)throw Error(c(174));return i}function wu(i,a){gt(gi,a),gt(va,i),gt(Rn,ma),i=$(a),St(Rn),gt(Rn,i)}function yi(){St(Rn),St(va),St(gi)}function pm(i){var a=dr(gi.current),d=dr(Rn.current);a=Z(d,i.type,a),d!==a&&(gt(va,i),gt(Rn,a))}function ju(i){va.current===i&&(St(Rn),St(va))}var Tt=Yr(0);function Hs(i){for(var a=i;a!==null;){if(a.tag===13){var d=a.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||Vp(d)||Zc(d)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var ku=[];function Eu(){for(var i=0;i<ku.length;i++){var a=ku[i];Qe?a._workInProgressVersionPrimary=null:a._workInProgressVersionSecondary=null}ku.length=0}var Ws=u.ReactCurrentDispatcher,Pu=u.ReactCurrentBatchConfig,_o=0,_t=null,Ut=null,Yt=null,Vs=!1,ga=!1,ya=0,sS=0;function rn(){throw Error(c(321))}function Iu(i,a){if(a===null)return!1;for(var d=0;d<a.length&&d<i.length;d++)if(!Yn(i[d],a[d]))return!1;return!0}function Mu(i,a,d,p,g,b){if(_o=b,_t=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Ws.current=i===null||i.memoizedState===null?dS:fS,i=d(p,g),ga){b=0;do{if(ga=!1,ya=0,25<=b)throw Error(c(301));b+=1,Yt=Ut=null,a.updateQueue=null,Ws.current=hS,i=d(p,g)}while(ga)}if(Ws.current=Gs,a=Ut!==null&&Ut.next!==null,_o=0,Yt=Ut=_t=null,Vs=!1,a)throw Error(c(300));return i}function Tu(){var i=ya!==0;return ya=0,i}function fr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?_t.memoizedState=Yt=i:Yt=Yt.next=i,Yt}function Nn(){if(Ut===null){var i=_t.alternate;i=i!==null?i.memoizedState:null}else i=Ut.next;var a=Yt===null?_t.memoizedState:Yt.next;if(a!==null)Yt=a,Ut=i;else{if(i===null)throw Error(c(310));Ut=i,i={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Yt===null?_t.memoizedState=Yt=i:Yt=Yt.next=i}return Yt}function xa(i,a){return typeof a=="function"?a(i):a}function _u(i){var a=Nn(),d=a.queue;if(d===null)throw Error(c(311));d.lastRenderedReducer=i;var p=Ut,g=p.baseQueue,b=d.pending;if(b!==null){if(g!==null){var E=g.next;g.next=b.next,b.next=E}p.baseQueue=g=b,d.pending=null}if(g!==null){b=g.next,p=p.baseState;var O=E=null,V=null,ie=b;do{var ke=ie.lane;if((_o&ke)===ke)V!==null&&(V=V.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),p=ie.hasEagerState?ie.eagerState:i(p,ie.action);else{var He={lane:ke,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};V===null?(O=V=He,E=p):V=V.next=He,_t.lanes|=ke,Do|=ke}ie=ie.next}while(ie!==null&&ie!==b);V===null?E=p:V.next=O,Yn(p,a.memoizedState)||(bn=!0),a.memoizedState=p,a.baseState=E,a.baseQueue=V,d.lastRenderedState=p}if(i=d.interleaved,i!==null){g=i;do b=g.lane,_t.lanes|=b,Do|=b,g=g.next;while(g!==i)}else g===null&&(d.lanes=0);return[a.memoizedState,d.dispatch]}function Du(i){var a=Nn(),d=a.queue;if(d===null)throw Error(c(311));d.lastRenderedReducer=i;var p=d.dispatch,g=d.pending,b=a.memoizedState;if(g!==null){d.pending=null;var E=g=g.next;do b=i(b,E.action),E=E.next;while(E!==g);Yn(b,a.memoizedState)||(bn=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),d.lastRenderedState=b}return[b,p]}function mm(){}function vm(i,a){var d=_t,p=Nn(),g=a(),b=!Yn(p.memoizedState,g);if(b&&(p.memoizedState=g,bn=!0),p=p.queue,Au(xm.bind(null,d,p,i),[i]),p.getSnapshot!==a||b||Yt!==null&&Yt.memoizedState.tag&1){if(d.flags|=2048,ba(9,ym.bind(null,d,p,g,a),void 0,null),Kt===null)throw Error(c(349));_o&30||gm(d,a,g)}return g}function gm(i,a,d){i.flags|=16384,i={getSnapshot:a,value:d},a=_t.updateQueue,a===null?(a={lastEffect:null,stores:null},_t.updateQueue=a,a.stores=[i]):(d=a.stores,d===null?a.stores=[i]:d.push(i))}function ym(i,a,d,p){a.value=d,a.getSnapshot=p,bm(a)&&Sm(i)}function xm(i,a,d){return d(function(){bm(a)&&Sm(i)})}function bm(i){var a=i.getSnapshot;i=i.value;try{var d=a();return!Yn(i,d)}catch{return!0}}function Sm(i){var a=ur(i,1);a!==null&&Fn(a,i,1,-1)}function Cm(i){var a=fr();return typeof i=="function"&&(i=i()),a.memoizedState=a.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:i},a.queue=i,i=i.dispatch=uS.bind(null,_t,i),[a.memoizedState,i]}function ba(i,a,d,p){return i={tag:i,create:a,destroy:d,deps:p,next:null},a=_t.updateQueue,a===null?(a={lastEffect:null,stores:null},_t.updateQueue=a,a.lastEffect=i.next=i):(d=a.lastEffect,d===null?a.lastEffect=i.next=i:(p=d.next,d.next=i,i.next=p,a.lastEffect=i)),i}function wm(){return Nn().memoizedState}function Us(i,a,d,p){var g=fr();_t.flags|=i,g.memoizedState=ba(1|a,d,void 0,p===void 0?null:p)}function $s(i,a,d,p){var g=Nn();p=p===void 0?null:p;var b=void 0;if(Ut!==null){var E=Ut.memoizedState;if(b=E.destroy,p!==null&&Iu(p,E.deps)){g.memoizedState=ba(a,d,b,p);return}}_t.flags|=i,g.memoizedState=ba(1|a,d,b,p)}function jm(i,a){return Us(8390656,8,i,a)}function Au(i,a){return $s(2048,8,i,a)}function km(i,a){return $s(4,2,i,a)}function Em(i,a){return $s(4,4,i,a)}function Pm(i,a){if(typeof a=="function")return i=i(),a(i),function(){a(null)};if(a!=null)return i=i(),a.current=i,function(){a.current=null}}function Im(i,a,d){return d=d!=null?d.concat([i]):null,$s(4,4,Pm.bind(null,a,i),d)}function Ou(){}function Mm(i,a){var d=Nn();a=a===void 0?null:a;var p=d.memoizedState;return p!==null&&a!==null&&Iu(a,p[1])?p[0]:(d.memoizedState=[i,a],i)}function Tm(i,a){var d=Nn();a=a===void 0?null:a;var p=d.memoizedState;return p!==null&&a!==null&&Iu(a,p[1])?p[0]:(i=i(),d.memoizedState=[i,a],i)}function _m(i,a,d){return _o&21?(Yn(d,a)||(d=qp(),_t.lanes|=d,Do|=d,i.baseState=!0),a):(i.baseState&&(i.baseState=!1,bn=!0),i.memoizedState=d)}function lS(i,a){var d=ot;ot=d!==0&&4>d?d:4,i(!0);var p=Pu.transition;Pu.transition={};try{i(!1),a()}finally{ot=d,Pu.transition=p}}function Dm(){return Nn().memoizedState}function cS(i,a,d){var p=eo(i);if(d={lane:p,action:d,hasEagerState:!1,eagerState:null,next:null},Am(i))Om(a,d);else if(d=rm(i,a,d,p),d!==null){var g=sn();Fn(d,i,p,g),zm(d,a,p)}}function uS(i,a,d){var p=eo(i),g={lane:p,action:d,hasEagerState:!1,eagerState:null,next:null};if(Am(i))Om(a,g);else{var b=i.alternate;if(i.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var E=a.lastRenderedState,O=b(E,d);if(g.hasEagerState=!0,g.eagerState=O,Yn(O,E)){var V=a.interleaved;V===null?(g.next=g,xu(a)):(g.next=V.next,V.next=g),a.interleaved=g;return}}catch{}finally{}d=rm(i,a,g,p),d!==null&&(g=sn(),Fn(d,i,p,g),zm(d,a,p))}}function Am(i){var a=i.alternate;return i===_t||a!==null&&a===_t}function Om(i,a){ga=Vs=!0;var d=i.pending;d===null?a.next=a:(a.next=d.next,d.next=a),i.pending=a}function zm(i,a,d){if(d&4194240){var p=a.lanes;p&=i.pendingLanes,d|=p,a.lanes=d,iu(i,d)}}var Gs={readContext:zn,useCallback:rn,useContext:rn,useEffect:rn,useImperativeHandle:rn,useInsertionEffect:rn,useLayoutEffect:rn,useMemo:rn,useReducer:rn,useRef:rn,useState:rn,useDebugValue:rn,useDeferredValue:rn,useTransition:rn,useMutableSource:rn,useSyncExternalStore:rn,useId:rn,unstable_isNewReconciler:!1},dS={readContext:zn,useCallback:function(i,a){return fr().memoizedState=[i,a===void 0?null:a],i},useContext:zn,useEffect:jm,useImperativeHandle:function(i,a,d){return d=d!=null?d.concat([i]):null,Us(4194308,4,Pm.bind(null,a,i),d)},useLayoutEffect:function(i,a){return Us(4194308,4,i,a)},useInsertionEffect:function(i,a){return Us(4,2,i,a)},useMemo:function(i,a){var d=fr();return a=a===void 0?null:a,i=i(),d.memoizedState=[i,a],i},useReducer:function(i,a,d){var p=fr();return a=d!==void 0?d(a):a,p.memoizedState=p.baseState=a,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:a},p.queue=i,i=i.dispatch=cS.bind(null,_t,i),[p.memoizedState,i]},useRef:function(i){var a=fr();return i={current:i},a.memoizedState=i},useState:Cm,useDebugValue:Ou,useDeferredValue:function(i){return fr().memoizedState=i},useTransition:function(){var i=Cm(!1),a=i[0];return i=lS.bind(null,i[1]),fr().memoizedState=i,[a,i]},useMutableSource:function(){},useSyncExternalStore:function(i,a,d){var p=_t,g=fr();if(Pt){if(d===void 0)throw Error(c(407));d=d()}else{if(d=a(),Kt===null)throw Error(c(349));_o&30||gm(p,a,d)}g.memoizedState=d;var b={value:d,getSnapshot:a};return g.queue=b,jm(xm.bind(null,p,b,i),[i]),p.flags|=2048,ba(9,ym.bind(null,p,b,d,a),void 0,null),d},useId:function(){var i=fr(),a=Kt.identifierPrefix;if(Pt){var d=_r,p=Tr;d=(p&~(1<<32-qn(p)-1)).toString(32)+d,a=":"+a+"R"+d,d=ya++,0<d&&(a+="H"+d.toString(32)),a+=":"}else d=sS++,a=":"+a+"r"+d.toString(32)+":";return i.memoizedState=a},unstable_isNewReconciler:!1},fS={readContext:zn,useCallback:Mm,useContext:zn,useEffect:Au,useImperativeHandle:Im,useInsertionEffect:km,useLayoutEffect:Em,useMemo:Tm,useReducer:_u,useRef:wm,useState:function(){return _u(xa)},useDebugValue:Ou,useDeferredValue:function(i){var a=Nn();return _m(a,Ut.memoizedState,i)},useTransition:function(){var i=_u(xa)[0],a=Nn().memoizedState;return[i,a]},useMutableSource:mm,useSyncExternalStore:vm,useId:Dm,unstable_isNewReconciler:!1},hS={readContext:zn,useCallback:Mm,useContext:zn,useEffect:Au,useImperativeHandle:Im,useInsertionEffect:km,useLayoutEffect:Em,useMemo:Tm,useReducer:Du,useRef:wm,useState:function(){return Du(xa)},useDebugValue:Ou,useDeferredValue:function(i){var a=Nn();return Ut===null?a.memoizedState=i:_m(a,Ut.memoizedState,i)},useTransition:function(){var i=Du(xa)[0],a=Nn().memoizedState;return[i,a]},useMutableSource:mm,useSyncExternalStore:vm,useId:Dm,unstable_isNewReconciler:!1};function xi(i,a){try{var d="",p=a;do d+=aS(p),p=p.return;while(p);var g=d}catch(b){g=`
|
||
Error generating stack: `+b.message+`
|
||
`+b.stack}return{value:i,source:a,stack:g,digest:null}}function zu(i,a,d){return{value:i,source:null,stack:d??null,digest:a??null}}function Ru(i,a){try{console.error(a.value)}catch(d){setTimeout(function(){throw d})}}var pS=typeof WeakMap=="function"?WeakMap:Map;function Rm(i,a,d){d=Dr(-1,d),d.tag=3,d.payload={element:null};var p=a.value;return d.callback=function(){al||(al=!0,nd=p),Ru(i,a)},d}function Nm(i,a,d){d=Dr(-1,d),d.tag=3;var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var g=a.value;d.payload=function(){return p(g)},d.callback=function(){Ru(i,a)}}var b=i.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(d.callback=function(){Ru(i,a),typeof p!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var E=a.stack;this.componentDidCatch(a.value,{componentStack:E!==null?E:""})}),d}function Fm(i,a,d){var p=i.pingCache;if(p===null){p=i.pingCache=new pS;var g=new Set;p.set(a,g)}else g=p.get(a),g===void 0&&(g=new Set,p.set(a,g));g.has(d)||(g.add(d),i=IS.bind(null,i,a,d),a.then(i,i))}function Lm(i){do{var a;if((a=i.tag===13)&&(a=i.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return i;i=i.return}while(i!==null);return null}function Bm(i,a,d,p,g){return i.mode&1?(i.flags|=65536,i.lanes=g,i):(i===a?i.flags|=65536:(i.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(a=Dr(-1,1),a.tag=2,Qr(d,a,1))),d.lanes|=1),i)}var mS=u.ReactCurrentOwner,bn=!1;function hn(i,a,d,p){a.child=i===null?hm(a,null,d,p):vi(a,i.child,d,p)}function Hm(i,a,d,p,g){d=d.render;var b=a.ref;return mi(a,g),p=Mu(i,a,d,p,b,g),d=Tu(),i!==null&&!bn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~g,Ar(i,a,g)):(Pt&&d&&uu(a),a.flags|=1,hn(i,a,p,g),a.child)}function Wm(i,a,d,p,g){if(i===null){var b=d.type;return typeof b=="function"&&!ld(b)&&b.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(a.tag=15,a.type=b,Vm(i,a,b,p,g)):(i=fl(d.type,null,p,a,a.mode,g),i.ref=a.ref,i.return=a,a.child=i)}if(b=i.child,!(i.lanes&g)){var E=b.memoizedProps;if(d=d.compare,d=d!==null?d:Os,d(E,p)&&i.ref===a.ref)return Ar(i,a,g)}return a.flags|=1,i=no(b,p),i.ref=a.ref,i.return=a,a.child=i}function Vm(i,a,d,p,g){if(i!==null){var b=i.memoizedProps;if(Os(b,p)&&i.ref===a.ref)if(bn=!1,a.pendingProps=p=b,(i.lanes&g)!==0)i.flags&131072&&(bn=!0);else return a.lanes=i.lanes,Ar(i,a,g)}return Nu(i,a,d,p,g)}function Um(i,a,d){var p=a.pendingProps,g=p.children,b=i!==null?i.memoizedState:null;if(p.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(Si,_n),_n|=d;else{if(!(d&1073741824))return i=b!==null?b.baseLanes|d:d,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:i,cachePool:null,transitions:null},a.updateQueue=null,gt(Si,_n),_n|=i,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},p=b!==null?b.baseLanes:d,gt(Si,_n),_n|=p}else b!==null?(p=b.baseLanes|d,a.memoizedState=null):p=d,gt(Si,_n),_n|=p;return hn(i,a,g,d),a.child}function $m(i,a){var d=a.ref;(i===null&&d!==null||i!==null&&i.ref!==d)&&(a.flags|=512,a.flags|=2097152)}function Nu(i,a,d,p,g){var b=xn(d)?Po:nn.current;return b=ui(a,b),mi(a,g),d=Mu(i,a,d,p,b,g),p=Tu(),i!==null&&!bn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~g,Ar(i,a,g)):(Pt&&p&&uu(a),a.flags|=1,hn(i,a,d,g),a.child)}function Gm(i,a,d,p,g){if(xn(d)){var b=!0;ks(a)}else b=!1;if(mi(a,g),a.stateNode===null)Ys(i,a),cm(a,d,p),Cu(a,d,p,g),p=!0;else if(i===null){var E=a.stateNode,O=a.memoizedProps;E.props=O;var V=E.context,ie=d.contextType;typeof ie=="object"&&ie!==null?ie=zn(ie):(ie=xn(d)?Po:nn.current,ie=ui(a,ie));var ke=d.getDerivedStateFromProps,He=typeof ke=="function"||typeof E.getSnapshotBeforeUpdate=="function";He||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(O!==p||V!==ie)&&um(a,E,p,ie),Xr=!1;var be=a.memoizedState;E.state=be,Fs(a,p,E,g),V=a.memoizedState,O!==p||be!==V||yn.current||Xr?(typeof ke=="function"&&(Su(a,d,ke,p),V=a.memoizedState),(O=Xr||lm(a,d,O,p,be,V,ie))?(He||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(a.flags|=4194308)):(typeof E.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=p,a.memoizedState=V),E.props=p,E.state=V,E.context=ie,p=O):(typeof E.componentDidMount=="function"&&(a.flags|=4194308),p=!1)}else{E=a.stateNode,om(i,a),O=a.memoizedProps,ie=a.type===a.elementType?O:Xn(a.type,O),E.props=ie,He=a.pendingProps,be=E.context,V=d.contextType,typeof V=="object"&&V!==null?V=zn(V):(V=xn(d)?Po:nn.current,V=ui(a,V));var Ct=d.getDerivedStateFromProps;(ke=typeof Ct=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(O!==He||be!==V)&&um(a,E,p,V),Xr=!1,be=a.memoizedState,E.state=be,Fs(a,p,E,g);var ht=a.memoizedState;O!==He||be!==ht||yn.current||Xr?(typeof Ct=="function"&&(Su(a,d,Ct,p),ht=a.memoizedState),(ie=Xr||lm(a,d,ie,p,be,ht,V)||!1)?(ke||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(p,ht,V),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(p,ht,V)),typeof E.componentDidUpdate=="function"&&(a.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof E.componentDidUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(a.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(a.flags|=1024),a.memoizedProps=p,a.memoizedState=ht),E.props=p,E.state=ht,E.context=V,p=ie):(typeof E.componentDidUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(a.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(a.flags|=1024),p=!1)}return Fu(i,a,d,p,b,g)}function Fu(i,a,d,p,g,b){$m(i,a);var E=(a.flags&128)!==0;if(!p&&!E)return g&&Gp(a,d,!1),Ar(i,a,b);p=a.stateNode,mS.current=a;var O=E&&typeof d.getDerivedStateFromError!="function"?null:p.render();return a.flags|=1,i!==null&&E?(a.child=vi(a,i.child,null,b),a.child=vi(a,null,O,b)):hn(i,a,O,b),a.memoizedState=p.state,g&&Gp(a,d,!0),a.child}function qm(i){var a=i.stateNode;a.pendingContext?Up(i,a.pendingContext,a.pendingContext!==a.context):a.context&&Up(i,a.context,!1),wu(i,a.containerInfo)}function Ym(i,a,d,p,g){return hi(),pu(g),a.flags|=256,hn(i,a,d,p),a.child}var Lu={dehydrated:null,treeContext:null,retryLane:0};function Bu(i){return{baseLanes:i,cachePool:null,transitions:null}}function Km(i,a,d){var p=a.pendingProps,g=Tt.current,b=!1,E=(a.flags&128)!==0,O;if((O=E)||(O=i!==null&&i.memoizedState===null?!1:(g&2)!==0),O?(b=!0,a.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),gt(Tt,g&1),i===null)return hu(a),i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?(a.mode&1?Zc(i)?a.lanes=8:a.lanes=1073741824:a.lanes=1,null):(E=p.children,i=p.fallback,b?(p=a.mode,b=a.child,E={mode:"hidden",children:E},!(p&1)&&b!==null?(b.childLanes=0,b.pendingProps=E):b=hl(E,p,0,null),i=Ro(i,p,d,null),b.return=a,i.return=a,b.sibling=i,a.child=b,a.child.memoizedState=Bu(d),a.memoizedState=Lu,i):Hu(a,E));if(g=i.memoizedState,g!==null&&(O=g.dehydrated,O!==null))return vS(i,a,E,p,O,g,d);if(b){b=p.fallback,E=a.mode,g=i.child,O=g.sibling;var V={mode:"hidden",children:p.children};return!(E&1)&&a.child!==g?(p=a.child,p.childLanes=0,p.pendingProps=V,a.deletions=null):(p=no(g,V),p.subtreeFlags=g.subtreeFlags&14680064),O!==null?b=no(O,b):(b=Ro(b,E,d,null),b.flags|=2),b.return=a,p.return=a,p.sibling=b,a.child=p,p=b,b=a.child,E=i.child.memoizedState,E=E===null?Bu(d):{baseLanes:E.baseLanes|d,cachePool:null,transitions:E.transitions},b.memoizedState=E,b.childLanes=i.childLanes&~d,a.memoizedState=Lu,p}return b=i.child,i=b.sibling,p=no(b,{mode:"visible",children:p.children}),!(a.mode&1)&&(p.lanes=d),p.return=a,p.sibling=null,i!==null&&(d=a.deletions,d===null?(a.deletions=[i],a.flags|=16):d.push(i)),a.child=p,a.memoizedState=null,p}function Hu(i,a){return a=hl({mode:"visible",children:a},i.mode,0,null),a.return=i,i.child=a}function qs(i,a,d,p){return p!==null&&pu(p),vi(a,i.child,null,d),i=Hu(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function vS(i,a,d,p,g,b,E){if(d)return a.flags&256?(a.flags&=-257,p=zu(Error(c(422))),qs(i,a,E,p)):a.memoizedState!==null?(a.child=i.child,a.flags|=128,null):(b=p.fallback,g=a.mode,p=hl({mode:"visible",children:p.children},g,0,null),b=Ro(b,g,E,null),b.flags|=2,p.return=a,b.return=a,p.sibling=b,a.child=p,a.mode&1&&vi(a,i.child,null,E),a.child.memoizedState=Bu(E),a.memoizedState=Lu,b);if(!(a.mode&1))return qs(i,a,E,null);if(Zc(g))return p=M4(g).digest,b=Error(c(419)),p=zu(b,p,void 0),qs(i,a,E,p);if(d=(E&i.childLanes)!==0,bn||d){if(p=Kt,p!==null){switch(E&-E){case 4:g=2;break;case 16:g=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=g&(p.suspendedLanes|E)?0:g,g!==0&&g!==b.retryLane&&(b.retryLane=g,ur(i,g),Fn(p,i,g,-1))}return sd(),p=zu(Error(c(421))),qs(i,a,E,p)}return Vp(g)?(a.flags|=128,a.child=i.child,a=MS.bind(null,i),T4(g,a),null):(i=b.treeContext,Ge&&(On=A4(g),Tn=a,Pt=!0,Kn=null,ha=!1,i!==null&&(Dn[An++]=Tr,Dn[An++]=_r,Dn[An++]=Io,Tr=i.id,_r=i.overflow,Io=a)),a=Hu(a,p.children),a.flags|=4096,a)}function Xm(i,a,d){i.lanes|=a;var p=i.alternate;p!==null&&(p.lanes|=a),yu(i.return,a,d)}function Wu(i,a,d,p,g){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:g}:(b.isBackwards=a,b.rendering=null,b.renderingStartTime=0,b.last=p,b.tail=d,b.tailMode=g)}function Qm(i,a,d){var p=a.pendingProps,g=p.revealOrder,b=p.tail;if(hn(i,a,p.children,d),p=Tt.current,p&2)p=p&1|2,a.flags|=128;else{if(i!==null&&i.flags&128)e:for(i=a.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Xm(i,d,a);else if(i.tag===19)Xm(i,d,a);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}p&=1}if(gt(Tt,p),!(a.mode&1))a.memoizedState=null;else switch(g){case"forwards":for(d=a.child,g=null;d!==null;)i=d.alternate,i!==null&&Hs(i)===null&&(g=d),d=d.sibling;d=g,d===null?(g=a.child,a.child=null):(g=d.sibling,d.sibling=null),Wu(a,!1,g,d,b);break;case"backwards":for(d=null,g=a.child,a.child=null;g!==null;){if(i=g.alternate,i!==null&&Hs(i)===null){a.child=g;break}i=g.sibling,g.sibling=d,d=g,g=i}Wu(a,!0,d,null,b);break;case"together":Wu(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Ys(i,a){!(a.mode&1)&&i!==null&&(i.alternate=null,a.alternate=null,a.flags|=2)}function Ar(i,a,d){if(i!==null&&(a.dependencies=i.dependencies),Do|=a.lanes,!(d&a.childLanes))return null;if(i!==null&&a.child!==i.child)throw Error(c(153));if(a.child!==null){for(i=a.child,d=no(i,i.pendingProps),a.child=d,d.return=a;i.sibling!==null;)i=i.sibling,d=d.sibling=no(i,i.pendingProps),d.return=a;d.sibling=null}return a.child}function gS(i,a,d){switch(a.tag){case 3:qm(a),hi();break;case 5:pm(a);break;case 1:xn(a.type)&&ks(a);break;case 4:wu(a,a.stateNode.containerInfo);break;case 10:nm(a,a.type._context,a.memoizedProps.value);break;case 13:var p=a.memoizedState;if(p!==null)return p.dehydrated!==null?(gt(Tt,Tt.current&1),a.flags|=128,null):d&a.child.childLanes?Km(i,a,d):(gt(Tt,Tt.current&1),i=Ar(i,a,d),i!==null?i.sibling:null);gt(Tt,Tt.current&1);break;case 19:if(p=(d&a.childLanes)!==0,i.flags&128){if(p)return Qm(i,a,d);a.flags|=128}var g=a.memoizedState;if(g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),gt(Tt,Tt.current),p)break;return null;case 22:case 23:return a.lanes=0,Um(i,a,d)}return Ar(i,a,d)}function hr(i){i.flags|=4}function Zm(i,a){if(i!==null&&i.child===a.child)return!0;if(a.flags&16)return!1;for(i=a.child;i!==null;){if(i.flags&12854||i.subtreeFlags&12854)return!1;i=i.sibling}return!0}var Sa,Ca,Ks,Xs;if(ve)Sa=function(i,a){for(var d=a.child;d!==null;){if(d.tag===5||d.tag===6)Re(i,d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===a)break;for(;d.sibling===null;){if(d.return===null||d.return===a)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Ca=function(){},Ks=function(i,a,d,p,g){if(i=i.memoizedProps,i!==p){var b=a.stateNode,E=dr(Rn.current);d=pe(b,d,i,p,g,E),(a.updateQueue=d)&&hr(a)}},Xs=function(i,a,d,p){d!==p&&hr(a)};else if(Te){Sa=function(i,a,d,p){for(var g=a.child;g!==null;){if(g.tag===5){var b=g.stateNode;d&&p&&(b=Hp(b,g.type,g.memoizedProps,g)),Re(i,b)}else if(g.tag===6)b=g.stateNode,d&&p&&(b=Wp(b,g.memoizedProps,g)),Re(i,b);else if(g.tag!==4){if(g.tag===22&&g.memoizedState!==null)b=g.child,b!==null&&(b.return=g),Sa(i,g,!0,!0);else if(g.child!==null){g.child.return=g,g=g.child;continue}}if(g===a)break;for(;g.sibling===null;){if(g.return===null||g.return===a)return;g=g.return}g.sibling.return=g.return,g=g.sibling}};var Jm=function(i,a,d,p){for(var g=a.child;g!==null;){if(g.tag===5){var b=g.stateNode;d&&p&&(b=Hp(b,g.type,g.memoizedProps,g)),Bp(i,b)}else if(g.tag===6)b=g.stateNode,d&&p&&(b=Wp(b,g.memoizedProps,g)),Bp(i,b);else if(g.tag!==4){if(g.tag===22&&g.memoizedState!==null)b=g.child,b!==null&&(b.return=g),Jm(i,g,!0,!0);else if(g.child!==null){g.child.return=g,g=g.child;continue}}if(g===a)break;for(;g.sibling===null;){if(g.return===null||g.return===a)return;g=g.return}g.sibling.return=g.return,g=g.sibling}};Ca=function(i,a){var d=a.stateNode;if(!Zm(i,a)){i=d.containerInfo;var p=Lp(i);Jm(p,a,!1,!1),d.pendingChildren=p,hr(a),k4(i,p)}},Ks=function(i,a,d,p,g){var b=i.stateNode,E=i.memoizedProps;if((i=Zm(i,a))&&E===p)a.stateNode=b;else{var O=a.stateNode,V=dr(Rn.current),ie=null;E!==p&&(ie=pe(O,d,E,p,g,V)),i&&ie===null?a.stateNode=b:(b=j4(b,ie,d,E,p,a,i,O),Ie(b,d,p,g,V)&&hr(a),a.stateNode=b,i?hr(a):Sa(b,a,!1,!1))}},Xs=function(i,a,d,p){d!==p?(i=dr(gi.current),d=dr(Rn.current),a.stateNode=Ne(p,i,d,a),hr(a)):a.stateNode=i.stateNode}}else Ca=function(){},Ks=function(){},Xs=function(){};function wa(i,a){if(!Pt)switch(i.tailMode){case"hidden":a=i.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?i.tail=null:d.sibling=null;break;case"collapsed":d=i.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function on(i){var a=i.alternate!==null&&i.alternate.child===i.child,d=0,p=0;if(a)for(var g=i.child;g!==null;)d|=g.lanes|g.childLanes,p|=g.subtreeFlags&14680064,p|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)d|=g.lanes|g.childLanes,p|=g.subtreeFlags,p|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=p,i.childLanes=d,a}function yS(i,a,d){var p=a.pendingProps;switch(du(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return on(a),null;case 1:return xn(a.type)&&js(),on(a),null;case 3:return d=a.stateNode,yi(),St(yn),St(nn),Eu(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(As(a)?hr(a):i===null||i.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,Kn!==null&&(id(Kn),Kn=null))),Ca(i,a),on(a),null;case 5:ju(a),d=dr(gi.current);var g=a.type;if(i!==null&&a.stateNode!=null)Ks(i,a,g,p,d),i.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!p){if(a.stateNode===null)throw Error(c(166));return on(a),null}if(i=dr(Rn.current),As(a)){if(!Ge)throw Error(c(175));i=O4(a.stateNode,a.type,a.memoizedProps,d,i,a,!ha),a.updateQueue=i,i!==null&&hr(a)}else{var b=ze(g,p,d,i,a);Sa(b,a,!1,!1),a.stateNode=b,Ie(b,g,p,d,i)&&hr(a)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return on(a),null;case 6:if(i&&a.stateNode!=null)Xs(i,a,i.memoizedProps,p);else{if(typeof p!="string"&&a.stateNode===null)throw Error(c(166));if(i=dr(gi.current),d=dr(Rn.current),As(a)){if(!Ge)throw Error(c(176));if(i=a.stateNode,d=a.memoizedProps,(p=z4(i,d,a,!ha))&&(g=Tn,g!==null))switch(g.tag){case 3:V4(g.stateNode.containerInfo,i,d,(g.mode&1)!==0);break;case 5:U4(g.type,g.memoizedProps,g.stateNode,i,d,(g.mode&1)!==0)}p&&hr(a)}else a.stateNode=Ne(p,i,d,a)}return on(a),null;case 13:if(St(Tt),p=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Pt&&On!==null&&a.mode&1&&!(a.flags&128))tm(),hi(),a.flags|=98560,g=!1;else if(g=As(a),p!==null&&p.dehydrated!==null){if(i===null){if(!g)throw Error(c(318));if(!Ge)throw Error(c(344));if(g=a.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(c(317));R4(g,a)}else hi(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;on(a),g=!1}else Kn!==null&&(id(Kn),Kn=null),g=!0;if(!g)return a.flags&65536?a:null}return a.flags&128?(a.lanes=d,a):(d=p!==null,d!==(i!==null&&i.memoizedState!==null)&&d&&(a.child.flags|=8192,a.mode&1&&(i===null||Tt.current&1?$t===0&&($t=3):sd())),a.updateQueue!==null&&(a.flags|=4),on(a),null);case 4:return yi(),Ca(i,a),i===null&&Pe(a.stateNode.containerInfo),on(a),null;case 10:return gu(a.type._context),on(a),null;case 17:return xn(a.type)&&js(),on(a),null;case 19:if(St(Tt),g=a.memoizedState,g===null)return on(a),null;if(p=(a.flags&128)!==0,b=g.rendering,b===null)if(p)wa(g,!1);else{if($t!==0||i!==null&&i.flags&128)for(i=a.child;i!==null;){if(b=Hs(i),b!==null){for(a.flags|=128,wa(g,!1),i=b.updateQueue,i!==null&&(a.updateQueue=i,a.flags|=4),a.subtreeFlags=0,i=d,d=a.child;d!==null;)p=d,g=i,p.flags&=14680066,b=p.alternate,b===null?(p.childLanes=0,p.lanes=g,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=b.childLanes,p.lanes=b.lanes,p.child=b.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=b.memoizedProps,p.memoizedState=b.memoizedState,p.updateQueue=b.updateQueue,p.type=b.type,g=b.dependencies,p.dependencies=g===null?null:{lanes:g.lanes,firstContext:g.firstContext}),d=d.sibling;return gt(Tt,Tt.current&1|2),a.child}i=i.sibling}g.tail!==null&&qt()>td&&(a.flags|=128,p=!0,wa(g,!1),a.lanes=4194304)}else{if(!p)if(i=Hs(b),i!==null){if(a.flags|=128,p=!0,i=i.updateQueue,i!==null&&(a.updateQueue=i,a.flags|=4),wa(g,!0),g.tail===null&&g.tailMode==="hidden"&&!b.alternate&&!Pt)return on(a),null}else 2*qt()-g.renderingStartTime>td&&d!==1073741824&&(a.flags|=128,p=!0,wa(g,!1),a.lanes=4194304);g.isBackwards?(b.sibling=a.child,a.child=b):(i=g.last,i!==null?i.sibling=b:a.child=b,g.last=b)}return g.tail!==null?(a=g.tail,g.rendering=a,g.tail=a.sibling,g.renderingStartTime=qt(),a.sibling=null,i=Tt.current,gt(Tt,p?i&1|2:i&1),a):(on(a),null);case 22:case 23:return ad(),d=a.memoizedState!==null,i!==null&&i.memoizedState!==null!==d&&(a.flags|=8192),d&&a.mode&1?_n&1073741824&&(on(a),ve&&a.subtreeFlags&6&&(a.flags|=8192)):on(a),null;case 24:return null;case 25:return null}throw Error(c(156,a.tag))}function xS(i,a){switch(du(a),a.tag){case 1:return xn(a.type)&&js(),i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 3:return yi(),St(yn),St(nn),Eu(),i=a.flags,i&65536&&!(i&128)?(a.flags=i&-65537|128,a):null;case 5:return ju(a),null;case 13:if(St(Tt),i=a.memoizedState,i!==null&&i.dehydrated!==null){if(a.alternate===null)throw Error(c(340));hi()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 19:return St(Tt),null;case 4:return yi(),null;case 10:return gu(a.type._context),null;case 22:case 23:return ad(),null;case 24:return null;default:return null}}var Qs=!1,an=!1,bS=typeof WeakSet=="function"?WeakSet:Set,we=null;function bi(i,a){var d=i.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(p){It(i,a,p)}else d.current=null}function Vu(i,a,d){try{d()}catch(p){It(i,a,p)}}var ev=!1;function SS(i,a){for(oe(i.containerInfo),we=a;we!==null;)if(i=we,a=i.child,(i.subtreeFlags&1028)!==0&&a!==null)a.return=i,we=a;else for(;we!==null;){i=we;try{var d=i.alternate;if(i.flags&1024)switch(i.tag){case 0:case 11:case 15:break;case 1:if(d!==null){var p=d.memoizedProps,g=d.memoizedState,b=i.stateNode,E=b.getSnapshotBeforeUpdate(i.elementType===i.type?p:Xn(i.type,p),g);b.__reactInternalSnapshotBeforeUpdate=E}break;case 3:ve&&Eo(i.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(c(163))}}catch(O){It(i,i.return,O)}if(a=i.sibling,a!==null){a.return=i.return,we=a;break}we=i.return}return d=ev,ev=!1,d}function ja(i,a,d){var p=a.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var g=p=p.next;do{if((g.tag&i)===i){var b=g.destroy;g.destroy=void 0,b!==void 0&&Vu(a,d,b)}g=g.next}while(g!==p)}}function Zs(i,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var d=a=a.next;do{if((d.tag&i)===i){var p=d.create;d.destroy=p()}d=d.next}while(d!==a)}}function Uu(i){var a=i.ref;if(a!==null){var d=i.stateNode;switch(i.tag){case 5:i=re(d);break;default:i=d}typeof a=="function"?a(i):a.current=i}}function tv(i){var a=i.alternate;a!==null&&(i.alternate=null,tv(a)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(a=i.stateNode,a!==null&&Be(a)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function nv(i){return i.tag===5||i.tag===3||i.tag===4}function rv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||nv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function $u(i,a,d){var p=i.tag;if(p===5||p===6)i=i.stateNode,a?dn(d,i,a):Le(d,i);else if(p!==4&&(i=i.child,i!==null))for($u(i,a,d),i=i.sibling;i!==null;)$u(i,a,d),i=i.sibling}function Gu(i,a,d){var p=i.tag;if(p===5||p===6)i=i.stateNode,a?_e(d,i,a):J(d,i);else if(p!==4&&(i=i.child,i!==null))for(Gu(i,a,d),i=i.sibling;i!==null;)Gu(i,a,d),i=i.sibling}var Zt=null,Qn=!1;function pr(i,a,d){for(d=d.child;d!==null;)qu(i,a,d),d=d.sibling}function qu(i,a,d){if(lr&&typeof lr.onCommitFiberUnmount=="function")try{lr.onCommitFiberUnmount(Ms,d)}catch{}switch(d.tag){case 5:an||bi(d,a);case 6:if(ve){var p=Zt,g=Qn;Zt=null,pr(i,a,d),Zt=p,Qn=g,Zt!==null&&(Qn?fn(Zt,d.stateNode):Vt(Zt,d.stateNode))}else pr(i,a,d);break;case 18:ve&&Zt!==null&&(Qn?H4(Zt,d.stateNode):B4(Zt,d.stateNode));break;case 4:ve?(p=Zt,g=Qn,Zt=d.stateNode.containerInfo,Qn=!0,pr(i,a,d),Zt=p,Qn=g):(Te&&(p=d.stateNode.containerInfo,g=Lp(p),Qc(p,g)),pr(i,a,d));break;case 0:case 11:case 14:case 15:if(!an&&(p=d.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){g=p=p.next;do{var b=g,E=b.destroy;b=b.tag,E!==void 0&&(b&2||b&4)&&Vu(d,a,E),g=g.next}while(g!==p)}pr(i,a,d);break;case 1:if(!an&&(bi(d,a),p=d.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=d.memoizedProps,p.state=d.memoizedState,p.componentWillUnmount()}catch(O){It(d,a,O)}pr(i,a,d);break;case 21:pr(i,a,d);break;case 22:d.mode&1?(an=(p=an)||d.memoizedState!==null,pr(i,a,d),an=p):pr(i,a,d);break;default:pr(i,a,d)}}function ov(i){var a=i.updateQueue;if(a!==null){i.updateQueue=null;var d=i.stateNode;d===null&&(d=i.stateNode=new bS),a.forEach(function(p){var g=TS.bind(null,i,p);d.has(p)||(d.add(p),p.then(g,g))})}}function Zn(i,a){var d=a.deletions;if(d!==null)for(var p=0;p<d.length;p++){var g=d[p];try{var b=i,E=a;if(ve){var O=E;e:for(;O!==null;){switch(O.tag){case 5:Zt=O.stateNode,Qn=!1;break e;case 3:Zt=O.stateNode.containerInfo,Qn=!0;break e;case 4:Zt=O.stateNode.containerInfo,Qn=!0;break e}O=O.return}if(Zt===null)throw Error(c(160));qu(b,E,g),Zt=null,Qn=!1}else qu(b,E,g);var V=g.alternate;V!==null&&(V.return=null),g.return=null}catch(ie){It(g,a,ie)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)iv(a,i),a=a.sibling}function iv(i,a){var d=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Zn(a,i),mr(i),p&4){try{ja(3,i,i.return),Zs(3,i)}catch(be){It(i,i.return,be)}try{ja(5,i,i.return)}catch(be){It(i,i.return,be)}}break;case 1:Zn(a,i),mr(i),p&512&&d!==null&&bi(d,d.return);break;case 5:if(Zn(a,i),mr(i),p&512&&d!==null&&bi(d,d.return),ve){if(i.flags&32){var g=i.stateNode;try{sr(g)}catch(be){It(i,i.return,be)}}if(p&4&&(g=i.stateNode,g!=null)){var b=i.memoizedProps;if(d=d!==null?d.memoizedProps:b,p=i.type,a=i.updateQueue,i.updateQueue=null,a!==null)try{he(g,a,p,d,b,i)}catch(be){It(i,i.return,be)}}}break;case 6:if(Zn(a,i),mr(i),p&4&&ve){if(i.stateNode===null)throw Error(c(162));g=i.stateNode,b=i.memoizedProps,d=d!==null?d.memoizedProps:b;try{nt(g,d,b)}catch(be){It(i,i.return,be)}}break;case 3:if(Zn(a,i),mr(i),p&4){if(ve&&Ge&&d!==null&&d.memoizedState.isDehydrated)try{F4(a.containerInfo)}catch(be){It(i,i.return,be)}if(Te){g=a.containerInfo,b=a.pendingChildren;try{Qc(g,b)}catch(be){It(i,i.return,be)}}}break;case 4:if(Zn(a,i),mr(i),p&4&&Te){b=i.stateNode,g=b.containerInfo,b=b.pendingChildren;try{Qc(g,b)}catch(be){It(i,i.return,be)}}break;case 13:Zn(a,i),mr(i),g=i.child,g.flags&8192&&(b=g.memoizedState!==null,g.stateNode.isHidden=b,!b||g.alternate!==null&&g.alternate.memoizedState!==null||(ed=qt())),p&4&&ov(i);break;case 22:var E=d!==null&&d.memoizedState!==null;if(i.mode&1?(an=(d=an)||E,Zn(a,i),an=d):Zn(a,i),mr(i),p&8192){if(d=i.memoizedState!==null,(i.stateNode.isHidden=d)&&!E&&i.mode&1)for(we=i,p=i.child;p!==null;){for(a=we=p;we!==null;){E=we;var O=E.child;switch(E.tag){case 0:case 11:case 14:case 15:ja(4,E,E.return);break;case 1:bi(E,E.return);var V=E.stateNode;if(typeof V.componentWillUnmount=="function"){var ie=E,ke=E.return;try{var He=ie;V.props=He.memoizedProps,V.state=He.memoizedState,V.componentWillUnmount()}catch(be){It(ie,ke,be)}}break;case 5:bi(E,E.return);break;case 22:if(E.memoizedState!==null){lv(a);continue}}O!==null?(O.return=E,we=O):lv(a)}p=p.sibling}if(ve){e:if(p=null,ve)for(a=i;;){if(a.tag===5){if(p===null){p=a;try{g=a.stateNode,d?ko(g):Xc(a.stateNode,a.memoizedProps)}catch(be){It(i,i.return,be)}}}else if(a.tag===6){if(p===null)try{b=a.stateNode,d?la(b):ca(b,a.memoizedProps)}catch(be){It(i,i.return,be)}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===i)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;p===a&&(p=null),a=a.return}p===a&&(p=null),a.sibling.return=a.return,a=a.sibling}}}break;case 19:Zn(a,i),mr(i),p&4&&ov(i);break;case 21:break;default:Zn(a,i),mr(i)}}function mr(i){var a=i.flags;if(a&2){try{if(ve){e:{for(var d=i.return;d!==null;){if(nv(d)){var p=d;break e}d=d.return}throw Error(c(160))}switch(p.tag){case 5:var g=p.stateNode;p.flags&32&&(sr(g),p.flags&=-33);var b=rv(i);Gu(i,b,g);break;case 3:case 4:var E=p.stateNode.containerInfo,O=rv(i);$u(i,O,E);break;default:throw Error(c(161))}}}catch(V){It(i,i.return,V)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function CS(i,a,d){we=i,av(i)}function av(i,a,d){for(var p=(i.mode&1)!==0;we!==null;){var g=we,b=g.child;if(g.tag===22&&p){var E=g.memoizedState!==null||Qs;if(!E){var O=g.alternate,V=O!==null&&O.memoizedState!==null||an;O=Qs;var ie=an;if(Qs=E,(an=V)&&!ie)for(we=g;we!==null;)E=we,V=E.child,E.tag===22&&E.memoizedState!==null?cv(g):V!==null?(V.return=E,we=V):cv(g);for(;b!==null;)we=b,av(b),b=b.sibling;we=g,Qs=O,an=ie}sv(i)}else g.subtreeFlags&8772&&b!==null?(b.return=g,we=b):sv(i)}}function sv(i){for(;we!==null;){var a=we;if(a.flags&8772){var d=a.alternate;try{if(a.flags&8772)switch(a.tag){case 0:case 11:case 15:an||Zs(5,a);break;case 1:var p=a.stateNode;if(a.flags&4&&!an)if(d===null)p.componentDidMount();else{var g=a.elementType===a.type?d.memoizedProps:Xn(a.type,d.memoizedProps);p.componentDidUpdate(g,d.memoizedState,p.__reactInternalSnapshotBeforeUpdate)}var b=a.updateQueue;b!==null&&am(a,b,p);break;case 3:var E=a.updateQueue;if(E!==null){if(d=null,a.child!==null)switch(a.child.tag){case 5:d=re(a.child.stateNode);break;case 1:d=a.child.stateNode}am(a,E,d)}break;case 5:var O=a.stateNode;d===null&&a.flags&4&&Nt(O,a.type,a.memoizedProps,a);break;case 6:break;case 4:break;case 12:break;case 13:if(Ge&&a.memoizedState===null){var V=a.alternate;if(V!==null){var ie=V.memoizedState;if(ie!==null){var ke=ie.dehydrated;ke!==null&&L4(ke)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(c(163))}an||a.flags&512&&Uu(a)}catch(He){It(a,a.return,He)}}if(a===i){we=null;break}if(d=a.sibling,d!==null){d.return=a.return,we=d;break}we=a.return}}function lv(i){for(;we!==null;){var a=we;if(a===i){we=null;break}var d=a.sibling;if(d!==null){d.return=a.return,we=d;break}we=a.return}}function cv(i){for(;we!==null;){var a=we;try{switch(a.tag){case 0:case 11:case 15:var d=a.return;try{Zs(4,a)}catch(V){It(a,d,V)}break;case 1:var p=a.stateNode;if(typeof p.componentDidMount=="function"){var g=a.return;try{p.componentDidMount()}catch(V){It(a,g,V)}}var b=a.return;try{Uu(a)}catch(V){It(a,b,V)}break;case 5:var E=a.return;try{Uu(a)}catch(V){It(a,E,V)}}}catch(V){It(a,a.return,V)}if(a===i){we=null;break}var O=a.sibling;if(O!==null){O.return=a.return,we=O;break}we=a.return}}var Js=0,el=1,tl=2,nl=3,rl=4;if(typeof Symbol=="function"&&Symbol.for){var ka=Symbol.for;Js=ka("selector.component"),el=ka("selector.has_pseudo_class"),tl=ka("selector.role"),nl=ka("selector.test_id"),rl=ka("selector.text")}function Yu(i){var a=ye(i);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error(c(364));return a}if(i=ue(i),i===null)throw Error(c(362));return i.stateNode.current}function Ku(i,a){switch(a.$$typeof){case Js:if(i.type===a.value)return!0;break;case el:e:{a=a.value,i=[i,0];for(var d=0;d<i.length;){var p=i[d++],g=i[d++],b=a[g];if(p.tag!==5||!q(p)){for(;b!=null&&Ku(p,b);)g++,b=a[g];if(g===a.length){a=!0;break e}else for(p=p.child;p!==null;)i.push(p,g),p=p.sibling}}a=!1}return a;case tl:if(i.tag===5&&ae(i.stateNode,a.value))return!0;break;case rl:if((i.tag===5||i.tag===6)&&(i=je(i),i!==null&&0<=i.indexOf(a.value)))return!0;break;case nl:if(i.tag===5&&(i=i.memoizedProps["data-testname"],typeof i=="string"&&i.toLowerCase()===a.value.toLowerCase()))return!0;break;default:throw Error(c(365))}return!1}function Xu(i){switch(i.$$typeof){case Js:return"<"+(D(i.value)||"Unknown")+">";case el:return":has("+(Xu(i)||"")+")";case tl:return'[role="'+i.value+'"]';case rl:return'"'+i.value+'"';case nl:return'[data-testname="'+i.value+'"]';default:throw Error(c(365))}}function uv(i,a){var d=[];i=[i,0];for(var p=0;p<i.length;){var g=i[p++],b=i[p++],E=a[b];if(g.tag!==5||!q(g)){for(;E!=null&&Ku(g,E);)b++,E=a[b];if(b===a.length)d.push(g);else for(g=g.child;g!==null;)i.push(g,b),g=g.sibling}}return d}function Qu(i,a){if(!N)throw Error(c(363));i=Yu(i),i=uv(i,a),a=[],i=Array.from(i);for(var d=0;d<i.length;){var p=i[d++];if(p.tag===5)q(p)||a.push(p.stateNode);else for(p=p.child;p!==null;)i.push(p),p=p.sibling}return a}var wS=Math.ceil,ol=u.ReactCurrentDispatcher,Zu=u.ReactCurrentOwner,Ft=u.ReactCurrentBatchConfig,Xe=0,Kt=null,Lt=null,Jt=0,_n=0,Si=Yr(0),$t=0,Ea=null,Do=0,il=0,Ju=0,Pa=null,Sn=null,ed=0,td=1/0,Or=null;function Ci(){td=qt()+500}var al=!1,nd=null,Zr=null,sl=!1,Jr=null,ll=0,Ia=0,rd=null,cl=-1,ul=0;function sn(){return Xe&6?qt():cl!==-1?cl:cl=qt()}function eo(i){return i.mode&1?Xe&2&&Jt!==0?Jt&-Jt:iS.transition!==null?(ul===0&&(ul=qp()),ul):(i=ot,i!==0?i:et()):1}function Fn(i,a,d,p){if(50<Ia)throw Ia=0,rd=null,Error(c(185));fa(i,d,p),(!(Xe&2)||i!==Kt)&&(i===Kt&&(!(Xe&2)&&(il|=d),$t===4&&to(i,Jt)),Cn(i,p),d===1&&Xe===0&&!(a.mode&1)&&(Ci(),Ts&&cr()))}function Cn(i,a){var d=i.callbackNode;X4(i,a);var p=Is(i,i===Kt?Jt:0);if(p===0)d!==null&&Kp(d),i.callbackNode=null,i.callbackPriority=0;else if(a=p&-p,i.callbackPriority!==a){if(d!=null&&Kp(d),a===1)i.tag===0?oS(fv.bind(null,i)):Xp(fv.bind(null,i)),vt?Rt(function(){!(Xe&6)&&cr()}):au(su,cr),d=null;else{switch(Yp(p)){case 1:d=su;break;case 4:d=eS;break;case 16:d=lu;break;case 536870912:d=tS;break;default:d=lu}d=Sv(d,dv.bind(null,i))}i.callbackPriority=a,i.callbackNode=d}}function dv(i,a){if(cl=-1,ul=0,Xe&6)throw Error(c(327));var d=i.callbackNode;if(zo()&&i.callbackNode!==d)return null;var p=Is(i,i===Kt?Jt:0);if(p===0)return null;if(p&30||p&i.expiredLanes||a)a=dl(i,p);else{a=p;var g=Xe;Xe|=2;var b=mv();(Kt!==i||Jt!==a)&&(Or=null,Ci(),Ao(i,a));do try{ES();break}catch(O){pv(i,O)}while(1);vu(),ol.current=b,Xe=g,Lt!==null?a=0:(Kt=null,Jt=0,a=$t)}if(a!==0){if(a===2&&(g=ru(i),g!==0&&(p=g,a=od(i,g))),a===1)throw d=Ea,Ao(i,0),to(i,p),Cn(i,qt()),d;if(a===6)to(i,p);else{if(g=i.current.alternate,!(p&30)&&!jS(g)&&(a=dl(i,p),a===2&&(b=ru(i),b!==0&&(p=b,a=od(i,b))),a===1))throw d=Ea,Ao(i,0),to(i,p),Cn(i,qt()),d;switch(i.finishedWork=g,i.finishedLanes=p,a){case 0:case 1:throw Error(c(345));case 2:Oo(i,Sn,Or);break;case 3:if(to(i,p),(p&130023424)===p&&(a=ed+500-qt(),10<a)){if(Is(i,0)!==0)break;if(g=i.suspendedLanes,(g&p)!==p){sn(),i.pingedLanes|=i.suspendedLanes&g;break}i.timeoutHandle=Ve(Oo.bind(null,i,Sn,Or),a);break}Oo(i,Sn,Or);break;case 4:if(to(i,p),(p&4194240)===p)break;for(a=i.eventTimes,g=-1;0<p;){var E=31-qn(p);b=1<<E,E=a[E],E>g&&(g=E),p&=~b}if(p=g,p=qt()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*wS(p/1960))-p,10<p){i.timeoutHandle=Ve(Oo.bind(null,i,Sn,Or),p);break}Oo(i,Sn,Or);break;case 5:Oo(i,Sn,Or);break;default:throw Error(c(329))}}}return Cn(i,qt()),i.callbackNode===d?dv.bind(null,i):null}function od(i,a){var d=Pa;return i.current.memoizedState.isDehydrated&&(Ao(i,a).flags|=256),i=dl(i,a),i!==2&&(a=Sn,Sn=d,a!==null&&id(a)),i}function id(i){Sn===null?Sn=i:Sn.push.apply(Sn,i)}function jS(i){for(var a=i;;){if(a.flags&16384){var d=a.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var p=0;p<d.length;p++){var g=d[p],b=g.getSnapshot;g=g.value;try{if(!Yn(b(),g))return!1}catch{return!1}}}if(d=a.child,a.subtreeFlags&16384&&d!==null)d.return=a,a=d;else{if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function to(i,a){for(a&=~Ju,a&=~il,i.suspendedLanes|=a,i.pingedLanes&=~a,i=i.expirationTimes;0<a;){var d=31-qn(a),p=1<<d;i[d]=-1,a&=~p}}function fv(i){if(Xe&6)throw Error(c(327));zo();var a=Is(i,0);if(!(a&1))return Cn(i,qt()),null;var d=dl(i,a);if(i.tag!==0&&d===2){var p=ru(i);p!==0&&(a=p,d=od(i,p))}if(d===1)throw d=Ea,Ao(i,0),to(i,a),Cn(i,qt()),d;if(d===6)throw Error(c(345));return i.finishedWork=i.current.alternate,i.finishedLanes=a,Oo(i,Sn,Or),Cn(i,qt()),null}function hv(i){Jr!==null&&Jr.tag===0&&!(Xe&6)&&zo();var a=Xe;Xe|=1;var d=Ft.transition,p=ot;try{if(Ft.transition=null,ot=1,i)return i()}finally{ot=p,Ft.transition=d,Xe=a,!(Xe&6)&&cr()}}function ad(){_n=Si.current,St(Si)}function Ao(i,a){i.finishedWork=null,i.finishedLanes=0;var d=i.timeoutHandle;if(d!==$e&&(i.timeoutHandle=$e,Ue(d)),Lt!==null)for(d=Lt.return;d!==null;){var p=d;switch(du(p),p.tag){case 1:p=p.type.childContextTypes,p!=null&&js();break;case 3:yi(),St(yn),St(nn),Eu();break;case 5:ju(p);break;case 4:yi();break;case 13:St(Tt);break;case 19:St(Tt);break;case 10:gu(p.type._context);break;case 22:case 23:ad()}d=d.return}if(Kt=i,Lt=i=no(i.current,null),Jt=_n=a,$t=0,Ea=null,Ju=il=Do=0,Sn=Pa=null,To!==null){for(a=0;a<To.length;a++)if(d=To[a],p=d.interleaved,p!==null){d.interleaved=null;var g=p.next,b=d.pending;if(b!==null){var E=b.next;b.next=g,p.next=E}d.pending=p}To=null}return i}function pv(i,a){do{var d=Lt;try{if(vu(),Ws.current=Gs,Vs){for(var p=_t.memoizedState;p!==null;){var g=p.queue;g!==null&&(g.pending=null),p=p.next}Vs=!1}if(_o=0,Yt=Ut=_t=null,ga=!1,ya=0,Zu.current=null,d===null||d.return===null){$t=1,Ea=a,Lt=null;break}e:{var b=i,E=d.return,O=d,V=a;if(a=Jt,O.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var ie=V,ke=O,He=ke.tag;if(!(ke.mode&1)&&(He===0||He===11||He===15)){var be=ke.alternate;be?(ke.updateQueue=be.updateQueue,ke.memoizedState=be.memoizedState,ke.lanes=be.lanes):(ke.updateQueue=null,ke.memoizedState=null)}var Ct=Lm(E);if(Ct!==null){Ct.flags&=-257,Bm(Ct,E,O,b,a),Ct.mode&1&&Fm(b,ie,a),a=Ct,V=ie;var ht=a.updateQueue;if(ht===null){var wn=new Set;wn.add(V),a.updateQueue=wn}else ht.add(V);break e}else{if(!(a&1)){Fm(b,ie,a),sd();break e}V=Error(c(426))}}else if(Pt&&O.mode&1){var zr=Lm(E);if(zr!==null){!(zr.flags&65536)&&(zr.flags|=256),Bm(zr,E,O,b,a),pu(xi(V,O));break e}}b=V=xi(V,O),$t!==4&&($t=2),Pa===null?Pa=[b]:Pa.push(b),b=E;do{switch(b.tag){case 3:b.flags|=65536,a&=-a,b.lanes|=a;var H=Rm(b,V,a);im(b,H);break e;case 1:O=V;var R=b.type,G=b.stateNode;if(!(b.flags&128)&&(typeof R.getDerivedStateFromError=="function"||G!==null&&typeof G.componentDidCatch=="function"&&(Zr===null||!Zr.has(G)))){b.flags|=65536,a&=-a,b.lanes|=a;var Se=Nm(b,O,a);im(b,Se);break e}}b=b.return}while(b!==null)}gv(d)}catch(De){a=De,Lt===d&&d!==null&&(Lt=d=d.return);continue}break}while(1)}function mv(){var i=ol.current;return ol.current=Gs,i===null?Gs:i}function sd(){($t===0||$t===3||$t===2)&&($t=4),Kt===null||!(Do&268435455)&&!(il&268435455)||to(Kt,Jt)}function dl(i,a){var d=Xe;Xe|=2;var p=mv();(Kt!==i||Jt!==a)&&(Or=null,Ao(i,a));do try{kS();break}catch(g){pv(i,g)}while(1);if(vu(),Xe=d,ol.current=p,Lt!==null)throw Error(c(261));return Kt=null,Jt=0,$t}function kS(){for(;Lt!==null;)vv(Lt)}function ES(){for(;Lt!==null&&!Z4();)vv(Lt)}function vv(i){var a=bv(i.alternate,i,_n);i.memoizedProps=i.pendingProps,a===null?gv(i):Lt=a,Zu.current=null}function gv(i){var a=i;do{var d=a.alternate;if(i=a.return,a.flags&32768){if(d=xS(d,a),d!==null){d.flags&=32767,Lt=d;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{$t=6,Lt=null;return}}else if(d=yS(d,a,_n),d!==null){Lt=d;return}if(a=a.sibling,a!==null){Lt=a;return}Lt=a=i}while(a!==null);$t===0&&($t=5)}function Oo(i,a,d){var p=ot,g=Ft.transition;try{Ft.transition=null,ot=1,PS(i,a,d,p)}finally{Ft.transition=g,ot=p}return null}function PS(i,a,d,p){do zo();while(Jr!==null);if(Xe&6)throw Error(c(327));d=i.finishedWork;var g=i.finishedLanes;if(d===null)return null;if(i.finishedWork=null,i.finishedLanes=0,d===i.current)throw Error(c(177));i.callbackNode=null,i.callbackPriority=0;var b=d.lanes|d.childLanes;if(Q4(i,b),i===Kt&&(Lt=Kt=null,Jt=0),!(d.subtreeFlags&2064)&&!(d.flags&2064)||sl||(sl=!0,Sv(lu,function(){return zo(),null})),b=(d.flags&15990)!==0,d.subtreeFlags&15990||b){b=Ft.transition,Ft.transition=null;var E=ot;ot=1;var O=Xe;Xe|=4,Zu.current=null,SS(i,d),iv(d,i),le(i.containerInfo),i.current=d,CS(d),J4(),Xe=O,ot=E,Ft.transition=b}else i.current=d;if(sl&&(sl=!1,Jr=i,ll=g),b=i.pendingLanes,b===0&&(Zr=null),nS(d.stateNode),Cn(i,qt()),a!==null)for(p=i.onRecoverableError,d=0;d<a.length;d++)g=a[d],p(g.value,{componentStack:g.stack,digest:g.digest});if(al)throw al=!1,i=nd,nd=null,i;return ll&1&&i.tag!==0&&zo(),b=i.pendingLanes,b&1?i===rd?Ia++:(Ia=0,rd=i):Ia=0,cr(),null}function zo(){if(Jr!==null){var i=Yp(ll),a=Ft.transition,d=ot;try{if(Ft.transition=null,ot=16>i?16:i,Jr===null)var p=!1;else{if(i=Jr,Jr=null,ll=0,Xe&6)throw Error(c(331));var g=Xe;for(Xe|=4,we=i.current;we!==null;){var b=we,E=b.child;if(we.flags&16){var O=b.deletions;if(O!==null){for(var V=0;V<O.length;V++){var ie=O[V];for(we=ie;we!==null;){var ke=we;switch(ke.tag){case 0:case 11:case 15:ja(8,ke,b)}var He=ke.child;if(He!==null)He.return=ke,we=He;else for(;we!==null;){ke=we;var be=ke.sibling,Ct=ke.return;if(tv(ke),ke===ie){we=null;break}if(be!==null){be.return=Ct,we=be;break}we=Ct}}}var ht=b.alternate;if(ht!==null){var wn=ht.child;if(wn!==null){ht.child=null;do{var zr=wn.sibling;wn.sibling=null,wn=zr}while(wn!==null)}}we=b}}if(b.subtreeFlags&2064&&E!==null)E.return=b,we=E;else e:for(;we!==null;){if(b=we,b.flags&2048)switch(b.tag){case 0:case 11:case 15:ja(9,b,b.return)}var H=b.sibling;if(H!==null){H.return=b.return,we=H;break e}we=b.return}}var R=i.current;for(we=R;we!==null;){E=we;var G=E.child;if(E.subtreeFlags&2064&&G!==null)G.return=E,we=G;else e:for(E=R;we!==null;){if(O=we,O.flags&2048)try{switch(O.tag){case 0:case 11:case 15:Zs(9,O)}}catch(De){It(O,O.return,De)}if(O===E){we=null;break e}var Se=O.sibling;if(Se!==null){Se.return=O.return,we=Se;break e}we=O.return}}if(Xe=g,cr(),lr&&typeof lr.onPostCommitFiberRoot=="function")try{lr.onPostCommitFiberRoot(Ms,i)}catch{}p=!0}return p}finally{ot=d,Ft.transition=a}}return!1}function yv(i,a,d){a=xi(d,a),a=Rm(i,a,1),i=Qr(i,a,1),a=sn(),i!==null&&(fa(i,1,a),Cn(i,a))}function It(i,a,d){if(i.tag===3)yv(i,i,d);else for(;a!==null;){if(a.tag===3){yv(a,i,d);break}else if(a.tag===1){var p=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Zr===null||!Zr.has(p))){i=xi(d,i),i=Nm(a,i,1),a=Qr(a,i,1),i=sn(),a!==null&&(fa(a,1,i),Cn(a,i));break}}a=a.return}}function IS(i,a,d){var p=i.pingCache;p!==null&&p.delete(a),a=sn(),i.pingedLanes|=i.suspendedLanes&d,Kt===i&&(Jt&d)===d&&($t===4||$t===3&&(Jt&130023424)===Jt&&500>qt()-ed?Ao(i,0):Ju|=d),Cn(i,a)}function xv(i,a){a===0&&(i.mode&1?(a=Ps,Ps<<=1,!(Ps&130023424)&&(Ps=4194304)):a=1);var d=sn();i=ur(i,a),i!==null&&(fa(i,a,d),Cn(i,d))}function MS(i){var a=i.memoizedState,d=0;a!==null&&(d=a.retryLane),xv(i,d)}function TS(i,a){var d=0;switch(i.tag){case 13:var p=i.stateNode,g=i.memoizedState;g!==null&&(d=g.retryLane);break;case 19:p=i.stateNode;break;default:throw Error(c(314))}p!==null&&p.delete(a),xv(i,d)}var bv;bv=function(i,a,d){if(i!==null)if(i.memoizedProps!==a.pendingProps||yn.current)bn=!0;else{if(!(i.lanes&d)&&!(a.flags&128))return bn=!1,gS(i,a,d);bn=!!(i.flags&131072)}else bn=!1,Pt&&a.flags&1048576&&Qp(a,Ds,a.index);switch(a.lanes=0,a.tag){case 2:var p=a.type;Ys(i,a),i=a.pendingProps;var g=ui(a,nn.current);mi(a,d),g=Mu(null,a,p,i,g,d);var b=Tu();return a.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,xn(p)?(b=!0,ks(a)):b=!1,a.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,bu(a),g.updater=Ls,a.stateNode=g,g._reactInternals=a,Cu(a,p,i,d),a=Fu(null,a,p,!0,b,d)):(a.tag=0,Pt&&b&&uu(a),hn(null,a,g,d),a=a.child),a;case 16:p=a.elementType;e:{switch(Ys(i,a),i=a.pendingProps,g=p._init,p=g(p._payload),a.type=p,g=a.tag=DS(p),i=Xn(p,i),g){case 0:a=Nu(null,a,p,i,d);break e;case 1:a=Gm(null,a,p,i,d);break e;case 11:a=Hm(null,a,p,i,d);break e;case 14:a=Wm(null,a,p,Xn(p.type,i),d);break e}throw Error(c(306,p,""))}return a;case 0:return p=a.type,g=a.pendingProps,g=a.elementType===p?g:Xn(p,g),Nu(i,a,p,g,d);case 1:return p=a.type,g=a.pendingProps,g=a.elementType===p?g:Xn(p,g),Gm(i,a,p,g,d);case 3:e:{if(qm(a),i===null)throw Error(c(387));p=a.pendingProps,b=a.memoizedState,g=b.element,om(i,a),Fs(a,p,null,d);var E=a.memoizedState;if(p=E.element,Ge&&b.isDehydrated)if(b={element:p,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},a.updateQueue.baseState=b,a.memoizedState=b,a.flags&256){g=xi(Error(c(423)),a),a=Ym(i,a,p,d,g);break e}else if(p!==g){g=xi(Error(c(424)),a),a=Ym(i,a,p,d,g);break e}else for(Ge&&(On=D4(a.stateNode.containerInfo),Tn=a,Pt=!0,Kn=null,ha=!1),d=hm(a,null,p,d),a.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(hi(),p===g){a=Ar(i,a,d);break e}hn(i,a,p,d)}a=a.child}return a;case 5:return pm(a),i===null&&hu(a),p=a.type,g=a.pendingProps,b=i!==null?i.memoizedProps:null,E=g.children,ce(p,g)?E=null:b!==null&&ce(p,b)&&(a.flags|=32),$m(i,a),hn(i,a,E,d),a.child;case 6:return i===null&&hu(a),null;case 13:return Km(i,a,d);case 4:return wu(a,a.stateNode.containerInfo),p=a.pendingProps,i===null?a.child=vi(a,null,p,d):hn(i,a,p,d),a.child;case 11:return p=a.type,g=a.pendingProps,g=a.elementType===p?g:Xn(p,g),Hm(i,a,p,g,d);case 7:return hn(i,a,a.pendingProps,d),a.child;case 8:return hn(i,a,a.pendingProps.children,d),a.child;case 12:return hn(i,a,a.pendingProps.children,d),a.child;case 10:e:{if(p=a.type._context,g=a.pendingProps,b=a.memoizedProps,E=g.value,nm(a,p,E),b!==null)if(Yn(b.value,E)){if(b.children===g.children&&!yn.current){a=Ar(i,a,d);break e}}else for(b=a.child,b!==null&&(b.return=a);b!==null;){var O=b.dependencies;if(O!==null){E=b.child;for(var V=O.firstContext;V!==null;){if(V.context===p){if(b.tag===1){V=Dr(-1,d&-d),V.tag=2;var ie=b.updateQueue;if(ie!==null){ie=ie.shared;var ke=ie.pending;ke===null?V.next=V:(V.next=ke.next,ke.next=V),ie.pending=V}}b.lanes|=d,V=b.alternate,V!==null&&(V.lanes|=d),yu(b.return,d,a),O.lanes|=d;break}V=V.next}}else if(b.tag===10)E=b.type===a.type?null:b.child;else if(b.tag===18){if(E=b.return,E===null)throw Error(c(341));E.lanes|=d,O=E.alternate,O!==null&&(O.lanes|=d),yu(E,d,a),E=b.sibling}else E=b.child;if(E!==null)E.return=b;else for(E=b;E!==null;){if(E===a){E=null;break}if(b=E.sibling,b!==null){b.return=E.return,E=b;break}E=E.return}b=E}hn(i,a,g.children,d),a=a.child}return a;case 9:return g=a.type,p=a.pendingProps.children,mi(a,d),g=zn(g),p=p(g),a.flags|=1,hn(i,a,p,d),a.child;case 14:return p=a.type,g=Xn(p,a.pendingProps),g=Xn(p.type,g),Wm(i,a,p,g,d);case 15:return Vm(i,a,a.type,a.pendingProps,d);case 17:return p=a.type,g=a.pendingProps,g=a.elementType===p?g:Xn(p,g),Ys(i,a),a.tag=1,xn(p)?(i=!0,ks(a)):i=!1,mi(a,d),cm(a,p,g),Cu(a,p,g,d),Fu(null,a,p,!0,i,d);case 19:return Qm(i,a,d);case 22:return Um(i,a,d)}throw Error(c(156,a.tag))};function Sv(i,a){return au(i,a)}function _S(i,a,d,p){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(i,a,d,p){return new _S(i,a,d,p)}function ld(i){return i=i.prototype,!(!i||!i.isReactComponent)}function DS(i){if(typeof i=="function")return ld(i)?1:0;if(i!=null){if(i=i.$$typeof,i===j)return 11;if(i===M)return 14}return 2}function no(i,a){var d=i.alternate;return d===null?(d=Ln(i.tag,a,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=a,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&14680064,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,a=i.dependencies,d.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d}function fl(i,a,d,p,g,b){var E=2;if(p=i,typeof i=="function")ld(i)&&(E=1);else if(typeof i=="string")E=5;else e:switch(i){case m:return Ro(d.children,g,b,a);case v:E=8,g|=8;break;case x:return i=Ln(12,d,a,g|2),i.elementType=x,i.lanes=b,i;case w:return i=Ln(13,d,a,g),i.elementType=w,i.lanes=b,i;case k:return i=Ln(19,d,a,g),i.elementType=k,i.lanes=b,i;case I:return hl(d,g,b,a);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case S:E=10;break e;case C:E=9;break e;case j:E=11;break e;case M:E=14;break e;case P:E=16,p=null;break e}throw Error(c(130,i==null?i:typeof i,""))}return a=Ln(E,d,a,g),a.elementType=i,a.type=p,a.lanes=b,a}function Ro(i,a,d,p){return i=Ln(7,i,p,a),i.lanes=d,i}function hl(i,a,d,p){return i=Ln(22,i,p,a),i.elementType=I,i.lanes=d,i.stateNode={isHidden:!1},i}function cd(i,a,d){return i=Ln(6,i,null,a),i.lanes=d,i}function ud(i,a,d){return a=Ln(4,i.children!==null?i.children:[],i.key,a),a.lanes=d,a.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},a}function AS(i,a,d,p,g){this.tag=a,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=$e,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ou(0),this.expirationTimes=ou(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ou(0),this.identifierPrefix=p,this.onRecoverableError=g,Ge&&(this.mutableSourceEagerHydrationData=null)}function Cv(i,a,d,p,g,b,E,O,V){return i=new AS(i,a,d,O,V),a===1?(a=1,b===!0&&(a|=8)):a=0,b=Ln(3,null,null,a),i.current=b,b.stateNode=i,b.memoizedState={element:p,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},bu(b),i}function wv(i){if(!i)return Kr;i=i._reactInternals;e:{if(W(i)!==i||i.tag!==1)throw Error(c(170));var a=i;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(xn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(c(171))}if(i.tag===1){var d=i.type;if(xn(d))return $p(i,d,a)}return a}function jv(i){var a=i._reactInternals;if(a===void 0)throw typeof i.render=="function"?Error(c(188)):(i=Object.keys(i).join(","),Error(c(268,i)));return i=Q(a),i===null?null:i.stateNode}function kv(i,a){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var d=i.retryLane;i.retryLane=d!==0&&d<a?d:a}}function pl(i,a){kv(i,a),(i=i.alternate)&&kv(i,a)}function OS(i){return i=Q(i),i===null?null:i.stateNode}function zS(){return null}return n.attemptContinuousHydration=function(i){if(i.tag===13){var a=ur(i,134217728);if(a!==null){var d=sn();Fn(a,i,134217728,d)}pl(i,134217728)}},n.attemptDiscreteHydration=function(i){if(i.tag===13){var a=ur(i,1);if(a!==null){var d=sn();Fn(a,i,1,d)}pl(i,1)}},n.attemptHydrationAtCurrentPriority=function(i){if(i.tag===13){var a=eo(i),d=ur(i,a);if(d!==null){var p=sn();Fn(d,i,a,p)}pl(i,a)}},n.attemptSynchronousHydration=function(i){switch(i.tag){case 3:var a=i.stateNode;if(a.current.memoizedState.isDehydrated){var d=da(a.pendingLanes);d!==0&&(iu(a,d|1),Cn(a,qt()),!(Xe&6)&&(Ci(),cr()))}break;case 13:hv(function(){var p=ur(i,1);if(p!==null){var g=sn();Fn(p,i,1,g)}}),pl(i,1)}},n.batchedUpdates=function(i,a){var d=Xe;Xe|=1;try{return i(a)}finally{Xe=d,Xe===0&&(Ci(),Ts&&cr())}},n.createComponentSelector=function(i){return{$$typeof:Js,value:i}},n.createContainer=function(i,a,d,p,g,b,E){return Cv(i,a,!1,null,d,p,g,b,E)},n.createHasPseudoClassSelector=function(i){return{$$typeof:el,value:i}},n.createHydrationContainer=function(i,a,d,p,g,b,E,O,V){return i=Cv(d,p,!0,i,g,b,E,O,V),i.context=wv(null),d=i.current,p=sn(),g=eo(d),b=Dr(p,g),b.callback=a??null,Qr(d,b,g),i.current.lanes=g,fa(i,g,p),Cn(i,p),i},n.createPortal=function(i,a,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:p==null?null:""+p,children:i,containerInfo:a,implementation:d}},n.createRoleSelector=function(i){return{$$typeof:tl,value:i}},n.createTestNameSelector=function(i){return{$$typeof:nl,value:i}},n.createTextSelector=function(i){return{$$typeof:rl,value:i}},n.deferredUpdates=function(i){var a=ot,d=Ft.transition;try{return Ft.transition=null,ot=16,i()}finally{ot=a,Ft.transition=d}},n.discreteUpdates=function(i,a,d,p,g){var b=ot,E=Ft.transition;try{return Ft.transition=null,ot=1,i(a,d,p,g)}finally{ot=b,Ft.transition=E,Xe===0&&Ci()}},n.findAllNodes=Qu,n.findBoundingRects=function(i,a){if(!N)throw Error(c(363));a=Qu(i,a),i=[];for(var d=0;d<a.length;d++)i.push(xe(a[d]));for(a=i.length-1;0<a;a--){d=i[a];for(var p=d.x,g=p+d.width,b=d.y,E=b+d.height,O=a-1;0<=O;O--)if(a!==O){var V=i[O],ie=V.x,ke=ie+V.width,He=V.y,be=He+V.height;if(p>=ie&&b>=He&&g<=ke&&E<=be){i.splice(a,1);break}else if(p!==ie||d.width!==V.width||be<b||He>E){if(!(b!==He||d.height!==V.height||ke<p||ie>g)){ie>p&&(V.width+=ie-p,V.x=p),ke<g&&(V.width=g-ie),i.splice(a,1);break}}else{He>b&&(V.height+=He-b,V.y=b),be<E&&(V.height=E-He),i.splice(a,1);break}}}return i},n.findHostInstance=jv,n.findHostInstanceWithNoPortals=function(i){return i=B(i),i=i!==null?X(i):null,i===null?null:i.stateNode},n.findHostInstanceWithWarning=function(i){return jv(i)},n.flushControlled=function(i){var a=Xe;Xe|=1;var d=Ft.transition,p=ot;try{Ft.transition=null,ot=1,i()}finally{ot=p,Ft.transition=d,Xe=a,Xe===0&&(Ci(),cr())}},n.flushPassiveEffects=zo,n.flushSync=hv,n.focusWithin=function(i,a){if(!N)throw Error(c(363));for(i=Yu(i),a=uv(i,a),a=Array.from(a),i=0;i<a.length;){var d=a[i++];if(!q(d)){if(d.tag===5&&Oe(d.stateNode))return!0;for(d=d.child;d!==null;)a.push(d),d=d.sibling}}return!1},n.getCurrentUpdatePriority=function(){return ot},n.getFindAllNodesFailureDescription=function(i,a){if(!N)throw Error(c(363));var d=0,p=[];i=[Yu(i),0];for(var g=0;g<i.length;){var b=i[g++],E=i[g++],O=a[E];if((b.tag!==5||!q(b))&&(Ku(b,O)&&(p.push(Xu(O)),E++,E>d&&(d=E)),E<a.length))for(b=b.child;b!==null;)i.push(b,E),b=b.sibling}if(d<a.length){for(i=[];d<a.length;d++)i.push(Xu(a[d]));return`findAllNodes was able to match part of the selector:
|
||
`+(p.join(" > ")+`
|
||
|
||
No matching component was found for:
|
||
`)+i.join(" > ")}return null},n.getPublicRootInstance=function(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return re(i.child.stateNode);default:return i.child.stateNode}},n.injectIntoDevTools=function(i){if(i={bundleType:i.bundleType,version:i.version,rendererPackageName:i.rendererPackageName,rendererConfig:i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:OS,findFiberByHostInstance:i.findFiberByHostInstance||zS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")i=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)i=!0;else{try{Ms=a.inject(i),lr=a}catch{}i=!!a.checkDCE}}return i},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(i,a,d,p){if(!N)throw Error(c(363));i=Qu(i,a);var g=Ze(i,d,p).disconnect;return{disconnect:function(){g()}}},n.registerMutableSourceForHydration=function(i,a){var d=a._getVersion;d=d(a._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[a,d]:i.mutableSourceEagerHydrationData.push(a,d)},n.runWithPriority=function(i,a){var d=ot;try{return ot=i,a()}finally{ot=d}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(i,a,d,p){var g=a.current,b=sn(),E=eo(g);return d=wv(d),a.context===null?a.context=d:a.pendingContext=d,a=Dr(b,E),a.payload={element:i},p=p===void 0?null:p,p!==null&&(a.callback=p),i=Qr(g,a,E),i!==null&&(Fn(i,g,E,b),Ns(i,g,E)),E},n};(function(e){e.exports=mO})(pO);const vO=M3($f);var pc={},gO={get exports(){return pc},set exports(e){pc=e}},li={};/**
|
||
* @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.
|
||
*/li.ConcurrentRoot=1;li.ContinuousEventPriority=4;li.DefaultEventPriority=16;li.DiscreteEventPriority=1;li.IdleEventPriority=536870912;li.LegacyRoot=0;(function(e){e.exports=li})(gO);const J0={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let e1=!1,t1=!1;const Dp=".react-konva-event",yO=`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
|
||
`,xO=`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
|
||
`,bO={};function Vc(e,t,n=bO){if(!e1&&"zIndex"in t&&(console.warn(xO),e1=!0),!t1&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(yO),t1=!0)}for(var s in n)if(!J0[s]){var c=s.slice(0,2)==="on",u=n[s]!==t[s];if(c&&u){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e.off(f,n[s])}var h=!t.hasOwnProperty(s);h&&e.setAttr(s,void 0)}var m=t._useStrictMode,v={},x=!1;const S={};for(var s in t)if(!J0[s]){var c=s.slice(0,2)==="on",C=n[s]!==t[s];if(c&&C){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[s]&&(S[f]=t[s])}!c&&(t[s]!==n[s]||m&&t[s]!==e.getAttr(s))&&(x=!0,v[s]=t[s])}x&&(e.setAttrs(v),wo(e));for(var f in S)e.on(f+Dp,S[f])}function wo(e){if(!T3.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const Vb={},SO={};Ua.Node.prototype._applyProps=Vc;function CO(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),wo(e)}function wO(e,t,n){let r=Ua[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=Ua.Group);const o={},s={};for(var c in t){var u=c.slice(0,2)==="on";u?s[c]=t[c]:o[c]=t[c]}const f=new r(o);return Vc(f,s),f}function jO(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function kO(e,t,n){return!1}function EO(e){return e}function PO(){return null}function IO(){return null}function MO(e,t,n,r){return SO}function TO(){}function _O(e){}function DO(e,t){return!1}function AO(){return Vb}function OO(){return Vb}const zO=setTimeout,RO=clearTimeout,NO=-1;function FO(e,t){return!1}const LO=!1,BO=!0,HO=!0;function WO(e,t){t.parent===e?t.moveToTop():e.add(t),wo(e)}function VO(e,t){t.parent===e?t.moveToTop():e.add(t),wo(e)}function Ub(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),wo(e)}function UO(e,t,n){Ub(e,t,n)}function $O(e,t){t.destroy(),t.off(Dp),wo(e)}function GO(e,t){t.destroy(),t.off(Dp),wo(e)}function qO(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function YO(e,t,n){}function KO(e,t,n,r,o){Vc(e,o,r)}function XO(e){e.hide(),wo(e)}function QO(e){}function ZO(e,t){(t.visible==null||t.visible)&&e.show()}function JO(e,t){}function ez(e){}function tz(){}const nz=()=>pc.DefaultEventPriority,rz=Object.freeze(Object.defineProperty({__proto__:null,appendChild:WO,appendChildToContainer:VO,appendInitialChild:CO,cancelTimeout:RO,clearContainer:ez,commitMount:YO,commitTextUpdate:qO,commitUpdate:KO,createInstance:wO,createTextInstance:jO,detachDeletedInstance:tz,finalizeInitialChildren:kO,getChildHostContext:OO,getCurrentEventPriority:nz,getPublicInstance:EO,getRootHostContext:AO,hideInstance:XO,hideTextInstance:QO,idlePriority:Bl.unstable_IdlePriority,insertBefore:Ub,insertInContainerBefore:UO,isPrimaryRenderer:LO,noTimeout:NO,now:Bl.unstable_now,prepareForCommit:PO,preparePortalMount:IO,prepareUpdate:MO,removeChild:$O,removeChildFromContainer:GO,resetAfterCommit:TO,resetTextContent:_O,run:Bl.unstable_runWithPriority,scheduleTimeout:zO,shouldDeprioritizeSubtree:DO,shouldSetTextContent:FO,supportsMutation:HO,unhideInstance:ZO,unhideTextInstance:JO,warnsIfNotActing:BO},Symbol.toStringTag,{value:"Module"}));var oz=Object.defineProperty,iz=Object.defineProperties,az=Object.getOwnPropertyDescriptors,n1=Object.getOwnPropertySymbols,sz=Object.prototype.hasOwnProperty,lz=Object.prototype.propertyIsEnumerable,r1=(e,t,n)=>t in e?oz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,o1=(e,t)=>{for(var n in t||(t={}))sz.call(t,n)&&r1(e,n,t[n]);if(n1)for(var n of n1(t))lz.call(t,n)&&r1(e,n,t[n]);return e},cz=(e,t)=>iz(e,az(t));function $b(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=$b(r,t,n);if(o)return o;r=t?null:r.sibling}}function Gb(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const Ap=Gb(y.createContext(null));class qb extends y.Component{render(){return y.createElement(Ap.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:uz,ReactCurrentDispatcher:dz}=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function fz(){const e=y.useContext(Ap);if(!e)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=y.useId();return y.useMemo(()=>{var r;return(r=uz.current)!=null?r:$b(e,!1,o=>{let s=o.memoizedState;for(;s;){if(s.memoizedState===t)return!0;s=s.next}})},[e,t])}function hz(){var e,t;const n=fz(),[r]=y.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==Ap&&!r.has(s)&&r.set(s,(t=dz.current)==null?void 0:t.readContext(Gb(s))),o=o.return}return y.useMemo(()=>Array.from(r.keys()).reduce((s,c)=>u=>y.createElement(s,null,y.createElement(c.Provider,cz(o1({},u),{value:r.get(c)}))),s=>y.createElement(qb,o1({},s))),[r])}function pz(e){const t=Me.useRef();return Me.useLayoutEffect(()=>{t.current=e}),t.current}const mz=e=>{const t=Me.useRef(),n=Me.useRef(),r=Me.useRef(),o=pz(e),s=hz(),c=u=>{const{forwardedRef:f}=e;f&&(typeof f=="function"?f(u):f.current=u)};return Me.useLayoutEffect(()=>(n.current=new Ua.Stage({width:e.width,height:e.height,container:t.current}),c(n.current),r.current=Na.createContainer(n.current,pc.LegacyRoot,!1,null),Na.updateContainer(Me.createElement(s,{},e.children),r.current),()=>{Ua.isBrowser&&(c(null),Na.updateContainer(null,r.current,null),n.current.destroy())}),[]),Me.useLayoutEffect(()=>{c(n.current),Vc(n.current,e,o),Na.updateContainer(Me.createElement(s,{},e.children),r.current,null)}),Me.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},Aa="Layer",Ur="Group",$r="Rect",Fo="Circle",mc="Line",Yb="Image",vz="Transformer",Na=vO(rz);Na.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:Me.version,rendererPackageName:"react-konva"});const gz=Me.forwardRef((e,t)=>Me.createElement(qb,{},Me.createElement(mz,{...e,forwardedRef:t}))),yz=me([tt,Ot],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),xz=()=>{const e=Y(),{tool:t,isStaging:n,isMovingBoundingBox:r}=A(yz);return{handleDragStart:y.useCallback(()=>{(t==="move"||n)&&!r&&e(Kl(!0))},[e,r,n,t]),handleDragMove:y.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(G1(s))},[e,r,n,t]),handleDragEnd:y.useCallback(()=>{(t==="move"||n)&&!r&&e(Kl(!1))},[e,r,n,t])}},bz=me([tt,bt,Ot],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:c,isMaskEnabled:u,shouldSnapToGrid:f}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:c,isStaging:n,isMaskEnabled:u,shouldSnapToGrid:f}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Sz=()=>{const e=Y(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:c}=A(bz),u=y.useRef(null),f=q1(),h=()=>e(Zf());de(["shift+c"],()=>{h()},{enabled:()=>!o,preventDefault:!0},[]);const m=()=>e(as(!s));de(["h"],()=>{m()},{enabled:()=>!o,preventDefault:!0},[s]),de(["n"],()=>{e(Xl(!c))},{enabled:!0,preventDefault:!0},[c]),de("esc",()=>{e(_3())},{enabled:()=>!0,preventDefault:!0}),de("shift+h",()=>{e(D3(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),de(["space"],v=>{v.repeat||(f==null||f.container().focus(),r!=="move"&&(u.current=r,e(Sr("move"))),r==="move"&&u.current&&u.current!=="move"&&(e(Sr(u.current)),u.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,u])},Op=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}},Kb=()=>{const e=Y(),t=jr(),n=q1();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=A3.pixelRatio,[s,c,u,f]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;e(O3({r:s,g:c,b:u,a:f}))},commitColorUnderCursor:()=>{e(z3())}}},Cz=me([bt,tt,Ot],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),wz=e=>{const t=Y(),{tool:n,isStaging:r}=A(Cz),{commitColorUnderCursor:o}=Kb();return y.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(Kl(!0));return}if(n==="colorPicker"){o();return}const c=Op(e.current);c&&(s.evt.preventDefault(),t(Y1(!0)),t(R3([c.x,c.y])))},[e,n,r,t,o])},jz=me([bt,tt,Ot],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),kz=(e,t,n)=>{const r=Y(),{isDrawing:o,tool:s,isStaging:c}=A(jz),{updateColorUnderCursor:u}=Kb();return y.useCallback(()=>{if(!e.current)return;const f=Op(e.current);if(f){if(r(N3(f)),n.current=f,s==="colorPicker"){u();return}!o||s==="move"||c||(t.current=!0,r(K1([f.x,f.y])))}},[t,r,o,c,n,e,s,u])},Ez=()=>{const e=Y();return y.useCallback(()=>{e(F3())},[e])},Pz=me([bt,tt,Ot],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Iz=(e,t)=>{const n=Y(),{tool:r,isDrawing:o,isStaging:s}=A(Pz);return y.useCallback(()=>{if(r==="move"||s){n(Kl(!1));return}if(!t.current&&o&&e.current){const c=Op(e.current);if(!c)return;n(K1([c.x,c.y]))}else t.current=!1;n(Y1(!1))},[t,n,o,s,e,r])},Mz=me([tt],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Tz=e=>{const t=Y(),{isMoveStageKeyHeld:n,stageScale:r}=A(Mz);return y.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const c={x:(s.x-e.current.x())/r,y:(s.y-e.current.y())/r};let u=o.evt.deltaY;o.evt.ctrlKey&&(u=-u);const f=ee.clamp(r*L3**u,B3,H3),h={x:s.x-c.x*f,y:s.y-c.y*f};t(W3(f)),t(G1(h))},[e,n,r,t])},_z=me(tt,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:c}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:c,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Dz=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=A(_z);return l.jsxs(Ur,{children:[l.jsx($r,{offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),l.jsx($r,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},Az=me([tt],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Oz=()=>{const e=A(f=>f.ui.currentTheme),{stageScale:t,stageCoordinates:n,stageDimensions:r}=A(Az),[o,s]=y.useState([]),[c]=k1("colors",["gridLineColor"]),u=y.useCallback(f=>f/t,[t]);return y.useLayoutEffect(()=>{const{width:f,height:h}=r,{x:m,y:v}=n,x={x1:0,y1:0,x2:f,y2:h,offset:{x:u(m),y:u(v)}},S={x:Math.ceil(u(m)/64)*64,y:Math.ceil(u(v)/64)*64},C={x1:-S.x,y1:-S.y,x2:u(f)-S.x+64,y2:u(h)-S.y+64},w={x1:Math.min(x.x1,C.x1),y1:Math.min(x.y1,C.y1),x2:Math.max(x.x2,C.x2),y2:Math.max(x.y2,C.y2)},k=w.x2-w.x1,M=w.y2-w.y1,P=Math.round(k/64)+1,I=Math.round(M/64)+1,T=ee.range(0,P).map(D=>l.jsx(mc,{x:w.x1+D*64,y:w.y1,points:[0,0,0,M],stroke:c,strokeWidth:1},`x_${D}`)),_=ee.range(0,I).map(D=>l.jsx(mc,{x:w.x1,y:w.y1+D*64,points:[0,0,k,0],stroke:c,strokeWidth:1},`y_${D}`));s(T.concat(_))},[t,n,r,e,u,c]),l.jsx(Ur,{children:o})},zz=me([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Rz=e=>{const{...t}=e,n=A(zz),[r,o]=y.useState(null);if(y.useEffect(()=>{if(!n)return;const h=new Image;h.onload=()=>{o(h)},h.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:s,y:c,width:u,height:f}}=n;return r?l.jsx(Yb,{x:s,y:c,width:u,height:f,image:r,listening:!1,...t}):null},Ko=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},Nz=me(tt,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Ko(t)}}),i1=e=>`data:image/svg+xml;utf8,<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||
<svg width="60px" height="60px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
||
<g transform="matrix(0.5,0,0,0.5,0,0)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,2.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,7.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,10)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,12.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,15)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,17.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,20)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,22.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,25)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,27.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,30)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-2.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-7.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-10)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-12.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-15)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-17.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-20)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-22.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-25)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-27.5)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
<g transform="matrix(0.5,0,0,0.5,0,-30)">
|
||
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
|
||
</g>
|
||
</svg>`.replaceAll("black",e),Fz=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=A(Nz),[c,u]=y.useState(null),[f,h]=y.useState(0),m=y.useRef(null),v=y.useCallback(()=>{h(f+1),setTimeout(v,500)},[f]);return y.useEffect(()=>{if(c)return;const x=new Image;x.onload=()=>{u(x)},x.src=i1(n)},[c,n]),y.useEffect(()=>{c&&(c.src=i1(n))},[c,n]),y.useEffect(()=>{const x=setInterval(()=>h(S=>(S+1)%5),50);return()=>clearInterval(x)},[]),!c||!ee.isNumber(r.x)||!ee.isNumber(r.y)||!ee.isNumber(s)||!ee.isNumber(o.width)||!ee.isNumber(o.height)?null:l.jsx($r,{ref:m,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:c,fillPatternOffsetY:ee.isNumber(f)?f:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Lz=me([tt],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Bz=e=>{const{...t}=e,{objects:n}=A(Lz);return l.jsx(Ur,{listening:!1,...t,children:n.filter(V3).map((r,o)=>l.jsx(mc,{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"},o))})};var Lo=y,Hz=function(t,n,r){const o=Lo.useRef("loading"),s=Lo.useRef(),[c,u]=Lo.useState(0),f=Lo.useRef(),h=Lo.useRef(),m=Lo.useRef();return(f.current!==t||h.current!==n||m.current!==r)&&(o.current="loading",s.current=void 0,f.current=t,h.current=n,m.current=r),Lo.useLayoutEffect(function(){if(!t)return;var v=document.createElement("img");function x(){o.current="loaded",s.current=v,u(Math.random())}function S(){o.current="failed",s.current=void 0,u(Math.random())}return v.addEventListener("load",x),v.addEventListener("error",S),n&&(v.crossOrigin=n),r&&(v.referrerpolicy=r),v.src=t,function(){v.removeEventListener("load",x),v.removeEventListener("error",S)}},[t,n,r]),[s.current,o.current]};const Xb=e=>{const{url:t,x:n,y:r}=e,[o]=Hz(t);return l.jsx(Yb,{x:n,y:r,image:o,listening:!1})},Wz=me([tt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Vz=()=>{const{objects:e}=A(Wz);return e?l.jsx(Ur,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if($1(t))return l.jsx(Xb,{x:t.x,y:t.y,url:t.image.url},n);if(U3(t)){const r=l.jsx(mc,{points:t.points,stroke:t.color?Ko(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?l.jsx(Ur,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if($3(t))return l.jsx($r,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Ko(t.color)},n);if(G3(t))return l.jsx($r,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Uz=me([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:o,boundingBoxCoordinates:{x:s,y:c},boundingBoxDimensions:{width:u,height:f}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:c,width:u,height:f}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),$z=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:c,width:u,height:f}=A(Uz);return l.jsxs(Ur,{...t,children:[r&&n&&l.jsx(Xb,{url:n.image.url,x:s,y:c}),o&&l.jsxs(Ur,{children:[l.jsx($r,{x:s,y:c,width:u,height:f,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),l.jsx($r,{x:s,y:c,width:u,height:f,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},Gz=me([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:o}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:o,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),qz=()=>{const e=Y(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o}=A(Gz),{t:s}=K(),c=y.useCallback(()=>{e(Rv(!0))},[e]),u=y.useCallback(()=>{e(Rv(!1))},[e]);de(["left"],()=>{f()},{enabled:()=>!0,preventDefault:!0}),de(["right"],()=>{h()},{enabled:()=>!0,preventDefault:!0}),de(["enter"],()=>{m()},{enabled:()=>!0,preventDefault:!0});const f=()=>e(q3()),h=()=>e(Y3()),m=()=>e(K3());return r?l.jsx(L,{pos:"absolute",bottom:4,w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:c,onMouseOut:u,children:l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{tooltip:`${s("unifiedCanvas.previous")} (Left)`,"aria-label":`${s("unifiedCanvas.previous")} (Left)`,icon:l.jsx(Fx,{}),onClick:f,colorScheme:"accent",isDisabled:t}),l.jsx(se,{tooltip:`${s("unifiedCanvas.next")} (Right)`,"aria-label":`${s("unifiedCanvas.next")} (Right)`,icon:l.jsx(C9,{}),onClick:h,colorScheme:"accent",isDisabled:n}),l.jsx(se,{tooltip:`${s("unifiedCanvas.accept")} (Enter)`,"aria-label":`${s("unifiedCanvas.accept")} (Enter)`,icon:l.jsx(Oc,{}),onClick:m,colorScheme:"accent"}),l.jsx(se,{tooltip:s("unifiedCanvas.showHide"),"aria-label":s("unifiedCanvas.showHide"),"data-alert":!o,icon:o?l.jsx(M9,{}):l.jsx(I9,{}),onClick:()=>e(X3(!o)),colorScheme:"accent"}),l.jsx(se,{tooltip:s("unifiedCanvas.saveToGallery"),"aria-label":s("unifiedCanvas.saveToGallery"),icon:l.jsx(Zh,{}),onClick:()=>e(Q3(r.image.url)),colorScheme:"accent"}),l.jsx(se,{tooltip:s("unifiedCanvas.discardAll"),"aria-label":s("unifiedCanvas.discardAll"),icon:l.jsx(zc,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(Z3()),colorScheme:"error",fontSize:20})]})}):null},Fi=e=>Math.round(e*100)/100,Yz=me([tt],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Fi(n)}, ${Fi(r)})`}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function Kz(){const{cursorCoordinatesString:e}=A(Yz),{t}=K();return l.jsx(Ye,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Gf="var(--invokeai-colors-warning-500)",Xz=me([tt],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:c},scaledBoundingBoxDimensions:{width:u,height:f},boundingBoxCoordinates:{x:h,y:m},stageScale:v,shouldShowCanvasDebugInfo:x,layer:S,boundingBoxScaleMethod:C,shouldPreserveMaskedArea:j}=e;let w="inherit";return(C==="none"&&(s<512||c<512)||C==="manual"&&u*f<512*512)&&(w=Gf),{activeLayerColor:S==="mask"?Gf:"inherit",activeLayerString:S.charAt(0).toUpperCase()+S.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${Fi(h)}, ${Fi(m)})`,boundingBoxDimensionsString:`${s}×${c}`,scaledBoundingBoxDimensionsString:`${u}×${f}`,canvasCoordinatesString:`${Fi(r)}×${Fi(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(v*100),shouldShowCanvasDebugInfo:x,shouldShowBoundingBox:C!=="auto",shouldShowScaledBoundingBox:C!=="none",shouldPreserveMaskedArea:j}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Qz=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:c,canvasCoordinatesString:u,canvasDimensionsString:f,canvasScaleString:h,shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:v,shouldPreserveMaskedArea:x}=A(Xz),{t:S}=K();return l.jsxs(L,{sx:{flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,opacity:.65,display:"flex",fontSize:"sm",padding:1,px:2,minWidth:48,margin:1,borderRadius:"base",pointerEvents:"none",bg:"base.800"},children:[l.jsx(Ye,{style:{color:e},children:`${S("unifiedCanvas.activeLayer")}: ${t}`}),l.jsx(Ye,{children:`${S("unifiedCanvas.canvasScale")}: ${h}%`}),x&&l.jsx(Ye,{style:{color:Gf},children:"Preserve Masked Area: On"}),v&&l.jsx(Ye,{style:{color:n},children:`${S("unifiedCanvas.boundingBox")}: ${o}`}),c&&l.jsx(Ye,{style:{color:n},children:`${S("unifiedCanvas.scaledBoundingBox")}: ${s}`}),m&&l.jsxs(l.Fragment,{children:[l.jsx(Ye,{children:`${S("unifiedCanvas.boundingBoxPosition")}: ${r}`}),l.jsx(Ye,{children:`${S("unifiedCanvas.canvasDimensions")}: ${f}`}),l.jsx(Ye,{children:`${S("unifiedCanvas.canvasPosition")}: ${u}`}),l.jsx(Kz,{})]})]})},Zz=me(tt,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:o,isTransformingBoundingBox:s,isMovingBoundingBox:c,tool:u,shouldSnapToGrid:f}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:o,isMovingBoundingBox:c,isTransformingBoundingBox:s,stageScale:r,shouldSnapToGrid:f,tool:u,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Jz=e=>{const{...t}=e,n=Y(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:c,isTransformingBoundingBox:u,stageScale:f,shouldSnapToGrid:h,tool:m,hitStrokeWidth:v}=A(Zz),x=y.useRef(null),S=y.useRef(null),[C,j]=y.useState(!1);y.useEffect(()=>{var Q;!x.current||!S.current||(x.current.nodes([S.current]),(Q=x.current.getLayer())==null||Q.batchDraw())},[]);const w=64*f,k=y.useCallback(Q=>{if(!h){n(hd({x:Math.floor(Q.target.x()),y:Math.floor(Q.target.y())}));return}const U=Q.target.x(),X=Q.target.y(),te=Nv(U,64),re=Nv(X,64);Q.target.x(te),Q.target.y(re),n(hd({x:te,y:re}))},[n,h]),M=y.useCallback(()=>{if(!S.current)return;const Q=S.current,U=Q.scaleX(),X=Q.scaleY(),te=Math.round(Q.width()*U),re=Math.round(Q.height()*X),$=Math.round(Q.x()),Z=Math.round(Q.y());n(za({width:te,height:re})),n(hd({x:h?ml($,64):$,y:h?ml(Z,64):Z})),Q.scaleX(1),Q.scaleY(1)},[n,h]),P=y.useCallback((Q,U,X)=>{const te=Q.x%w,re=Q.y%w;return{x:ml(U.x,w)+te,y:ml(U.y,w)+re}},[w]),I=()=>{n(pd(!0))},T=()=>{n(pd(!1)),n(md(!1)),n(vl(!1)),j(!1)},_=()=>{n(md(!0))},D=()=>{n(pd(!1)),n(md(!1)),n(vl(!1)),j(!1)},z=()=>{j(!0)},W=()=>{!u&&!c&&j(!1)},F=()=>{n(vl(!0))},B=()=>{n(vl(!1))};return l.jsxs(Ur,{...t,children:[l.jsx($r,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:F,onMouseOver:F,onMouseLeave:B,onMouseOut:B}),l.jsx($r,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:v,listening:!s&&m==="move",onDragStart:_,onDragEnd:D,onDragMove:k,onMouseDown:_,onMouseOut:W,onMouseOver:z,onMouseEnter:z,onMouseUp:D,onTransform:M,onTransformEnd:T,ref:S,stroke:C?"rgba(255,255,255,0.7)":"white",strokeWidth:(C?8:1)/f,width:o.width,x:r.x,y:r.y}),l.jsx(vz,{anchorCornerRadius:3,anchorDragBoundFunc:P,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:m==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&m==="move",onDragStart:_,onDragEnd:D,onMouseDown:I,onMouseUp:T,onTransformEnd:T,ref:x,rotateEnabled:!1})]})},eR=me(tt,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:c,layer:u,shouldShowBrush:f,isMovingBoundingBox:h,isTransformingBoundingBox:m,stageScale:v,stageDimensions:x,boundingBoxCoordinates:S,boundingBoxDimensions:C,shouldRestrictStrokesToBox:j}=e,w=j?{clipX:S.x,clipY:S.y,clipWidth:C.width,clipHeight:C.height}:{};return{cursorPosition:t,brushX:t?t.x:x.width/2,brushY:t?t.y:x.height/2,radius:n/2,colorPickerOuterRadius:Fv/v,colorPickerInnerRadius:(Fv-lf+1)/v,maskColorString:Ko({...o,a:.5}),brushColorString:Ko(s),colorPickerColorString:Ko(r),tool:c,layer:u,shouldShowBrush:f,shouldDrawBrushPreview:!(h||m||!t)&&f,strokeWidth:1.5/v,dotRadius:1.5/v,clip:w}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),tR=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:c,layer:u,shouldDrawBrushPreview:f,dotRadius:h,strokeWidth:m,brushColorString:v,colorPickerColorString:x,colorPickerInnerRadius:S,colorPickerOuterRadius:C,clip:j}=A(eR);return f?l.jsxs(Ur,{listening:!1,...j,...t,children:[c==="colorPicker"?l.jsxs(l.Fragment,{children:[l.jsx(Fo,{x:n,y:r,radius:C,stroke:v,strokeWidth:lf,strokeScaleEnabled:!1}),l.jsx(Fo,{x:n,y:r,radius:S,stroke:x,strokeWidth:lf,strokeScaleEnabled:!1})]}):l.jsxs(l.Fragment,{children:[l.jsx(Fo,{x:n,y:r,radius:o,fill:u==="mask"?s:v,globalCompositeOperation:c==="eraser"?"destination-out":"source-out"}),l.jsx(Fo,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:m*2,strokeEnabled:!0,listening:!1}),l.jsx(Fo,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:m,strokeEnabled:!0,listening:!1})]}),l.jsx(Fo,{x:n,y:r,radius:h*2,fill:"rgba(255,255,255,0.4)",listening:!1}),l.jsx(Fo,{x:n,y:r,radius:h,fill:"rgba(0,0,0,1)",listening:!1})]}):null},nR=me([tt,Ot],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:c,isMovingBoundingBox:u,stageDimensions:f,stageCoordinates:h,tool:m,isMovingStage:v,shouldShowIntermediates:x,shouldShowGrid:S,shouldRestrictStrokesToBox:C}=e;let j="none";return m==="move"||t?v?j="grabbing":j="grab":s?j=void 0:C&&!c&&(j="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||u,shouldShowBoundingBox:o,shouldShowGrid:S,stageCoordinates:h,stageCursor:j,stageDimensions:f,stageScale:r,tool:m,isStaging:t,shouldShowIntermediates:x}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),rR=ne(gz,{shouldForwardProp:e=>!["sx"].includes(e)}),Qb=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:c,stageScale:u,tool:f,isStaging:h,shouldShowIntermediates:m}=A(nR);Sz();const v=y.useRef(null),x=y.useRef(null),S=y.useCallback(W=>{eC(W),v.current=W},[]),C=y.useCallback(W=>{J3(W),x.current=W},[]),j=y.useRef({x:0,y:0}),w=y.useRef(!1),k=Tz(v),M=wz(v),P=Iz(v,w),I=kz(v,w,j),T=Ez(),{handleDragStart:_,handleDragMove:D,handleDragEnd:z}=xz();return l.jsx(L,{sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:l.jsxs(Ye,{sx:{position:"relative"},children:[l.jsxs(rR,{tabIndex:-1,ref:S,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:c.width,height:c.height,scale:{x:u,y:u},onTouchStart:M,onTouchMove:I,onTouchEnd:P,onMouseDown:M,onMouseLeave:T,onMouseMove:I,onMouseUp:P,onDragStart:_,onDragMove:D,onDragEnd:z,onContextMenu:W=>W.evt.preventDefault(),onWheel:k,draggable:(f==="move"||h)&&!t,children:[l.jsx(Aa,{id:"grid",visible:r,children:l.jsx(Oz,{})}),l.jsx(Aa,{id:"base",ref:C,listening:!1,imageSmoothingEnabled:!1,children:l.jsx(Vz,{})}),l.jsxs(Aa,{id:"mask",visible:e,listening:!1,children:[l.jsx(Bz,{visible:!0,listening:!1}),l.jsx(Fz,{listening:!1})]}),l.jsx(Aa,{children:l.jsx(Dz,{})}),l.jsxs(Aa,{id:"preview",imageSmoothingEnabled:!1,children:[!h&&l.jsx(tR,{visible:f!=="move",listening:!1}),l.jsx($z,{visible:h}),m&&l.jsx(Rz,{}),l.jsx(Jz,{visible:n&&!h})]})]}),l.jsx(Qz,{}),l.jsx(qz,{})]})})},oR=me(tt,Bb,bt,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}}),Zb=()=>{const e=Y(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=A(oR),s=y.useRef(null);return y.useLayoutEffect(()=>{window.setTimeout(()=>{if(!s.current)return;const{clientWidth:c,clientHeight:u}=s.current;e(tC({width:c,height:u})),e(o?nC():Sc()),e(P1(!1))},0)},[e,r,t,n,o]),l.jsx(L,{ref:s,sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,width:"100%",height:"100%"},children:l.jsx(yc,{thickness:"2px",speed:"1s",size:"xl"})})},iR=me([tt,bt,Et],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function Jb(){const e=Y(),{canRedo:t,activeTabName:n}=A(iR),{t:r}=K(),o=()=>{e(rC())};return de(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),l.jsx(se,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:l.jsx(B9,{}),onClick:o,isDisabled:!t})}const aR=me([tt,bt,Et],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function e4(){const e=Y(),{t}=K(),{canUndo:n,activeTabName:r}=A(aR),o=()=>{e(oC())};return de(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),l.jsx(se,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:l.jsx(U9,{}),onClick:o,isDisabled:!n})}const sR=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const o=document.createElement("canvas");o.width=t,o.height=n;const s=o.getContext("2d");s&&(s.drawImage(r,0,0),o.toBlob(c=>{c&&navigator.clipboard.write([new ClipboardItem({[c.type]:c})])}),o.remove(),r.remove())}),r.src=e},lR=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},cR=(e,t,n,r)=>{const o=e.scale(),s=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:c,y:u,width:f,height:h}=e.getClientRect(),m=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:c,y:u,width:f,height:h},v=e.toDataURL(m);return e.scale(o),{dataURL:v,boundingBox:{x:s.x,y:s.y,width:f,height:h}}},uR={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},co=(e=uR)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:o,shouldSaveToGallery:s,shouldDownload:c,shouldCopy:u,shouldSetAsInitialImage:f}=e;t(iC("Exporting Image")),t(gl(!1));const h=n(),{stageScale:m,boundingBoxCoordinates:v,boundingBoxDimensions:x,stageCoordinates:S}=h.canvas,C=jr();if(!C){t(vd(!1)),t(gl(!0));return}const{dataURL:j,boundingBox:w}=cR(C,m,S,o?{...v,...x}:void 0);if(!j){t(vd(!1)),t(gl(!0));return}const k=new FormData;k.append("data",JSON.stringify({dataURL:j,filename:"merged_canvas.png",kind:s?"result":"temp",cropVisible:r}));const P=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:k})).json(),{url:I,width:T,height:_}=P,D={uuid:S1(),category:s?"result":"user",...P};c&&(lR(I),t(yl({title:Ma.t("toast.downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),u&&(sR(I,T,_),t(yl({title:Ma.t("toast.imageCopied"),status:"success",duration:2500,isClosable:!0}))),s&&(t(C1({image:D,category:"result"})),t(yl({title:Ma.t("toast.imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),f&&(t(aC({kind:"image",layer:"base",...w,image:D})),t(yl({title:Ma.t("toast.canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(vd(!1)),t(sC(Ma.t("common.statusConnected"))),t(gl(!0))};function dR(){const e=A(Ot),t=jr(),n=A(u=>u.system.isProcessing),r=A(u=>u.canvas.shouldCropToBoundingBoxOnSave),o=Y(),{t:s}=K();de(["meta+c","ctrl+c"],()=>{c()},{enabled:()=>!e,preventDefault:!0},[t,n]);const c=()=>{o(co({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return l.jsx(se,{"aria-label":`${s("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${s("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:l.jsx(Xi,{}),onClick:c,isDisabled:e})}function fR(){const e=Y(),{t}=K(),n=jr(),r=A(Ot),o=A(u=>u.system.isProcessing),s=A(u=>u.canvas.shouldCropToBoundingBoxOnSave);de(["shift+d"],()=>{c()},{enabled:()=>!r,preventDefault:!0},[n,o]);const c=()=>{e(co({cropVisible:!s,cropToBoundingBox:s,shouldDownload:!0}))};return l.jsx(se,{"aria-label":`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:l.jsx(Qh,{}),onClick:c,isDisabled:r})}function hR(){const e=A(Ot),{openUploader:t}=Kh(),{t:n}=K();return l.jsx(se,{"aria-label":n("common.upload"),tooltip:n("common.upload"),icon:l.jsx(Rc,{}),onClick:t,isDisabled:e})}const pR=me([tt,Ot],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function mR(){const e=Y(),{t}=K(),{layer:n,isMaskEnabled:r,isStaging:o}=A(pR),s=()=>{e(Ql(n==="mask"?"base":"mask"))};de(["q"],()=>{s()},{enabled:()=>!o,preventDefault:!0},[n]);const c=u=>{const f=u.target.value;e(Ql(f)),f==="mask"&&!r&&e(as(!0))};return l.jsx(Mn,{tooltip:`${t("unifiedCanvas.layer")} (Q)`,"aria-label":`${t("unifiedCanvas.layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:X1,onChange:c,isDisabled:o})}function vR(){const e=Y(),{t}=K(),n=jr(),r=A(Ot),o=A(c=>c.system.isProcessing);de(["shift+m"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n,o]);const s=()=>{e(co({cropVisible:!1,shouldSetAsInitialImage:!0}))};return l.jsx(se,{"aria-label":`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:l.jsx($x,{}),onClick:s,isDisabled:r})}function gR(){const e=A(s=>s.canvas.tool),t=A(Ot),n=Y(),{t:r}=K();de(["v"],()=>{o()},{enabled:()=>!t,preventDefault:!0},[]);const o=()=>n(Sr("move"));return l.jsx(se,{"aria-label":`${r("unifiedCanvas.move")} (V)`,tooltip:`${r("unifiedCanvas.move")} (V)`,icon:l.jsx(Lx,{}),isChecked:e==="move"||t,onClick:o})}function yR(){const e=A(s=>s.ui.shouldPinParametersPanel),t=A(s=>s.ui.shouldShowParametersPanel),n=Y(),{t:r}=K(),o=()=>{n(ql(!0)),e&&n(cn())};return!e||!t?l.jsxs(L,{flexDirection:"column",gap:2,children:[l.jsx(se,{tooltip:`${r("parameters.showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":r("parameters.showOptionsPanel"),onClick:o,children:l.jsx(Jh,{})}),l.jsx(L,{children:l.jsx(Ip,{iconButton:!0})}),l.jsx(L,{children:l.jsx(Ep,{width:"100%",height:"40px",btnGroupWidth:"100%"})})]}):null}function xR(){const e=Y(),{t}=K(),n=A(Ot),r=()=>{e(Jf()),e(Sc())};return l.jsx(se,{"aria-label":t("unifiedCanvas.clearCanvas"),tooltip:t("unifiedCanvas.clearCanvas"),icon:l.jsx(So,{}),onClick:r,isDisabled:n,colorScheme:"error"})}function t4(e,t,n=250){const[r,o]=y.useState(0);return y.useEffect(()=>{const s=setTimeout(()=>{r===1&&e(),o(0)},n);return r===2&&t(),()=>clearTimeout(s)},[r,e,t,n]),()=>o(s=>s+1)}function bR(){const e=jr(),t=Y(),{t:n}=K();de(["r"],()=>{o()},{enabled:()=>!0,preventDefault:!0},[e]);const r=t4(()=>o(!1),()=>o(!0)),o=(s=!1)=>{const c=jr();if(!c)return;const u=c.getClientRect({skipTransform:!0});t(Q1({contentRect:u,shouldScaleTo1:s}))};return l.jsx(se,{"aria-label":`${n("unifiedCanvas.resetView")} (R)`,tooltip:`${n("unifiedCanvas.resetView")} (R)`,icon:l.jsx(Hx,{}),onClick:r})}function SR(){const e=A(Ot),t=jr(),n=A(u=>u.system.isProcessing),r=A(u=>u.canvas.shouldCropToBoundingBoxOnSave),o=Y(),{t:s}=K();de(["shift+s"],()=>{c()},{enabled:()=>!e,preventDefault:!0},[t,n]);const c=()=>{o(co({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return l.jsx(se,{"aria-label":`${s("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${s("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:l.jsx(Zh,{}),onClick:c,isDisabled:e})}const CR=me([tt,Ot,Et],(e,t,n)=>{const{isProcessing:r}=n,{tool:o}=e;return{tool:o,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),wR=()=>{const e=Y(),{t}=K(),{tool:n,isStaging:r}=A(CR);de(["b"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[]),de(["e"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n]),de(["c"],()=>{c()},{enabled:()=>!r,preventDefault:!0},[n]),de(["shift+f"],()=>{u()},{enabled:()=>!r,preventDefault:!0}),de(["delete","backspace"],()=>{f()},{enabled:()=>!r,preventDefault:!0});const o=()=>e(Sr("brush")),s=()=>e(Sr("eraser")),c=()=>e(Sr("colorPicker")),u=()=>e(Z1()),f=()=>e(J1());return l.jsxs(L,{flexDirection:"column",gap:2,children:[l.jsxs(Qt,{children:[l.jsx(se,{"aria-label":`${t("unifiedCanvas.brush")} (B)`,tooltip:`${t("unifiedCanvas.brush")} (B)`,icon:l.jsx(Gx,{}),isChecked:n==="brush"&&!r,onClick:o,isDisabled:r}),l.jsx(se,{"aria-label":`${t("unifiedCanvas.eraser")} (E)`,tooltip:`${t("unifiedCanvas.eraser")} (B)`,icon:l.jsx(Wx,{}),isChecked:n==="eraser"&&!r,isDisabled:r,onClick:s})]}),l.jsxs(Qt,{children:[l.jsx(se,{"aria-label":`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:l.jsx(Ux,{}),isDisabled:r,onClick:u}),l.jsx(se,{"aria-label":`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:l.jsx(zc,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:f})]}),l.jsx(se,{"aria-label":`${t("unifiedCanvas.colorPicker")} (C)`,tooltip:`${t("unifiedCanvas.colorPicker")} (C)`,icon:l.jsx(Vx,{}),isChecked:n==="colorPicker"&&!r,isDisabled:r,onClick:c,width:"max-content"})]})},n4=()=>{const e=A(Ot),t=Y(),{t:n}=K(),r=()=>{t(lC()),t(Jf()),t(e2())};return l.jsxs(Wc,{title:n("unifiedCanvas.emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedCanvas.emptyFolder"),triggerComponent:l.jsx(Je,{leftIcon:l.jsx(So,{}),size:"sm",isDisabled:e,children:n("unifiedCanvas.emptyTempImageFolder")}),children:[l.jsx("p",{children:n("unifiedCanvas.emptyTempImagesFolderMessage")}),l.jsx("br",{}),l.jsx("p",{children:n("unifiedCanvas.emptyTempImagesFolderConfirm")})]})},r4=()=>{const e=A(Ot),t=Y(),{t:n}=K();return l.jsxs(Wc,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(e2()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:l.jsx(Je,{size:"sm",leftIcon:l.jsx(So,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[l.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),l.jsx("br",{}),l.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},jR=me([tt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),kR=()=>{const e=Y(),{t}=K(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:o,shouldShowIntermediates:s}=A(jR);return l.jsx(or,{isLazy:!1,triggerComponent:l.jsx(se,{tooltip:t("unifiedCanvas.canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedCanvas.canvasSettings"),icon:l.jsx(ep,{})}),children:l.jsxs(L,{direction:"column",gap:2,children:[l.jsx(ft,{label:t("unifiedCanvas.showIntermediates"),isChecked:s,onChange:c=>e(t2(c.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:c=>e(n2(c.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:c=>e(r2(c.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:o,onChange:c=>e(o2(c.target.checked))}),l.jsx(r4,{}),l.jsx(n4,{})]})})},ER=()=>l.jsxs(L,{flexDirection:"column",rowGap:2,children:[l.jsx(mR,{}),l.jsx(wR,{}),l.jsxs(L,{gap:2,children:[l.jsx(gR,{}),l.jsx(bR,{})]}),l.jsxs(L,{columnGap:2,children:[l.jsx(vR,{}),l.jsx(SR,{})]}),l.jsxs(L,{columnGap:2,children:[l.jsx(dR,{}),l.jsx(fR,{})]}),l.jsxs(L,{gap:2,children:[l.jsx(e4,{}),l.jsx(Jb,{})]}),l.jsxs(L,{gap:2,children:[l.jsx(hR,{}),l.jsx(xR,{})]}),l.jsx(kR,{}),l.jsx(yR,{})]});function PR(){const e=Y(),t=A(o=>o.canvas.brushSize),{t:n}=K(),r=A(Ot);return de(["BracketLeft"],()=>{e(Li(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),de(["BracketRight"],()=>{e(Li(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),l.jsx(ut,{label:n("unifiedCanvas.brushSize"),value:t,withInput:!0,onChange:o=>e(Li(o)),sliderNumberInputProps:{max:500},inputReadOnly:!1,isCompact:!0})}function Uc(){return(Uc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o4(e,t){if(e==null)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)t.indexOf(n=s[r])>=0||(o[n]=e[n]);return o}function qf(e){var t=y.useRef(e),n=y.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Ji=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Wa=function(e){return"touches"in e},Yf=function(e){return e&&e.ownerDocument.defaultView||self},a1=function(e,t,n){var r=e.getBoundingClientRect(),o=Wa(t)?function(s,c){for(var u=0;u<s.length;u++)if(s[u].identifier===c)return s[u];return s[0]}(t.touches,n):t;return{left:Ji((o.pageX-(r.left+Yf(e).pageXOffset))/r.width),top:Ji((o.pageY-(r.top+Yf(e).pageYOffset))/r.height)}},s1=function(e){!Wa(e)&&e.preventDefault()},zp=Me.memo(function(e){var t=e.onMove,n=e.onKey,r=o4(e,["onMove","onKey"]),o=y.useRef(null),s=qf(t),c=qf(n),u=y.useRef(null),f=y.useRef(!1),h=y.useMemo(function(){var S=function(w){s1(w),(Wa(w)?w.touches.length>0:w.buttons>0)&&o.current?s(a1(o.current,w,u.current)):j(!1)},C=function(){return j(!1)};function j(w){var k=f.current,M=Yf(o.current),P=w?M.addEventListener:M.removeEventListener;P(k?"touchmove":"mousemove",S),P(k?"touchend":"mouseup",C)}return[function(w){var k=w.nativeEvent,M=o.current;if(M&&(s1(k),!function(I,T){return T&&!Wa(I)}(k,f.current)&&M)){if(Wa(k)){f.current=!0;var P=k.changedTouches||[];P.length&&(u.current=P[0].identifier)}M.focus(),s(a1(M,k,u.current)),j(!0)}},function(w){var k=w.which||w.keyCode;k<37||k>40||(w.preventDefault(),c({left:k===39?.05:k===37?-.05:0,top:k===40?.05:k===38?-.05:0}))},j]},[c,s]),m=h[0],v=h[1],x=h[2];return y.useEffect(function(){return x},[x]),Me.createElement("div",Uc({},r,{onTouchStart:m,onMouseDown:m,className:"react-colorful__interactive",ref:o,onKeyDown:v,tabIndex:0,role:"slider"}))}),$c=function(e){return e.filter(Boolean).join(" ")},Rp=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=$c(["react-colorful__pointer",e.className]);return Me.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},Me.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},gn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},i4=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:gn(e.h),s:gn(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:gn(o/2),a:gn(r,2)}},Kf=function(e){var t=i4(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},$d=function(e){var t=i4(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},IR=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var s=Math.floor(t),c=r*(1-n),u=r*(1-(t-s)*n),f=r*(1-(1-t+s)*n),h=s%6;return{r:gn(255*[r,u,c,c,f,r][h]),g:gn(255*[f,r,r,u,c,c][h]),b:gn(255*[c,c,f,r,r,u][h]),a:gn(o,2)}},MR=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),c=s-Math.min(t,n,r),u=c?s===t?(n-r)/c:s===n?2+(r-t)/c:4+(t-n)/c:0;return{h:gn(60*(u<0?u+6:u)),s:gn(s?c/s*100:0),v:gn(s/255*100),a:o}},TR=Me.memo(function(e){var t=e.hue,n=e.onChange,r=$c(["react-colorful__hue",e.className]);return Me.createElement("div",{className:r},Me.createElement(zp,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Ji(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":gn(t),"aria-valuemax":"360","aria-valuemin":"0"},Me.createElement(Rp,{className:"react-colorful__hue-pointer",left:t/360,color:Kf({h:t,s:100,v:100,a:1})})))}),_R=Me.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Kf({h:t.h,s:100,v:100,a:1})};return Me.createElement("div",{className:"react-colorful__saturation",style:r},Me.createElement(zp,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Ji(t.s+100*o.left,0,100),v:Ji(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+gn(t.s)+"%, Brightness "+gn(t.v)+"%"},Me.createElement(Rp,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Kf(t)})))}),a4=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function DR(e,t,n){var r=qf(n),o=y.useState(function(){return e.toHsva(t)}),s=o[0],c=o[1],u=y.useRef({color:t,hsva:s});y.useEffect(function(){if(!e.equal(t,u.current.color)){var h=e.toHsva(t);u.current={hsva:h,color:t},c(h)}},[t,e]),y.useEffect(function(){var h;a4(s,u.current.hsva)||e.equal(h=e.fromHsva(s),u.current.color)||(u.current={hsva:s,color:h},r(h))},[s,e,r]);var f=y.useCallback(function(h){c(function(m){return Object.assign({},m,h)})},[]);return[s,f]}var AR=typeof window<"u"?y.useLayoutEffect:y.useEffect,OR=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},l1=new Map,zR=function(e){AR(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!l1.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,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,l1.set(t,n);var r=OR();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},RR=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+$d(Object.assign({},n,{a:0}))+", "+$d(Object.assign({},n,{a:1}))+")"},s=$c(["react-colorful__alpha",t]),c=gn(100*n.a);return Me.createElement("div",{className:s},Me.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),Me.createElement(zp,{onMove:function(u){r({a:u.left})},onKey:function(u){r({a:Ji(n.a+u.left)})},"aria-label":"Alpha","aria-valuetext":c+"%","aria-valuenow":c,"aria-valuemin":"0","aria-valuemax":"100"},Me.createElement(Rp,{className:"react-colorful__alpha-pointer",left:n.a,color:$d(n)})))},NR=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,c=o4(e,["className","colorModel","color","onChange"]),u=y.useRef(null);zR(u);var f=DR(n,o,s),h=f[0],m=f[1],v=$c(["react-colorful",t]);return Me.createElement("div",Uc({},c,{ref:u,className:v}),Me.createElement(_R,{hsva:h,onChange:m}),Me.createElement(TR,{hue:h.h,onChange:m}),Me.createElement(RR,{hsva:h,onChange:m,className:"react-colorful__last-control"}))},FR={defaultColor:{r:0,g:0,b:0,a:1},toHsva:MR,fromHsva:IR,equal:a4},LR=function(e){return Me.createElement(NR,Uc({},e,{colorModel:FR}))};const BR=ne(LR,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),Gd={width:6,height:6,borderColor:"base.100"},HR=e=>{const{styleClass:t="",...n}=e;return l.jsx(BR,{sx:{".react-colorful__hue-pointer":Gd,".react-colorful__saturation-pointer":Gd,".react-colorful__alpha-pointer":Gd},className:t,...n})},vc=y.memo(HR),WR=me([tt,Ot],(e,t)=>{const{brushColor:n,maskColor:r,layer:o}=e;return{brushColor:n,maskColor:r,layer:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function VR(){const e=Y(),{brushColor:t,maskColor:n,layer:r,isStaging:o}=A(WR),s=()=>{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 de(["shift+BracketLeft"],()=>{e(Bi({...t,a:ee.clamp(t.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),de(["shift+BracketRight"],()=>{e(Bi({...t,a:ee.clamp(t.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),l.jsx(or,{triggerComponent:l.jsx(Ye,{sx:{width:7,height:7,minWidth:7,minHeight:7,borderRadius:"full",bg:s(),cursor:"pointer"}}),children:l.jsxs(L,{minWidth:60,direction:"column",gap:4,width:"100%",children:[r==="base"&&l.jsx(vc,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:t,onChange:c=>e(Bi(c))}),r==="mask"&&l.jsx(vc,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:c=>e(i2(c))})]})})}function s4(){return l.jsxs(L,{columnGap:4,alignItems:"center",children:[l.jsx(PR,{}),l.jsx(VR,{})]})}function UR(){const e=Y(),t=A(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=K();return l.jsx(ft,{label:n("unifiedCanvas.betaLimitToBox"),isChecked:t,onChange:r=>e(a2(r.target.checked))})}function $R(){return l.jsxs(L,{gap:4,alignItems:"center",children:[l.jsx(s4,{}),l.jsx(UR,{})]})}function GR(){const e=Y(),{t}=K(),n=()=>e(Zf());return l.jsx(Je,{size:"sm",leftIcon:l.jsx(So,{}),onClick:n,tooltip:`${t("unifiedCanvas.clearMask")} (Shift+C)`,children:t("unifiedCanvas.betaClear")})}function qR(){const e=A(o=>o.canvas.isMaskEnabled),t=Y(),{t:n}=K(),r=()=>t(as(!e));return l.jsx(ft,{label:`${n("unifiedCanvas.enableMask")} (H)`,isChecked:e,onChange:r})}function YR(){const e=Y(),{t}=K(),n=A(r=>r.canvas.shouldPreserveMaskedArea);return l.jsx(ft,{label:t("unifiedCanvas.betaPreserveMasked"),isChecked:n,onChange:r=>e(s2(r.target.checked))})}function KR(){return l.jsxs(L,{gap:4,alignItems:"center",children:[l.jsx(s4,{}),l.jsx(qR,{}),l.jsx(YR,{}),l.jsx(GR,{})]})}function XR(){const e=A(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Y(),{t:n}=K();return l.jsx(ft,{label:n("unifiedCanvas.betaDarkenOutside"),isChecked:e,onChange:r=>t(l2(r.target.checked))})}function QR(){const e=A(r=>r.canvas.shouldShowGrid),t=Y(),{t:n}=K();return l.jsx(ft,{label:n("unifiedCanvas.showGrid"),isChecked:e,onChange:r=>t(c2(r.target.checked))})}function ZR(){const e=A(o=>o.canvas.shouldSnapToGrid),t=Y(),{t:n}=K(),r=o=>t(Xl(o.target.checked));return l.jsx(ft,{label:`${n("unifiedCanvas.snapToGrid")} (N)`,isChecked:e,onChange:r})}function JR(){return l.jsxs(L,{alignItems:"center",gap:4,children:[l.jsx(QR,{}),l.jsx(ZR,{}),l.jsx(XR,{})]})}const eN=me([tt],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function tN(){const{tool:e,layer:t}=A(eN);return l.jsxs(L,{height:8,minHeight:8,maxHeight:8,alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&l.jsx($R,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&l.jsx(KR,{}),e=="move"&&l.jsx(JR,{})]})}const nN=me([tt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),rN=()=>{const e=Y(),{doesCanvasNeedScaling:t}=A(nN);return y.useLayoutEffect(()=>{e(cn());const n=()=>{e(cn())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),l.jsx(Ye,{sx:{width:"100%",height:"100%",borderRadius:"base",bg:"base.850"},children:l.jsxs(L,{flexDirection:"row",width:"100%",height:"100%",columnGap:4,padding:4,children:[l.jsx(ER,{}),l.jsxs(L,{width:"100%",height:"100%",flexDirection:"column",rowGap:4,children:[l.jsx(tN,{}),t?l.jsx(Zb,{}):l.jsx(Qb,{})]})]})})},oN=me([tt,Ot],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Ko(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),iN=()=>{const e=Y(),{t}=K(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:c}=A(oN);de(["q"],()=>{u()},{enabled:()=>!c,preventDefault:!0},[n]),de(["shift+c"],()=>{f()},{enabled:()=>!c,preventDefault:!0},[]),de(["h"],()=>{h()},{enabled:()=>!c,preventDefault:!0},[o]);const u=()=>{e(Ql(n==="mask"?"base":"mask"))},f=()=>e(Zf()),h=()=>e(as(!o));return l.jsx(or,{triggerComponent:l.jsx(Qt,{children:l.jsx(se,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:l.jsx(O9,{}),isChecked:n==="mask",isDisabled:c})}),children:l.jsxs(L,{direction:"column",gap:2,children:[l.jsx(ft,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:h}),l.jsx(ft,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:m=>e(s2(m.target.checked))}),l.jsx(vc,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:m=>e(i2(m))}),l.jsxs(Je,{size:"sm",leftIcon:l.jsx(So,{}),onClick:f,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},aN=me([tt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:c,shouldSnapToGrid:u,shouldRestrictStrokesToBox:f}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:c,shouldSnapToGrid:u,shouldRestrictStrokesToBox:f}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),sN=()=>{const e=Y(),{t}=K(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:c,shouldShowIntermediates:u,shouldSnapToGrid:f,shouldRestrictStrokesToBox:h}=A(aN);de(["n"],()=>{e(Xl(!f))},{enabled:!0,preventDefault:!0},[f]);const m=v=>e(Xl(v.target.checked));return l.jsx(or,{isLazy:!1,triggerComponent:l.jsx(se,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:l.jsx(ep,{})}),children:l.jsxs(L,{direction:"column",gap:2,children:[l.jsx(ft,{label:t("unifiedCanvas.showIntermediates"),isChecked:u,onChange:v=>e(t2(v.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.showGrid"),isChecked:c,onChange:v=>e(c2(v.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.snapToGrid"),isChecked:f,onChange:m}),l.jsx(ft,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:v=>e(l2(v.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:v=>e(n2(v.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:v=>e(r2(v.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:h,onChange:v=>e(a2(v.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:v=>e(o2(v.target.checked))}),l.jsx(r4,{}),l.jsx(n4,{})]})})},lN=me([tt,Ot,Et],(e,t,n)=>{const{isProcessing:r}=n,{tool:o,brushColor:s,brushSize:c}=e;return{tool:o,isStaging:t,isProcessing:r,brushColor:s,brushSize:c}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),cN=()=>{const e=Y(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=A(lN),{t:s}=K();de(["b"],()=>{c()},{enabled:()=>!o,preventDefault:!0},[]),de(["e"],()=>{u()},{enabled:()=>!o,preventDefault:!0},[t]),de(["c"],()=>{f()},{enabled:()=>!o,preventDefault:!0},[t]),de(["shift+f"],()=>{h()},{enabled:()=>!o,preventDefault:!0}),de(["delete","backspace"],()=>{m()},{enabled:()=>!o,preventDefault:!0}),de(["BracketLeft"],()=>{e(Li(Math.max(r-5,5)))},{enabled:()=>!o,preventDefault:!0},[r]),de(["BracketRight"],()=>{e(Li(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),de(["shift+BracketLeft"],()=>{e(Bi({...n,a:ee.clamp(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),de(["shift+BracketRight"],()=>{e(Bi({...n,a:ee.clamp(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const c=()=>e(Sr("brush")),u=()=>e(Sr("eraser")),f=()=>e(Sr("colorPicker")),h=()=>e(Z1()),m=()=>e(J1());return l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:l.jsx(Gx,{}),isChecked:t==="brush"&&!o,onClick:c,isDisabled:o}),l.jsx(se,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:l.jsx(Wx,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:u}),l.jsx(se,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:l.jsx(Ux,{}),isDisabled:o,onClick:h}),l.jsx(se,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:l.jsx(zc,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:m}),l.jsx(se,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:l.jsx(Vx,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:f}),l.jsx(or,{triggerComponent:l.jsx(se,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:l.jsx(Jh,{})}),children:l.jsxs(L,{minWidth:60,direction:"column",gap:4,width:"100%",children:[l.jsx(L,{gap:4,justifyContent:"space-between",children:l.jsx(ut,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:v=>e(Li(v)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),l.jsx(vc,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:v=>e(Bi(v))})]})})]})},uN=me([Et,tt,Ot],(e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:s,layer:c,isMaskEnabled:u}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:u,tool:o,layer:c,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),dN=()=>{const e=Y(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s,shouldCropToBoundingBoxOnSave:c}=A(uN),u=jr(),{t:f}=K(),{openUploader:h}=Kh();de(["v"],()=>{m()},{enabled:()=>!n,preventDefault:!0},[]),de(["r"],()=>{x()},{enabled:()=>!0,preventDefault:!0},[u]),de(["shift+m"],()=>{C()},{enabled:()=>!n,preventDefault:!0},[u,t]),de(["shift+s"],()=>{j()},{enabled:()=>!n,preventDefault:!0},[u,t]),de(["meta+c","ctrl+c"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[u,t]),de(["shift+d"],()=>{k()},{enabled:()=>!n,preventDefault:!0},[u,t]);const m=()=>e(Sr("move")),v=t4(()=>x(!1),()=>x(!0)),x=(P=!1)=>{const I=jr();if(!I)return;const T=I.getClientRect({skipTransform:!0});e(Q1({contentRect:T,shouldScaleTo1:P}))},S=()=>{e(Jf()),e(Sc())},C=()=>{e(co({cropVisible:!1,shouldSetAsInitialImage:!0}))},j=()=>{e(co({cropVisible:!c,cropToBoundingBox:c,shouldSaveToGallery:!0}))},w=()=>{e(co({cropVisible:!c,cropToBoundingBox:c,shouldCopy:!0}))},k=()=>{e(co({cropVisible:!c,cropToBoundingBox:c,shouldDownload:!0}))},M=P=>{const I=P.target.value;e(Ql(I)),I==="mask"&&!r&&e(as(!0))};return l.jsxs(L,{sx:{alignItems:"center",gap:2},children:[l.jsx(Mn,{tooltip:`${f("unifiedCanvas.layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:o,validValues:X1,onChange:M,isDisabled:n}),l.jsx(iN,{}),l.jsx(cN,{}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{"aria-label":`${f("unifiedCanvas.move")} (V)`,tooltip:`${f("unifiedCanvas.move")} (V)`,icon:l.jsx(Lx,{}),isChecked:s==="move"||n,onClick:m}),l.jsx(se,{"aria-label":`${f("unifiedCanvas.resetView")} (R)`,tooltip:`${f("unifiedCanvas.resetView")} (R)`,icon:l.jsx(Hx,{}),onClick:v})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{"aria-label":`${f("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${f("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:l.jsx($x,{}),onClick:C,isDisabled:n}),l.jsx(se,{"aria-label":`${f("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${f("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:l.jsx(Zh,{}),onClick:j,isDisabled:n}),l.jsx(se,{"aria-label":`${f("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${f("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:l.jsx(Xi,{}),onClick:w,isDisabled:n}),l.jsx(se,{"aria-label":`${f("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${f("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:l.jsx(Qh,{}),onClick:k,isDisabled:n})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(e4,{}),l.jsx(Jb,{})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{"aria-label":`${f("common.upload")}`,tooltip:`${f("common.upload")}`,icon:l.jsx(Rc,{}),onClick:h,isDisabled:n}),l.jsx(se,{"aria-label":`${f("unifiedCanvas.clearCanvas")}`,tooltip:`${f("unifiedCanvas.clearCanvas")}`,icon:l.jsx(So,{}),onClick:S,colorScheme:"error",isDisabled:n})]}),l.jsx(Qt,{isAttached:!0,children:l.jsx(sN,{})})]})},fN=me([tt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),hN=()=>{const e=Y(),{doesCanvasNeedScaling:t}=A(fN);return y.useLayoutEffect(()=>{e(cn());const n=()=>{e(cn())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),l.jsx(Ye,{sx:{width:"100%",height:"100%",padding:4,borderRadius:"base",bg:"base.850"},children:l.jsxs(L,{sx:{flexDirection:"column",alignItems:"center",gap:4,width:"100%",height:"100%"},children:[l.jsx(dN,{}),l.jsx(L,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,width:"100%",height:"100%"},children:t?l.jsx(Zb,{}):l.jsx(Qb,{})})]})})},pN=me(tt,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),mN=()=>{const e=Y(),{boundingBoxDimensions:t}=A(pN),{t:n}=K(),r=u=>{e(za({...t,width:Math.floor(u)}))},o=u=>{e(za({...t,height:Math.floor(u)}))},s=()=>{e(za({...t,width:Math.floor(512)}))},c=()=>{e(za({...t,height:Math.floor(512)}))};return l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(ut,{label:n("parameters.width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:s}),l.jsx(ut,{label:n("parameters.height"),min:64,max:1024,step:64,value:t.height,onChange:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:c})]})},vN=me([Pp,Et,tt],(e,t,n)=>{const{tileSize:r,infillMethod:o}=e,{infill_methods:s}=t,{boundingBoxScaleMethod:c,scaledBoundingBoxDimensions:u}=n;return{boundingBoxScale:c,scaledBoundingBoxDimensions:u,tileSize:r,infillMethod:o,availableInfillMethods:s,isManual:c==="manual"}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),gN=()=>{const e=Y(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:o,isManual:s,scaledBoundingBoxDimensions:c}=A(vN),{t:u}=K(),f=S=>{e(xl({...c,width:Math.floor(S)}))},h=S=>{e(xl({...c,height:Math.floor(S)}))},m=()=>{e(xl({...c,width:Math.floor(512)}))},v=()=>{e(xl({...c,height:Math.floor(512)}))},x=S=>{e(dC(S.target.value))};return l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(Mn,{label:u("parameters.scaleBeforeProcessing"),validValues:cC,value:o,onChange:x}),l.jsx(ut,{isInputDisabled:!s,isResetDisabled:!s,isSliderDisabled:!s,label:u("parameters.scaledWidth"),min:64,max:1024,step:64,value:c.width,onChange:f,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:m}),l.jsx(ut,{isInputDisabled:!s,isResetDisabled:!s,isSliderDisabled:!s,label:u("parameters.scaledHeight"),min:64,max:1024,step:64,value:c.height,onChange:h,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:v}),l.jsx(Mn,{label:u("parameters.infillMethod"),value:n,validValues:r,onChange:S=>e(uC(S.target.value))}),l.jsx(ut,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",label:u("parameters.tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:S=>{e(Lv(S))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Lv(32))}})]})};function yN(){const e=Y(),t=A(r=>r.generation.seamBlur),{t:n}=K();return l.jsx(ut,{label:n("parameters.seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(Bv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Bv(16))}})}function xN(){const e=Y(),{t}=K(),n=A(r=>r.generation.seamSize);return l.jsx(ut,{label:t("parameters.seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(Hv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(Hv(96))})}function bN(){const{t:e}=K(),t=A(r=>r.generation.seamSteps),n=Y();return l.jsx(ut,{label:e("parameters.seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(Wv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(Wv(30))}})}function SN(){const e=Y(),{t}=K(),n=A(r=>r.generation.seamStrength);return l.jsx(ut,{label:t("parameters.seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(Vv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Vv(.7))}})}const CN=()=>l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(xN,{}),l.jsx(yN,{}),l.jsx(SN,{}),l.jsx(bN,{})]});function wN(){const{t:e}=K(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(jp,{})},unifiedCanvasImg2Img:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:l.jsx(Wb,{label:e("parameters.img2imgStrength")})},seed:{header:`${e("parameters.seed")}`,feature:ln.SEED,content:l.jsx(Sp,{})},boundingBox:{header:`${e("parameters.boundingBoxHeader")}`,feature:ln.BOUNDING_BOX,content:l.jsx(mN,{})},seamCorrection:{header:`${e("parameters.seamCorrectionHeader")}`,feature:ln.SEAM_CORRECTION,content:l.jsx(CN,{})},infillAndScaling:{header:`${e("parameters.infillScalingHeader")}`,feature:ln.INFILL_AND_SCALING,content:l.jsx(gN,{})},variations:{header:`${e("parameters.variations")}`,feature:ln.VARIATIONS,content:l.jsx(wp,{}),additionalHeaderComponents:l.jsx(Cp,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(xp,{}),additionalHeaderComponents:l.jsx(bp,{})}};return l.jsxs(L,{flexDir:"column",gap:2,position:"relative",children:[l.jsx(_p,{}),l.jsx(Tp,{}),l.jsx(Mp,{}),l.jsx(kp,{accordionInfo:t})]})}function jN(){const e=A(n=>n.ui.shouldUseCanvasBetaLayout),t=A(bt);return l.jsx(hp,{parametersPanelContent:l.jsx(wN,{}),children:t==="unifiedCanvas"&&(e?l.jsx(rN,{}):l.jsx(hN,{}))})}const _i={boxSize:6},c1=[{id:"txt2img",icon:l.jsx(tn,{as:FD,sx:_i}),workarea:l.jsx(hO,{})},{id:"img2img",icon:l.jsx(tn,{as:dp,sx:_i}),workarea:l.jsx(iO,{})},{id:"unifiedCanvas",icon:l.jsx(tn,{as:HD,sx:_i}),workarea:l.jsx(jN,{})},{id:"nodes",icon:l.jsx(tn,{as:LD,sx:_i}),workarea:l.jsx(YD,{})},{id:"postprocessing",icon:l.jsx(tn,{as:WD,sx:_i}),workarea:l.jsx(KD,{})},{id:"training",icon:l.jsx(tn,{as:BD,sx:_i}),workarea:l.jsx(XD,{})}];function kN(){const e=A(X8),t=A(f=>f.lightbox.isLightboxOpen),n=A(f=>f.ui.shouldPinGallery),r=A(f=>f.ui.shouldPinParametersPanel),{t:o}=K(),s=Y();de("1",()=>{s(kn(0))}),de("2",()=>{s(kn(1))}),de("3",()=>{s(kn(2))}),de("4",()=>{s(kn(3))}),de("5",()=>{s(kn(4))}),de("6",()=>{s(kn(5))}),de("z",()=>{s(Uo(!t))},[t]),de("f",()=>{s(fC()),(n||r)&&s(cn())},[n,r]);const c=y.useMemo(()=>c1.map(f=>l.jsx(Gt,{hasArrow:!0,label:String(o(`common.${f.id}`)),placement:"end",children:l.jsxs(gx,{children:[l.jsx(C2,{children:String(o(`common.${f.id}`))}),f.icon]})},f.id)),[o]),u=y.useMemo(()=>c1.map(f=>l.jsx(mx,{children:f.workarea},f.id)),[]);return l.jsxs(hx,{defaultIndex:e,index:e,onChange:f=>{s(kn(f))},flexGrow:1,children:[l.jsx(px,{children:c}),l.jsx(vx,{children:u})]})}function EN(){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(o=>o)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const PN=()=>{const e=Y(),t=A(G9),n=ls();y.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(hC())},[e,n,t])},IN=me([bt,Pr],(e,t)=>{const{shouldPinGallery:n,shouldShowGallery:r}=t;return{shouldPinGallery:n,shouldShowGalleryButton:(!n||!r)&&["txt2img","img2img","unifiedCanvas"].includes(e)}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),MN=()=>{const{t:e}=K(),{shouldPinGallery:t,shouldShowGalleryButton:n}=A(IN),r=Y(),o=()=>{r(cf(!0)),t&&r(cn())};return n?l.jsx(se,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":e("accessibility.showGallery"),onClick:o,sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",zIndex:31,p:0,insetInlineEnd:0,px:3,h:48,w:8,borderStartEndRadius:0,borderEndEndRadius:0},children:l.jsx(dp,{})}):null},qd={borderStartStartRadius:0,borderEndStartRadius:0},TN=me([Pr,bt],(e,t)=>{const{shouldPinParametersPanel:n,shouldUseCanvasBetaLayout:r,shouldShowParametersPanel:o}=e,s=r&&t==="unifiedCanvas",c=!s&&(!n||!o),u=!s&&(!n||!o)&&["txt2img","img2img","unifiedCanvas"].includes(t);return{shouldPinParametersPanel:n,shouldShowParametersPanelButton:u,shouldShowProcessButtons:c}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),_N=()=>{const e=Y(),{t}=K(),{shouldShowProcessButtons:n,shouldShowParametersPanelButton:r,shouldPinParametersPanel:o}=A(TN),s=()=>{e(ql(!0)),o&&e(cn())};return r?l.jsxs(L,{pos:"absolute",transform:"translate(0, -50%)",zIndex:20,minW:8,top:"50%",insetInlineStart:"4.5rem",direction:"column",gap:2,children:[l.jsx(se,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":t("accessibility.showOptionsPanel"),onClick:s,sx:qd,children:l.jsx(Jh,{})}),n&&l.jsxs(l.Fragment,{children:[l.jsx(Ip,{iconButton:!0,sx:qd}),l.jsx(Ep,{sx:qd})]})]}):null};var Va=globalThis&&globalThis.__assign||function(){return Va=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Va.apply(this,arguments)};function DN(e){var t,n=y.useState(!1),r=n[0],o=n[1],s=y.useState(!1),c=s[0],u=s[1],f=y.useState(!1),h=f[0],m=f[1],v=y.useState([0,0]),x=v[0],S=v[1],C=y.useRef(null);y.useEffect(function(){if(r)setTimeout(function(){u(!0),setTimeout(function(){m(!0)})});else{m(!1);var w=setTimeout(function(){u(r)},1e3);return function(){return clearTimeout(w)}}},[r]),k6("contextmenu",function(w){var k;!((k=C.current)===null||k===void 0)&&k.contains(w.target)||w.target===C.current?(w.preventDefault(),o(!0),S([w.pageX,w.pageY])):o(!1)});var j=y.useCallback(function(){var w,k;(k=(w=e.menuProps)===null||w===void 0?void 0:w.onClose)===null||k===void 0||k.call(w),o(!1)},[(t=e.menuProps)===null||t===void 0?void 0:t.onClose,o]);return y.createElement(y.Fragment,null,e.children(C),c&&y.createElement($a,Va({},e.portalProps),y.createElement(Ah,Va({isOpen:h,gutter:0},e.menuProps,{onClose:j}),y.createElement(zh,Va({"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:x[0],top:x[1],cursor:"default"}},e.menuButtonProps)),e.renderMenu())))}const AN=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,l4=y.memo(e=>{const t=Y(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:o,mayDeleteImage:s,shouldUseSingleGalleryColumn:c}=A(ZD),{image:u,isSelected:f}=e,{url:h,thumbnail:m,uuid:v,metadata:x}=u,[S,C]=y.useState(!1),j=ls(),{direction:w}=ta(),{t:k}=K(),M=gp(),P=()=>C(!0),I=()=>C(!1),T=()=>{var X,te,re,$;(te=(X=u.metadata)==null?void 0:X.image)!=null&&te.prompt&&M(($=(re=u.metadata)==null?void 0:re.image)==null?void 0:$.prompt),j({title:k("toast.promptSet"),status:"success",duration:2500,isClosable:!0})},_=()=>{u.metadata&&t(is(u.metadata.image.seed)),j({title:k("toast.seedSet"),status:"success",duration:2500,isClosable:!0})},D=()=>{t(rs(u)),n!=="img2img"&&t(kn("img2img")),j({title:k("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},z=()=>{t(bc(u)),t(Sc()),n!=="unifiedCanvas"&&t(kn("unifiedCanvas")),j({title:k("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},W=()=>{x&&t(D1(x)),j({title:k("toast.parametersSet"),status:"success",duration:2500,isClosable:!0})},F=async()=>{var X;if((X=x==null?void 0:x.image)!=null&&X.init_image_path&&(await fetch(x.image.init_image_path)).ok){t(kn("img2img")),t(pC(x)),j({title:k("toast.initialImageSet"),status:"success",duration:2500,isClosable:!0});return}j({title:k("toast.initialImageNotSet"),description:k("toast.initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},B=()=>t(Uv(u)),Q=X=>{X.dataTransfer.setData("invokeai/imageUuid",v),X.dataTransfer.effectAllowed="move"},U=()=>{t(Uv(u)),t(Uo(!0))};return l.jsx(DN,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>{var X,te,re,$,Z,oe,le,ze;return l.jsxs(Oh,{children:[l.jsx(gr,{onClickCapture:U,children:k("parameters.openInViewer")}),l.jsx(gr,{onClickCapture:T,isDisabled:((te=(X=u==null?void 0:u.metadata)==null?void 0:X.image)==null?void 0:te.prompt)===void 0,children:k("parameters.usePrompt")}),l.jsx(gr,{onClickCapture:_,isDisabled:(($=(re=u==null?void 0:u.metadata)==null?void 0:re.image)==null?void 0:$.seed)===void 0,children:k("parameters.useSeed")}),l.jsx(gr,{onClickCapture:W,isDisabled:!["txt2img","img2img"].includes((oe=(Z=u==null?void 0:u.metadata)==null?void 0:Z.image)==null?void 0:oe.type),children:k("parameters.useAll")}),l.jsx(gr,{onClickCapture:F,isDisabled:((ze=(le=u==null?void 0:u.metadata)==null?void 0:le.image)==null?void 0:ze.type)!=="img2img",children:k("parameters.useInitImg")}),l.jsx(gr,{onClickCapture:D,children:k("parameters.sendToImg2Img")}),l.jsx(gr,{onClickCapture:z,children:k("parameters.sendToUnifiedCanvas")}),l.jsx(gr,{"data-warning":!0,children:l.jsx(hc,{image:u,children:l.jsx("p",{children:k("parameters.deleteImage")})})})]})},children:X=>l.jsxs(Ye,{position:"relative",onMouseOver:P,onMouseOut:I,userSelect:"none",draggable:!0,onDragStart:Q,ref:X,sx:{padding:2,display:"flex",justifyContent:"center",transition:"transform 0.2s ease-out",_hover:{cursor:"pointer",zIndex:2},_before:{content:'""',display:"block",paddingBottom:"100%"}},children:[l.jsx(cs,{objectFit:c?"contain":r,rounded:"md",src:m||h,loading:"lazy",sx:{position:"absolute",width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",top:"50%",transform:"translate(-50%,-50%)",...w==="rtl"?{insetInlineEnd:"50%"}:{insetInlineStart:"50%"}}}),l.jsx(L,{onClick:B,sx:{position:"absolute",top:"0",insetInlineStart:"0",width:"100%",height:"100%",alignItems:"center",justifyContent:"center"},children:f&&l.jsx(tn,{as:Oc,sx:{width:"50%",height:"50%",fill:"ok.500"}})}),S&&o>=64&&l.jsx(Ye,{sx:{position:"absolute",top:1,insetInlineEnd:1},children:l.jsx(hc,{image:u,children:l.jsx(se,{"aria-label":k("parameters.deleteImage"),icon:l.jsx(V9,{}),size:"xs",fontSize:14,isDisabled:!s})})})]},v)})},AN);l4.displayName="HoverableImage";const ON=290,c4=()=>{const e=Y(),{t}=K(),n=y.useRef(null),[r,o]=y.useState(!0),{images:s,currentCategory:c,currentImageUuid:u,shouldPinGallery:f,galleryImageMinimumWidth:h,galleryGridTemplateColumns:m,galleryImageObjectFit:v,shouldAutoSwitchToNewImages:x,areMoreImagesAvailable:S,shouldUseSingleGalleryColumn:C}=A(QD),j=()=>{e(yC(c))},w=M=>{e(Zl(M))},k=()=>{e(u2()),e(cn())};return y.useEffect(()=>{if(!n.current)return;const M=new ResizeObserver(()=>{if(n.current){if(n.current.clientWidth<ON){o(!0);return}o(!1)}});return M.observe(n.current),()=>M.disconnect()},[]),l.jsxs(L,{flexDirection:"column",w:"full",h:"full",gap:4,children:[l.jsxs(L,{ref:n,alignItems:"center",justifyContent:"space-between",children:[l.jsx(Qt,{size:"sm",isAttached:!0,w:"max-content",justifyContent:"stretch",children:r?l.jsxs(l.Fragment,{children:[l.jsx(se,{"aria-label":t("gallery.showGenerations"),tooltip:t("gallery.showGenerations"),isChecked:c==="result",role:"radio",icon:l.jsx(_9,{}),onClick:()=>e(bl("result"))}),l.jsx(se,{"aria-label":t("gallery.showUploads"),tooltip:t("gallery.showUploads"),role:"radio",isChecked:c==="user",icon:l.jsx($9,{}),onClick:()=>e(bl("user"))})]}):l.jsxs(l.Fragment,{children:[l.jsx(Je,{size:"sm",isChecked:c==="result",onClick:()=>e(bl("result")),flexGrow:1,children:t("gallery.generations")}),l.jsx(Je,{size:"sm",isChecked:c==="user",onClick:()=>e(bl("user")),flexGrow:1,children:t("gallery.uploads")})]})}),l.jsxs(L,{gap:2,children:[l.jsx(or,{triggerComponent:l.jsx(se,{size:"sm","aria-label":t("gallery.gallerySettings"),icon:l.jsx(ep,{})}),children:l.jsxs(L,{direction:"column",gap:2,children:[l.jsx(ut,{value:h,onChange:w,min:32,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:()=>e(Zl(64))}),l.jsx(ft,{label:t("gallery.maintainAspectRatio"),isChecked:v==="contain",onChange:()=>e(mC(v==="contain"?"cover":"contain"))}),l.jsx(ft,{label:t("gallery.autoSwitchNewImages"),isChecked:x,onChange:M=>e(vC(M.target.checked))}),l.jsx(ft,{label:t("gallery.singleColumnLayout"),isChecked:C,onChange:M=>e(gC(M.target.checked))})]})}),l.jsx(se,{size:"sm","aria-label":t("gallery.pinGallery"),tooltip:`${t("gallery.pinGallery")} (Shift+G)`,onClick:k,icon:f?l.jsx(Db,{}):l.jsx(Ab,{})})]})]}),l.jsx(_b,{children:l.jsx(L,{direction:"column",gap:2,h:"full",children:s.length||S?l.jsxs(l.Fragment,{children:[l.jsx(ir,{gap:2,style:{gridTemplateColumns:m},children:s.map(M=>{const{uuid:P}=M,I=u===P;return l.jsx(l4,{image:M,isSelected:I},P)})}),l.jsx(Je,{onClick:j,isDisabled:!S,flexShrink:0,children:t(S?"gallery.loadMore":"gallery.allImagesLoaded")})]}):l.jsxs(L,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,padding:8,h:"100%",w:"100%",color:"base.500"},children:[l.jsx(tn,{as:dp,sx:{w:16,h:16}}),l.jsx(Ce,{textAlign:"center",children:t("gallery.noImagesInGallery")})]})})})]})};c4.displayName="ImageGalleryContent";const u1={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocessing:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},zN=me([bt,Pr,qr,Ot,Ss],(e,t,n,r,o)=>{const{shouldPinGallery:s,shouldShowGallery:c}=t,{galleryImageMinimumWidth:u}=n,{isLightboxOpen:f}=o;return{activeTabName:e,isStaging:r,shouldPinGallery:s,shouldShowGallery:c,galleryImageMinimumWidth:u,isResizable:e!=="unifiedCanvas",isLightboxOpen:f}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function RN(){const e=Y(),{shouldPinGallery:t,shouldShowGallery:n,galleryImageMinimumWidth:r,activeTabName:o,isStaging:s,isResizable:c,isLightboxOpen:u}=A(zN),f=()=>{e(u2()),e(cn())},h=()=>{e(xC()),t&&e(cn())},m=()=>{e(cf(!1)),t&&e(cn())};de("g",()=>{h()},[t]),de("left",()=>{e(L1())},{enabled:!s||o!=="unifiedCanvas"},[s,o]),de("right",()=>{e(B1())},{enabled:!s||o!=="unifiedCanvas"},[s,o]),de("shift+g",()=>{f()},[t]),de("esc",()=>{e(cf(!1))},{enabled:()=>!t,preventDefault:!0},[t]);const v=32;return de("shift+up",()=>{if(r<256){const x=ee.clamp(r+v,32,256);e(Zl(x))}},[r]),de("shift+down",()=>{if(r>32){const x=ee.clamp(r-v,32,256);e(Zl(x))}},[r]),l.jsx(Tb,{direction:"right",isResizable:c||!t,isOpen:n,onClose:m,isPinned:t&&!u,minWidth:t?u1[o].galleryMinWidth:200,maxWidth:t?u1[o].galleryMaxWidth:void 0,children:l.jsx(c4,{})})}var Hn=function(e,t){return Number(e.toFixed(t))},NN=function(e,t){return typeof e=="number"?e:t},Mt=function(e,t,n){n&&typeof n=="function"&&n(e,t)},FN=function(e){return-Math.cos(e*Math.PI)/2+.5},LN=function(e){return e},BN=function(e){return e*e},HN=function(e){return e*(2-e)},WN=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},VN=function(e){return e*e*e},UN=function(e){return--e*e*e+1},$N=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},GN=function(e){return e*e*e*e},qN=function(e){return 1- --e*e*e*e},YN=function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},KN=function(e){return e*e*e*e*e},XN=function(e){return 1+--e*e*e*e*e},QN=function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},u4={easeOut:FN,linear:LN,easeInQuad:BN,easeOutQuad:HN,easeInOutQuad:WN,easeInCubic:VN,easeOutCubic:UN,easeInOutCubic:$N,easeInQuart:GN,easeOutQuart:qN,easeInOutQuart:YN,easeInQuint:KN,easeOutQuint:XN,easeInOutQuint:QN},d4=function(e){typeof e=="number"&&cancelAnimationFrame(e)},br=function(e){e.mounted&&(d4(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function f4(e,t,n,r){if(e.mounted){var o=new Date().getTime(),s=1;br(e),e.animation=function(){if(!e.mounted)return d4(e.animation);var c=new Date().getTime()-o,u=c/n,f=u4[t],h=f(u);c>=n?(r(s),e.animation=null):e.animation&&(r(h),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function ZN(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function jo(e,t,n,r){var o=ZN(t);if(!(!e.mounted||!o)){var s=e.setTransformState,c=e.transformState,u=c.scale,f=c.positionX,h=c.positionY,m=t.scale-u,v=t.positionX-f,x=t.positionY-h;n===0?s(t.scale,t.positionX,t.positionY):f4(e,r,n,function(S){var C=u+m*S,j=f+v*S,w=h+x*S;s(C,j,w)})}}function JN(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,s=t.offsetWidth,c=t.offsetHeight,u=s*n,f=c*n,h=r-u,m=o-f;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:u,newDiffWidth:h,newContentHeight:f,newDiffHeight:m}}var eF=function(e,t,n,r,o,s,c){var u=e>t?n*(c?1:.5):0,f=r>o?s*(c?1:.5):0,h=e-t-u,m=u,v=r-o-f,x=f;return{minPositionX:h,maxPositionX:m,minPositionY:v,maxPositionY:x}},Np=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var s=JN(n,r,t),c=s.wrapperWidth,u=s.wrapperHeight,f=s.newContentWidth,h=s.newDiffWidth,m=s.newContentHeight,v=s.newDiffHeight,x=eF(c,f,h,u,m,v,Boolean(o));return x},Xf=function(e,t,n,r){return r?e<t?Hn(t,2):e>n?Hn(n,2):Hn(e,2):Hn(e,2)},ea=function(e,t){var n=Np(e,t);return e.bounds=n,n};function Gc(e,t,n,r,o,s,c){var u=n.minPositionX,f=n.minPositionY,h=n.maxPositionX,m=n.maxPositionY,v=0,x=0;c&&(v=o,x=s);var S=Xf(e,u-v,h+v,r),C=Xf(t,f-x,m+x,r);return{x:S,y:C}}function qc(e,t,n,r,o,s){var c=e.transformState,u=c.scale,f=c.positionX,h=c.positionY,m=r-u;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:f,y:h};var v=f-t*m,x=h-n*m,S=Gc(v,x,o,s,0,0,null);return S}function Cs(e,t,n,r,o){var s=o?r:0,c=t-s;return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=c?c:e}var d1=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,s=t.target,c=o==null?void 0:o.contains(s),u=r&&s&&c;if(!u)return!1;var f=Yc(s,n);return!f},f1=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,o=r.panning.disabled,s=t&&n&&!o;return!!s},tF=function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var s=t.clientX,c=t.clientY;e.startCoords={x:s-r,y:c-o}},nF=function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,s=r.positionY;e.isPanning=!0;var c=n.length===1;if(c){var u=n[0].clientX,f=n[0].clientY;e.startCoords={x:u-o,y:f-s}}};function rF(e){var t=e.transformState,n=t.positionX,r=t.positionY,o=t.scale,s=e.setup,c=s.disabled,u=s.limitToBounds,f=s.centerZoomedOut,h=e.wrapperComponent;if(!(c||!h||!e.bounds)){var m=e.bounds,v=m.maxPositionX,x=m.minPositionX,S=m.maxPositionY,C=m.minPositionY,j=n>v||n<x,w=r>S||r<C,k=n>v?h.offsetWidth:e.setup.minPositionX||0,M=r>S?h.offsetHeight:e.setup.minPositionY||0,P=qc(e,k,M,o,e.bounds,u||f),I=P.x,T=P.y;return{scale:o,positionX:j?I:n,positionY:w?T:r}}}function oF(e,t,n,r,o){var s=e.setup.limitToBounds,c=e.wrapperComponent,u=e.bounds,f=e.transformState,h=f.scale,m=f.positionX,v=f.positionY;if(!(c===null||u===null||t===m&&n===v)){var x=Gc(t,n,u,s,r,o,c),S=x.x,C=x.y;e.setTransformState(h,S,C)}}var iF=function(e,t,n){var r=e.startCoords,o=e.transformState,s=e.setup.panning,c=s.lockAxisX,u=s.lockAxisY,f=o.positionX,h=o.positionY;if(!r)return{x:f,y:h};var m=t-r.x,v=n-r.y,x=c?f:m,S=u?h:v;return{x,y:S}},gc=function(e,t){var n=e.setup,r=e.transformState,o=r.scale,s=n.minScale,c=n.disablePadding;return t>0&&o>=s&&!c?t:0},aF=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,s=e.transformState.scale,c=o.disabled,u=!c||s>1||!r||t;return!!u},sF=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,s=o.disabled,c=o.velocityAnimation,u=e.transformState.scale,f=c.disabled,h=!f||u>1||!s||t;return!(!h||!n||!r)};function lF(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,s=n.sensitivity;return r?o*t*s:o}function h1(e,t,n,r,o,s,c,u,f,h){if(o){if(t>c&&n>c){var m=c+(e-c)*h;return m>f?f:m<c?c:m}if(t<s&&n<s){var m=s+(e-s)*h;return m<u?u:m>s?s:m}}return r?t:Xf(e,s,c,o)}function cF(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function uF(e,t){var n=aF(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,s=e.setup,c=e.wrapperComponent,u=s.velocityAnimation.equalToMove,f=Date.now();if(r&&o&&c){var h=cF(c,u),m=t.x-r.x,v=t.y-r.y,x=m/h,S=v/h,C=f-o,j=m*m+v*v,w=Math.sqrt(j)/C;e.velocity={velocityX:x,velocityY:S,total:w}}e.lastMousePosition=t,e.velocityTime=f}}function dF(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,s=sF(e);if(!(!s||!t||!n||!o)){var c=t.velocityX,u=t.velocityY,f=t.total,h=n.maxPositionX,m=n.minPositionX,v=n.maxPositionY,x=n.minPositionY,S=r.limitToBounds,C=r.alignmentAnimation,j=r.zoomAnimation,w=r.panning,k=w.lockAxisY,M=w.lockAxisX,P=j.animationType,I=C.sizeX,T=C.sizeY,_=C.velocityAlignmentTime,D=_,z=lF(e,f),W=Math.max(z,D),F=gc(e,I),B=gc(e,T),Q=F*o.offsetWidth/100,U=B*o.offsetHeight/100,X=h+Q,te=m-Q,re=v+U,$=x-U,Z=e.transformState,oe=new Date().getTime();f4(e,P,W,function(le){var ze=e.transformState,Re=ze.scale,Ie=ze.positionX,pe=ze.positionY,ce=new Date().getTime()-oe,Ne=ce/D,Ve=u4[C.animationType],Ue=1-Ve(Math.min(1,Ne)),$e=1-le,Qe=Ie+c*$e,ve=pe+u*$e,Te=h1(Qe,Z.positionX,Ie,M,S,m,h,te,X,Ue),Ge=h1(ve,Z.positionY,pe,k,S,x,v,$,re,Ue);(Ie!==Qe||pe!==ve)&&e.setTransformState(Re,Te,Ge)})}}function p1(e,t){var n=e.transformState.scale;br(e),ea(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?nF(e,t):tF(e,t)}function h4(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,s=o.disabled,c=o.sizeX,u=o.sizeY,f=o.animationTime,h=o.animationType,m=s||t<r||!c&&!u;if(!m){var v=rF(e);v&&jo(e,v,f,h)}}function m1(e,t,n){var r=e.startCoords,o=e.setup,s=o.alignmentAnimation,c=s.sizeX,u=s.sizeY;if(r){var f=iF(e,t,n),h=f.x,m=f.y,v=gc(e,c),x=gc(e,u);uF(e,{x:h,y:m}),oF(e,h,m,v,x)}}function fF(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var s=r==null?void 0:r.getBoundingClientRect(),c=o==null?void 0:o.getBoundingClientRect(),u=(s==null?void 0:s.width)||0,f=(s==null?void 0:s.height)||0,h=(c==null?void 0:c.width)||0,m=(c==null?void 0:c.height)||0,v=u<h||f<m,x=!t&&n&&(n==null?void 0:n.total)>.1&&v;x?dF(e):h4(e)}}function Fp(e,t,n,r){var o=e.setup,s=o.minScale,c=o.maxScale,u=o.limitToBounds,f=Cs(Hn(t,2),s,c,0,!1),h=ea(e,f),m=qc(e,n,r,f,h,u),v=m.x,x=m.y;return{scale:f,positionX:v,positionY:x}}function p4(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,c=s.minScale,u=s.limitToBounds,f=s.zoomAnimation,h=f.disabled,m=f.animationTime,v=f.animationType,x=h||r>=c;if((r>=1||u)&&h4(e),!(x||!o||!e.mounted)){var S=t||o.offsetWidth/2,C=n||o.offsetHeight/2,j=Fp(e,c,S,C);j&&jo(e,j,m,v)}}var fo=function(){return fo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},fo.apply(this,arguments)};function v1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Rl={previousScale:1,scale:1,positionX:0,positionY:0},Oa={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,disablePadding:!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}},m4=function(e){var t,n,r,o;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:Rl.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:Rl.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:Rl.positionX,positionY:(o=e.initialPositionY)!==null&&o!==void 0?o:Rl.positionY}},g1=function(e){var t=fo({},Oa);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",o=typeof Oa[n]<"u";if(o&&r){var s=Object.prototype.toString.call(Oa[n]),c=s==="[object Object]",u=s==="[object Array]";c?t[n]=fo(fo({},Oa[n]),e[n]):u?t[n]=v1(v1([],Oa[n],!0),e[n],!0):t[n]=e[n]}}),t},v4=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,c=s.maxScale,u=s.minScale,f=s.zoomAnimation,h=f.size;if(!o)throw new Error("Wrapper is not mounted");var m=r*Math.exp(t*n),v=Cs(Hn(m,3),u,c,h,!1);return v};function g4(e,t,n,r,o){var s=e.wrapperComponent,c=e.transformState,u=c.scale,f=c.positionX,h=c.positionY;if(!s)return console.error("No WrapperComponent found");var m=s.offsetWidth,v=s.offsetHeight,x=(m/2-f)/u,S=(v/2-h)/u,C=v4(e,t,n),j=Fp(e,C,x,S);if(!j)return console.error("Error during zoom event. New transformation state was not calculated.");jo(e,j,r,o)}function y4(e,t,n,r){var o=e.setup,s=e.wrapperComponent,c=o.limitToBounds,u=m4(e.props),f=e.transformState,h=f.scale,m=f.positionX,v=f.positionY;if(s){var x=Np(e,u.scale),S=Gc(u.positionX,u.positionY,x,c,0,0,s),C={scale:u.scale,positionX:S.x,positionY:S.y};h===u.scale&&m===u.positionX&&v===u.positionY||(r==null||r(),jo(e,C,t,n))}}function hF(e,t,n,r){var o=e.getBoundingClientRect(),s=t.getBoundingClientRect(),c=n.getBoundingClientRect(),u=s.x*r.scale,f=s.y*r.scale;return{x:(o.x-c.x+u)/r.scale,y:(o.y-c.y+f)/r.scale}}function pF(e,t,n){var r=e.wrapperComponent,o=e.contentComponent,s=e.transformState,c=e.setup,u=c.limitToBounds,f=c.minScale,h=c.maxScale;if(!r||!o)return s;var m=r.getBoundingClientRect(),v=t.getBoundingClientRect(),x=hF(t,r,o,s),S=x.x,C=x.y,j=v.width/s.scale,w=v.height/s.scale,k=r.offsetWidth/j,M=r.offsetHeight/w,P=Cs(n||Math.min(k,M),f,h,0,!1),I=(m.width-j*P)/2,T=(m.height-w*P)/2,_=(m.left-S)*P+I,D=(m.top-C)*P+T,z=Np(e,P),W=Gc(_,D,z,u,0,0,r),F=W.x,B=W.y;return{positionX:F,positionY:B,scale:P}}var mF=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),g4(e,1,t,n,r)}},vF=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),g4(e,-1,t,n,r)}},gF=function(e){return function(t,n,r,o,s){o===void 0&&(o=300),s===void 0&&(s="easeOut");var c=e.transformState,u=c.positionX,f=c.positionY,h=c.scale,m=e.wrapperComponent,v=e.contentComponent,x=e.setup.disabled;if(!(x||!m||!v)){var S={positionX:Number.isNaN(t)?u:t,positionY:Number.isNaN(n)?f:n,scale:Number.isNaN(r)?h:r};jo(e,S,o,s)}}},yF=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),y4(e,t,n)}},xF=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var o=e.transformState,s=e.wrapperComponent,c=e.contentComponent;if(s&&c){var u=x4(t||o.scale,s,c);jo(e,u,n,r)}}},bF=function(e){return function(t,n,r,o){r===void 0&&(r=600),o===void 0&&(o="easeOut"),br(e);var s=e.wrapperComponent,c=typeof t=="string"?document.getElementById(t):t;if(s&&c&&s.contains(c)){var u=pF(e,c,n);jo(e,u,r,o)}}},dt=function(e){return{instance:e,state:e.transformState,zoomIn:mF(e),zoomOut:vF(e),setTransform:gF(e),resetTransform:yF(e),centerView:xF(e),zoomToElement:bF(e)}},Yd=!1;function Kd(){try{var e={get passive(){return Yd=!0,!1}};return e}catch{return Yd=!1,Yd}}var Yc=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(s){return s.toUpperCase()===n});if(r)return!0;var o=t.find(function(s){return e.classList.contains(s)});return!!o},Qf=function(e){e&&clearTimeout(e)},SF=function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")},x4=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e,s=(t.offsetWidth-r)/2,c=(t.offsetHeight-o)/2;return{scale:e,positionX:s,positionY:c}};function CF(e){return function(t){e.forEach(function(n){typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var wF=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,s=n.touchPadDisabled,c=n.excluded,u=e.isInitialized,f=e.isPanning,h=t.target,m=u&&!f&&!r&&h;if(!m||o&&!t.ctrlKey||s&&t.ctrlKey)return!1;var v=Yc(h,c);return!v},jF=function(e){return e?e.deltaY<0?1:-1:0};function kF(e,t){var n=jF(e),r=NN(t,n);return r}function b4(e,t,n){var r=t.getBoundingClientRect(),o=0,s=0;if("clientX"in e)o=(e.clientX-r.left)/n,s=(e.clientY-r.top)/n;else{var c=e.touches[0];o=(c.clientX-r.left)/n,s=(c.clientY-r.top)/n}return(Number.isNaN(o)||Number.isNaN(s))&&console.error("No mouse or touch offset found"),{x:o,y:s}}var EF=function(e,t,n,r,o){var s=e.transformState.scale,c=e.wrapperComponent,u=e.setup,f=u.maxScale,h=u.minScale,m=u.zoomAnimation,v=u.disablePadding,x=m.size,S=m.disabled;if(!c)throw new Error("Wrapper is not mounted");var C=s+t*(s-s*n)*n;if(o)return C;var j=r?!1:!S,w=Cs(Hn(C,3),h,f,x,j&&!v);return w},PF=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,s=o.maxScale,c=o.minScale;return n?r<s||r>c||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaY<t.deltaY||n.deltaY<0&&n.deltaY>t.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},IF=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,s=e.isInitialized,c=t.target,u=s&&!r&&c;if(!u)return!1;var f=Yc(c,o);return!f},MF=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,o=n&&!t&&r;return!!o},TF=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,s=Hn(o[0].clientX-r.left,5),c=Hn(o[0].clientY-r.top,5),u=Hn(o[1].clientX-r.left,5),f=Hn(o[1].clientY-r.top,5);return{x:(s+u)/2/t,y:(c+f)/2/t}},S4=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))},_F=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,s=o.maxScale,c=o.minScale,u=o.zoomAnimation,f=o.disablePadding,h=u.size,m=u.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var v=t/r,x=v*n;return Cs(Hn(x,2),c,s,h,!m&&!f)},DF=160,AF=100,OF=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(br(e),Mt(dt(e),t,r),Mt(dt(e),t,o))},zF=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,s=e.contentComponent,c=e.setup,u=e.transformState,f=u.scale,h=c.limitToBounds,m=c.centerZoomedOut,v=c.zoomAnimation,x=c.wheel,S=c.disablePadding,C=v.size,j=v.disabled,w=x.step;if(!s)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var k=kF(t,null),M=EF(e,k,w,!t.ctrlKey);if(f!==M){var P=ea(e,M),I=b4(t,s,f),T=j||C===0||m||S,_=h&&T,D=qc(e,I.x,I.y,M,P,_),z=D.x,W=D.y;e.previousWheelEvent=t,e.setTransformState(M,z,W),Mt(dt(e),t,r),Mt(dt(e),t,o)}},RF=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;Qf(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(p4(e,t.x,t.y),e.wheelAnimationTimer=null)},AF);var s=PF(e,t);s&&(Qf(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Mt(dt(e),t,r),Mt(dt(e),t,o))},DF))},NF=function(e,t){var n=S4(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,br(e)},FF=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,s=e.setup,c=s.limitToBounds,u=s.centerZoomedOut,f=s.zoomAnimation,h=f.disabled,m=f.size;if(!(r===null||!n)){var v=TF(t,o,n);if(!(!Number.isFinite(v.x)||!Number.isFinite(v.y))){var x=S4(t),S=_F(e,x);if(S!==o){var C=ea(e,S),j=h||m===0||u,w=c&&j,k=qc(e,v.x,v.y,S,C,w),M=k.x,P=k.y;e.pinchMidpoint=v,e.lastDistance=x,e.setTransformState(S,M,P)}}}},LF=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,p4(e,t==null?void 0:t.x,t==null?void 0:t.y)},C4=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;Qf(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,Mt(dt(e),t,n)},r)},BF=function(e,t){var n=e.props,r=n.onZoomStart,o=n.onZoom,s=e.setup.doubleClick,c=s.animationTime,u=s.animationType;Mt(dt(e),t,r),y4(e,c,u,function(){return Mt(dt(e),t,o)}),C4(e,t)};function HF(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,o=e.transformState,s=e.contentComponent,c=o.scale,u=e.props,f=u.onZoomStart,h=u.onZoom,m=n.doubleClick,v=m.disabled,x=m.mode,S=m.step,C=m.animationTime,j=m.animationType;if(!v&&!r){if(x==="reset")return BF(e,t);if(!s)return console.error("No ContentComponent found");var w=x==="zoomOut"?-1:1,k=v4(e,w,S);if(c!==k){Mt(dt(e),t,f);var M=b4(t,s,c),P=Fp(e,k,M.x,M.y);if(!P)return console.error("Error during zoom event. New transformation state was not calculated.");Mt(dt(e),t,h),jo(e,P,C,j),C4(e,t)}}}var WF=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,s=r.doubleClick,c=s.disabled,u=s.excluded,f=t.target,h=o==null?void 0:o.contains(f),m=n&&f&&h&&!c;if(!m)return!1;var v=Yc(f,u);return!v},VF=function(){function e(t){var n=this;this.mounted=!0,this.onChangeCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){n.initializeWindowEvents()},this.unmount=function(){n.cleanupWindowEvents()},this.update=function(r){ea(n,n.transformState.scale),n.setup=g1(r)},this.initializeWindowEvents=function(){var r,o=Kd(),s=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,c=s==null?void 0:s.defaultView;c==null||c.addEventListener("mousedown",n.onPanningStart,o),c==null||c.addEventListener("mousemove",n.onPanning,o),c==null||c.addEventListener("mouseup",n.onPanningStop,o),s==null||s.addEventListener("mouseleave",n.clearPanning,o),c==null||c.addEventListener("keyup",n.setKeyUnPressed,o),c==null||c.addEventListener("keydown",n.setKeyPressed,o)},this.cleanupWindowEvents=function(){var r,o,s=Kd(),c=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,u=c==null?void 0:c.defaultView;u==null||u.removeEventListener("mousedown",n.onPanningStart,s),u==null||u.removeEventListener("mousemove",n.onPanning,s),u==null||u.removeEventListener("mouseup",n.onPanningStop,s),c==null||c.removeEventListener("mouseleave",n.clearPanning,s),u==null||u.removeEventListener("keyup",n.setKeyUnPressed,s),u==null||u.removeEventListener("keydown",n.setKeyPressed,s),document.removeEventListener("mouseleave",n.clearPanning,s),br(n),(o=n.observer)===null||o===void 0||o.disconnect()},this.handleInitializeWrapperEvents=function(r){var o=Kd();r.addEventListener("wheel",n.onWheelZoom,o),r.addEventListener("dblclick",n.onDoubleClick,o),r.addEventListener("touchstart",n.onTouchPanningStart,o),r.addEventListener("touchmove",n.onTouchPanning,o),r.addEventListener("touchend",n.onTouchPanningStop,o)},this.handleInitialize=function(r){var o=n.setup.centerOnInit;n.applyTransformation(),o&&(n.setCenter(),n.observer=new ResizeObserver(function(){var s;n.setCenter(),(s=n.observer)===null||s===void 0||s.disconnect()}),n.observer.observe(r))},this.onWheelZoom=function(r){var o=n.setup.disabled;if(!o){var s=wF(n,r);if(s){var c=n.isPressingKeys(n.setup.wheel.activationKeys);c&&(OF(n,r),zF(n,r),RF(n,r))}}},this.onPanningStart=function(r){var o=n.setup.disabled,s=n.props.onPanningStart;if(!o){var c=d1(n,r);if(c){var u=n.isPressingKeys(n.setup.panning.activationKeys);u&&(r.preventDefault(),r.stopPropagation(),br(n),p1(n,r),Mt(dt(n),r,s))}}},this.onPanning=function(r){var o=n.setup.disabled,s=n.props.onPanning;if(!o){var c=f1(n);if(c){var u=n.isPressingKeys(n.setup.panning.activationKeys);u&&(r.preventDefault(),r.stopPropagation(),m1(n,r.clientX,r.clientY),Mt(dt(n),r,s))}}},this.onPanningStop=function(r){var o=n.props.onPanningStop;n.isPanning&&(fF(n),Mt(dt(n),r,o))},this.onPinchStart=function(r){var o=n.setup.disabled,s=n.props,c=s.onPinchingStart,u=s.onZoomStart;if(!o){var f=IF(n,r);f&&(NF(n,r),br(n),Mt(dt(n),r,c),Mt(dt(n),r,u))}},this.onPinch=function(r){var o=n.setup.disabled,s=n.props,c=s.onPinching,u=s.onZoom;if(!o){var f=MF(n);f&&(r.preventDefault(),r.stopPropagation(),FF(n,r),Mt(dt(n),r,c),Mt(dt(n),r,u))}},this.onPinchStop=function(r){var o=n.props,s=o.onPinchingStop,c=o.onZoomStop;n.pinchStartScale&&(LF(n),Mt(dt(n),r,s),Mt(dt(n),r,c))},this.onTouchPanningStart=function(r){var o=n.setup.disabled,s=n.props.onPanningStart;if(!o){var c=d1(n,r);if(c){var u=n.lastTouch&&+new Date-n.lastTouch<200;if(u&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,br(n);var f=r.touches,h=f.length===1,m=f.length===2;h&&(br(n),p1(n,r),Mt(dt(n),r,s)),m&&n.onPinchStart(r)}}}},this.onTouchPanning=function(r){var o=n.setup.disabled,s=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(o)return;var c=f1(n);if(!c)return;r.preventDefault(),r.stopPropagation();var u=r.touches[0];m1(n,u.clientX,u.clientY),Mt(dt(n),r,s)}else r.touches.length>1&&n.onPinch(r)},this.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},this.onDoubleClick=function(r){var o=n.setup.disabled;if(!o){var s=WF(n,r);s&&HF(n,r)}},this.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},this.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},this.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},this.isPressingKeys=function(r){return r.length?Boolean(r.find(function(o){return n.pressedKeys[o]})):!0},this.setTransformState=function(r,o,s){var c=n.props.onTransformed;if(!Number.isNaN(r)&&!Number.isNaN(o)&&!Number.isNaN(s)){r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=o,n.transformState.positionY=s;var u=dt(n);n.onChangeCallbacks.forEach(function(f){return f(u)}),Mt(u,{scale:r,positionX:o,positionY:s},c),n.applyTransformation()}else console.error("Detected NaN set state values")},this.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=x4(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},this.handleTransformStyles=function(r,o,s){return n.props.customTransform?n.props.customTransform(r,o,s):SF(r,o,s)},this.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,o=r.scale,s=r.positionX,c=r.positionY,u=n.handleTransformStyles(s,c,o);n.contentComponent.style.transform=u}},this.getContext=function(){return dt(n)},this.onChange=function(r){return n.onChangeCallbacks.has(r)||n.onChangeCallbacks.add(r),function(){n.onChangeCallbacks.delete(r)}},this.init=function(r,o){n.cleanupWindowEvents(),n.wrapperComponent=r,n.contentComponent=o,ea(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(o),n.initializeWindowEvents(),n.isInitialized=!0,Mt(dt(n),void 0,n.props.onInit)},this.props=t,this.setup=g1(this.props),this.transformState=m4(this.props)}return e}(),Kc=Me.createContext(null),UF=function(e,t){return typeof e=="function"?e(t):e},$F=Me.forwardRef(function(e,t){var n=y.useState(0),r=n[1],o=e.children,s=y.useRef(new VF(e)).current,c=UF(e.children,dt(s)),u=y.useCallback(function(){typeof o=="function"&&r(function(f){return f+1})},[o]);return y.useImperativeHandle(t,function(){return dt(s)},[s]),y.useEffect(function(){s.update(e)},[s,e]),y.useEffect(function(){return s.onChange(u)},[s,e,u]),Me.createElement(Kc.Provider,{value:s},c)});function GF(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var qF=`.transform-component-module_wrapper__7HFJe {
|
||
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__uCDPE {
|
||
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__uCDPE img {
|
||
pointer-events: none;
|
||
}
|
||
`,y1={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};GF(qF);var YF=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,o=e.contentClass,s=o===void 0?"":o,c=e.wrapperStyle,u=e.contentStyle,f=e.wrapperProps,h=f===void 0?{}:f,m=e.contentProps,v=m===void 0?{}:m,x=y.useContext(Kc).init,S=y.useRef(null),C=y.useRef(null);return y.useEffect(function(){var j=S.current,w=C.current;j!==null&&w!==null&&x&&x(j,w)},[]),Me.createElement("div",fo({},h,{ref:S,className:"react-transform-wrapper ".concat(y1.wrapper," ").concat(r),style:c}),Me.createElement("div",fo({},v,{ref:C,className:"react-transform-component ".concat(y1.content," ").concat(s),style:u}),t))},w4=function(){var e=y.useContext(Kc),t=y.useState(dt(e||{})),n=t[0],r=t[1];if(!e)throw new Error("Transform context mus be placed inside TransformWrapper");return y.useEffect(function(){e.onChange(function(o){r(o)})},[e]),n};Me.forwardRef(function(e,t){var n=y.useRef(null),r=y.useContext(Kc);return y.useEffect(function(){return r.onChange(function(o){if(n.current){var s=0,c=0;n.current.style.transform=r.handleTransformStyles(s,c,1/o.state.scale)}})},[r]),Me.createElement("div",fo({},e,{ref:CF([n,t])}))});const KF=()=>{const[e,t]=y.useState(0),[n,r]=y.useState(1),[o,s]=y.useState(1);return{rotation:e,scaleX:n,scaleY:o,flipHorizontally:()=>{r(n*-1)},flipVertically:()=>{s(o*-1)},rotateCounterClockwise:()=>{t(e===-270?0:e-90)},rotateClockwise:()=>{t(e===270?0:e+90)},reset:()=>{t(0),r(1),s(1)}}},XF=({flipHorizontally:e,flipVertically:t,rotateCounterClockwise:n,rotateClockwise:r,reset:o})=>{const{zoomIn:s,zoomOut:c,resetTransform:u}=w4(),{t:f}=K();return l.jsxs(Qt,{isAttached:!0,orientation:"vertical",children:[l.jsx(se,{icon:l.jsx(yD,{}),"aria-label":f("accessibility.zoomIn"),tooltip:"Zoom In",onClick:()=>s(),fontSize:20}),l.jsx(se,{icon:l.jsx(xD,{}),"aria-label":f("accessibility.zoomOut"),tooltip:"Zoom Out",onClick:()=>c(),fontSize:20}),l.jsx(se,{icon:l.jsx(vD,{}),"aria-label":f("accessibility.rotateCounterClockwise"),tooltip:"Rotate Counter-Clockwise",onClick:n,fontSize:20}),l.jsx(se,{icon:l.jsx(gD,{}),"aria-label":f("accessibility.rotateClockwise"),tooltip:"Rotate Clockwise",onClick:r,fontSize:20}),l.jsx(se,{icon:l.jsx(H0,{}),"aria-label":f("accessibility.flipHorizontally"),tooltip:"Flip Horizontally",onClick:e,fontSize:20}),l.jsx(se,{icon:l.jsx(H0,{style:{transform:"rotate(90deg)"}}),"aria-label":f("accessibility.flipVertically"),tooltip:"Flip Vertically",onClick:t,fontSize:20}),l.jsx(se,{icon:l.jsx(Pb,{}),"aria-label":f("accessibility.reset"),tooltip:"Reset",onClick:()=>{u(),o()},fontSize:20})]})};function QF({image:e,alt:t,ref:n,styleClass:r,rotation:o,scaleX:s,scaleY:c}){const{centerView:u}=w4();return l.jsx(YF,{wrapperStyle:{width:"100%",height:"100%"},children:l.jsx("img",{style:{transform:`rotate(${o}deg) scaleX(${s}) scaleY(${c})`,width:"100%"},src:e.url,alt:t,ref:n,className:r||"",onLoad:()=>u(1,0,"easeOut")})})}const ZF=me([qr,Pr],(e,t)=>{const{currentImage:n}=e,{shouldShowImageDetails:r}=t;return{viewerImageToDisplay:n,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function JF(){const e=Y(),t=A(x=>x.lightbox.isLightboxOpen),{rotation:n,scaleX:r,scaleY:o,flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:h}=KF(),{viewerImageToDisplay:m,shouldShowImageDetails:v}=A(ZF);return de("Esc",()=>{t&&e(Uo(!1))},[t]),l.jsx(xo,{children:t&&l.jsx(ar.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},style:{display:"flex",width:"100vw",height:`calc(100vh - ${dc*4}px)`,position:"fixed",top:`${dc*4}px`,background:"var(--invokeai-colors-base-900)",zIndex:99},children:l.jsxs($F,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:[l.jsxs(L,{sx:{flexDir:"column",position:"absolute",insetInlineStart:4,gap:4,zIndex:3,top:4},children:[l.jsx(se,{icon:l.jsx(mD,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Uo(!1))},fontSize:20}),l.jsx(XF,{flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:h})]}),l.jsx(L,{sx:{position:"absolute",top:4,zIndex:3,insetInlineStart:"50%",transform:"translate(-50%, 0)"},children:l.jsx(Ob,{})}),m&&l.jsxs(l.Fragment,{children:[l.jsx(QF,{rotation:n,scaleX:r,scaleY:o,image:m,styleClass:"lightbox-image"}),v&&l.jsx(yp,{image:m}),!v&&l.jsx(Ye,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"100vw",h:"100vh",px:16,pointerEvents:"none"},children:l.jsx(zb,{})})]})]})},"lightbox")})}EN();const oL=e=>{PN();const t=A(r=>r.ui.currentTheme),{setColorMode:n}=bC();return y.useEffect(()=>{n(["light"].includes(t)?"light":"dark")},[n,t]),l.jsxs(ir,{w:"100vw",h:"100vh",children:[l.jsx(JF,{}),l.jsxs(a9,{children:[l.jsx(rP,{}),l.jsxs(ir,{gap:4,p:4,gridAutoRows:"min-content auto",w:Z9,h:J9,children:[e.children||l.jsx(Mb,{}),l.jsxs(L,{gap:4,w:"full",h:"full",children:[l.jsx(kN,{}),l.jsx(RN,{})]})]}),l.jsx(Ye,{children:l.jsx(X9,{})})]}),l.jsx($a,{children:l.jsx(_N,{})}),l.jsx($a,{children:l.jsx(MN,{})})]})};export{oL as default};
|