mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
189 lines
591 KiB
JavaScript
189 lines
591 KiB
JavaScript
import{r as g,f as ue,j as l,u as BS,c as ne,a as ze,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 HS,m as WS,R as _e,n as Pv,p as VS,q as Qd,s as ta,t as b1,v as S1,x as US,y as $S,z as ee,A as C1,B as w1,C as bc,D as rs,F as L,E as K,G as GS,H as dd,T as Ce,I as j1,J as qS,K as os,L as Iv,M as YS,N as KS,O as XS,P as Di,Q as k1,U as Mv,V as QS,W as E1,X as ZS,Y as JS,Z as e3,$ as P1,a0 as t3,a1 as n3,a2 as r3,a3 as o3,a4 as i3,a5 as a3,a6 as s3,a7 as I1,a8 as l3,a9 as c3,aa as ql,ab as u3,ac as d3,ad as Nl,ae as Yl,af as Zd,ag as Jd,ah as ef,ai as f3,aj as M1,ak as h3,al as T1,am as p3,an as _1,ao as D1,ap as Uo,aq as kn,ar as m3,as as A1,at as is,au as v3,av as g3,aw as O1,ax as tf,ay as nf,az as z1,aA as rf,aB as of,aC as Tv,aD as R1,aE as N1,aF as F1,aG as Fl,aH as Ll,aI as y3,aJ as af,aK as L1,aL as B1,aM as H1,aN as x3,aO as b3,aP as _v,aQ as Dv,aR as S3,aS as C3,aT as w3,aU as W1,aV as V1,aW as j3,aX as k3,aY as U1,aZ as Av,a_ as E3,a$ as Ov,b0 as P3,b1 as I3,b2 as $1,b3 as M3,b4 as T3,b5 as _3,b6 as fd,b7 as zv,b8 as G1,b9 as sf,ba as D3,bb as Rv,bc as Bl,bd as A3,be as O3,bf as Ua,bg as Kl,bh as q1,bi as Xl,bj as z3,bk as R3,bl as Sr,bm as Y1,bn as Zf,bo as as,bp as N3,bq as F3,br as L3,bs as jr,bt as K1,bu as B3,bv as H3,bw as X1,bx as W3,by as V3,bz as U3,bA as $3,bB as G3,bC as q3,bD as Y3,bE as K3,bF as X3,bG as Nv,bH as Q3,bI as Z3,bJ as J3,bK as eC,bL as tC,bM as nC,bN as hd,bO as za,bP as ml,bQ as Fv,bR as pd,bS as md,bT as vl,bU as Lv,bV as lf,bW as rC,bX as oC,bY as iC,bZ as Sc,b_ as aC,b$ as sC,c0 as lC,c1 as cC,c2 as gl,c3 as vd,c4 as yl,c5 as Ma,c6 as uC,c7 as dC,c8 as Q1,c9 as Ql,ca as Jf,cb as Z1,cc as J1,cd as e2,ce as fC,cf as t2,cg as n2,ch as r2,ci as o2,cj as i2,ck as Li,cl as Bi,cm as a2,cn as s2,co as l2,cp as c2,cq as u2,cr as hC,cs as pC,ct as Bv,cu as xl,cv as mC,cw as Hv,cx as Wv,cy as Vv,cz as Uv,cA as vC,cB as gC,cC as cf,cD as yC,cE as $v,cF as bl,cG as Zl,cH as xC,cI as bC,cJ as SC,cK as CC,cL as d2,cM as wC,cN as jC}from"./index-e53e8108.js";import{I as tn,u as kC,c as EC,a as kt,b as Wt,A as xo,m as ar,d as Hi,e as ti,P as $a,f as PC,C as IC,g as Y,h as A}from"./storeHooks-5cde7d31.js";function MC(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 TC(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 _C(e,t){var n=[];function r(u){var f=n.findIndex(function(h){return t(u,h.key)});if(f>-1){var p=n[f];return f>0&&(n.splice(f,1),n.unshift(p)),p.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 DC=function(t,n){return t===n};function AC(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 OC(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,o=r===void 0?DC:r,s=n.maxSize,c=s===void 0?1:s,u=n.resultEqualityCheck,f=AC(o),p=c===1?TC(f):_C(c,f);function h(){var y=p.get(arguments);if(y===Jl){if(y=e.apply(null,arguments),u){var x=p.getEntries(),S=x.find(function(j){return u(j.value,y)});S&&(y=S.value)}p.put(arguments,y)}return y}return h.clearCache=function(){return p.clear()},h}function zC(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 RC(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 p=0,h,y={memoizeOptions:void 0},x=u.pop();if(typeof x=="object"&&(y=x,x=u.pop()),typeof x!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof x+"]");var S=y,j=S.memoizeOptions,C=j===void 0?n:j,w=Array.isArray(C)?C:[C],k=zC(u),I=e.apply(void 0,[function(){return p++,x.apply(null,arguments)}].concat(w)),P=e(function(){for(var T=[],D=k.length,_=0;_<D;_++)T.push(k[_].apply(null,arguments));return h=I.apply(null,T),h});return Object.assign(P,{resultFunc:x,memoizedResultFunc:I,dependencies:k,lastResult:function(){return h},recomputations:function(){return p},resetRecomputations:function(){return p=0}}),P};return o}var pe=RC(OC);function NC(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function f2(e){var t;return NC(e)&&(t=e.ownerDocument)!=null?t:document}function FC(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var LC=FC();const h2=1/60*1e3,BC=typeof performance<"u"?()=>performance.now():()=>Date.now(),p2=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(BC()),h2);function HC(e){let t=[],n=[],r=0,o=!1,s=!1;const c=new WeakSet,u={schedule:(f,p=!1,h=!1)=>{const y=h&&o,x=y?t:n;return p&&c.add(f),x.indexOf(f)===-1&&(x.push(f),y&&o&&(r=t.length)),f},cancel:f=>{const p=n.indexOf(f);p!==-1&&n.splice(p,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 p=0;p<r;p++){const h=t[p];h(f),c.has(h)&&(u.schedule(h),e())}o=!1,s&&(s=!1,u.process(f))}};return u}const WC=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]=HC(()=>Ga=!0),e),{}),VC=ss.reduce((e,t)=>{const n=Cc[t];return e[t]=(r,o=!1,s=!1)=>(Ga||GC(),n.schedule(r,o,s)),e},{}),UC=ss.reduce((e,t)=>(e[t]=Cc[t].cancel,e),{});ss.reduce((e,t)=>(e[t]=()=>Cc[t].process(Wi),e),{});const $C=e=>Cc[e].process(Wi),m2=e=>{Ga=!1,Wi.delta=uf?h2:Math.max(Math.min(e-Wi.timestamp,WC),1),Wi.timestamp=e,df=!0,ss.forEach($C),df=!1,Ga&&(uf=!1,p2(m2))},GC=()=>{Ga=!0,uf=!0,df||p2(m2)},Gv=()=>Wi;function eh(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=g.Children.toArray(e.path),c=ue((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}=BS(),n=kC();return g.useMemo(()=>EC(t.direction,{...n,...e}),[e,t.direction,n])}var qC=Object.defineProperty,YC=(e,t,n)=>t in e?qC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zt=(e,t,n)=>(YC(e,typeof t!="symbol"?t+"":t,n),n);function qv(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 KC=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function Yv(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function Kv(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var ff=typeof window<"u"?g.useLayoutEffect:g.useEffect,ec=e=>e,XC=class{constructor(){zt(this,"descendants",new Map),zt(this,"register",e=>{if(e!=null)return KC(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),zt(this,"unregister",e=>{this.descendants.delete(e);const t=qv(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=Yv(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=Yv(r,this.enabledCount(),t);return this.enabledItem(o)}),zt(this,"prev",(e,t=!0)=>{const n=Kv(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=Kv(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=qv(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 ZC(...e){return g.useMemo(()=>ct(...e),e)}function JC(){const e=g.useRef(new XC);return ff(()=>()=>e.current.destroy()),e.current}var[ew,v2]=kt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function tw(e){const t=v2(),[n,r]=g.useState(-1),o=g.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(ew),()=>ec(v2()),()=>JC(),o=>tw(o)]}var[nw,wc]=kt({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[rw,nh]=kt({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[ow,oL,iw,aw]=th(),Ai=ue(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:ze("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]=g.useState(n),p=t!==void 0,h=p?t:u,y=Wt(x=>{const j=typeof x=="function"?x(h):x;c(h,j)&&(p||f(j),s(j))},[p,s,h,c]);return[h,y]}function sw(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...c}=e;uw(e),dw(e);const u=iw(),[f,p]=g.useState(-1);g.useEffect(()=>()=>{p(-1)},[]);const[h,y]=rh({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:h,setIndex:y,htmlProps:c,getAccordionItemProps:S=>{let j=!1;return S!==null&&(j=Array.isArray(h)?h.includes(S):h===S),{isOpen:j,onChange:w=>{if(S!==null)if(o&&Array.isArray(h)){const k=w?h.concat(S):h.filter(I=>I!==S);y(k)}else w?y(S):s&&y(-1)}}},focusedIndex:f,setFocusedIndex:p,descendants:u}}var[lw,oh]=kt({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function cw(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:c}=oh(),u=g.useRef(null),f=g.useId(),p=r??f,h=`accordion-button-${p}`,y=`accordion-panel-${p}`;fw(e);const{register:x,index:S,descendants:j}=aw({disabled:t&&!n}),{isOpen:C,onChange:w}=s(S===-1?null:S);hw({isOpen:C,isDisabled:t});const k=()=>{w==null||w(!0)},I=()=>{w==null||w(!1)},P=g.useCallback(()=>{w==null||w(!C),c(S)},[S,c,C,w]),M=g.useCallback(R=>{const F={ArrowDown:()=>{const B=j.nextEnabled(S);B==null||B.node.focus()},ArrowUp:()=>{const B=j.prevEnabled(S);B==null||B.node.focus()},Home:()=>{const B=j.firstEnabled();B==null||B.node.focus()},End:()=>{const B=j.lastEnabled();B==null||B.node.focus()}}[R.key];F&&(R.preventDefault(),F(R))},[j,S]),T=g.useCallback(()=>{c(S)},[c,S]),D=g.useCallback(function(V={},F=null){return{...V,type:"button",ref:ct(x,u,F),id:h,disabled:!!t,"aria-expanded":!!C,"aria-controls":y,onClick:Ee(V.onClick,P),onFocus:Ee(V.onFocus,T),onKeyDown:Ee(V.onKeyDown,M)}},[h,t,C,P,T,M,y,x]),_=g.useCallback(function(V={},F=null){return{...V,ref:F,role:"region",id:y,"aria-labelledby":h,hidden:!C}},[h,C,y]);return{isOpen:C,isDisabled:t,isFocusable:n,onOpen:k,onClose:I,getButtonProps:D,getPanelProps:_,htmlProps:o}}function uw(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 dw(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 fw(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 hw(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=ze("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=ue(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...c}=cw(t),f={...wc().container,overflowAnchor:"none"},p=g.useMemo(()=>c,[c]);return l.jsx(rw,{value:p,children:l.jsx(ne.div,{ref:n,...s,className:ze("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})},pw=e=>e!=null&&parseInt(e.toString(),10)>0,Xv={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}}},mw={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:pw(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:rr.exit(Xv.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(Xv.enter,o)}}},g2=g.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:c="auto",style:u,className:f,transition:p,transitionEnd:h,...y}=e,[x,S]=g.useState(!1);g.useEffect(()=>{const I=setTimeout(()=>{S(!0)});return()=>clearTimeout(I)},[]),ns({condition:Boolean(s>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const j=parseFloat(s.toString())>0,C={startingHeight:s,endingHeight:c,animateOpacity:o,transition:x?p:{enter:{duration:0}},transitionEnd:{enter:h==null?void 0:h.enter,exit:r?h==null?void 0:h.exit:{...h==null?void 0:h.exit,display:j?"block":"none"}}},w=r?n:!0,k=n||r?"enter":"exit";return l.jsx(xo,{initial:!1,custom:C,children:w&&l.jsx(ar.div,{ref:t,...y,className:ze("chakra-collapse",f),style:{overflow:"hidden",display:"block",...u},custom:C,variants:mw,initial:r?"exit":!1,animate:k,exit:"exit"})})});g2.displayName="Collapse";var vw={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}}},y2={initial:"exit",animate:"enter",exit:"exit",variants:vw},gw=g.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:c,transitionEnd:u,delay:f,...p}=t,h=o||r?"enter":"exit",y=r?o&&r:!0,x={transition:c,transitionEnd:u,delay:f};return l.jsx(xo,{custom:x,children:y&&l.jsx(ar.div,{ref:n,className:ze("chakra-fade",s),custom:x,...y2,animate:h,...p})})});gw.displayName="Fade";var yw={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}}},x2={initial:"exit",animate:"enter",exit:"exit",variants:yw},xw=g.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:c=.95,className:u,transition:f,transitionEnd:p,delay:h,...y}=t,x=r?o&&r:!0,S=o||r?"enter":"exit",j={initialScale:c,reverse:s,transition:f,transitionEnd:p,delay:h};return l.jsx(xo,{custom:j,children:x&&l.jsx(ar.div,{ref:n,className:ze("chakra-offset-slide",u),...x2,animate:S,custom:j,...y})})});xw.displayName="ScaleFade";var bw={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:bw},Sw=g.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:c,offsetX:u=0,offsetY:f=8,transition:p,transitionEnd:h,delay:y,...x}=t,S=r?o&&r:!0,j=o||r?"enter":"exit",C={offsetX:u,offsetY:f,reverse:s,transition:p,transitionEnd:h,delay:y};return l.jsx(xo,{custom:C,children:S&&l.jsx(ar.div,{ref:n,className:ze("chakra-offset-slide",c),custom:C,...pf,animate:j,...x})})});Sw.displayName="SlideFade";var Qv={exit:{duration:.15,ease:Wo.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},Cw={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(Qv.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(Qv.enter,r),transitionEnd:t==null?void 0:t.enter}}},b2=g.forwardRef(function(t,n){const{direction:r="right",style:o,unmountOnExit:s,in:c,className:u,transition:f,transitionEnd:p,delay:h,motionProps:y,...x}=t,S=hf({direction:r}),j=Object.assign({position:"fixed"},S.position,o),C=s?c&&s:!0,w=c||s?"enter":"exit",k={transitionEnd:p,transition:f,direction:r,delay:h};return l.jsx(xo,{custom:k,children:C&&l.jsx(ar.div,{...x,ref:n,initial:"exit",className:ze("chakra-slide",u),animate:w,exit:"exit",custom:k,variants:Cw,style:j,...y})})});b2.displayName="Slide";var Ri=ue(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:c}=oh(),{getPanelProps:u,isOpen:f}=nh(),p=u(s,n),h=ze("chakra-accordion__panel",r),y=wc();c||delete p.hidden;const x=l.jsx(ne.div,{...p,__css:y.panel,className:h});return c?x:l.jsx(g2,{in:f,...o,children:x})});Ri.displayName="AccordionPanel";var ih=ue(function({children:t,reduceMotion:n,...r},o){const s=un("Accordion",r),c=At(r),{htmlProps:u,descendants:f,...p}=sw(c),h=g.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return l.jsx(ow,{value:f,children:l.jsx(lw,{value:h,children:l.jsx(nw,{value:s,children:l.jsx(ne.div,{ref:o,...u,className:ze("chakra-accordion",r.className),__css:s.root,children:t})})})})});ih.displayName="Accordion";var mf=ue(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 ww(e){const{loading:t,src:n,srcSet:r,onLoad:o,onError:s,crossOrigin:c,sizes:u,ignoreFallback:f}=e,[p,h]=g.useState("pending");g.useEffect(()=>{h(n?"loading":"pending")},[n]);const y=g.useRef(),x=g.useCallback(()=>{if(!n)return;S();const j=new Image;j.src=n,c&&(j.crossOrigin=c),r&&(j.srcset=r),u&&(j.sizes=u),t&&(j.loading=t),j.onload=C=>{S(),h("loaded"),o==null||o(C)},j.onerror=C=>{S(),h("failed"),s==null||s(C)},y.current=j},[n,c,r,u,o,s,t]),S=()=>{y.current&&(y.current.onload=null,y.current.onerror=null,y.current=null)};return Hi(()=>{if(!f)return p==="loading"&&x(),()=>{S()}},[p,x,f]),f?"loaded":p}var jw=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function kw(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var cs=ue(function(t,n){const{fallbackSrc:r,fallback:o,src:s,srcSet:c,align:u,fit:f,loading:p,ignoreFallback:h,crossOrigin:y,fallbackStrategy:x="beforeLoadOrError",referrerPolicy:S,...j}=t,C=r!==void 0||o!==void 0,w=p!=null||h||!C,k=ww({...t,ignoreFallback:w}),I=jw(k,x),P={ref:n,objectFit:f,objectPosition:u,...w?j:kw(j,["onError","onLoad"])};return I?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:y,loading:p,referrerPolicy:S,className:"chakra-image",...P})});cs.displayName="Image";function ah(e){return g.Children.toArray(e).filter(t=>g.isValidElement(t))}var[Ew,Pw]=kt({strict:!1,name:"ButtonGroupContext"}),Iw={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}}},Mw={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Qt=ue(function(t,n){const{size:r,colorScheme:o,variant:s,className:c,spacing:u="0.5rem",isAttached:f,isDisabled:p,orientation:h="horizontal",...y}=t,x=ze("chakra-button__group",c),S=g.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let j={display:"inline-flex",...f?Iw[h]:Mw[h](u)};const C=h==="vertical";return l.jsx(Ew,{value:S,children:l.jsx(ne.div,{ref:n,role:"group",__css:j,className:x,"data-attached":f?"":void 0,"data-orientation":h,flexDir:C?"column":void 0,...y})})});Qt.displayName="ButtonGroup";function Tw(e){const[t,n]=g.useState(!e);return{ref:g.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function vf(e){const{children:t,className:n,...r}=e,o=g.isValidElement(t)?g.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=ze("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=ze("chakra-button__spinner",s),p=n==="start"?"marginEnd":"marginStart",h=g.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[p]:t?r:0,fontSize:"1em",lineHeight:"normal",...c}),[c,t,p,r]);return l.jsx(ne.div,{className:f,...u,__css:h,children:o})}tc.displayName="ButtonSpinner";var ni=ue((e,t)=>{const n=Pw(),r=yo("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:c,children:u,leftIcon:f,rightIcon:p,loadingText:h,iconSpacing:y="0.5rem",type:x,spinner:S,spinnerPlacement:j="start",className:C,as:w,...k}=At(e),I=g.useMemo(()=>{const D={...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:D}}},[r,n]),{ref:P,type:M}=Tw(w),T={rightIcon:p,leftIcon:f,iconSpacing:y,children:u};return l.jsxs(ne.button,{ref:ZC(t,P),as:w,type:x??M,"data-active":qe(c),"data-loading":qe(s),__css:I,className:ze("chakra-button",C),...k,disabled:o||s,children:[s&&j==="start"&&l.jsx(tc,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:y,children:S}),s?h||l.jsx(ne.span,{opacity:0,children:l.jsx(Zv,{...T})}):l.jsx(Zv,{...T}),s&&j==="end"&&l.jsx(tc,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:y,children:S})]})});ni.displayName="Button";function Zv(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=ue((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...c}=e,u=n||r,f=g.isValidElement(u)?g.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[iL,_w]=kt({name:"CheckboxGroupContext",strict:!1});function Dw(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 Aw(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 Ow(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?Aw:Dw;return n||t?l.jsx(ne.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:l.jsx(o,{...r})}):null}var[zw,S2]=kt({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[Rw,ri]=kt({strict:!1,name:"FormControlContext"});function Nw(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...c}=e,u=g.useId(),f=t||`field-${u}`,p=`${f}-label`,h=`${f}-feedback`,y=`${f}-helptext`,[x,S]=g.useState(!1),[j,C]=g.useState(!1),[w,k]=g.useState(!1),I=g.useCallback((_={},R=null)=>({id:y,..._,ref:ct(R,V=>{V&&C(!0)})}),[y]),P=g.useCallback((_={},R=null)=>{var V,F;return{..._,ref:R,"data-focus":qe(w),"data-disabled":qe(o),"data-invalid":qe(r),"data-readonly":qe(s),id:(V=_.id)!=null?V:p,htmlFor:(F=_.htmlFor)!=null?F:f}},[f,o,w,r,s,p]),M=g.useCallback((_={},R=null)=>({id:h,..._,ref:ct(R,V=>{V&&S(!0)}),"aria-live":"polite"}),[h]),T=g.useCallback((_={},R=null)=>({..._,...c,ref:R,role:"group"}),[c]),D=g.useCallback((_={},R=null)=>({..._,ref:R,role:"presentation","aria-hidden":!0,children:_.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!w,onFocus:()=>k(!0),onBlur:()=>k(!1),hasFeedbackText:x,setHasFeedbackText:S,hasHelpText:j,setHasHelpText:C,id:f,labelId:p,feedbackId:h,helpTextId:y,htmlProps:c,getHelpTextProps:I,getErrorMessageProps:M,getRootProps:T,getLabelProps:P,getRequiredIndicatorProps:D}}var rt=ue(function(t,n){const r=un("Form",t),o=At(t),{getRootProps:s,htmlProps:c,...u}=Nw(o),f=ze("chakra-form-control",t.className);return l.jsx(Rw,{value:u,children:l.jsx(zw,{value:r,children:l.jsx(ne.div,{...s({},n),className:f,__css:r.container})})})});rt.displayName="FormControl";var pn=ue(function(t,n){const r=ri(),o=S2(),s=ze("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[Fw,Lw]=kt({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormError />" `}),mn=ue((e,t)=>{const n=un("FormError",e),r=At(e),o=ri();return o!=null&&o.isInvalid?l.jsx(Fw,{value:n,children:l.jsx(ne.div,{...o==null?void 0:o.getErrorMessageProps(r,t),className:ze("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})}):null});mn.displayName="FormErrorMessage";var Bw=ue((e,t)=>{const n=Lw(),r=ri();if(!(r!=null&&r.isInvalid))return null;const o=ze("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"})})});Bw.displayName="FormErrorIcon";var st=ue(function(t,n){var r;const o=yo("FormLabel",t),s=At(t),{className:c,children:u,requiredIndicator:f=l.jsx(C2,{}),optionalIndicator:p=null,...h}=s,y=ri(),x=(r=y==null?void 0:y.getLabelProps(h,n))!=null?r:{ref:n,...h};return l.jsxs(ne.label,{...x,className:ze("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[u,y!=null&&y.isRequired?f:p]})});st.displayName="FormLabel";var C2=ue(function(t,n){const r=ri(),o=S2();if(!(r!=null&&r.isRequired))return null;const s=ze("chakra-form__required-indicator",t.className);return l.jsx(ne.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});C2.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:p,isInvalid:h,isReadOnly:y,isDisabled:x,onFocus:S,onBlur:j,...C}=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),{...C,"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??y)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=f??p)!=null?r:o==null?void 0:o.isRequired,isInvalid:h??(o==null?void 0:o.isInvalid),onFocus:Ee(o==null?void 0:o.onFocus,S),onBlur:Ee(o==null?void 0:o.onBlur,j)}}var ch={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},w2=ne("span",{baseStyle:ch});w2.displayName="VisuallyHidden";var Hw=ne("input",{baseStyle:ch});Hw.displayName="VisuallyHiddenInput";var Jv=!1,us=null,Xo=!1,gf=!1,yf=new Set;function uh(e,t){yf.forEach(n=>n(e,t))}var Ww=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function Vw(e){return!(e.metaKey||!Ww&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function eg(e){Xo=!0,Vw(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 Uw(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function $w(e){Uw(e)&&(Xo=!0,us="virtual")}function Gw(e){e.target===window||e.target===document||(!Xo&&!gf&&(us="virtual",uh("virtual",e)),Xo=!1,gf=!1)}function qw(){Xo=!1,gf=!0}function tg(){return us!=="pointer"}function Yw(){if(typeof window>"u"||Jv)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Xo=!0,e.apply(this,n)},document.addEventListener("keydown",eg,!0),document.addEventListener("keyup",eg,!0),document.addEventListener("click",$w,!0),window.addEventListener("focus",Gw,!0),window.addEventListener("blur",qw,!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)),Jv=!0}function j2(e){Yw(),e(tg());const t=()=>e(tg());return yf.add(t),()=>{yf.delete(t)}}function Kw(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function k2(e={}){const t=lh(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:c,onBlur:u,onFocus:f,"aria-describedby":p}=t,{defaultChecked:h,isChecked:y,isFocusable:x,onChange:S,isIndeterminate:j,name:C,value:w,tabIndex:k=void 0,"aria-label":I,"aria-labelledby":P,"aria-invalid":M,...T}=e,D=Kw(T,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),_=Wt(S),R=Wt(u),V=Wt(f),[F,B]=g.useState(!1),[Q,U]=g.useState(!1),[X,te]=g.useState(!1),[re,$]=g.useState(!1);g.useEffect(()=>j2(B),[]);const Z=g.useRef(null),[fe,Se]=g.useState(!0),[Me,Ie]=g.useState(!!h),Pe=y!==void 0,he=Pe?y:Me,se=g.useCallback(ge=>{if(r||n){ge.preventDefault();return}Pe||Ie(he?ge.target.checked:j?!0:ge.target.checked),_==null||_(ge)},[r,n,he,Pe,j,_]);Hi(()=>{Z.current&&(Z.current.indeterminate=Boolean(j))},[j]),ti(()=>{n&&U(!1)},[n,U]),Hi(()=>{const ge=Z.current;ge!=null&&ge.form&&(ge.form.onreset=()=>{Ie(!!h)})},[]);const Ne=n&&!x,Ve=g.useCallback(ge=>{ge.key===" "&&$(!0)},[$]),Ue=g.useCallback(ge=>{ge.key===" "&&$(!1)},[$]);Hi(()=>{if(!Z.current)return;Z.current.checked!==he&&Ie(Z.current.checked)},[Z.current]);const $e=g.useCallback((ge={},Te=null)=>{const et=Be=>{Q&&Be.preventDefault(),$(!0)};return{...ge,ref:Te,"data-active":qe(re),"data-hover":qe(X),"data-checked":qe(he),"data-focus":qe(Q),"data-focus-visible":qe(Q&&F),"data-indeterminate":qe(j),"data-disabled":qe(n),"data-invalid":qe(s),"data-readonly":qe(r),"aria-hidden":!0,onMouseDown:Ee(ge.onMouseDown,et),onMouseUp:Ee(ge.onMouseUp,()=>$(!1)),onMouseEnter:Ee(ge.onMouseEnter,()=>te(!0)),onMouseLeave:Ee(ge.onMouseLeave,()=>te(!1))}},[re,he,n,Q,F,X,j,s,r]),Qe=g.useCallback((ge={},Te=null)=>({...D,...ge,ref:ct(Te,et=>{et&&Se(et.tagName==="LABEL")}),onClick:Ee(ge.onClick,()=>{var et;fe||((et=Z.current)==null||et.click(),requestAnimationFrame(()=>{var Be;(Be=Z.current)==null||Be.focus()}))}),"data-disabled":qe(n),"data-checked":qe(he),"data-invalid":qe(s)}),[D,n,he,s,fe]),me=g.useCallback((ge={},Te=null)=>({...ge,ref:ct(Z,Te),type:"checkbox",name:C,value:w,id:c,tabIndex:k,onChange:Ee(ge.onChange,se),onBlur:Ee(ge.onBlur,R,()=>U(!1)),onFocus:Ee(ge.onFocus,V,()=>U(!0)),onKeyDown:Ee(ge.onKeyDown,Ve),onKeyUp:Ee(ge.onKeyUp,Ue),required:o,checked:he,disabled:Ne,readOnly:r,"aria-label":I,"aria-labelledby":P,"aria-invalid":M?Boolean(M):s,"aria-describedby":p,"aria-disabled":n,style:ch}),[C,w,c,se,R,V,Ve,Ue,o,he,Ne,r,I,P,M,s,p,n,k]),De=g.useCallback((ge={},Te=null)=>({...ge,ref:Te,onMouseDown:Ee(ge.onMouseDown,ng),onTouchStart:Ee(ge.onTouchStart,ng),"data-disabled":qe(n),"data-checked":qe(he),"data-invalid":qe(s)}),[he,n,s]);return{state:{isInvalid:s,isFocused:Q,isChecked:he,isActive:re,isHovered:X,isIndeterminate:j,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:Qe,getCheckboxProps:$e,getInputProps:me,getLabelProps:De,htmlProps:D}}function ng(e){e.preventDefault(),e.stopPropagation()}var Xw={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"},Zw=ei({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),Jw=ei({from:{opacity:0},to:{opacity:1}}),e5=ei({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),E2=ue(function(t,n){const r=_w(),o={...r,...t},s=un("Checkbox",o),c=At(t),{spacing:u="0.5rem",className:f,children:p,iconColor:h,iconSize:y,icon:x=l.jsx(Ow,{}),isChecked:S,isDisabled:j=r==null?void 0:r.isDisabled,onChange:C,inputProps:w,...k}=c;let I=S;r!=null&&r.value&&c.value&&(I=r.value.includes(c.value));let P=C;r!=null&&r.onChange&&c.value&&(P=xc(r.onChange,C));const{state:M,getInputProps:T,getCheckboxProps:D,getLabelProps:_,getRootProps:R}=k2({...k,isDisabled:j,isChecked:I,onChange:P}),V=g.useMemo(()=>({animation:M.isIndeterminate?`${Jw} 20ms linear, ${e5} 200ms linear`:`${Zw} 200ms linear`,fontSize:y,color:h,...s.icon}),[h,y,,M.isIndeterminate,s.icon]),F=g.cloneElement(x,{__css:V,isIndeterminate:M.isIndeterminate,isChecked:M.isChecked});return l.jsxs(ne.label,{__css:{...Qw,...s.container},className:ze("chakra-checkbox",f),...R(),children:[l.jsx("input",{className:"chakra-checkbox__input",...T(w,n)}),l.jsx(ne.span,{__css:{...Xw,...s.control},className:"chakra-checkbox__control",...D(),children:F}),p&&l.jsx(ne.span,{className:"chakra-checkbox__label",..._(),__css:{marginStart:u,...s.label},children:p})]})});E2.displayName="Checkbox";function t5(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function dh(e,t){let n=t5(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 rg(e,t,n){return(e-t)*100/(n-t)}function n5(e,t,n){return(n-t)*e+t}function og(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 r5(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,p=Wt(t),[h,y]=g.useState(()=>{var F;return r==null?"":(F=gd(r,s,n))!=null?F:""}),x=typeof o<"u",S=x?o:h,j=P2(io(S),s),C=n??j,w=g.useCallback(F=>{F!==S&&(x||y(F.toString()),p==null||p(F.toString(),io(F)))},[p,x,S]),k=g.useCallback(F=>{let B=F;return f&&(B=Hl(B,c,u)),dh(B,C)},[C,f,u,c]),I=g.useCallback((F=s)=>{let B;S===""?B=io(F):B=io(S)+F,B=k(B),w(B)},[k,s,w,S]),P=g.useCallback((F=s)=>{let B;S===""?B=io(-F):B=io(S)-F,B=k(B),w(B)},[k,s,w,S]),M=g.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=g.useCallback(F=>{var B;const Q=(B=gd(F,s,C))!=null?B:c;w(Q)},[C,s,w,c]),D=io(S);return{isOutOfRange:D>u||D<c,isAtMax:D===u,isAtMin:D===c,precision:C,value:S,valueAsNumber:D,update:w,reset:M,increment:I,decrement:P,clamp:k,cast:T,setValue:y}}function io(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function P2(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=P2(r,t);return dh(r,n??o)}function Go(e,t,n,r){const o=Wt(n);return g.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 o5(e){return"current"in e}var I2=()=>typeof window<"u";function i5(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var a5=e=>I2()&&e.test(navigator.vendor),s5=e=>I2()&&e.test(i5()),l5=()=>s5(/mac|iphone|ipad|ipod/i),c5=()=>l5()&&a5(/apple/i);function u5(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(!c5()||!r)return;const c=s.target,f=(n??[t]).some(p=>{const h=o5(p)?p.current:p;return(h==null?void 0:h.contains(c))||h===c});o().activeElement!==c&&f&&(s.preventDefault(),c.focus())})}var lt={},d5={get exports(){return lt},set exports(e){lt=e}},f5="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",h5=f5,p5=h5;function M2(){}function T2(){}T2.resetWarningCache=M2;var m5=function(){function e(r,o,s,c,u,f){if(f!==p5){var p=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 p.name="Invariant Violation",p}}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:T2,resetWarningCache:M2};return n.PropTypes=n,n};d5.exports=m5();var bf="data-focus-lock",_2="data-focus-lock-disabled",v5="data-no-focus-lock",g5="data-autofocus-inside",y5="data-no-autofocus";function x5(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function b5(e,t){var n=g.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 D2(e,t){return b5(t||null,function(n){return e.forEach(function(r){return x5(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 A2(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(h){try{p(r.next(h))}catch(y){c(y)}}function f(h){try{p(r.throw(h))}catch(y){c(y)}}function p(h){h.done?s(h.value):o(h.value).then(u,f)}p((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(p){return function(h){return f([p,h])}}function f(p){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,p[0]&&(n=0)),n;)try{if(r=1,o&&(s=p[0]&2?o.return:p[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,p[1])).done)return s;switch(o=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){n.label=p[1];break}if(p[0]===6&&n.label<s[1]){n.label=s[1],s=p;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(p);break}s[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(h){p=[6,h],o=0}finally{r=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function ig(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 O2(e){return e}function z2(e,t){t===void 0&&(t=O2);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 h=c;c=[],h.forEach(s)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(h){c.push(h),p()},filter:function(h){return c=c.filter(h),n}}}};return o}function fh(e,t){return t===void 0&&(t=O2),z2(e,t)}function R2(e){e===void 0&&(e={});var t=z2(null);return t.options=xr({async:!0,ssr:!1},e),t}var N2=function(e){var t=e.sideCar,n=A2(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 g.createElement(r,xr({},n))};N2.isSideCarExport=!0;function S5(e,t){return e.useMedium(t),N2}var F2=fh({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),L2=fh(),C5=fh(),w5=R2({async:!0}),j5=[],hh=g.forwardRef(function(t,n){var r,o=g.useState(),s=o[0],c=o[1],u=g.useRef(),f=g.useRef(!1),p=g.useRef(null),h=t.children,y=t.disabled,x=t.noFocusGuards,S=t.persistentFocus,j=t.crossFrame,C=t.autoFocus;t.allowTextSelection;var w=t.group,k=t.className,I=t.whiteList,P=t.hasPositiveIndices,M=t.shards,T=M===void 0?j5:M,D=t.as,_=D===void 0?"div":D,R=t.lockProps,V=R===void 0?{}:R,F=t.sideCar,B=t.returnFocus,Q=t.focusOptions,U=t.onActivation,X=t.onDeactivation,te=g.useState({}),re=te[0],$=g.useCallback(function(){p.current=p.current||document&&document.activeElement,u.current&&U&&U(u.current),f.current=!0},[U]),Z=g.useCallback(function(){f.current=!1,X&&X(u.current)},[X]);g.useEffect(function(){y||(p.current=null)},[]);var fe=g.useCallback(function(Ve){var Ue=p.current;if(Ue&&Ue.focus){var $e=typeof B=="function"?B(Ue):B;if($e){var Qe=typeof $e=="object"?$e:void 0;p.current=null,Ve?Promise.resolve().then(function(){return Ue.focus(Qe)}):Ue.focus(Qe)}}},[B]),Se=g.useCallback(function(Ve){f.current&&F2.useMedium(Ve)},[]),Me=L2.useMedium,Ie=g.useCallback(function(Ve){u.current!==Ve&&(u.current=Ve,c(Ve))},[]),Pe=Xd((r={},r[_2]=y&&"disabled",r[bf]=w,r),V),he=x!==!0,se=he&&x!=="tail",Ne=D2([n,Ie]);return g.createElement(g.Fragment,null,he&&[g.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:y?-1:0,style:yd}),P?g.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:y?-1:1,style:yd}):null],!y&&g.createElement(F,{id:re,sideCar:w5,observed:s,disabled:y,persistentFocus:S,crossFrame:j,autoFocus:C,whiteList:I,shards:T,onActivation:$,onDeactivation:Z,returnFocus:fe,focusOptions:Q}),g.createElement(_,Xd({ref:Ne},Pe,{className:k,onBlur:Me,onFocus:Se}),h),se&&g.createElement("div",{"data-focus-guard":!0,tabIndex:y?-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 B2=hh;function k5(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,HS(e,t)}function E5(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],c;function u(){c=e(s.map(function(p){return p.props})),t(c)}var f=function(p){k5(h,p);function h(){return p.apply(this,arguments)||this}h.peek=function(){return c};var y=h.prototype;return y.componentDidMount=function(){s.push(this),u()},y.componentDidUpdate=function(){u()},y.componentWillUnmount=function(){var S=s.indexOf(this);s.splice(S,1),u()},y.render=function(){return _e.createElement(o,this.props)},h}(g.PureComponent);return WS(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]},H2=function(e){return Array.isArray(e)?e[0]:e},P5=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"},W2=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},V2=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},I5=function(e,t){return!e||V2(e)||!P5(e)&&t(W2(e))},U2=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=I5(t,U2.bind(void 0,e));return e.set(t,r),r},M5=function(e,t){return e&&!V2(e)?D5(e)?t(W2(e)):!1:!0},$2=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=M5(t,$2.bind(void 0,e));return e.set(t,r),r},G2=function(e){return e.dataset},T5=function(e){return e.tagName==="BUTTON"},q2=function(e){return e.tagName==="INPUT"},Y2=function(e){return q2(e)&&e.type==="radio"},_5=function(e){return!((q2(e)||T5(e))&&(e.type==="hidden"||e.disabled))},D5=function(e){var t=e.getAttribute(y5);return![!0,"true",""].includes(t)},ph=function(e){var t;return Boolean(e&&((t=G2(e))===null||t===void 0?void 0:t.focusGuard))},rc=function(e){return!ph(e)},A5=function(e){return Boolean(e)},O5=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},K2=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(O5)},z5=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],mh=z5.join(","),R5="".concat(mh,", [data-focus-guard]"),X2=function(e,t){return Er((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?R5:mh)?[r]:[],X2(r))},[])},N5=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=X2(r,t),c=(o=[]).concat.apply(o,s.map(function(u){return N5(u,t)}));return n.concat(c,r.parentNode?Er(r.parentNode.querySelectorAll(mh)).filter(function(u){return u===r}):[])},[])},F5=function(e){var t=e.querySelectorAll("[".concat(g5,"]"));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 U2(t,n)}).filter(function(n){return _5(n)})},ag=function(e,t){return t===void 0&&(t=new Map),Er(e).filter(function(n){return $2(t,n)})},Cf=function(e,t,n){return K2(vh(jc(e,n),t),!0,n)},sg=function(e,t){return K2(vh(jc(e),t),!1)},L5=function(e,t){return vh(F5(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)})},B5=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)})},Q2=function(e){return e.parentNode?Q2(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?B5(Er(Q2(r).querySelectorAll("[".concat(bf,'="').concat(o,'"]:not([').concat(_2,'="disabled"])')))):[r]),n},[])},H5=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&&H5(function(){return t.contentWindow.document})?qa(t.contentWindow.document):t}},W5=function(e,t){return e===t},V5=function(e,t){return Boolean(Er(e.querySelectorAll("iframe")).some(function(n){return W5(n,t)}))},Z2=function(e,t){return t===void 0&&(t=qa(H2(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:gh(e).some(function(n){return Vi(n,t)||V5(n,t)})},U5=function(e){e===void 0&&(e=document);var t=qa(e);return t?Er(e.querySelectorAll("[".concat(v5,"]"))).some(function(n){return Vi(n,t)}):!1},$5=function(e,t){return t.filter(Y2).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},yh=function(e,t){return Y2(e)&&e.name?$5(e,t):e},G5=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)})},lg=function(e){return e[0]&&e.length>1?yh(e[0],e):e[0]},cg=function(e,t){return e.length>1?e.indexOf(yh(e[t],e)):t},J2="NEW_FOCUS",q5=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,p=r?t.indexOf(r):f,h=r?e.indexOf(r):-1,y=f-p,x=t.indexOf(s),S=t.indexOf(c),j=G5(t),C=n!==void 0?j.indexOf(n):-1,w=C-(r?j.indexOf(r):f),k=cg(e,0),I=cg(e,o-1);if(f===-1||h===-1)return J2;if(!y&&h>=0)return h;if(f<=x&&u&&Math.abs(y)>1)return I;if(f>=S&&u&&Math.abs(y)>1)return k;if(y&&Math.abs(w)>1)return h;if(f<=x)return I;if(f>S)return k;if(y)return Math.abs(y)>1?h:(o+h+y)%o}},Y5=function(e){return function(t){var n,r=(n=G2(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},K5=function(e,t,n){var r=e.map(function(s){var c=s.node;return c}),o=ag(r.filter(Y5(n)));return o&&o.length?lg(o):lg(ag(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},ey=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 p=xd(s,f);p&&(!c||Vi(p,c)?c=p:c=xd(p,c))})}),c},X5=function(e,t){return e.reduce(function(n,r){return n.concat(L5(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(A5)},Z5=function(e,t){var n=qa(nc(e).length>0?document:H2(e).ownerDocument),r=gh(e).filter(rc),o=ey(n||e,e,r),s=new Map,c=sg(r,s),u=Cf(r,s).filter(function(S){var j=S.node;return rc(j)});if(!(!u[0]&&(u=c,!u[0]))){var f=sg([o],s).map(function(S){var j=S.node;return j}),p=Q5(f,u),h=p.map(function(S){var j=S.node;return j}),y=q5(h,f,n,t);if(y===J2){var x=K5(c,h,X5(r,s));if(x)return{node:x};console.warn("focus-lock: cannot find any node to move focus into");return}return y===void 0?y:p[y]}},J5=function(e){var t=gh(e).filter(rc),n=ey(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)}})},e6=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},bd=0,Sd=!1,ty=function(e,t,n){n===void 0&&(n={});var r=Z5(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++,e6(r.node,n.focusOptions),bd--}};function ny(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var t6=function(){return document&&document.activeElement===document.body},n6=function(){return t6()||U5()},Ui=null,Ni=null,$i=null,Ya=!1,r6=function(){return!0},o6=function(t){return(Ui.whiteList||r6)(t)},i6=function(t,n){$i={observerNode:t,portaledElement:n}},a6=function(t){return $i&&$i.portaledElement===t};function ug(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 s6=function(t){return t&&"current"in t?t.current:t},l6=function(t){return t?Boolean(Ya):Ya==="meanwhile"},c6=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},u6=function(t,n){return n.some(function(r){return c6(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,p=r||$i&&$i.portaledElement,h=document&&document.activeElement;if(p){var y=[p].concat(c.map(s6).filter(Boolean));if((!h||o6(h))&&(o||l6(u)||!n6()||!Ni&&s)&&(p&&!(Z2(y)||h&&u6(h,y)||a6(h))&&(document&&!Ni&&h&&!s?(h.blur&&h.blur(),document.body.focus()):(t=ty(y,Ni,{focusOptions:f}),$i={})),Ya=!1,Ni=document&&document.activeElement),document){var x=document&&document.activeElement,S=J5(y),j=S.map(function(C){var w=C.node;return w}).indexOf(x);j>-1&&(S.filter(function(C){var w=C.guard,k=C.node;return w&&k.dataset.focusAutoGuard}).forEach(function(C){var w=C.node;return w.removeAttribute("tabIndex")}),ug(j,S.length,1,S),ug(j,-1,-1,S))}}}return t},ry=function(t){oc()&&t&&(t.stopPropagation(),t.preventDefault())},xh=function(){return ny(oc)},d6=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||i6(r,n)},f6=function(){return null},oy=function(){Ya="just",setTimeout(function(){Ya="meanwhile"},0)},h6=function(){document.addEventListener("focusin",ry),document.addEventListener("focusout",xh),window.addEventListener("blur",oy)},p6=function(){document.removeEventListener("focusin",ry),document.removeEventListener("focusout",xh),window.removeEventListener("blur",oy)};function m6(e){return e.filter(function(t){var n=t.disabled;return!n})}function v6(e){var t=e.slice(-1)[0];t&&!Ui&&h6();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(),ny(oc)):(p6(),Ni=null)}F2.assignSyncMedium(d6);L2.assignMedium(xh);C5.assignMedium(function(e){return e({moveFocusInside:ty,focusInside:Z2})});const g6=E5(m6,v6)(f6);var iy=g.forwardRef(function(t,n){return g.createElement(B2,Xd({sideCar:g6,ref:n},t))}),ay=B2.propTypes||{};ay.sideCar;MC(ay,["sideCar"]);iy.propTypes={};const dg=iy;function sy(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function ly(e){var t;if(!sy(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function y6(e){var t,n;return(n=(t=cy(e))==null?void 0:t.defaultView)!=null?n:window}function cy(e){return sy(e)?e.ownerDocument:document}function x6(e){return cy(e).activeElement}var uy=e=>e.hasAttribute("tabindex"),b6=e=>uy(e)&&e.tabIndex===-1;function S6(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function dy(e){return e.parentElement&&dy(e.parentElement)?!0:e.hidden}function C6(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function fy(e){if(!ly(e)||dy(e)||S6(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]():C6(e)?!0:uy(e)}function w6(e){return e?ly(e)&&fy(e)&&!b6(e):!1}var j6=["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]"],k6=j6.join(),E6=e=>e.offsetWidth>0&&e.offsetHeight>0;function hy(e){const t=Array.from(e.querySelectorAll(k6));return t.unshift(e),t.filter(n=>fy(n)&&E6(n))}var fg,P6=(fg=dg.default)!=null?fg:dg,py=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:c,autoFocus:u,persistentFocus:f,lockFocusAcrossFrames:p}=e,h=g.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&hy(r.current).length===0&&requestAnimationFrame(()=>{var j;(j=r.current)==null||j.focus()})},[t,r]),y=g.useCallback(()=>{var S;(S=n==null?void 0:n.current)==null||S.focus()},[n]),x=o&&!n;return l.jsx(P6,{crossFrame:p,persistentFocus:f,autoFocus:u,disabled:c,onActivation:h,onDeactivation:y,returnFocus:x,children:s})};py.displayName="FocusLock";var I6=LC?g.useLayoutEffect:g.useEffect;function ic(e,t=[]){const n=g.useRef(e);return I6(()=>{n.current=e}),g.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function M6(e,t,n,r){const o=ic(t);return g.useEffect(()=>{var s;const c=(s=Pv(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=Pv(n))!=null?s:document).removeEventListener(e,o,r)}}function T6(e){const{ref:t,handler:n,enabled:r=!0}=e,o=ic(n),c=g.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;g.useEffect(()=>{if(!r)return;const u=y=>{Cd(y,t)&&(c.isPointerDown=!0)},f=y=>{if(c.ignoreEmulatedMouseEvents){c.ignoreEmulatedMouseEvents=!1;return}c.isPointerDown&&n&&Cd(y,t)&&(c.isPointerDown=!1,o(y))},p=y=>{c.ignoreEmulatedMouseEvents=!0,n&&c.isPointerDown&&Cd(y,t)&&(c.isPointerDown=!1,o(y))},h=f2(t.current);return h.addEventListener("mousedown",u,!0),h.addEventListener("mouseup",f,!0),h.addEventListener("touchstart",u,!0),h.addEventListener("touchend",p,!0),()=>{h.removeEventListener("mousedown",u,!0),h.removeEventListener("mouseup",f,!0),h.removeEventListener("touchstart",u,!0),h.removeEventListener("touchend",p,!0)}},[n,t,o,c,r])}function Cd(e,t){var n;const r=e.target;return e.button>0||r&&!f2(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function _6(e,t){const n=g.useId();return g.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function D6(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]=g.useState(e.defaultIsOpen||!1),[p,h]=D6(r,u),y=_6(o,"disclosure"),x=g.useCallback(()=>{p||f(!1),c==null||c()},[p,c]),S=g.useCallback(()=>{p||f(!0),s==null||s()},[p,s]),j=g.useCallback(()=>{(h?x:S)()},[h,S,x]);return{isOpen:!!h,onOpen:S,onClose:x,onToggle:j,isControlled:p,getButtonProps:(C={})=>({...C,"aria-expanded":h,"aria-controls":y,onClick:VS(C.onClick,j)}),getDisclosureProps:(C={})=>({...C,hidden:!h,id:y})}}var bh=ue(function(t,n){const{htmlSize:r,...o}=t,s=un("Input",o),c=At(o),u=sh(c),f=ze("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[A6,my]=kt({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),Sh=ue(function(t,n){const r=un("List",t),{children:o,styleType:s="none",stylePosition:c,spacing:u,...f}=At(t),p=ah(o),y=u?{["& > *:not(style) ~ *:not(style)"]:{mt:u}}:{};return l.jsx(A6,{value:r,children:l.jsx(ne.ul,{ref:n,listStyleType:s,listStylePosition:c,role:"list",__css:{...r.container,...y},...f,children:p})})});Sh.displayName="List";var O6=ue((e,t)=>{const{as:n,...r}=e;return l.jsx(Sh,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});O6.displayName="OrderedList";var vy=ue(function(t,n){const{as:r,...o}=t;return l.jsx(Sh,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});vy.displayName="UnorderedList";var Ra=ue(function(t,n){const r=my();return l.jsx(ne.li,{ref:n,...t,__css:r.item})});Ra.displayName="ListItem";var z6=ue(function(t,n){const r=my();return l.jsx(tn,{ref:n,role:"presentation",...t,__css:r.icon})});z6.displayName="ListIcon";var ir=ue(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:c,column:u,row:f,autoFlow:p,autoRows:h,templateRows:y,autoColumns:x,templateColumns:S,...j}=t,C={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:c,gridAutoColumns:x,gridColumn:u,gridRow:f,gridAutoFlow:p,gridAutoRows:h,gridTemplateRows:y,gridTemplateColumns:S};return l.jsx(ne.div,{ref:n,__css:C,...j})});ir.displayName="Grid";function gy(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 yy=e=>l.jsx(ne.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});yy.displayName="StackItem";var jf="& > *:not(style) ~ *:not(style)";function R6(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]:gy(n,o=>r[o])}}function N6(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{"&":gy(n,o=>r[o])}}var Ch=ue((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:c="0.5rem",wrap:u,children:f,divider:p,className:h,shouldWrapChildren:y,...x}=e,S=n?"row":r??"column",j=g.useMemo(()=>R6({direction:S,spacing:c}),[S,c]),C=g.useMemo(()=>N6({spacing:c,direction:S}),[c,S]),w=!!p,k=!y&&!w,I=g.useMemo(()=>{const M=ah(f);return k?M:M.map((T,D)=>{const _=typeof T.key<"u"?T.key:D,R=D+1===M.length,F=y?l.jsx(yy,{children:T},_):T;if(!w)return F;const B=g.cloneElement(p,{__css:C}),Q=R?null:B;return l.jsxs(g.Fragment,{children:[F,Q]},_)})},[p,C,w,k,y,f]),P=ze("chakra-stack",h);return l.jsx(ne.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:j.flexDirection,flexWrap:u,className:P,__css:w?{}:{[jf]:j[jf]},...x,children:I})});Ch.displayName="Stack";var Fe=ue((e,t)=>l.jsx(Ch,{align:"center",...e,direction:"column",ref:t}));Fe.displayName="VStack";var oa=ue((e,t)=>l.jsx(Ch,{align:"center",...e,direction:"row",ref:t}));oa.displayName="HStack";var Wn=ue(function(t,n){const r=yo("Heading",t),{className:o,...s}=At(t);return l.jsx(ne.h2,{ref:n,className:ze("chakra-heading",t.className),...s,__css:r})});Wn.displayName="Heading";var Ye=ne("div");Ye.displayName="Box";var xy=ue(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})});xy.displayName="Square";var F6=ue(function(t,n){const{size:r,...o}=t;return l.jsx(xy,{size:r,ref:n,borderRadius:"9999px",...o})});F6.displayName="Circle";var qo=ue(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:ze("chakra-link",o),...c,__css:r})});qo.displayName="Link";var by=ue(function(t,n){const r=yo("Badge",t),{className:o,...s}=At(t);return l.jsx(ne.span,{ref:n,className:ze("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});by.displayName="Badge";var Sy=ne("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});Sy.displayName="Center";var L6={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};ue(function(t,n){const{axis:r="both",...o}=t;return l.jsx(ne.div,{ref:n,__css:L6[r],...o,position:"absolute"})});var Cy=ue(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:c,borderWidth:u,borderStyle:f,borderColor:p,...h}=yo("Divider",t),{className:y,orientation:x="horizontal",__css:S,...j}=At(t),C={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,...j,__css:{...h,border:"0",borderColor:p,borderStyle:f,...C[x],...S},className:ze("chakra-divider",y)})});Cy.displayName="Divider";function B6(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function H6(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=g.useState([]),s=g.useRef(),c=()=>{s.current&&(clearTimeout(s.current),s.current=null)},u=()=>{c(),s.current=setTimeout(()=>{o([]),s.current=null},t)};g.useEffect(()=>c,[]);function f(p){return h=>{if(h.key==="Backspace"){const y=[...r];y.pop(),o(y);return}if(B6(h)){const y=r.concat(h.key);n(h)&&(h.preventDefault(),h.stopPropagation()),o(y),p(y.join("")),u()}}}return f}function W6(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 V6(){const e=g.useRef(new Map),t=e.current,n=g.useCallback((o,s,c,u)=>{e.current.set(c,{type:s,el:o,options:u}),o.addEventListener(s,c,u)},[]),r=g.useCallback((o,s,c,u)=>{o.removeEventListener(s,c,u),e.current.delete(c)},[]);return g.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 wy(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:c,onMouseUp:u,onClick:f,onKeyDown:p,onKeyUp:h,tabIndex:y,onMouseOver:x,onMouseLeave:S,...j}=e,[C,w]=g.useState(!0),[k,I]=g.useState(!1),P=V6(),M=$=>{$&&$.tagName!=="BUTTON"&&w(!1)},T=C?y:y||0,D=n&&!r,_=g.useCallback($=>{if(n){$.stopPropagation(),$.preventDefault();return}$.currentTarget.focus(),f==null||f($)},[n,f]),R=g.useCallback($=>{k&&wd($)&&($.preventDefault(),$.stopPropagation(),I(!1),P.remove(document,"keyup",R,!1))},[k,P]),V=g.useCallback($=>{if(p==null||p($),n||$.defaultPrevented||$.metaKey||!wd($.nativeEvent)||C)return;const Z=o&&$.key==="Enter";s&&$.key===" "&&($.preventDefault(),I(!0)),Z&&($.preventDefault(),$.currentTarget.click()),P.add(document,"keyup",R,!1)},[n,C,p,o,s,P,R]),F=g.useCallback($=>{if(h==null||h($),n||$.defaultPrevented||$.metaKey||!wd($.nativeEvent)||C)return;s&&$.key===" "&&($.preventDefault(),I(!1),$.currentTarget.click())},[s,C,n,h]),B=g.useCallback($=>{$.button===0&&(I(!1),P.remove(document,"mouseup",B,!1))},[P]),Q=g.useCallback($=>{if($.button!==0)return;if(n){$.stopPropagation(),$.preventDefault();return}C||I(!0),$.currentTarget.focus({preventScroll:!0}),P.add(document,"mouseup",B,!1),c==null||c($)},[n,C,c,P,B]),U=g.useCallback($=>{$.button===0&&(C||I(!1),u==null||u($))},[u,C]),X=g.useCallback($=>{if(n){$.preventDefault();return}x==null||x($)},[n,x]),te=g.useCallback($=>{k&&($.preventDefault(),I(!1)),S==null||S($)},[k,S]),re=ct(t,M);return C?{...j,ref:re,type:"button","aria-disabled":D?void 0:n,disabled:D,onClick:_,onMouseDown:c,onMouseUp:u,onKeyUp:h,onKeyDown:p,onMouseOver:x,onMouseLeave:S}:{...j,ref:re,role:"button","data-active":qe(k),"aria-disabled":n?"true":void 0,tabIndex:D?void 0:T,onClick:_,onMouseDown:Q,onMouseUp:U,onKeyUp:F,onKeyDown:V,onMouseOver:X,onMouseLeave:te}}function U6(e){const t=e.current;if(!t)return!1;const n=x6(t);return!n||t.contains(n)?!1:!!w6(n)}function jy(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;ti(()=>{if(!s||U6(e))return;const c=(o==null?void 0:o.current)||e.current;c&&requestAnimationFrame(()=>{c.focus()})},[s,e,o])}var $6={preventScroll:!0,shouldFocus:!1};function G6(e,t=$6){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,c=q6(e)?e.current:e,u=o&&s,f=g.useRef(u),p=g.useRef(s);Hi(()=>{!p.current&&s&&(f.current=u),p.current=s},[s,u]);const h=g.useCallback(()=>{if(!(!s||!c||!f.current)&&(f.current=!1,!c.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var y;(y=n.current)==null||y.focus({preventScroll:r})});else{const y=hy(c);y.length>0&&requestAnimationFrame(()=>{y[0].focus({preventScroll:r})})}},[s,r,c,n]);ti(()=>{h()},[h]),Go(c,"transitionend",h)}function q6(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 Y6(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 K6={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"},X6=e=>K6[e],hg={scroll:!0,resize:!0};function Q6(e){let t;return typeof e=="object"?t={enabled:!0,options:{...hg,...e}}:t={enabled:e,options:hg},t}var Z6={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`}},J6={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{pg(e)},effect:({state:e})=>()=>{pg(e)}},pg=e=>{e.elements.popper.style.setProperty(Ht.transformOrigin.var,X6(e.placement))},ej={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{tj(e)}},tj=e=>{var t;if(!e.placement)return;const n=nj(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])}},nj=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}},rj={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{mg(e)},effect:({state:e})=>()=>{mg(e)}},mg=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=Y6(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))"})},oj={"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"}},ij={"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 aj(e,t="ltr"){var n,r;const o=((n=oj[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=ij[e])!=null?r:o}var Pn="top",Un="bottom",$n="right",In="left",wh="auto",ds=[Pn,Un,$n,In],Gi="start",Ka="end",sj="clippingParents",ky="viewport",_a="popper",lj="reference",vg=ds.reduce(function(e,t){return e.concat([t+"-"+Gi,t+"-"+Ka])},[]),Ey=[].concat(ds,[wh]).reduce(function(e,t){return e.concat([t,t+"-"+Gi,t+"-"+Ka])},[]),cj="beforeRead",uj="read",dj="afterRead",fj="beforeMain",hj="main",pj="afterMain",mj="beforeWrite",vj="write",gj="afterWrite",yj=[cj,uj,dj,fj,hj,pj,mj,vj,gj];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 xj(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 bj(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,p){return f[p]="",f},{});!Vn(o)||!kr(o)||(Object.assign(o.style,u),Object.keys(s).forEach(function(f){o.removeAttribute(f)}))})}}const Sj={name:"applyStyles",enabled:!0,phase:"write",fn:xj,effect:bj,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 Py(){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=!Py()&&n,p=(r.left+(f&&u?u.offsetLeft:0))/o,h=(r.top+(f&&u?u.offsetTop:0))/s,y=r.width/o,x=r.height/s;return{width:y,height:x,top:h,right:p+y,bottom:h+x,left:p,x:p,y:h}}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 Iy(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 Cj(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 gg(e){return!Vn(e)||Fr(e).position==="fixed"?null:e.offsetParent}function wj(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=gg(e);n&&Cj(n)&&Fr(n).position==="static";)n=gg(n);return n&&(kr(n)==="html"||kr(n)==="body"&&Fr(n).position==="static")?t:n||wj(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 jj(e,t,n){var r=Fa(e,t,n);return r>n?n:r}function My(){return{top:0,right:0,bottom:0,left:0}}function Ty(e){return Object.assign({},My(),e)}function _y(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var kj=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Ty(typeof t!="number"?t:_y(t,ds))};function Ej(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),p=[In,$n].indexOf(u)>=0,h=p?"height":"width";if(!(!s||!c)){var y=kj(o.padding,n),x=kh(s),S=f==="y"?Pn:In,j=f==="y"?Un:$n,C=n.rects.reference[h]+n.rects.reference[f]-c[f]-n.rects.popper[h],w=c[f]-n.rects.reference[f],k=fs(s),I=k?f==="y"?k.clientHeight||0:k.clientWidth||0:0,P=C/2-w/2,M=y[S],T=I-x[h]-y[j],D=I/2-x[h]/2+P,_=Fa(M,D,T),R=f;n.modifiersData[r]=(t={},t[R]=_,t.centerOffset=_-D,t)}}function Pj(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)||Iy(t.elements.popper,o)&&(t.elements.arrow=o))}const Ij={name:"arrow",enabled:!0,phase:"main",fn:Ej,effect:Pj,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ki(e){return e.split("-")[1]}var Mj={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Tj(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 yg(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,c=e.offsets,u=e.position,f=e.gpuAcceleration,p=e.adaptive,h=e.roundOffsets,y=e.isFixed,x=c.x,S=x===void 0?0:x,j=c.y,C=j===void 0?0:j,w=typeof h=="function"?h({x:S,y:C}):{x:S,y:C};S=w.x,C=w.y;var k=c.hasOwnProperty("x"),I=c.hasOwnProperty("y"),P=In,M=Pn,T=window;if(p){var D=fs(n),_="clientHeight",R="clientWidth";if(D===Gn(n)&&(D=bo(n),Fr(D).position!=="static"&&u==="absolute"&&(_="scrollHeight",R="scrollWidth")),D=D,o===Pn||(o===In||o===$n)&&s===Ka){M=Un;var V=y&&D===T&&T.visualViewport?T.visualViewport.height:D[_];C-=V-r.height,C*=f?1:-1}if(o===In||(o===Pn||o===Un)&&s===Ka){P=$n;var F=y&&D===T&&T.visualViewport?T.visualViewport.width:D[R];S-=F-r.width,S*=f?1:-1}}var B=Object.assign({position:u},p&&Mj),Q=h===!0?Tj({x:S,y:C}):{x:S,y:C};if(S=Q.x,C=Q.y,f){var U;return Object.assign({},B,(U={},U[M]=I?"0":"",U[P]=k?"0":"",U.transform=(T.devicePixelRatio||1)<=1?"translate("+S+"px, "+C+"px)":"translate3d("+S+"px, "+C+"px, 0)",U))}return Object.assign({},B,(t={},t[M]=I?C+"px":"",t[P]=k?S+"px":"",t.transform="",t))}function _j(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,p={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,yg(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:f})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,yg(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Dj={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_j,data:{}};var Sl={passive:!0};function Aj(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),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&p.forEach(function(h){h.addEventListener("scroll",n.update,Sl)}),u&&f.addEventListener("resize",n.update,Sl),function(){s&&p.forEach(function(h){h.removeEventListener("scroll",n.update,Sl)}),u&&f.removeEventListener("resize",n.update,Sl)}}const Oj={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Aj,data:{}};var zj={left:"right",right:"left",bottom:"top",top:"bottom"};function Wl(e){return e.replace(/left|right|bottom|top/g,function(t){return zj[t]})}var Rj={start:"end",end:"start"};function xg(e){return e.replace(/start|end/g,function(t){return Rj[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 Nj(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 p=Py();(p||!p&&t==="fixed")&&(u=o.offsetLeft,f=o.offsetTop)}return{width:s,height:c,x:u+Ih(e),y:f}}function Fj(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 Dy(e){return["html","body","#document"].indexOf(kr(e))>=0?e.ownerDocument.body:Vn(e)&&Mh(e)?e:Dy(Ec(e))}function La(e,t){var n;t===void 0&&(t=[]);var r=Dy(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 Lj(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 bg(e,t,n){return t===ky?Ef(Nj(e,n)):Qo(t)?Lj(t,n):Ef(Fj(bo(e)))}function Bj(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)&&Iy(o,r)&&kr(o)!=="body"}):[]}function Hj(e,t,n,r){var o=t==="clippingParents"?Bj(e):[].concat(t),s=[].concat(o,[n]),c=s[0],u=s.reduce(function(f,p){var h=bg(e,p,r);return f.top=Yo(h.top,f.top),f.right=ac(h.right,f.right),f.bottom=ac(h.bottom,f.bottom),f.left=Yo(h.left,f.left),f},bg(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 Ay(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 p=o?Eh(o):null;if(p!=null){var h=p==="y"?"height":"width";switch(s){case Gi:f[p]=f[p]-(t[h]/2-n[h]/2);break;case Ka:f[p]=f[p]+(t[h]/2-n[h]/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?sj:u,p=n.rootBoundary,h=p===void 0?ky:p,y=n.elementContext,x=y===void 0?_a:y,S=n.altBoundary,j=S===void 0?!1:S,C=n.padding,w=C===void 0?0:C,k=Ty(typeof w!="number"?w:_y(w,ds)),I=x===_a?lj:_a,P=e.rects.popper,M=e.elements[j?I:x],T=Hj(Qo(M)?M:M.contextElement||bo(e.elements.popper),f,h,c),D=Yi(e.elements.reference),_=Ay({reference:D,element:P,strategy:"absolute",placement:o}),R=Ef(Object.assign({},P,_)),V=x===_a?R:D,F={top:T.top-V.top+k.top,bottom:V.bottom-T.bottom+k.bottom,left:T.left-V.left+k.left,right:V.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 Wj(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,p=f===void 0?Ey:f,h=Ki(r),y=h?u?vg:vg.filter(function(j){return Ki(j)===h}):ds,x=y.filter(function(j){return p.indexOf(j)>=0});x.length===0&&(x=y);var S=x.reduce(function(j,C){return j[C]=Xa(e,{placement:C,boundary:o,rootBoundary:s,padding:c})[Cr(C)],j},{});return Object.keys(S).sort(function(j,C){return S[j]-S[C]})}function Vj(e){if(Cr(e)===wh)return[];var t=Wl(e);return[xg(e),t,xg(t)]}function Uj(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,p=n.padding,h=n.boundary,y=n.rootBoundary,x=n.altBoundary,S=n.flipVariations,j=S===void 0?!0:S,C=n.allowedAutoPlacements,w=t.options.placement,k=Cr(w),I=k===w,P=f||(I||!j?[Wl(w)]:Vj(w)),M=[w].concat(P).reduce(function(he,se){return he.concat(Cr(se)===wh?Wj(t,{placement:se,boundary:h,rootBoundary:y,padding:p,flipVariations:j,allowedAutoPlacements:C}):se)},[]),T=t.rects.reference,D=t.rects.popper,_=new Map,R=!0,V=M[0],F=0;F<M.length;F++){var B=M[F],Q=Cr(B),U=Ki(B)===Gi,X=[Pn,Un].indexOf(Q)>=0,te=X?"width":"height",re=Xa(t,{placement:B,boundary:h,rootBoundary:y,altBoundary:x,padding:p}),$=X?U?$n:In:U?Un:Pn;T[te]>D[te]&&($=Wl($));var Z=Wl($),fe=[];if(s&&fe.push(re[Q]<=0),u&&fe.push(re[$]<=0,re[Z]<=0),fe.every(function(he){return he})){V=B,R=!1;break}_.set(B,fe)}if(R)for(var Se=j?3:1,Me=function(se){var Ne=M.find(function(Ve){var Ue=_.get(Ve);if(Ue)return Ue.slice(0,se).every(function($e){return $e})});if(Ne)return V=Ne,"break"},Ie=Se;Ie>0;Ie--){var Pe=Me(Ie);if(Pe==="break")break}t.placement!==V&&(t.modifiersData[r]._skip=!0,t.placement=V,t.reset=!0)}}const $j={name:"flip",enabled:!0,phase:"main",fn:Uj,requiresIfExists:["offset"],data:{_skip:!1}};function Sg(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 Cg(e){return[Pn,$n,Un,In].some(function(t){return e[t]>=0})}function Gj(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=Sg(c,r),p=Sg(u,o,s),h=Cg(f),y=Cg(p);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:p,isReferenceHidden:h,hasPopperEscaped:y},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":y})}const qj={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Gj};function Yj(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 Kj(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,c=Ey.reduce(function(h,y){return h[y]=Yj(y,t.rects,s),h},{}),u=c[t.placement],f=u.x,p=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=c}const Xj={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Kj};function Qj(e){var t=e.state,n=e.name;t.modifiersData[n]=Ay({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Zj={name:"popperOffsets",enabled:!0,phase:"read",fn:Qj,data:{}};function Jj(e){return e==="x"?"y":"x"}function ek(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,p=n.rootBoundary,h=n.altBoundary,y=n.padding,x=n.tether,S=x===void 0?!0:x,j=n.tetherOffset,C=j===void 0?0:j,w=Xa(t,{boundary:f,rootBoundary:p,padding:y,altBoundary:h}),k=Cr(t.placement),I=Ki(t.placement),P=!I,M=Eh(k),T=Jj(M),D=t.modifiersData.popperOffsets,_=t.rects.reference,R=t.rects.popper,V=typeof C=="function"?C(Object.assign({},t.rects,{placement:t.placement})):C,F=typeof V=="number"?{mainAxis:V,altAxis:V}:Object.assign({mainAxis:0,altAxis:0},V),B=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Q={x:0,y:0};if(D){if(s){var U,X=M==="y"?Pn:In,te=M==="y"?Un:$n,re=M==="y"?"height":"width",$=D[M],Z=$+w[X],fe=$-w[te],Se=S?-R[re]/2:0,Me=I===Gi?_[re]:R[re],Ie=I===Gi?-R[re]:-_[re],Pe=t.elements.arrow,he=S&&Pe?kh(Pe):{width:0,height:0},se=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:My(),Ne=se[X],Ve=se[te],Ue=Fa(0,_[re],he[re]),$e=P?_[re]/2-Se-Ue-Ne-F.mainAxis:Me-Ue-Ne-F.mainAxis,Qe=P?-_[re]/2+Se+Ue+Ve+F.mainAxis:Ie+Ue+Ve+F.mainAxis,me=t.elements.arrow&&fs(t.elements.arrow),De=me?M==="y"?me.clientTop||0:me.clientLeft||0:0,Ge=(U=B==null?void 0:B[M])!=null?U:0,ge=$+$e-Ge-De,Te=$+Qe-Ge,et=Fa(S?ac(Z,ge):Z,$,S?Yo(fe,Te):fe);D[M]=et,Q[M]=et-$}if(u){var Be,vt=M==="x"?Pn:In,Rt=M==="x"?Un:$n,N=D[T],le=T==="y"?"height":"width",ye=N+w[vt],je=N-w[Rt],q=[Pn,In].indexOf(k)!==-1,ie=(Be=B==null?void 0:B[T])!=null?Be:0,Re=q?ye:N-_[le]-R[le]-ie+F.altAxis,Ze=q?N+_[le]+R[le]-ie-F.altAxis:je,J=S&&q?jj(Re,N,Ze):Fa(S?Re:ye,N,S?Ze:je);D[T]=J,Q[T]=J-N}t.modifiersData[r]=Q}}const tk={name:"preventOverflow",enabled:!0,phase:"main",fn:ek,requiresIfExists:["offset"]};function nk(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function rk(e){return e===Gn(e)||!Vn(e)?Ph(e):nk(e)}function ok(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 ik(e,t,n){n===void 0&&(n=!1);var r=Vn(t),o=Vn(t)&&ok(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=rk(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 ak(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 sk(e){var t=ak(e);return yj.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function lk(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function ck(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 wg={placement:"bottom",modifiers:[],strategy:"absolute"};function jg(){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 uk(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?wg:o;return function(u,f,p){p===void 0&&(p=s);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},wg,s),modifiersData:{},elements:{reference:u,popper:f},attributes:{},styles:{}},y=[],x=!1,S={state:h,setOptions:function(k){var I=typeof k=="function"?k(h.options):k;C(),h.options=Object.assign({},s,h.options,I),h.scrollParents={reference:Qo(u)?La(u):u.contextElement?La(u.contextElement):[],popper:La(f)};var P=sk(ck([].concat(r,h.options.modifiers)));return h.orderedModifiers=P.filter(function(M){return M.enabled}),j(),S.update()},forceUpdate:function(){if(!x){var k=h.elements,I=k.reference,P=k.popper;if(jg(I,P)){h.rects={reference:ik(I,fs(P),h.options.strategy==="fixed"),popper:kh(P)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(F){return h.modifiersData[F.name]=Object.assign({},F.data)});for(var M=0;M<h.orderedModifiers.length;M++){if(h.reset===!0){h.reset=!1,M=-1;continue}var T=h.orderedModifiers[M],D=T.fn,_=T.options,R=_===void 0?{}:_,V=T.name;typeof D=="function"&&(h=D({state:h,options:R,name:V,instance:S})||h)}}}},update:lk(function(){return new Promise(function(w){S.forceUpdate(),w(h)})}),destroy:function(){C(),x=!0}};if(!jg(u,f))return S;S.setOptions(p).then(function(w){!x&&p.onFirstUpdate&&p.onFirstUpdate(w)});function j(){h.orderedModifiers.forEach(function(w){var k=w.name,I=w.options,P=I===void 0?{}:I,M=w.effect;if(typeof M=="function"){var T=M({state:h,name:k,instance:S,options:P}),D=function(){};y.push(T||D)}})}function C(){y.forEach(function(w){return w()}),y=[]}return S}}var dk=[Oj,Zj,Dj,Sj,Xj,$j,tk,Ij,qj],fk=uk({defaultModifiers:dk});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:p=!0,boundary:h="clippingParents",preventOverflow:y=!0,matchWidth:x,direction:S="ltr"}=e,j=g.useRef(null),C=g.useRef(null),w=g.useRef(null),k=aj(r,S),I=g.useRef(()=>{}),P=g.useCallback(()=>{var F;!t||!j.current||!C.current||((F=I.current)==null||F.call(I),w.current=fk(j.current,C.current,{placement:k,modifiers:[rj,ej,J6,{...Z6,enabled:!!x},{name:"eventListeners",...Q6(c)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:u??[0,f]}},{name:"flip",enabled:!!p,options:{padding:8}},{name:"preventOverflow",enabled:!!y,options:{boundary:h}},...n??[]],strategy:o}),w.current.forceUpdate(),I.current=w.current.destroy)},[k,t,n,x,c,s,u,f,p,y,h,o]);g.useEffect(()=>()=>{var F;!j.current&&!C.current&&((F=w.current)==null||F.destroy(),w.current=null)},[]);const M=g.useCallback(F=>{j.current=F,P()},[P]),T=g.useCallback((F={},B=null)=>({...F,ref:ct(M,B)}),[M]),D=g.useCallback(F=>{C.current=F,P()},[P]),_=g.useCallback((F={},B=null)=>({...F,ref:ct(D,B),style:{...F.style,position:o,minWidth:x?void 0:"max-content",inset:"0 auto auto 0"}}),[o,D,x]),R=g.useCallback((F={},B=null)=>{const{size:Q,shadowColor:U,bg:X,style:te,...re}=F;return{...re,ref:B,"data-popper-arrow":"",style:hk(F)}},[]),V=g.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:M,popperRef:D,getPopperProps:_,getArrowProps:R,getArrowInnerProps:V,getReferenceProps:T}}function hk(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]=g.useState(e.defaultIsOpen||!1),p=r!==void 0?r:u,h=r!==void 0,y=g.useId(),x=o??`disclosure-${y}`,S=g.useCallback(()=>{h||f(!1),c==null||c()},[h,c]),j=g.useCallback(()=>{h||f(!0),s==null||s()},[h,s]),C=g.useCallback(()=>{p?S():j()},[p,j,S]);function w(I={}){return{...I,"aria-expanded":p,"aria-controls":x,onClick(P){var M;(M=I.onClick)==null||M.call(I,P),C()}}}function k(I={}){return{...I,hidden:!p,id:x}}return{isOpen:p,onOpen:j,onClose:S,onToggle:C,isControlled:h,getButtonProps:w,getDisclosureProps:k}}function pk(e){const{ref:t,handler:n,enabled:r=!0}=e,o=Wt(n),c=g.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;g.useEffect(()=>{if(!r)return;const u=y=>{jd(y,t)&&(c.isPointerDown=!0)},f=y=>{if(c.ignoreEmulatedMouseEvents){c.ignoreEmulatedMouseEvents=!1;return}c.isPointerDown&&n&&jd(y,t)&&(c.isPointerDown=!1,o(y))},p=y=>{c.ignoreEmulatedMouseEvents=!0,n&&c.isPointerDown&&jd(y,t)&&(c.isPointerDown=!1,o(y))},h=Oy(t.current);return h.addEventListener("mousedown",u,!0),h.addEventListener("mouseup",f,!0),h.addEventListener("touchstart",u,!0),h.addEventListener("touchend",p,!0),()=>{h.removeEventListener("mousedown",u,!0),h.removeEventListener("mouseup",f,!0),h.removeEventListener("touchstart",u,!0),h.removeEventListener("touchend",p,!0)}},[n,t,o,c,r])}function jd(e,t){var n;const r=e.target;return e.button>0||r&&!Oy(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function Oy(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function zy(e){const{isOpen:t,ref:n}=e,[r,o]=g.useState(t),[s,c]=g.useState(!1);return g.useEffect(()=>{s||(o(t),c(!0))},[t,s,r]),Go(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var f;const p=y6(n.current),h=new p.CustomEvent("animationend",{bubbles:!0});(f=n.current)==null||f.dispatchEvent(h)}}}function Dh(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[mk,vk,gk,yk]=th(),[xk,hs]=kt({strict:!1,name:"MenuContext"});function bk(e,...t){const n=g.useId(),r=e||n;return g.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function Ry(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function kg(e){return Ry(e).activeElement===e}function Sk(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:c,isOpen:u,defaultIsOpen:f,onClose:p,onOpen:h,placement:y="bottom-start",lazyBehavior:x="unmount",direction:S,computePositionOnMount:j=!1,...C}=e,w=g.useRef(null),k=g.useRef(null),I=gk(),P=g.useCallback(()=>{requestAnimationFrame(()=>{var Pe;(Pe=w.current)==null||Pe.focus({preventScroll:!1})})},[]),M=g.useCallback(()=>{const Pe=setTimeout(()=>{var he;if(o)(he=o.current)==null||he.focus();else{const se=I.firstEnabled();se&&U(se.index)}});Z.current.add(Pe)},[I,o]),T=g.useCallback(()=>{const Pe=setTimeout(()=>{const he=I.lastEnabled();he&&U(he.index)});Z.current.add(Pe)},[I]),D=g.useCallback(()=>{h==null||h(),s?M():P()},[s,M,P,h]),{isOpen:_,onOpen:R,onClose:V,onToggle:F}=_h({isOpen:u,defaultIsOpen:f,onClose:p,onOpen:D});pk({enabled:_&&r,ref:w,handler:Pe=>{var he;(he=k.current)!=null&&he.contains(Pe.target)||V()}});const B=Th({...C,enabled:_||j,placement:y,direction:S}),[Q,U]=g.useState(-1);ti(()=>{_||U(-1)},[_]),jy(w,{focusRef:k,visible:_,shouldFocus:!0});const X=zy({isOpen:_,ref:w}),[te,re]=bk(t,"menu-button","menu-list"),$=g.useCallback(()=>{R(),P()},[R,P]),Z=g.useRef(new Set([]));Ik(()=>{Z.current.forEach(Pe=>clearTimeout(Pe)),Z.current.clear()});const fe=g.useCallback(()=>{R(),M()},[M,R]),Se=g.useCallback(()=>{R(),T()},[R,T]),Me=g.useCallback(()=>{var Pe,he;const se=Ry(w.current),Ne=(Pe=w.current)==null?void 0:Pe.contains(se.activeElement);if(!(_&&!Ne))return;const Ue=(he=I.item(Q))==null?void 0:he.node;Ue==null||Ue.focus()},[_,Q,I]),Ie=g.useRef(null);return{openAndFocusMenu:$,openAndFocusFirstItem:fe,openAndFocusLastItem:Se,onTransitionEnd:Me,unstable__animationState:X,descendants:I,popper:B,buttonId:te,menuId:re,forceUpdate:B.forceUpdate,orientation:"vertical",isOpen:_,onToggle:F,onOpen:R,onClose:V,menuRef:w,buttonRef:k,focusedIndex:Q,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:U,isLazy:c,lazyBehavior:x,initialFocusRef:o,rafId:Ie}}function Ck(e={},t=null){const n=hs(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:c}=n,u=g.useCallback(f=>{const p=f.key,y={Enter:s,ArrowDown:s,ArrowUp:c}[p];y&&(f.preventDefault(),f.stopPropagation(),y(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 Ek(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function wk(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:p,lazyBehavior:h,unstable__animationState:y}=n,x=vk(),S=H6({preventDefault:k=>k.key!==" "&&Pf(k.target)}),j=g.useCallback(k=>{const I=k.key,M={Tab:D=>D.preventDefault(),Escape:u,ArrowDown:()=>{const D=x.nextEnabled(r);D&&o(D.index)},ArrowUp:()=>{const D=x.prevEnabled(r);D&&o(D.index)}}[I];if(M){k.preventDefault(),M(k);return}const T=S(D=>{const _=W6(x.values(),D,R=>{var V,F;return(F=(V=R==null?void 0:R.node)==null?void 0:V.textContent)!=null?F:""},x.item(r));if(_){const R=x.indexOf(_.node);o(R)}});Pf(k.target)&&T(k)},[x,r,S,u,o]),C=g.useRef(!1);c&&(C.current=!0);const w=Dh({wasSelected:C.current,enabled:p,mode:h,isSelected:y.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,j)}}function jk(e={}){const{popper:t,isOpen:n}=hs();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function kk(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:c,isDisabled:u,isFocusable:f,closeOnSelect:p,type:h,...y}=e,x=hs(),{setFocusedIndex:S,focusedIndex:j,closeOnSelect:C,onClose:w,menuRef:k,isOpen:I,menuId:P,rafId:M}=x,T=g.useRef(null),D=`${P}-menuitem-${g.useId()}`,{index:_,register:R}=yk({disabled:u&&!f}),V=g.useCallback($=>{n==null||n($),!u&&S(_)},[S,_,u,n]),F=g.useCallback($=>{r==null||r($),T.current&&!kg(T.current)&&V($)},[V,r]),B=g.useCallback($=>{o==null||o($),!u&&S(-1)},[S,u,o]),Q=g.useCallback($=>{s==null||s($),Pf($.currentTarget)&&(p??C)&&w()},[w,s,C,p]),U=g.useCallback($=>{c==null||c($),S(_)},[S,c,_]),X=_===j,te=u&&!f;ti(()=>{I&&(X&&!te&&T.current?(M.current&&cancelAnimationFrame(M.current),M.current=requestAnimationFrame(()=>{var $;($=T.current)==null||$.focus(),M.current=null})):k.current&&!kg(k.current)&&k.current.focus())},[X,te,k,I]);const re=wy({onClick:Q,onFocus:U,onMouseEnter:V,onMouseMove:F,onMouseLeave:B,ref:ct(R,T,t),isDisabled:u,isFocusable:f});return{...y,...re,type:h??re.type,id:D,role:"menuitem",tabIndex:X?0:-1}}function Ek(e){var t;if(!Pk(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function Pk(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Ik(e,t=[]){return g.useEffect(()=>()=>e(),t)}var[Mk,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}=Sk({...r,direction:o}),u=g.useMemo(()=>c,[c]),{isOpen:f,onClose:p,forceUpdate:h}=u;return l.jsx(mk,{value:s,children:l.jsx(xk,{value:u,children:l.jsx(Mk,{value:n,children:b1(t,{isOpen:f,onClose:p,forceUpdate:h})})})})};Ah.displayName="Menu";var Ny=ue((e,t)=>{const n=Pc();return l.jsx(ne.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});Ny.displayName="MenuCommand";var Tk=ue((e,t)=>{const{type:n,...r}=e,o=Pc(),s=r.as||n?n??void 0:"button",c=g.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})}),Fy=e=>{const{className:t,children:n,...r}=e,o=g.Children.only(n),s=g.isValidElement(o)?g.cloneElement(o,{focusable:"false","aria-hidden":!0,className:ze("chakra-menu__icon",o.props.className)}):null,c=ze("chakra-menu__icon-wrapper",t);return l.jsx(ne.span,{className:c,...r,__css:{flexShrink:0},children:s})};Fy.displayName="MenuIcon";var gr=ue((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:c,...u}=e,f=kk(u,t),h=n||o?l.jsx("span",{style:{pointerEvents:"none",flex:1},children:c}):c;return l.jsxs(Tk,{...f,className:ze("chakra-menu__menuitem",f.className),children:[n&&l.jsx(Fy,{fontSize:"0.8em",marginEnd:r,children:n}),h,o&&l.jsx(Ny,{marginStart:s,children:o})]})});gr.displayName="MenuItem";var _k={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"}}},Dk=ne(ar.div),Oh=ue(function(t,n){var r,o;const{rootProps:s,motionProps:c,...u}=t,{isOpen:f,onTransitionEnd:p,unstable__animationState:h}=hs(),y=wk(u,n),x=jk(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(Dk,{variants:_k,initial:!1,animate:f?"enter":"exit",__css:{outline:0,...S.list},...c,className:ze("chakra-menu__menu-list",y.className),...y,onUpdate:p,onAnimationComplete:xc(h.onComplete,y.onAnimationComplete)})})});Oh.displayName="MenuList";var Ak=ue((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=ue((e,t)=>{const{children:n,as:r,...o}=e,s=Ck(o,t),c=r||Ak;return l.jsx(c,{...s,className:ze("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 Ok={slideInBottom:{...pf,custom:{offsetY:16,reverse:!0}},slideInRight:{...pf,custom:{offsetX:16,reverse:!0}},scale:{...x2,custom:{initialScale:.95,reverse:!0}},none:{}},zk=ne(ar.section),Rk=e=>Ok[e||"none"],Ly=g.forwardRef((e,t)=>{const{preset:n,motionProps:r=Rk(n),...o}=e;return l.jsx(zk,{ref:t,...r,...o})});Ly.displayName="ModalTransition";var Nk=Object.defineProperty,Fk=(e,t,n)=>t in e?Nk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lk=(e,t,n)=>(Fk(e,typeof t!="symbol"?t+"":t,n),n),Bk=class{constructor(){Lk(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 Bk;function By(e,t){const[n,r]=g.useState(0);return g.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 Hk=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,Hy=function(e){return e&&(e.host||Hy(e.parentNode))},Wk=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Hy(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)})},Vk=function(e,t,n,r){var o=Wk(t,Array.isArray(e)?e:[e]);wl[n]||(wl[n]=new WeakMap);var s=wl[n],c=[],u=new Set,f=new Set(o),p=function(y){!y||u.has(y)||(u.add(y),p(y.parentNode))};o.forEach(p);var h=function(y){!y||f.has(y)||Array.prototype.forEach.call(y.children,function(x){if(u.has(x))h(x);else{var S=x.getAttribute(r),j=S!==null&&S!=="false",C=(ki.get(x)||0)+1,w=(s.get(x)||0)+1;ki.set(x,C),s.set(x,w),c.push(x),C===1&&j&&Cl.set(x,!0),w===1&&x.setAttribute(n,"true"),j||x.setAttribute(r,"true")}})};return h(t),u.clear(),kd++,function(){c.forEach(function(y){var x=ki.get(y)-1,S=s.get(y)-1;ki.set(y,x),s.set(y,S),x||(Cl.has(y)||y.removeAttribute(r),Cl.delete(y)),S||y.removeAttribute(n)}),kd--,kd||(ki=new WeakMap,ki=new WeakMap,Cl=new WeakMap,wl={})}},Uk=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Hk(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Vk(r,o,n,"aria-hidden")):function(){return null}};function $k(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:c=!0,onOverlayClick:u,onEsc:f}=e,p=g.useRef(null),h=g.useRef(null),[y,x,S]=qk(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Gk(p,t&&c),By(p,t);const j=g.useRef(null),C=g.useCallback(R=>{j.current=R.target},[]),w=g.useCallback(R=>{R.key==="Escape"&&(R.stopPropagation(),s&&(n==null||n()),f==null||f())},[s,n,f]),[k,I]=g.useState(!1),[P,M]=g.useState(!1),T=g.useCallback((R={},V=null)=>({role:"dialog",...R,ref:ct(V,p),id:y,tabIndex:-1,"aria-modal":!0,"aria-labelledby":k?x:void 0,"aria-describedby":P?S:void 0,onClick:Ee(R.onClick,F=>F.stopPropagation())}),[S,P,y,x,k]),D=g.useCallback(R=>{R.stopPropagation(),j.current===R.target&&If.isTopModal(p.current)&&(o&&(n==null||n()),u==null||u())},[n,o,u]),_=g.useCallback((R={},V=null)=>({...R,ref:ct(V,h),onClick:Ee(R.onClick,D),onKeyDown:Ee(R.onKeyDown,w),onMouseDown:Ee(R.onMouseDown,C)}),[w,C,D]);return{isOpen:t,onClose:n,headerId:x,bodyId:S,setBodyMounted:M,setHeaderMounted:I,dialogRef:p,overlayRef:h,getDialogProps:T,getDialogContainerProps:_}}function Gk(e,t){const n=e.current;g.useEffect(()=>{if(!(!e.current||!t))return Uk(e.current)},[t,e,n])}function qk(e,...t){const n=g.useId(),r=e||n;return g.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[Yk,ia]=kt({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[Kk,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:p,allowPinchZoom:h,preserveScrollBarGap:y,motionPreset:x,lockFocusAcrossFrames:S,onCloseComplete:j}=t,C=un("Modal",t),k={...$k(t),autoFocus:o,trapFocus:s,initialFocusRef:c,finalFocusRef:u,returnFocusOnClose:f,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:y,motionPreset:x,lockFocusAcrossFrames:S};return l.jsx(Kk,{value:k,children:l.jsx(Yk,{value:C,children:l.jsx(xo,{onExitComplete:j,children:k.isOpen&&l.jsx($a,{...n,children:r})})})})};mo.displayName="Modal";var Vl="right-scroll-bar-position",Ul="width-before-scroll-bar",Xk="with-scroll-bars-hidden",Qk="--removed-body-scroll-bar-size",Wy=R2(),Ed=function(){},Ic=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:Ed,onWheelCapture:Ed,onTouchMoveCapture:Ed}),o=r[0],s=r[1],c=e.forwardProps,u=e.children,f=e.className,p=e.removeScrollBar,h=e.enabled,y=e.shards,x=e.sideCar,S=e.noIsolation,j=e.inert,C=e.allowPinchZoom,w=e.as,k=w===void 0?"div":w,I=A2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),P=x,M=D2([n,t]),T=xr(xr({},I),o);return g.createElement(g.Fragment,null,h&&g.createElement(P,{sideCar:Wy,removeScrollBar:p,shards:y,noIsolation:S,inert:j,setCallbacks:s,allowPinchZoom:!!C,lockRef:n}),c?g.cloneElement(g.Children.only(u),xr(xr({},T),{ref:M})):g.createElement(k,xr({},T,{className:f,ref:M}),u))});Ic.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ic.classNames={fullWidth:Ul,zeroRight:Vl};var Eg,Zk=function(){if(Eg)return Eg;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Jk(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Zk();return t&&e.setAttribute("nonce",t),e}function e7(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function t7(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var n7=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Jk())&&(e7(t,n),t7(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},r7=function(){var e=n7();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Vy=function(){var e=r7(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},o7={left:0,top:0,right:0,gap:0},Pd=function(e){return parseInt(e||"",10)||0},i7=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)]},a7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return o7;var t=i7(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])}},s7=Vy(),l7=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(Xk,` {
|
||
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;
|
||
}
|
||
`)},c7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=g.useMemo(function(){return a7(o)},[o]);return g.createElement(s7,{styles:l7(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,u7=function(e){return e.tagName==="TEXTAREA"},Uy=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!u7(e)&&n[t]==="visible")},d7=function(e){return Uy(e,"overflowY")},f7=function(e){return Uy(e,"overflowX")},Pg=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=$y(e,n);if(r){var o=Gy(e,n),s=o[1],c=o[2];if(s>c)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},h7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},p7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},$y=function(e,t){return e==="v"?d7(t):f7(t)},Gy=function(e,t){return e==="v"?h7(t):p7(t)},m7=function(e,t){return e==="h"&&t==="rtl"?-1:1},v7=function(e,t,n,r,o){var s=m7(e,window.getComputedStyle(t).direction),c=s*r,u=n.target,f=t.contains(u),p=!1,h=c>0,y=0,x=0;do{var S=Gy(e,u),j=S[0],C=S[1],w=S[2],k=C-w-s*j;(j||k)&&$y(e,u)&&(y+=k,x+=j),u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(h&&(o&&y===0||!o&&c>y)||!h&&(o&&x===0||!o&&-c>x))&&(p=!0),p},kl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ig=function(e){return[e.deltaX,e.deltaY]},Mg=function(e){return e&&"current"in e?e.current:e},g7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},y7=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},x7=0,Pi=[];function b7(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(x7++)[0],s=g.useState(function(){return Vy()})[0],c=g.useRef(e);g.useEffect(function(){c.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var C=Sf([e.lockRef.current],(e.shards||[]).map(Mg),!0).filter(Boolean);return C.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),C.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=g.useCallback(function(C,w){if("touches"in C&&C.touches.length===2)return!c.current.allowPinchZoom;var k=kl(C),I=n.current,P="deltaX"in C?C.deltaX:I[0]-k[0],M="deltaY"in C?C.deltaY:I[1]-k[1],T,D=C.target,_=Math.abs(P)>Math.abs(M)?"h":"v";if("touches"in C&&_==="h"&&D.type==="range")return!1;var R=Pg(_,D);if(!R)return!0;if(R?T=_:(T=_==="v"?"h":"v",R=Pg(_,D)),!R)return!1;if(!r.current&&"changedTouches"in C&&(P||M)&&(r.current=T),!T)return!0;var V=r.current||T;return v7(V,w,C,V==="h"?P:M,!0)},[]),f=g.useCallback(function(C){var w=C;if(!(!Pi.length||Pi[Pi.length-1]!==s)){var k="deltaY"in w?Ig(w):kl(w),I=t.current.filter(function(T){return T.name===w.type&&T.target===w.target&&g7(T.delta,k)})[0];if(I&&I.should){w.cancelable&&w.preventDefault();return}if(!I){var P=(c.current.shards||[]).map(Mg).filter(Boolean).filter(function(T){return T.contains(w.target)}),M=P.length>0?u(w,P[0]):!c.current.noIsolation;M&&w.cancelable&&w.preventDefault()}}},[]),p=g.useCallback(function(C,w,k,I){var P={name:C,delta:w,target:k,should:I};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(M){return M!==P})},1)},[]),h=g.useCallback(function(C){n.current=kl(C),r.current=void 0},[]),y=g.useCallback(function(C){p(C.type,Ig(C),C.target,u(C,e.lockRef.current))},[]),x=g.useCallback(function(C){p(C.type,kl(C),C.target,u(C,e.lockRef.current))},[]);g.useEffect(function(){return Pi.push(s),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Ei),document.addEventListener("touchmove",f,Ei),document.addEventListener("touchstart",h,Ei),function(){Pi=Pi.filter(function(C){return C!==s}),document.removeEventListener("wheel",f,Ei),document.removeEventListener("touchmove",f,Ei),document.removeEventListener("touchstart",h,Ei)}},[]);var S=e.removeScrollBar,j=e.inert;return g.createElement(g.Fragment,null,j?g.createElement(s,{styles:y7(o)}):null,S?g.createElement(c7,{gapMode:"margin"}):null)}const S7=S5(Wy,b7);var qy=g.forwardRef(function(e,t){return g.createElement(Ic,xr({},e,{ref:t,sideCar:S7}))});qy.classNames=Ic.classNames;const C7=qy;function w7(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:c,finalFocusRef:u,returnFocusOnClose:f,preserveScrollBarGap:p,lockFocusAcrossFrames:h,isOpen:y}=Zo(),[x,S]=PC();g.useEffect(()=>{!x&&S&&setTimeout(S)},[x,S]);const j=By(r,y);return l.jsx(py,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:u,restoreFocus:f,contentRef:r,lockFocusAcrossFrames:h,children:l.jsx(C7,{removeScrollBar:!p,allowPinchZoom:c,enabled:j===1&&s,forwardProps:!0,children:e.children})})}var vo=ue((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...c}=e,{getDialogProps:u,getDialogContainerProps:f}=Zo(),p=u(c,t),h=f(o),y=ze("chakra-modal__content",n),x=ia(),S={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...x.dialog},j={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...x.dialogContainer},{motionPreset:C}=Zo();return l.jsx(w7,{children:l.jsx(ne.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:j,children:l.jsx(Ly,{preset:C,motionProps:s,className:y,...p,__css:S,children:r})})})});vo.displayName="ModalContent";function Yy(e){const{leastDestructiveRef:t,...n}=e;return l.jsx(mo,{...n,initialFocusRef:t})}var Ky=ue((e,t)=>l.jsx(vo,{ref:t,role:"alertdialog",...e})),Lr=ue((e,t)=>{const{className:n,...r}=e,o=ze("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=ue((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Zo();g.useEffect(()=>(s(!0),()=>s(!1)),[s]);const c=ze("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 j7=ne(ar.div),Hr=ue((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,c=ze("chakra-modal__overlay",n),f={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...ia().overlay},{motionPreset:p}=Zo(),y=o||(p==="none"?{}:y2);return l.jsx(j7,{...y,__css:f,ref:t,className:c,...s})});Hr.displayName="ModalOverlay";var Wr=ue((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Zo();g.useEffect(()=>(s(!0),()=>s(!1)),[s]);const c=ze("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=ue((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Zo(),c=ze("chakra-modal__close-btn",r),u=ia();return l.jsx(IC,{ref:t,__css:u.closeButton,className:c,onClick:Ee(n,f=>{f.stopPropagation(),s()}),...o})});aa.displayName="ModalCloseButton";var k7=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"})}),E7=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 Tg(e,t,n,r){g.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 p of f)p.type==="attributes"&&p.attributeName&&c.includes(p.attributeName)&&n(p)});return u.observe(e.current,{attributes:!0,attributeFilter:c}),()=>u.disconnect()})}function P7(e,t){const n=Wt(e);g.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var I7=50,_g=300;function M7(e,t){const[n,r]=g.useState(!1),[o,s]=g.useState(null),[c,u]=g.useState(!0),f=g.useRef(null),p=()=>clearTimeout(f.current);P7(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?I7:null);const h=g.useCallback(()=>{c&&e(),f.current=setTimeout(()=>{u(!1),r(!0),s("increment")},_g)},[e,c]),y=g.useCallback(()=>{c&&t(),f.current=setTimeout(()=>{u(!1),r(!0),s("decrement")},_g)},[t,c]),x=g.useCallback(()=>{u(!0),r(!1),p()},[]);return g.useEffect(()=>()=>p(),[]),{up:h,down:y,stop:x,isSpinning:n}}var T7=/^[Ee0-9+\-.]$/;function _7(e){return T7.test(e)}function D7(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 A7(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:p,isInvalid:h,pattern:y="[0-9]*(.[0-9]+)?",inputMode:x="decimal",allowMouseWheel:S,id:j,onChange:C,precision:w,name:k,"aria-describedby":I,"aria-label":P,"aria-labelledby":M,onFocus:T,onBlur:D,onInvalid:_,getAriaValueText:R,isValidCharacter:V,format:F,parse:B,...Q}=e,U=Wt(T),X=Wt(D),te=Wt(_),re=Wt(V??_7),$=Wt(R),Z=r5(e),{update:fe,increment:Se,decrement:Me}=Z,[Ie,Pe]=g.useState(!1),he=!(u||f),se=g.useRef(null),Ne=g.useRef(null),Ve=g.useRef(null),Ue=g.useRef(null),$e=g.useCallback(J=>J.split("").filter(re).join(""),[re]),Qe=g.useCallback(J=>{var Le;return(Le=B==null?void 0:B(J))!=null?Le:J},[B]),me=g.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",me(Z.value),Z.valueAsNumber))},[Z.valueAsNumber,Z.value,me,te]),Hi(()=>{if(!se.current)return;if(se.current.value!=Z.value){const Le=Qe(se.current.value);Z.setValue($e(Le))}},[Qe,$e]);const De=g.useCallback((J=c)=>{he&&Se(J)},[Se,he,c]),Ge=g.useCallback((J=c)=>{he&&Me(J)},[Me,he,c]),ge=M7(De,Ge);Tg(Ve,"disabled",ge.stop,ge.isSpinning),Tg(Ue,"disabled",ge.stop,ge.isSpinning);const Te=g.useCallback(J=>{if(J.nativeEvent.isComposing)return;const nt=Qe(J.currentTarget.value);fe($e(nt)),Ne.current={start:J.currentTarget.selectionStart,end:J.currentTarget.selectionEnd}},[fe,$e,Qe]),et=g.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=g.useCallback(J=>{if(J.nativeEvent.isComposing)return;D7(J,re)||J.preventDefault();const Le=vt(J)*c,nt=J.key,de={ArrowUp:()=>De(Le),ArrowDown:()=>Ge(Le),Home:()=>fe(o),End:()=>fe(s)}[nt];de&&(J.preventDefault(),de(J))},[re,c,De,Ge,fe,o,s]),vt=J=>{let Le=1;return(J.metaKey||J.ctrlKey)&&(Le=.1),J.shiftKey&&(Le=10),Le},Rt=g.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=g.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]),le=g.useCallback(()=>{Pe(!1),n&&N()},[n,Pe,N]),ye=g.useCallback(()=>{t&&requestAnimationFrame(()=>{var J;(J=se.current)==null||J.focus()})},[t]),je=g.useCallback(J=>{J.preventDefault(),ge.up(),ye()},[ye,ge]),q=g.useCallback(J=>{J.preventDefault(),ge.down(),ye()},[ye,ge]);Go(()=>se.current,"wheel",J=>{var Le,nt;const de=((nt=(Le=se.current)==null?void 0:Le.ownerDocument)!=null?nt:document).activeElement===se.current;if(!S||!de)return;J.preventDefault();const Ae=vt(J)*c,dn=Math.sign(J.deltaY);dn===-1?De(Ae):dn===1&&Ge(Ae)},{passive:!1});const ie=g.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,ge.stop),onPointerUp:Ee(J.onPointerUp,ge.stop),disabled:nt,"aria-disabled":Nr(nt)}},[Z.isAtMax,r,je,ge.stop,f]),Re=g.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,ge.stop),onPointerUp:Ee(J.onPointerUp,ge.stop),disabled:nt,"aria-disabled":Nr(nt)}},[Z.isAtMin,r,q,ge.stop,f]),Ze=g.useCallback((J={},Le=null)=>{var nt,Nt,de,Ae;return{name:k,inputMode:x,type:"text",pattern:y,"aria-labelledby":M,"aria-label":P,"aria-describedby":I,id:j,disabled:f,...J,readOnly:(nt=J.readOnly)!=null?nt:u,"aria-readonly":(Nt=J.readOnly)!=null?Nt:u,"aria-required":(de=J.required)!=null?de:p,required:(Ae=J.required)!=null?Ae:p,ref:ct(se,Le),value:me(Z.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(Z.valueAsNumber)?void 0:Z.valueAsNumber,"aria-invalid":Nr(h??Z.isOutOfRange),"aria-valuetext":Rt,autoComplete:"off",autoCorrect:"off",onChange:Ee(J.onChange,Te),onKeyDown:Ee(J.onKeyDown,Be),onFocus:Ee(J.onFocus,et,()=>Pe(!0)),onBlur:Ee(J.onBlur,X,le)}},[k,x,y,M,P,me,I,j,f,p,u,h,Z.value,Z.valueAsNumber,Z.isOutOfRange,o,s,Rt,Te,Be,et,X,le]);return{value:me(Z.value),valueAsNumber:Z.valueAsNumber,isFocused:Ie,isDisabled:f,isReadOnly:u,getIncrementButtonProps:ie,getDecrementButtonProps:Re,getInputProps:Ze,htmlProps:Q}}var[O7,Mc]=kt({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[z7,Rh]=kt({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Nh=ue(function(t,n){const r=un("NumberInput",t),o=At(t),s=lh(o),{htmlProps:c,...u}=A7(s),f=g.useMemo(()=>u,[u]);return l.jsx(z7,{value:f,children:l.jsx(O7,{value:r,children:l.jsx(ne.div,{...c,ref:n,className:ze("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Nh.displayName="NumberInput";var Fh=ue(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=ue(function(t,n){const{getInputProps:r}=Rh(),o=r(t,n),s=Mc();return l.jsx(ne.input,{...o,className:ze("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Lh.displayName="NumberInputField";var Xy=ne("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Bh=ue(function(t,n){var r;const o=Mc(),{getDecrementButtonProps:s}=Rh(),c=s(t,n);return l.jsx(Xy,{...c,__css:o.stepper,children:(r=t.children)!=null?r:l.jsx(k7,{})})});Bh.displayName="NumberDecrementStepper";var Hh=ue(function(t,n){var r;const{getIncrementButtonProps:o}=Rh(),s=o(t,n),c=Mc();return l.jsx(Xy,{...s,__css:c.stepper,children:(r=t.children)!=null?r:l.jsx(E7,{})})});Hh.displayName="NumberIncrementStepper";var[R7,ps]=kt({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[N7,Wh]=kt({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Vh(e){const t=g.Children.only(e.children),{getTriggerProps:n}=ps();return g.cloneElement(t,n(t.props,t.ref))}Vh.displayName="PopoverTrigger";var Ii={click:"click",hover:"hover"};function F7(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:c=!0,arrowSize:u,arrowShadowColor:f,trigger:p=Ii.click,openDelay:h=200,closeDelay:y=200,isLazy:x,lazyBehavior:S="unmount",computePositionOnMount:j,...C}=e,{isOpen:w,onClose:k,onOpen:I,onToggle:P}=_h(e),M=g.useRef(null),T=g.useRef(null),D=g.useRef(null),_=g.useRef(!1),R=g.useRef(!1);w&&(R.current=!0);const[V,F]=g.useState(!1),[B,Q]=g.useState(!1),U=g.useId(),X=o??U,[te,re,$,Z]=["popover-trigger","popover-content","popover-header","popover-body"].map(Te=>`${Te}-${X}`),{referenceRef:fe,getArrowProps:Se,getPopperProps:Me,getArrowInnerProps:Ie,forceUpdate:Pe}=Th({...C,enabled:w||!!j}),he=zy({isOpen:w,ref:D});u5({enabled:w,ref:T}),jy(D,{focusRef:T,visible:w,shouldFocus:s&&p===Ii.click}),G6(D,{focusRef:r,visible:w,shouldFocus:c&&p===Ii.click});const se=Dh({wasSelected:R.current,enabled:x,mode:S,isSelected:he.present}),Ne=g.useCallback((Te={},et=null)=>{const Be={...Te,style:{...Te.style,transformOrigin:Ht.transformOrigin.varRef,[Ht.arrowSize.var]:u?`${u}px`:void 0,[Ht.arrowShadowColor.var]:f},ref:ct(D,et),children:se?Te.children:null,id:re,tabIndex:-1,role:"dialog",onKeyDown:Ee(Te.onKeyDown,vt=>{n&&vt.key==="Escape"&&k()}),onBlur:Ee(Te.onBlur,vt=>{const Rt=Dg(vt),N=Id(D.current,Rt),le=Id(T.current,Rt);w&&t&&(!N&&!le)&&k()}),"aria-labelledby":V?$:void 0,"aria-describedby":B?Z:void 0};return p===Ii.hover&&(Be.role="tooltip",Be.onMouseEnter=Ee(Te.onMouseEnter,()=>{_.current=!0}),Be.onMouseLeave=Ee(Te.onMouseLeave,vt=>{vt.nativeEvent.relatedTarget!==null&&(_.current=!1,setTimeout(()=>k(),y))})),Be},[se,re,V,$,B,Z,p,n,k,w,t,y,f,u]),Ve=g.useCallback((Te={},et=null)=>Me({...Te,style:{visibility:w?"visible":"hidden",...Te.style}},et),[w,Me]),Ue=g.useCallback((Te,et=null)=>({...Te,ref:ct(et,M,fe)}),[M,fe]),$e=g.useRef(),Qe=g.useRef(),me=g.useCallback(Te=>{M.current==null&&fe(Te)},[fe]),De=g.useCallback((Te={},et=null)=>{const Be={...Te,ref:ct(T,et,me),id:te,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":re};return p===Ii.click&&(Be.onClick=Ee(Te.onClick,P)),p===Ii.hover&&(Be.onFocus=Ee(Te.onFocus,()=>{$e.current===void 0&&I()}),Be.onBlur=Ee(Te.onBlur,vt=>{const Rt=Dg(vt),N=!Id(D.current,Rt);w&&t&&N&&k()}),Be.onKeyDown=Ee(Te.onKeyDown,vt=>{vt.key==="Escape"&&k()}),Be.onMouseEnter=Ee(Te.onMouseEnter,()=>{_.current=!0,$e.current=window.setTimeout(()=>I(),h)}),Be.onMouseLeave=Ee(Te.onMouseLeave,()=>{_.current=!1,$e.current&&(clearTimeout($e.current),$e.current=void 0),Qe.current=window.setTimeout(()=>{_.current===!1&&k()},y)})),Be},[te,w,re,p,me,P,I,t,k,h,y]);g.useEffect(()=>()=>{$e.current&&clearTimeout($e.current),Qe.current&&clearTimeout(Qe.current)},[]);const Ge=g.useCallback((Te={},et=null)=>({...Te,id:$,ref:ct(et,Be=>{F(!!Be)})}),[$]),ge=g.useCallback((Te={},et=null)=>({...Te,id:Z,ref:ct(et,Be=>{Q(!!Be)})}),[Z]);return{forceUpdate:Pe,isOpen:w,onAnimationComplete:he.onComplete,onClose:k,getAnchorProps:Ue,getArrowProps:Se,getArrowInnerProps:Ie,getPopoverPositionerProps:Ve,getPopoverProps:Ne,getTriggerProps:De,getHeaderProps:Ge,getBodyProps:ge}}function Id(e,t){return e===t||(e==null?void 0:e.contains(t))}function Dg(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=F7({...r,direction:o.direction});return l.jsx(R7,{value:s,children:l.jsx(N7,{value:t,children:b1(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(),p=Wh(),h=(t=n??r)!=null?t:o,y=s??c;return l.jsx(ne.div,{...u(),className:"chakra-popover__arrow-positioner",children:l.jsx(ne.div,{className:ze("chakra-popover__arrow",e.className),...f(e),__css:{"--popper-arrow-bg":h?`colors.${h}, ${h}`:void 0,"--popper-arrow-shadow":y?`shadows.${y}, ${y}`:void 0,...p.arrow}})})}$h.displayName="PopoverArrow";var Qy=ue(function(t,n){const{getBodyProps:r}=ps(),o=Wh();return l.jsx(ne.div,{...r(t,n),className:ze("chakra-popover__body",t.className),__css:o.body})});Qy.displayName="PopoverBody";function L7(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var B7={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]}}},H7=ne(ar.section),Zy=ue(function(t,n){const{variants:r=B7,...o}=t,{isOpen:s}=ps();return l.jsx(H7,{ref:n,variants:L7(r),initial:!1,animate:s?"enter":"exit",...o})});Zy.displayName="PopoverTransition";var Gh=ue(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:c,getPopoverPositionerProps:u,onAnimationComplete:f}=ps(),p=Wh(),h={position:"relative",display:"flex",flexDirection:"column",...p.content};return l.jsx(ne.div,{...u(r),__css:p.popper,className:"chakra-popover__popper",children:l.jsx(Zy,{...o,...c(s,n),onAnimationComplete:xc(f,s.onAnimationComplete),className:ze("chakra-popover__content",t.className),__css:h})})});Gh.displayName="PopoverContent";function W7(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 V7=ei({"0%":{left:"-40%"},"100%":{left:"100%"}}),U7=ei({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function $7(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:c,role:u="progressbar"}=e,f=W7(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[G7,q7]=kt({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),Y7=ue((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:c,...u}=e,f=$7({value:o,min:n,max:r,isIndeterminate:s,role:c}),h={height:"100%",...q7().filledTrack};return l.jsx(ne.div,{ref:t,style:{width:`${f.percent}%`,...u.style},...f.bind,...u,__css:h})}),Jy=ue((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:c,isAnimated:u,children:f,borderRadius:p,isIndeterminate:h,"aria-label":y,"aria-labelledby":x,"aria-valuetext":S,title:j,role:C,...w}=At(e),k=un("Progress",e),I=p??((n=k.track)==null?void 0:n.borderRadius),P={animation:`${U7} 1s linear infinite`},D={...!h&&c&&u&&P,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${V7} 1s ease infinite normal none running`}},_={overflow:"hidden",position:"relative",...k.track};return l.jsx(ne.div,{ref:t,borderRadius:I,__css:_,...w,children:l.jsxs(G7,{value:k,children:[l.jsx(Y7,{"aria-label":y,"aria-labelledby":x,"aria-valuetext":S,min:o,max:s,value:r,isIndeterminate:h,css:D,borderRadius:I,title:j,role:C}),f]})})});Jy.displayName="Progress";function K7(e){return e&&Qd(e)&&Qd(e.target)}function X7(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:c,isNative:u,...f}=e,[p,h]=g.useState(r||""),y=typeof n<"u",x=y?n:p,S=g.useRef(null),j=g.useCallback(()=>{const T=S.current;if(!T)return;let D="input:not(:disabled):checked";const _=T.querySelector(D);if(_){_.focus();return}D="input:not(:disabled)";const R=T.querySelector(D);R==null||R.focus()},[]),w=`radio-${g.useId()}`,k=o||w,I=g.useCallback(T=>{const D=K7(T)?T.target.value:T;y||h(D),t==null||t(String(D))},[t,y]),P=g.useCallback((T={},D=null)=>({...T,ref:ct(D,S),role:"radiogroup"}),[]),M=g.useCallback((T={},D=null)=>({...T,ref:D,name:k,[u?"checked":"isChecked"]:x!=null?T.value===x:void 0,onChange(R){I(R)},"data-radiogroup":!0}),[u,k,I,x]);return{getRootProps:P,getRadioProps:M,name:k,ref:S,focus:j,setValue:h,value:x,onChange:I,isDisabled:s,isFocusable:c,htmlProps:f}}var[Q7,ex]=kt({name:"RadioGroupContext",strict:!1}),Qa=ue((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:c,isDisabled:u,isFocusable:f,...p}=e,{value:h,onChange:y,getRootProps:x,name:S,htmlProps:j}=X7(p),C=g.useMemo(()=>({name:S,size:r,onChange:y,colorScheme:n,value:h,variant:o,isDisabled:u,isFocusable:f}),[S,r,y,n,h,o,u,f]);return l.jsx(Q7,{value:C,children:l.jsx(ne.div,{...x(j,t),className:ze("chakra-radio-group",c),children:s})})});Qa.displayName="RadioGroup";var Z7={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function J7(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:c,onChange:u,isInvalid:f,name:p,value:h,id:y,"data-radiogroup":x,"aria-describedby":S,...j}=e,C=`radio-${g.useId()}`,w=ri(),I=!!ex()||!!x;let M=!!w&&!I?w.id:C;M=y??M;const T=o??(w==null?void 0:w.isDisabled),D=s??(w==null?void 0:w.isReadOnly),_=c??(w==null?void 0:w.isRequired),R=f??(w==null?void 0:w.isInvalid),[V,F]=g.useState(!1),[B,Q]=g.useState(!1),[U,X]=g.useState(!1),[te,re]=g.useState(!1),[$,Z]=g.useState(Boolean(t)),fe=typeof n<"u",Se=fe?n:$;g.useEffect(()=>j2(F),[]);const Me=g.useCallback(me=>{if(D||T){me.preventDefault();return}fe||Z(me.target.checked),u==null||u(me)},[fe,T,D,u]),Ie=g.useCallback(me=>{me.key===" "&&re(!0)},[re]),Pe=g.useCallback(me=>{me.key===" "&&re(!1)},[re]),he=g.useCallback((me={},De=null)=>({...me,ref:De,"data-active":qe(te),"data-hover":qe(U),"data-disabled":qe(T),"data-invalid":qe(R),"data-checked":qe(Se),"data-focus":qe(B),"data-focus-visible":qe(B&&V),"data-readonly":qe(D),"aria-hidden":!0,onMouseDown:Ee(me.onMouseDown,()=>re(!0)),onMouseUp:Ee(me.onMouseUp,()=>re(!1)),onMouseEnter:Ee(me.onMouseEnter,()=>X(!0)),onMouseLeave:Ee(me.onMouseLeave,()=>X(!1))}),[te,U,T,R,Se,B,D,V]),{onFocus:se,onBlur:Ne}=w??{},Ve=g.useCallback((me={},De=null)=>{const Ge=T&&!r;return{...me,id:M,ref:De,type:"radio",name:p,value:h,onChange:Ee(me.onChange,Me),onBlur:Ee(Ne,me.onBlur,()=>Q(!1)),onFocus:Ee(se,me.onFocus,()=>Q(!0)),onKeyDown:Ee(me.onKeyDown,Ie),onKeyUp:Ee(me.onKeyUp,Pe),checked:Se,disabled:Ge,readOnly:D,required:_,"aria-invalid":Nr(R),"aria-disabled":Nr(Ge),"aria-required":Nr(_),"data-readonly":qe(D),"aria-describedby":S,style:Z7}},[T,r,M,p,h,Me,Ne,se,Ie,Pe,Se,D,_,R,S]);return{state:{isInvalid:R,isFocused:B,isChecked:Se,isActive:te,isHovered:U,isDisabled:T,isReadOnly:D,isRequired:_},getCheckboxProps:he,getInputProps:Ve,getLabelProps:(me={},De=null)=>({...me,ref:De,onMouseDown:Ee(me.onMouseDown,Ag),onTouchStart:Ee(me.onTouchStart,Ag),"data-disabled":qe(T),"data-checked":qe(Se),"data-invalid":qe(R)}),getRootProps:(me,De=null)=>({...me,ref:De,"data-disabled":qe(T),"data-checked":qe(Se),"data-invalid":qe(R)}),htmlProps:j}}function Ag(e){e.preventDefault(),e.stopPropagation()}function e8(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=ue((e,t)=>{var n;const r=ex(),{onChange:o,value:s}=e,c=un("Radio",{...r,...e}),u=At(e),{spacing:f="0.5rem",children:p,isDisabled:h=r==null?void 0:r.isDisabled,isFocusable:y=r==null?void 0:r.isFocusable,inputProps:x,...S}=u;let j=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(j=r.value===s);let C=o;r!=null&&r.onChange&&s!=null&&(C=xc(r.onChange,o));const w=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:k,getCheckboxProps:I,getLabelProps:P,getRootProps:M,htmlProps:T}=J7({...S,isChecked:j,isFocusable:y,isDisabled:h,onChange:C,name:w}),[D,_]=e8(T,S1),R=I(_),V=k(x,t),F=P(),B=Object.assign({},D,M()),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",...V}),l.jsx(ne.span,{className:"chakra-radio__control",...R,__css:U}),p&&l.jsx(ne.span,{className:"chakra-radio__label",...F,__css:X,children:p})]})});vn.displayName="Radio";var tx=ue(function(t,n){const{children:r,placeholder:o,className:s,...c}=t;return l.jsxs(ne.select,{...c,ref:n,className:ze("chakra-select",s),children:[o&&l.jsx("option",{value:"",children:o}),r]})});tx.displayName="SelectField";function t8(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 nx=ue((e,t)=>{var n;const r=un("Select",e),{rootProps:o,placeholder:s,icon:c,color:u,height:f,h:p,minH:h,minHeight:y,iconColor:x,iconSize:S,...j}=At(e),[C,w]=t8(j,S1),k=sh(w),I={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:I,...C,...o,children:[l.jsx(tx,{ref:t,height:p??f,minH:h??y,placeholder:s,...k,__css:P,children:e.children}),l.jsx(rx,{"data-disabled":qe(k.disabled),...(x||u)&&{color:x||u},__css:r.icon,...S&&{fontSize:S},children:c})]})});nx.displayName="Select";var n8=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"})}),r8=ne("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),rx=e=>{const{children:t=l.jsx(n8,{}),...n}=e,r=g.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return l.jsx(r8,{...n,className:"chakra-select__icon-wrapper",children:g.isValidElement(t)?r:null})};rx.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 o8(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=C=>{var w;const k=(w=r[C])!=null?w:$l;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...El({orientation:t,vertical:{bottom:`calc(${n[C]}% - ${k.height/2}px)`},horizontal:{left:`calc(${n[C]}% - ${k.width/2}px)`}})}},c=t==="vertical"?r.reduce((C,w)=>Pl(C).height>Pl(w).height?C:w,$l):r.reduce((C,w)=>Pl(C).width>Pl(w).width?C: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%"}})},p=n.length===1,h=[0,o?100-n[0]:n[0]],y=p?h:n;let x=y[0];!p&&o&&(x=100-x);const S=Math.abs(y[y.length-1]-y[0]),j={...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:j,rootStyle:u,getThumbStyle:s}}function i8(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function a8(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function s8(e){const t=c8(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function ox(e){return!!e.touches}function l8(e){return ox(e)&&e.touches.length>1}function c8(e){var t;return(t=e.view)!=null?t:window}function u8(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function d8(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function ix(e,t="page"){return ox(e)?u8(e,t):d8(e,t)}function f8(e){return t=>{const n=s8(t);(!n||n&&t.button===0)&&e(t)}}function h8(e,t=!1){function n(o){e(o,{point:ix(o)})}return t?f8(n):n}function Gl(e,t,n,r){return a8(e,t,h8(n,t==="pointerdown"),r)}var p8=Object.defineProperty,m8=(e,t,n)=>t in e?p8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jn=(e,t,n)=>(m8(e,typeof t!="symbol"?t+"":t,n),n),v8=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,p=b8(u.offset,{x:0,y:0})>=this.threshold;if(!f&&!p)return;const{timestamp:h}=Gv();this.history.push({...u.point,timestamp:h});const{onStart:y,onMove:x}=this.handlers;f||(y==null||y(this.lastEvent,u),this.startEvent=this.lastEvent),x==null||x(this.lastEvent,u)}),Jn(this,"onPointerMove",(u,f)=>{this.lastEvent=u,this.lastEventInfo=f,VC.update(this.updatePoint,!0)}),Jn(this,"onPointerUp",(u,f)=>{const p=_d(f,this.history),{onEnd:h,onSessionEnd:y}=this.handlers;y==null||y(u,p),this.end(),!(!h||!this.startEvent)&&(h==null||h(u,p))});var r;if(this.win=(r=e.view)!=null?r:window,l8(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:ix(e)},{timestamp:s}=Gv();this.history=[{...o.point,timestamp:s}];const{onSessionStart:c}=t;c==null||c(e,_d(o,this.history)),this.removeListeners=x8(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),UC.update(this.updatePoint)}};function Og(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _d(e,t){return{point:e.point,delta:Og(e.point,t[t.length-1]),offset:Og(e.point,t[0]),velocity:y8(t,.1)}}var g8=e=>e*1e3;function y8(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>g8(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 x8(...e){return t=>e.reduce((n,r)=>r(n),t)}function Dd(e,t){return Math.abs(e-t)}function zg(e){return"x"in e&&"y"in e}function b8(e,t){if(typeof e=="number"&&typeof t=="number")return Dd(e,t);if(zg(e)&&zg(t)){const n=Dd(e.x,t.x),r=Dd(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function ax(e){const t=g.useRef(null);return t.current=e,t}function S8(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:c,threshold:u}=t,f=Boolean(n||r||o||s||c),p=g.useRef(null),h=ax({onSessionStart:s,onSessionEnd:c,onStart:r,onMove:n,onEnd(y,x){p.current=null,o==null||o(y,x)}});g.useEffect(()=>{var y;(y=p.current)==null||y.updateHandlers(h.current)}),g.useEffect(()=>{const y=e.current;if(!y||!f)return;function x(S){p.current=new v8(S,h.current,u)}return Gl(y,"pointerdown",x)},[e,f,h,u]),g.useEffect(()=>()=>{var y;(y=p.current)==null||y.end(),p.current=null},[])}function C8(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 p=c.borderBoxSize,h=Array.isArray(p)?p[0]:p;u=h.inlineSize,f=h.blockSize}else u=e.offsetWidth,f=e.offsetHeight;t({width:u,height:f})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}var w8=Boolean(globalThis==null?void 0:globalThis.document)?g.useLayoutEffect:g.useEffect;function j8(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 k8({getNodes:e,observeMutation:t=!0}){const[n,r]=g.useState([]),[o,s]=g.useState(0);return w8(()=>{const c=e(),u=c.map((f,p)=>C8(f,h=>{r(y=>[...y.slice(0,p),h,...y.slice(p+1)])}));if(t){const f=c[0];u.push(j8(f,()=>{s(p=>p+1)}))}return()=>{u.forEach(f=>{f==null||f()})}},[o]),n}function E8(e){return typeof e=="object"&&e!==null&&"current"in e}function P8(e){const[t]=k8({observeMutation:!1,getNodes(){return[E8(e)?e.current:e]}});return t}function I8(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:c,isReversed:u,direction:f="ltr",orientation:p="horizontal",id:h,isDisabled:y,isReadOnly:x,onChangeStart:S,onChangeEnd:j,step:C=1,getAriaValueText:w,"aria-valuetext":k,"aria-label":I,"aria-labelledby":P,name:M,focusThumbOnChange:T=!0,...D}=e,_=Wt(S),R=Wt(j),V=Wt(w),F=i8({isReversed:u,direction:f,orientation:p}),[B,Q]=rh({value:s,defaultValue:c??T8(n,r),onChange:o}),[U,X]=g.useState(!1),[te,re]=g.useState(!1),$=!(y||x),Z=(r-n)/10,fe=C||(r-n)/100,Se=Hl(B,n,r),Me=r-Se+n,Pe=rg(F?Me:Se,n,r),he=p==="vertical",se=ax({min:n,max:r,step:C,isDisabled:y,value:Se,isInteractive:$,isReversed:F,isVertical:he,eventSource:null,focusThumbOnChange:T,orientation:p}),Ne=g.useRef(null),Ve=g.useRef(null),Ue=g.useRef(null),$e=g.useId(),Qe=h??$e,[me,De]=[`slider-thumb-${Qe}`,`slider-track-${Qe}`],Ge=g.useCallback(de=>{var Ae,dn;if(!Ne.current)return;const Vt=se.current;Vt.eventSource="pointer";const fn=Ne.current.getBoundingClientRect(),{clientX:sr,clientY:ko}=(dn=(Ae=de.touches)==null?void 0:Ae[0])!=null?dn:de,la=he?fn.bottom-ko:sr-fn.left,Xc=he?fn.height:fn.width;let ca=la/Xc;F&&(ca=1-ca);let Eo=n5(ca,Vt.min,Vt.max);return Vt.step&&(Eo=parseFloat(og(Eo,Vt.min,Vt.step))),Eo=Hl(Eo,Vt.min,Vt.max),Eo},[he,F,se]),ge=g.useCallback(de=>{const Ae=se.current;Ae.isInteractive&&(de=parseFloat(og(de,Ae.min,fe)),de=Hl(de,Ae.min,Ae.max),Q(de))},[fe,Q,se]),Te=g.useMemo(()=>({stepUp(de=fe){const Ae=F?Se-de:Se+de;ge(Ae)},stepDown(de=fe){const Ae=F?Se+de:Se-de;ge(Ae)},reset(){ge(c||0)},stepTo(de){ge(de)}}),[ge,F,Se,fe,c]),et=g.useCallback(de=>{const Ae=se.current,Vt={ArrowRight:()=>Te.stepUp(),ArrowUp:()=>Te.stepUp(),ArrowLeft:()=>Te.stepDown(),ArrowDown:()=>Te.stepDown(),PageUp:()=>Te.stepUp(Z),PageDown:()=>Te.stepDown(Z),Home:()=>ge(Ae.min),End:()=>ge(Ae.max)}[de.key];Vt&&(de.preventDefault(),de.stopPropagation(),Vt(de),Ae.eventSource="keyboard")},[Te,ge,Z,se]),Be=(t=V==null?void 0:V(Se))!=null?t:k,vt=P8(Ve),{getThumbStyle:Rt,rootStyle:N,trackStyle:le,innerTrackStyle:ye}=g.useMemo(()=>{const de=se.current,Ae=vt??{width:0,height:0};return o8({isReversed:F,orientation:de.orientation,thumbRects:[Ae],thumbPercents:[Pe]})},[F,vt,Pe,se]),je=g.useCallback(()=>{se.current.focusThumbOnChange&&setTimeout(()=>{var Ae;return(Ae=Ve.current)==null?void 0:Ae.focus()})},[se]);ti(()=>{const de=se.current;je(),de.eventSource==="keyboard"&&(R==null||R(de.value))},[Se,R]);function q(de){const Ae=Ge(de);Ae!=null&&Ae!==se.current.value&&Q(Ae)}S8(Ue,{onPanSessionStart(de){const Ae=se.current;Ae.isInteractive&&(X(!0),je(),q(de),_==null||_(Ae.value))},onPanSessionEnd(){const de=se.current;de.isInteractive&&(X(!1),R==null||R(de.value))},onPan(de){se.current.isInteractive&&q(de)}});const ie=g.useCallback((de={},Ae=null)=>({...de,...D,ref:ct(Ae,Ue),tabIndex:-1,"aria-disabled":Md(y),"data-focused":Mi(te),style:{...de.style,...N}}),[D,y,te,N]),Re=g.useCallback((de={},Ae=null)=>({...de,ref:ct(Ae,Ne),id:De,"data-disabled":Mi(y),style:{...de.style,...le}}),[y,De,le]),Ze=g.useCallback((de={},Ae=null)=>({...de,ref:Ae,style:{...de.style,...ye}}),[ye]),J=g.useCallback((de={},Ae=null)=>({...de,ref:ct(Ae,Ve),role:"slider",tabIndex:$?0:void 0,id:me,"data-active":Mi(U),"aria-valuetext":Be,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":Se,"aria-orientation":p,"aria-disabled":Md(y),"aria-readonly":Md(x),"aria-label":I,"aria-labelledby":I?void 0:P,style:{...de.style,...Rt(0)},onKeyDown:Td(de.onKeyDown,et),onFocus:Td(de.onFocus,()=>re(!0)),onBlur:Td(de.onBlur,()=>re(!1))}),[$,me,U,Be,n,r,Se,p,y,x,I,P,Rt,et]),Le=g.useCallback((de,Ae=null)=>{const dn=!(de.value<n||de.value>r),Vt=Se>=de.value,fn=rg(de.value,n,r),sr={position:"absolute",pointerEvents:"none",...M8({orientation:p,vertical:{bottom:F?`${100-fn}%`:`${fn}%`},horizontal:{left:F?`${100-fn}%`:`${fn}%`}})};return{...de,ref:Ae,role:"presentation","aria-hidden":!0,"data-disabled":Mi(y),"data-invalid":Mi(!dn),"data-highlighted":Mi(Vt),style:{...de.style,...sr}}},[y,F,r,n,p,Se]),nt=g.useCallback((de={},Ae=null)=>({...de,ref:Ae,type:"hidden",value:Se,name:M}),[M,Se]);return{state:{value:Se,isFocused:te,isDragging:U},actions:Te,getRootProps:ie,getTrackProps:Re,getInnerTrackProps:Ze,getThumbProps:J,getMarkerProps:Le,getInputProps:nt}}function M8(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function T8(e,t){return t<e?e:e+(t-e)/2}var[_8,Tc]=kt({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[D8,_c]=kt({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),sx=ue((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}=I8(o),p=u(),h=c({},t);return l.jsx(_8,{value:f,children:l.jsx(D8,{value:r,children:l.jsxs(ne.div,{...p,className:ms("chakra-slider",n.className),__css:r.container,children:[n.children,l.jsx("input",{...h})]})})})});sx.displayName="Slider";var lx=ue((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})});lx.displayName="SliderThumb";var cx=ue((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})});cx.displayName="SliderTrack";var ux=ue((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})});ux.displayName="SliderFilledTrack";var Tf=ue((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 dx=ue(function(t,n){const r=un("Switch",t),{spacing:o="0.5rem",children:s,...c}=At(t),{state:u,getInputProps:f,getCheckboxProps:p,getRootProps:h,getLabelProps:y}=k2(c),x=g.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),S=g.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),j=g.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return l.jsxs(ne.label,{...h(),className:ze("chakra-switch",t.className),__css:x,children:[l.jsx("input",{className:"chakra-switch__input",...f({},n)}),l.jsx(ne.span,{...p(),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",...y(),__css:j,children:s})]})});dx.displayName="Switch";var[A8,O8,z8,R8]=th();function N8(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:c,lazyBehavior:u="unmount",orientation:f="horizontal",direction:p="ltr",...h}=e,[y,x]=g.useState(n??0),[S,j]=rh({defaultValue:n??0,value:o,onChange:r});g.useEffect(()=>{o!=null&&x(o)},[o]);const C=z8(),w=g.useId();return{id:`tabs-${(t=e.id)!=null?t:w}`,selectedIndex:S,focusedIndex:y,setSelectedIndex:j,setFocusedIndex:x,isManual:s,isLazy:c,lazyBehavior:u,orientation:f,descendants:C,direction:p,htmlProps:h}}var[F8,Dc]=kt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function L8(e){const{focusedIndex:t,orientation:n,direction:r}=Dc(),o=O8(),s=g.useCallback(c=>{const u=()=>{var I;const P=o.nextEnabled(t);P&&((I=P.node)==null||I.focus())},f=()=>{var I;const P=o.prevEnabled(t);P&&((I=P.node)==null||I.focus())},p=()=>{var I;const P=o.firstEnabled();P&&((I=P.node)==null||I.focus())},h=()=>{var I;const P=o.lastEnabled();P&&((I=P.node)==null||I.focus())},y=n==="horizontal",x=n==="vertical",S=c.key,j=r==="ltr"?"ArrowLeft":"ArrowRight",C=r==="ltr"?"ArrowRight":"ArrowLeft",k={[j]:()=>y&&f(),[C]:()=>y&&u(),ArrowDown:()=>x&&u(),ArrowUp:()=>x&&f(),Home:p,End:h}[S];k&&(c.preventDefault(),k(c))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Ee(e.onKeyDown,s)}}function B8(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:o,isManual:s,id:c,setFocusedIndex:u,selectedIndex:f}=Dc(),{index:p,register:h}=R8({disabled:t&&!n}),y=p===f,x=()=>{o(p)},S=()=>{u(p),!s&&!(t&&n)&&o(p)},j=wy({...r,ref:ct(h,e.ref),isDisabled:t,isFocusable:n,onClick:Ee(e.onClick,x)}),C="button";return{...j,id:fx(c,p),role:"tab",tabIndex:y?0:-1,type:C,"aria-selected":y,"aria-controls":hx(c,p),onFocus:t?void 0:Ee(e.onFocus,S)}}var[H8,W8]=kt({});function V8(e){const t=Dc(),{id:n,selectedIndex:r}=t,s=ah(e.children).map((c,u)=>g.createElement(H8,{key:u,value:{isSelected:u===r,id:hx(n,u),tabId:fx(n,u),selectedIndex:r}},c));return{...e,children:s}}function U8(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=Dc(),{isSelected:s,id:c,tabId:u}=W8(),f=g.useRef(!1);s&&(f.current=!0);const p=Dh({wasSelected:f.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:p?t:null,role:"tabpanel","aria-labelledby":u,hidden:!s,id:c}}function fx(e,t){return`${e}--tab-${t}`}function hx(e,t){return`${e}--tabpanel-${t}`}var[$8,Ac]=kt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),px=ue(function(t,n){const r=un("Tabs",t),{children:o,className:s,...c}=At(t),{htmlProps:u,descendants:f,...p}=N8(c),h=g.useMemo(()=>p,[p]),{isFitted:y,...x}=u;return l.jsx(A8,{value:f,children:l.jsx(F8,{value:h,children:l.jsx($8,{value:r,children:l.jsx(ne.div,{className:ze("chakra-tabs",s),ref:n,...x,__css:r.root,children:o})})})})});px.displayName="Tabs";var mx=ue(function(t,n){const r=L8({...t,ref:n}),s={display:"flex",...Ac().tablist};return l.jsx(ne.div,{...r,className:ze("chakra-tabs__tablist",t.className),__css:s})});mx.displayName="TabList";var vx=ue(function(t,n){const r=U8({...t,ref:n}),o=Ac();return l.jsx(ne.div,{outline:"0",...r,className:ze("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});vx.displayName="TabPanel";var gx=ue(function(t,n){const r=V8(t),o=Ac();return l.jsx(ne.div,{...r,width:"100%",ref:n,className:ze("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});gx.displayName="TabPanels";var yx=ue(function(t,n){const r=Ac(),o=B8({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return l.jsx(ne.button,{...o,className:ze("chakra-tabs__tab",t.className),__css:s})});yx.displayName="Tab";function G8(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var q8=["h","minH","height","minHeight"],qh=ue((e,t)=>{const n=yo("Textarea",e),{className:r,rows:o,...s}=At(e),c=sh(s),u=o?G8(n,q8):n;return l.jsx(ne.textarea,{ref:t,rows:o,...c,className:ze("chakra-textarea",r),__css:u})});qh.displayName="Textarea";var Y8={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 K8(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:c=o,closeOnEsc:u=!0,onOpen:f,onClose:p,placement:h,id:y,isOpen:x,defaultIsOpen:S,arrowSize:j=10,arrowShadowColor:C,arrowPadding:w,modifiers:k,isDisabled:I,gutter:P,offset:M,direction:T,...D}=e,{isOpen:_,onOpen:R,onClose:V}=_h({isOpen:x,defaultIsOpen:S,onOpen:f,onClose:p}),{referenceRef:F,getPopperProps:B,getArrowInnerProps:Q,getArrowProps:U}=Th({enabled:_,placement:h,arrowPadding:w,modifiers:k,gutter:P,offset:M,direction:T}),X=g.useId(),re=`tooltip-${y??X}`,$=g.useRef(null),Z=g.useRef(),fe=g.useCallback(()=>{Z.current&&(clearTimeout(Z.current),Z.current=void 0)},[]),Se=g.useRef(),Me=g.useCallback(()=>{Se.current&&(clearTimeout(Se.current),Se.current=void 0)},[]),Ie=g.useCallback(()=>{Me(),V()},[V,Me]),Pe=X8($,Ie),he=g.useCallback(()=>{if(!I&&!Z.current){Pe();const De=_f($);Z.current=De.setTimeout(R,t)}},[Pe,I,R,t]),se=g.useCallback(()=>{fe();const De=_f($);Se.current=De.setTimeout(Ie,n)},[n,Ie,fe]),Ne=g.useCallback(()=>{_&&r&&se()},[r,se,_]),Ve=g.useCallback(()=>{_&&c&&se()},[c,se,_]),Ue=g.useCallback(De=>{_&&De.key==="Escape"&&se()},[_,se]);Go(()=>sc($),"keydown",u?Ue:void 0),Go(()=>sc($),"scroll",()=>{_&&s&&Ie()}),g.useEffect(()=>{I&&(fe(),_&&V())},[I,_,V,fe]),g.useEffect(()=>()=>{fe(),Me()},[fe,Me]),Go(()=>$.current,"pointerleave",se);const $e=g.useCallback((De={},Ge=null)=>({...De,ref:ct($,Ge,F),onPointerEnter:Ee(De.onPointerEnter,Te=>{Te.pointerType!=="touch"&&he()}),onClick:Ee(De.onClick,Ne),onPointerDown:Ee(De.onPointerDown,Ve),onFocus:Ee(De.onFocus,he),onBlur:Ee(De.onBlur,se),"aria-describedby":_?re:void 0}),[he,se,Ve,_,re,Ne,F]),Qe=g.useCallback((De={},Ge=null)=>B({...De,style:{...De.style,[Ht.arrowSize.var]:j?`${j}px`:void 0,[Ht.arrowShadowColor.var]:C}},Ge),[B,j,C]),me=g.useCallback((De={},Ge=null)=>{const ge={...De.style,position:"relative",transformOrigin:Ht.transformOrigin.varRef};return{ref:Ge,...D,...De,id:re,role:"tooltip",style:ge}},[D,re]);return{isOpen:_,show:he,hide:se,getTriggerProps:$e,getTooltipProps:me,getTooltipPositionerProps:Qe,getArrowProps:U,getArrowInnerProps:Q}}var Ad="chakra-ui:close-tooltip";function X8(e,t){return g.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 Z8(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var J8=ne(ar.div),Gt=ue((e,t)=>{var n,r;const o=yo("Tooltip",e),s=At(e),c=ta(),{children:u,label:f,shouldWrapChildren:p,"aria-label":h,hasArrow:y,bg:x,portalProps:S,background:j,backgroundColor:C,bgColor:w,motionProps:k,...I}=s,P=(r=(n=j??C)!=null?n:x)!=null?r:w;if(P){o.bg=P;const B=US(c,"colors",P);o[Ht.arrowBg.var]=B}const M=K8({...I,direction:c.direction}),T=typeof u=="string"||p;let D;if(T)D=l.jsx(ne.span,{display:"inline-block",tabIndex:0,...M.getTriggerProps(),children:u});else{const B=g.Children.only(u);D=g.cloneElement(B,M.getTriggerProps(B.props,B.ref))}const _=!!h,R=M.getTooltipProps({},t),V=_?Q8(R,["role","id"]):R,F=Z8(R,["role","id"]);return f?l.jsxs(l.Fragment,{children:[D,l.jsx(xo,{children:M.isOpen&&l.jsx($a,{...S,children:l.jsx(ne.div,{...M.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:l.jsxs(J8,{variants:Y8,initial:"exit",animate:"enter",exit:"exit",...k,...V,__css:o,children:[f,_&&l.jsx(ne.span,{srOnly:!0,...F,children:h}),y&&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=g.createContext(null);let Rg;const Kh=()=>({setOpenUploader:e=>{e&&(Rg=e)},openUploader:Rg}),bt=pe(e=>e.ui,e=>$S[e.activeTab],{memoizeOptions:{equalityCheck:ee.isEqual}}),eE=pe(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:ee.isEqual}}),Pr=pe(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:ee.isEqual}}),Ng=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(),p={uuid:C1(),category:"user",...f};t(w1({image:p,category:"user"})),s==="unifiedCanvas"?t(bc(p)):s==="img2img"&&t(rs(p))};var tE=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=nE(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 nE(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=tE.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var rE=[".DS_Store","Thumbs.db"];function oE(e){return na(this,void 0,void 0,function(){return ra(this,function(t){return lc(e)&&iE(e.dataTransfer)?[2,cE(e.dataTransfer,e.type)]:aE(e)?[2,sE(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,lE(e)]:[2,[]]})})}function iE(e){return lc(e)}function aE(e){return lc(e)&&lc(e.target)}function lc(e){return typeof e=="object"&&e!==null}function sE(e){return Df(e.target.files).map(function(t){return vs(t)})}function lE(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 cE(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(uE))]):[3,2];case 1:return r=o.sent(),[2,Fg(xx(r))];case 2:return[2,Fg(Df(e.files).map(function(s){return vs(s)}))]}})})}function Fg(e){return e.filter(function(t){return rE.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 uE(e){if(typeof e.webkitGetAsEntry!="function")return Lg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?bx(t):Lg(e)}function xx(e){return e.reduce(function(t,n){return Sf(Sf([],ig(t),!1),ig(Array.isArray(n)?xx(n):[n]),!1)},[])}function Lg(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 dE(e){return na(this,void 0,void 0,function(){return ra(this,function(t){return[2,e.isDirectory?bx(e):fE(e)]})})}function bx(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,p,h;return ra(this,function(y){switch(y.label){case 0:if(u.length)return[3,5];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return f=y.sent(),n(f),[3,4];case 3:return p=y.sent(),r(p),[3,4];case 4:return[3,6];case 5:h=Promise.all(u.map(dE)),o.push(h),s(),y.label=6;case 6:return[2]}})})},function(u){r(u)})}s()})}function fE(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 hE=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 Bg(e){return vE(e)||mE(e)||Cx(e)||pE()}function pE(){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 mE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vE(e){if(Array.isArray(e))return Af(e)}function Hg(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 Wg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hg(Object(n),!0).forEach(function(r){Sx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sx(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 xE(e)||yE(e,t)||Cx(e,t)||gE()}function gE(){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 Cx(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 yE(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 xE(e){if(Array.isArray(e))return e}var bE="file-invalid-type",SE="file-too-large",CE="file-too-small",wE="too-many-files",jE=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:bE,message:"File type must be ".concat(n)}},Vg=function(t){return{code:SE,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Ug=function(t){return{code:CE,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},kE={code:wE,message:"Too many files"};function wx(e,t){var n=e.type==="application/x-moz-file"||hE(e,t);return[n,n?null:jE(t)]}function jx(e,t,n){if(Ho(e.size))if(Ho(t)&&Ho(n)){if(e.size>n)return[!1,Vg(n)];if(e.size<t)return[!1,Ug(t)]}else{if(Ho(t)&&e.size<t)return[!1,Ug(t)];if(Ho(n)&&e.size>n)return[!1,Vg(n)]}return[!0,null]}function Ho(e){return e!=null}function EE(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 p=wx(f,n),h=Za(p,1),y=h[0],x=jx(f,r,o),S=Za(x,1),j=S[0],C=u?u(f):null;return y&&j&&!C})}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 $g(e){e.preventDefault()}function PE(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function IE(e){return e.indexOf("Edge/")!==-1}function ME(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return PE(e)||IE(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 TE(){return"showOpenFilePicker"in window}function _E(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 kx(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(Ex))&&(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 Wg(Wg({},n),{},Sx({},s,c))},{});return[{description:"Files",accept:t}]}return e}function DE(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(Bg(t),[o],Bg(s))},[]).filter(function(t){return kx(t)||Ex(t)}).join(",")}function AE(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function OE(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function kx(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Ex(e){return/^.*\.[\w]+$/.test(e)}var zE=["children"],RE=["open"],NE=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],FE=["refKey","onChange","onClick"];function LE(e){return WE(e)||HE(e)||Px(e)||BE()}function BE(){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 HE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function WE(e){if(Array.isArray(e))return Of(e)}function Od(e,t){return $E(e)||UE(e,t)||Px(e,t)||VE()}function VE(){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 Px(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 UE(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 $E(e){if(Array.isArray(e))return e}function Gg(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?Gg(Object(n),!0).forEach(function(r){zf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gg(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=GE(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 GE(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=g.forwardRef(function(e,t){var n=e.children,r=uc(e,zE),o=Mx(r),s=o.open,c=uc(o,RE);return g.useImperativeHandle(t,function(){return{open:s}},[s]),_e.createElement(g.Fragment,null,n(Dt(Dt({},c),{},{open:s})))});Xh.displayName="Dropzone";var Ix={disabled:!1,getFilesFromEvent:oE,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=Ix;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 Mx(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Dt(Dt({},Ix),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,p=t.onDragEnter,h=t.onDragLeave,y=t.onDragOver,x=t.onDrop,S=t.onDropAccepted,j=t.onDropRejected,C=t.onFileDialogCancel,w=t.onFileDialogOpen,k=t.useFsAccessApi,I=t.autoFocus,P=t.preventDropOnDocument,M=t.noClick,T=t.noKeyboard,D=t.noDrag,_=t.noDragEventsBubbling,R=t.onError,V=t.validator,F=g.useMemo(function(){return DE(n)},[n]),B=g.useMemo(function(){return _E(n)},[n]),Q=g.useMemo(function(){return typeof w=="function"?w:qg},[w]),U=g.useMemo(function(){return typeof C=="function"?C:qg},[C]),X=g.useRef(null),te=g.useRef(null),re=g.useReducer(qE,Rf),$=Od(re,2),Z=$[0],fe=$[1],Se=Z.isFocused,Me=Z.isFileDialogActive,Ie=g.useRef(typeof window<"u"&&window.isSecureContext&&k&&TE()),Pe=function(){!Ie.current&&Me&&setTimeout(function(){if(te.current){var ie=te.current.files;ie.length||(fe({type:"closeDialog"}),U())}},300)};g.useEffect(function(){return window.addEventListener("focus",Pe,!1),function(){window.removeEventListener("focus",Pe,!1)}},[te,Me,U,Ie]);var he=g.useRef([]),se=function(ie){X.current&&X.current.contains(ie.target)||(ie.preventDefault(),he.current=[])};g.useEffect(function(){return P&&(document.addEventListener("dragover",$g,!1),document.addEventListener("drop",se,!1)),function(){P&&(document.removeEventListener("dragover",$g),document.removeEventListener("drop",se))}},[X,P]),g.useEffect(function(){return!r&&I&&X.current&&X.current.focus(),function(){}},[X,I,r]);var Ne=g.useCallback(function(q){R?R(q):console.error(q)},[R]),Ve=g.useCallback(function(q){q.preventDefault(),q.persist(),N(q),he.current=[].concat(LE(he.current),[q.target]),Il(q)&&Promise.resolve(o(q)).then(function(ie){if(!(cc(q)&&!_)){var Re=ie.length,Ze=Re>0&&EE({files:ie,accept:F,minSize:c,maxSize:s,multiple:u,maxFiles:f,validator:V}),J=Re>0&&!Ze;fe({isDragAccept:Ze,isDragReject:J,isDragActive:!0,type:"setDraggedFiles"}),p&&p(q)}}).catch(function(ie){return Ne(ie)})},[o,p,Ne,_,F,c,s,u,f,V]),Ue=g.useCallback(function(q){q.preventDefault(),q.persist(),N(q);var ie=Il(q);if(ie&&q.dataTransfer)try{q.dataTransfer.dropEffect="copy"}catch{}return ie&&y&&y(q),!1},[y,_]),$e=g.useCallback(function(q){q.preventDefault(),q.persist(),N(q);var ie=he.current.filter(function(Ze){return X.current&&X.current.contains(Ze)}),Re=ie.indexOf(q.target);Re!==-1&&ie.splice(Re,1),he.current=ie,!(ie.length>0)&&(fe({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Il(q)&&h&&h(q))},[X,h,_]),Qe=g.useCallback(function(q,ie){var Re=[],Ze=[];q.forEach(function(J){var Le=wx(J,F),nt=Od(Le,2),Nt=nt[0],de=nt[1],Ae=jx(J,c,s),dn=Od(Ae,2),Vt=dn[0],fn=dn[1],sr=V?V(J):null;if(Nt&&Vt&&!sr)Re.push(J);else{var ko=[de,fn];sr&&(ko=ko.concat(sr)),Ze.push({file:J,errors:ko.filter(function(la){return la})})}}),(!u&&Re.length>1||u&&f>=1&&Re.length>f)&&(Re.forEach(function(J){Ze.push({file:J,errors:[kE]})}),Re.splice(0)),fe({acceptedFiles:Re,fileRejections:Ze,type:"setFiles"}),x&&x(Re,Ze,ie),Ze.length>0&&j&&j(Ze,ie),Re.length>0&&S&&S(Re,ie)},[fe,u,F,c,s,f,x,S,j,V]),me=g.useCallback(function(q){q.preventDefault(),q.persist(),N(q),he.current=[],Il(q)&&Promise.resolve(o(q)).then(function(ie){cc(q)&&!_||Qe(ie,q)}).catch(function(ie){return Ne(ie)}),fe({type:"reset"})},[o,Qe,Ne,_]),De=g.useCallback(function(){if(Ie.current){fe({type:"openDialog"}),Q();var q={multiple:u,types:B};window.showOpenFilePicker(q).then(function(ie){return o(ie)}).then(function(ie){Qe(ie,null),fe({type:"closeDialog"})}).catch(function(ie){AE(ie)?(U(ie),fe({type:"closeDialog"})):OE(ie)?(Ie.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(ie)});return}te.current&&(fe({type:"openDialog"}),Q(),te.current.value=null,te.current.click())},[fe,Q,U,k,Qe,Ne,B,u]),Ge=g.useCallback(function(q){!X.current||!X.current.isEqualNode(q.target)||(q.key===" "||q.key==="Enter"||q.keyCode===32||q.keyCode===13)&&(q.preventDefault(),De())},[X,De]),ge=g.useCallback(function(){fe({type:"focus"})},[]),Te=g.useCallback(function(){fe({type:"blur"})},[]),et=g.useCallback(function(){M||(ME()?setTimeout(De,0):De())},[M,De]),Be=function(ie){return r?null:ie},vt=function(ie){return T?null:Be(ie)},Rt=function(ie){return D?null:Be(ie)},N=function(ie){_&&ie.stopPropagation()},le=g.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ie=q.refKey,Re=ie===void 0?"ref":ie,Ze=q.role,J=q.onKeyDown,Le=q.onFocus,nt=q.onBlur,Nt=q.onClick,de=q.onDragEnter,Ae=q.onDragOver,dn=q.onDragLeave,Vt=q.onDrop,fn=uc(q,NE);return Dt(Dt(zf({onKeyDown:vt(vr(J,Ge)),onFocus:vt(vr(Le,ge)),onBlur:vt(vr(nt,Te)),onClick:Be(vr(Nt,et)),onDragEnter:Rt(vr(de,Ve)),onDragOver:Rt(vr(Ae,Ue)),onDragLeave:Rt(vr(dn,$e)),onDrop:Rt(vr(Vt,me)),role:typeof Ze=="string"&&Ze!==""?Ze:"presentation"},Re,X),!r&&!T?{tabIndex:0}:{}),fn)}},[X,Ge,ge,Te,et,Ve,Ue,$e,me,T,D,r]),ye=g.useCallback(function(q){q.stopPropagation()},[]),je=g.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ie=q.refKey,Re=ie===void 0?"ref":ie,Ze=q.onChange,J=q.onClick,Le=uc(q,FE),nt=zf({accept:F,multiple:u,type:"file",style:{display:"none"},onChange:Be(vr(Ze,me)),onClick:Be(vr(J,ye)),tabIndex:-1},Re,te);return Dt(Dt({},nt),Le)}},[te,n,u,me,r]);return Dt(Dt({},Z),{},{isFocused:Se&&!r,getRootProps:le,getInputProps:je,rootRef:X,inputRef:te,open:Be(De)})}function qE(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 qg(){}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 Tx=["shift","alt","meta","mod","ctrl"],YE={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function so(e){return(YE[e]||e).trim().toLowerCase().replace("key","").replace("digit","").replace("numpad","").replace("arrow","")}function KE(e){return Tx.includes(e)}function zd(e,t){return t===void 0&&(t=","),typeof e=="string"?e.split(t):e}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!Tx.includes(s)});return Nf({},r,{keys:o})}var lo=new Set;function XE(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 _x(e){var t=Array.isArray(e)?e:[e];lo.has("meta")&&lo.forEach(function(n){return!KE(n)&&lo.delete(n.toLowerCase())}),t.forEach(function(n){return lo.add(n.toLowerCase())})}function Dx(e){var t=Array.isArray(e)?e:[e];e==="meta"?lo.clear():t.forEach(function(n){return lo.delete(n.toLowerCase())})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&_x([so(e.key),so(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&Dx([so(e.key),so(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){lo.clear()})})();function QE(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function ZE(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function JE(e){return Ax(e,["input","textarea","select"])}function Ax(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 e9(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 t9=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,p=n.keys,h=t.key,y=t.code,x=t.ctrlKey,S=t.metaKey,j=t.shiftKey,C=t.altKey,w=so(y),k=h.toLowerCase();if(!r){if(o===!C&&k!=="alt"||u===!j&&k!=="shift")return!1;if(c){if(!S&&!x)return!1}else if(s===!S&&k!=="meta"||f===!x&&k!=="ctrl")return!1}return p&&p.length===1&&(p.includes(k)||p.includes(w))?!0:p?XE(p):!p},n9=g.createContext(void 0),r9=function(){return g.useContext(n9)};function Ox(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&&Ox(e[r],t[r])},!0):e===t}var o9=g.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),i9=function(){return g.useContext(o9)};function a9(e){var t=g.useRef(void 0);return Ox(t.current,e)||(t.current=e),t.current}var Yg=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},s9=typeof window<"u"?g.useLayoutEffect:g.useEffect;function ce(e,t,n,r){var o=g.useRef(null),s=g.useRef(!1),c=n instanceof Array?r instanceof Array?void 0:r:n,u=n instanceof Array?n:r instanceof Array?r:void 0,f=g.useCallback(t,u??[]),p=g.useRef(f);u?p.current=f:p.current=t;var h=a9(c),y=i9(),x=y.enabledScopes,S=r9();return s9(function(){if(!((h==null?void 0:h.enabled)===!1||!e9(x,h==null?void 0:h.scopes))){var j=function(I,P){var M;if(P===void 0&&(P=!1),!(JE(I)&&!Ax(I,h==null?void 0:h.enableOnFormTags))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){Yg(I);return}(M=I.target)!=null&&M.isContentEditable&&!(h!=null&&h.enableOnContentEditable)||zd(e,h==null?void 0:h.splitKey).forEach(function(T){var D,_=Rd(T,h==null?void 0:h.combinationKey);if(t9(I,_,h==null?void 0:h.ignoreModifiers)||(D=_.keys)!=null&&D.includes("*")){if(P&&s.current)return;if(QE(I,_,h==null?void 0:h.preventDefault),!ZE(I,_,h==null?void 0:h.enabled)){Yg(I);return}p.current(I,_),P||(s.current=!0)}})}},C=function(I){I.key!==void 0&&(_x(so(I.code)),((h==null?void 0:h.keydown)===void 0&&(h==null?void 0:h.keyup)!==!0||h!=null&&h.keydown)&&j(I))},w=function(I){I.key!==void 0&&(Dx(so(I.code)),s.current=!1,h!=null&&h.keyup&&j(I,!0))};return(o.current||(c==null?void 0:c.document)||document).addEventListener("keyup",w),(o.current||(c==null?void 0:c.document)||document).addEventListener("keydown",C),S&&zd(e,h==null?void 0:h.splitKey).forEach(function(k){return S.addHotkey(Rd(k,h==null?void 0:h.combinationKey))}),function(){(o.current||(c==null?void 0:c.document)||document).removeEventListener("keyup",w),(o.current||(c==null?void 0:c.document)||document).removeEventListener("keydown",C),S&&zd(e,h==null?void 0:h.splitKey).forEach(function(k){return S.removeHotkey(Rd(k,h==null?void 0:h.combinationKey))})}}},[e,h,x]),o}const l9=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:o}=e;return ce("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"})]})})})},c9=e=>{const{children:t}=e,n=Y(),r=A(bt),o=ls({}),{t:s}=K(),[c,u]=g.useState(!1),{setOpenUploader:f}=Kh(),p=g.useCallback(P=>{u(!0);const M=P.errors.reduce((T,D)=>`${T}
|
||
${D.message}`,"");o({title:s("toast.uploadFailed"),description:M,status:"error",isClosable:!0})},[s,o]),h=g.useCallback(async P=>{n(Ng({imageFile:P}))},[n]),y=g.useCallback((P,M)=>{M.forEach(T=>{p(T)}),P.forEach(T=>{h(T)})},[h,p]),{getRootProps:x,getInputProps:S,isDragAccept:j,isDragReject:C,isDragActive:w,open:k}=Mx({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:y,onDragOver:()=>u(!0),maxFiles:1});f(k),g.useEffect(()=>{const P=M=>{var R;const T=(R=M.clipboardData)==null?void 0:R.items;if(!T)return;const D=[];for(const V of T)V.kind==="file"&&["image/png","image/jpg"].includes(V.type)&&D.push(V);if(!D.length)return;if(M.stopImmediatePropagation(),D.length>1){o({description:s("toast.uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const _=D[0].getAsFile();if(!_){o({description:s("toast.uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(Ng({imageFile:_}))};return document.addEventListener("paste",P),()=>{document.removeEventListener("paste",P)}},[s,n,o,r]);const I=["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(l9,{isDragAccept:j,isDragReject:C,overlaySecondaryText:I,setIsHandlingUpload:u})]})})},u9=g.memo(c9),zx=ue((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})})});zx.displayName="IAIIconButton";const ae=g.memo(zx);var d9=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)},Kg={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Xg={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Ml={width:"20px",height:"20px",position:"absolute"},f9={top:Bt(Bt({},Kg),{top:"-5px"}),right:Bt(Bt({},Xg),{left:void 0,right:"-5px"}),bottom:Bt(Bt({},Kg),{top:void 0,bottom:"-5px"}),left:Bt(Bt({},Xg),{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"})},h9=function(e){d9(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 g.createElement("div",{className:this.props.className||"",style:Bt(Bt({position:"absolute",userSelect:"none"},f9[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(g.PureComponent),p9=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)},m9={width:"auto",height:"auto"},Tl=function(e,t,n){return Math.max(Math.min(e,n),t)},Qg=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)},v9=function(e){return Boolean((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},Zg=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},g9=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)}},y9=["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"],Jg="__resizable_base__",Rx=function(e){p9(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(Jg):s.className+=Jg,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||m9},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(),p=Number(n.state[u].toString().replace("px","")),h=p/f[u]*100;return h+"%"}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,p;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(f=c?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),p=u?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(f=c?this.resizableRight:this.window.innerWidth-this.resizableLeft,p=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),p=u?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return f&&Number.isFinite(f)&&(n=n&&n<f?n:f),p&&Number.isFinite(p)&&(r=r&&r<p?r:p),{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,p=this.props,h=p.lockAspectRatio,y=p.lockAspectRatioExtraHeight,x=p.lockAspectRatioExtraWidth,S=f.width,j=f.height,C=y||0,w=x||0;return Ti("right",u)&&(S=f.width+(n-f.x)*s/o,h&&(j=(S-w)/this.ratio+C)),Ti("left",u)&&(S=f.width-(n-f.x)*s/o,h&&(j=(S-w)/this.ratio+C)),Ti("bottom",u)&&(j=f.height+(r-f.y)*s/o,h&&(S=(j-C)*this.ratio+w)),Ti("top",u)&&(j=f.height-(r-f.y)*s/o,h&&(S=(j-C)*this.ratio+w)),{newWidth:S,newHeight:j}},t.prototype.calculateNewSizeFromAspectRatio=function(n,r,o,s){var c=this.props,u=c.lockAspectRatio,f=c.lockAspectRatioExtraHeight,p=c.lockAspectRatioExtraWidth,h=typeof s.width>"u"?10:s.width,y=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,j=f||0,C=p||0;if(u){var w=(x-j)*this.ratio+C,k=(S-j)*this.ratio+C,I=(h-C)/this.ratio+j,P=(y-C)/this.ratio+j,M=Math.max(h,w),T=Math.min(y,k),D=Math.max(x,I),_=Math.min(S,P);n=Tl(n,M,T),r=Tl(r,D,_)}else n=Tl(n,h,y),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,p=s.bottom;this.resizableLeft=c,this.resizableRight=f,this.resizableTop=u,this.resizableBottom=p}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,s=0;if(n.nativeEvent&&v9(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 p=this.parentNode;if(p){var h=this.window.getComputedStyle(p).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",u=f.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var y={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(y)}},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,p=_l(n)?n.touches[0].clientX:n.clientX,h=_l(n)?n.touches[0].clientY:n.clientY,y=this.state,x=y.direction,S=y.original,j=y.width,C=y.height,w=this.getParentSize(),k=g9(w,this.window.innerWidth,this.window.innerHeight,s,c,u,f);s=k.maxWidth,c=k.maxHeight,u=k.minWidth,f=k.minHeight;var I=this.calculateNewSizeFromDirection(p,h),P=I.newHeight,M=I.newWidth,T=this.calculateNewMaxFromBoundary(s,c);this.props.snap&&this.props.snap.x&&(M=Zg(M,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(P=Zg(P,this.props.snap.y,this.props.snapGap));var D=this.calculateNewSizeFromAspectRatio(M,P,{width:T.maxWidth,height:T.maxHeight},{width:u,height:f});if(M=D.newWidth,P=D.newHeight,this.props.grid){var _=Qg(M,this.props.grid[0]),R=Qg(P,this.props.grid[1]),V=this.props.snapGap||0;M=V===0||Math.abs(_-M)<=V?_:M,P=V===0||Math.abs(R-P)<=V?R:P}var F={width:M-S.width,height:P-S.height};if(j&&typeof j=="string"){if(j.endsWith("%")){var B=M/w.width*100;M=B+"%"}else if(j.endsWith("vw")){var Q=M/this.window.innerWidth*100;M=Q+"vw"}else if(j.endsWith("vh")){var U=M/this.window.innerHeight*100;M=U+"vh"}}if(C&&typeof C=="string"){if(C.endsWith("%")){var B=P/w.height*100;P=B+"%"}else if(C.endsWith("vw")){var Q=P/this.window.innerWidth*100;P=Q+"vw"}else if(C.endsWith("vh")){var U=P/this.window.innerHeight*100;P=U+"vh"}}var X={width:this.createSizeForCssProperty(M,"width"),height:this.createSizeForCssProperty(P,"height")};this.flexDir==="row"?X.flexBasis=X.width:this.flexDir==="column"&&(X.flexBasis=X.height),GS.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,p=r.handleComponent;if(!o)return null;var h=Object.keys(o).map(function(y){return o[y]!==!1?g.createElement(h9,{key:y,direction:y,onResizeStart:n.onResizeStart,replaceStyles:s&&s[y],className:c&&c[y]},p&&p[y]?p[y]:null):null});return g.createElement("div",{className:f,style:u},h)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(c,u){return y9.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 g.createElement(s,yr({ref:this.ref,style:o,className:this.props.className},r),this.state.isResizing&&g.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}(g.PureComponent),Nx={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},e0=_e.createContext&&_e.createContext(Nx),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)},x9=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 Fx(e){return e&&e.map(function(t,n){return _e.createElement(t.tag,uo({key:n},t.attr),Fx(t.child))})}function ve(e){return function(t){return _e.createElement(b9,uo({attr:uo({},e.attr)},t),Fx(e.child))}}function b9(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,c=x9(e,["attr","size","title"]),u=o||n.size||"1em",f;return n.className&&(f=n.className),e.className&&(f=(f?f+" ":"")+e.className),_e.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&&_e.createElement("title",null,s),e.children)};return e0!==void 0?_e.createElement(e0.Consumer,null,function(n){return t(n)}):t(Nx)}function S9(e){return ve({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 C9(e){return ve({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 w9(e){return ve({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 j9(e){return ve({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 k9(e){return ve({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 Lx(e){return ve({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 E9(e){return ve({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 Bx(e){return ve({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 P9(e){return ve({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 I9(e){return ve({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 ve({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 Hx(e){return ve({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 ve({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 Wx(e){return ve({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 M9(e){return ve({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 ve({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 Vx(e){return ve({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 T9(e){return ve({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 _9(e){return ve({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 Ux(e){return ve({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 Zh(e){return ve({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 $x(e){return ve({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 Gx(e){return ve({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 D9(e){return ve({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 A9(e){return ve({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 O9(e){return ve({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 z9(e){return ve({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 qx(e){return ve({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 R9(e){return ve({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 N9(e){return ve({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 Yx(e){return ve({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 F9(e){return ve({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 L9(e){return ve({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 ve({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 B9(e){return ve({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 H9(e){return ve({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 W9(e){return ve({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 Jh(e){return ve({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 t0(e){return ve({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 V9(e){return ve({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 U9(e){return ve({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 n0(e){return ve({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 ep(e){return ve({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 $9(e){return ve({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 ve({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 G9(e){return ve({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 ve({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 q9(e){return ve({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 tp(e){return ve({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,Y9=e=>e.system.toastQueue,Kx=pe(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}}),K9=pe(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}}),X9=pe(Et,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),Q9=pe(Et,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Z9=()=>{const e=Y(),{t}=K(),n=A(X9),{shouldShowLogViewer:r,hasError:o,wasErrorSeen:s}=A(Q9),[c,u]=g.useState(!0),f=g.useRef(null);g.useLayoutEffect(()=>{f.current!==null&&c&&(f.current.scrollTop=f.current.scrollHeight)},[c,n,r]);const p=()=>{e(j1()),e(dd(!r))};ce("`",()=>{e(dd(!r))},[r]),ce("esc",()=>{e(dd(!1))});const h=()=>{f.current&&c&&f.current.scrollTop<f.current.scrollHeight-f.current.clientHeight&&u(!1)};return l.jsxs(l.Fragment,{children:[r&&l.jsx(Rx,{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:h,children:n.map((y,x)=>{const{timestamp:S,message:j,level:C}=y,w=C==="info"?"base":C;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:j})]},x)})})}),r&&l.jsx(Gt,{hasArrow:!0,label:c?"Autoscroll On":"Autoscroll Off",children:l.jsx(ae,{size:"sm","aria-label":t("accessibility.toggleAutoscroll"),icon:l.jsx(w9,{}),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(ae,{size:"sm","aria-label":t("accessibility.toggleLogViewer"),icon:r?l.jsx(N9,{}):l.jsx(Hx,{}),onClick:p,sx:{position:"fixed",insetInlineStart:2,bottom:2,zIndex:"10000"},colorScheme:o||!s?"error":"base"})})]})},J9="0px",Xx="calc(70px + 1rem)",dc=1.5,eP=`calc(100vw - ${J9})`,tP=`calc(100vh - ${dc*4}px)`,nP=`calc(100vh - ${Xx})`,rP=`calc(100vh - (${Xx} + 4.4rem))`,r0=384,oP=pe(Et,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),iP=()=>{const{t:e}=K(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=A(oP),s=n?Math.round(n*100/r):0;return l.jsx(Jy,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!o,height:dc,zIndex:99})};function aP(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 sP({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"}],p=h=>l.jsx(L,{flexDir:"column",gap:4,children:h.map((y,x)=>l.jsxs(L,{flexDir:"column",px:2,gap:4,children:[l.jsx(aP,{title:y.title,description:y.desc,hotkey:y.hotkey}),x<h.length-1&&l.jsx(Cy,{})]},x))});return l.jsxs(l.Fragment,{children:[g.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:p(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:p(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:p(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:p(f)})]})]})})}),l.jsx(Lr,{})]})]})]})}const lP=ue((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=g.memo(lP),cP=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=g.memo(cP),o0=/^-?(0\.)?\.?$/,uP=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:c,min:u,max:f,isInteger:p=!0,formControlProps:h,formLabelProps:y,numberInputFieldProps:x,numberInputStepperProps:S,tooltipProps:j,...C}=e,[w,k]=g.useState(String(s));g.useEffect(()=>{!w.match(o0)&&s!==Number(w)&&k(String(s))},[s,w]);const I=M=>{k(M),M.match(o0)||c(p?Math.floor(Number(M)):Number(M))},P=M=>{const T=ee.clamp(p?Math.floor(Number(M.target.value)):Number(M.target.value),u,f);k(String(T)),c(T)};return l.jsx(Gt,{...j,children:l.jsxs(rt,{isDisabled:n,isInvalid:o,...h,children:[t&&l.jsx(st,{...y,children:t}),l.jsxs(Nh,{value:w,min:u,max:f,keepWithinRange:!0,clampValueOnBlur:!1,onChange:I,onBlur:P,...C,children:[l.jsx(Lh,{...x}),r&&l.jsxs(Fh,{children:[l.jsx(Hh,{...S}),l.jsx(Bh,{...S})]})]})]})})},Vr=g.memo(uP);var i0=Array.isArray,a0=Object.keys,dP=Object.prototype.hasOwnProperty,fP=typeof Element<"u";function Ff(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=i0(e),r=i0(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 p=e instanceof RegExp,h=t instanceof RegExp;if(p!=h)return!1;if(p&&h)return e.toString()==t.toString();var y=a0(e);if(s=y.length,s!==a0(t).length)return!1;for(o=s;o--!==0;)if(!dP.call(t,y[o]))return!1;if(fP&&e instanceof Element&&t instanceof Element)return e===t;for(o=s;o--!==0;)if(c=y[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}},hP=function(t){return pP(t)&&!mP(t)};function pP(e){return!!e&&typeof e=="object"}function mP(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||yP(e)}var vP=typeof Symbol=="function"&&Symbol.for,gP=vP?Symbol.for("react.element"):60103;function yP(e){return e.$$typeof===gP}function xP(e){return Array.isArray(e)?[]:{}}function fc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ja(xP(e),e,t):e}function bP(e,t,n){return e.concat(t).map(function(r){return fc(r,n)})}function SP(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||bP,n.isMergeableObject=n.isMergeableObject||hP;var r=Array.isArray(t),o=Array.isArray(e),s=r===o;return s?r?n.arrayMerge(e,t,n):SP(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,CP=typeof global=="object"&&global&&global.Object===Object&&global;const Qx=CP;var wP=typeof self=="object"&&self&&self.Object===Object&&self,jP=Qx||wP||Function("return this")();const Ir=jP;var kP=Ir.Symbol;const go=kP;var Zx=Object.prototype,EP=Zx.hasOwnProperty,PP=Zx.toString,Da=go?go.toStringTag:void 0;function IP(e){var t=EP.call(e,Da),n=e[Da];try{e[Da]=void 0;var r=!0}catch{}var o=PP.call(e);return r&&(t?e[Da]=n:delete e[Da]),o}var MP=Object.prototype,TP=MP.toString;function _P(e){return TP.call(e)}var DP="[object Null]",AP="[object Undefined]",s0=go?go.toStringTag:void 0;function oi(e){return e==null?e===void 0?AP:DP:s0&&s0 in Object(e)?IP(e):_P(e)}function Jx(e,t){return function(n){return e(t(n))}}var OP=Jx(Object.getPrototypeOf,Object);const np=OP;function ii(e){return e!=null&&typeof e=="object"}var zP="[object Object]",RP=Function.prototype,NP=Object.prototype,eb=RP.toString,FP=NP.hasOwnProperty,LP=eb.call(Object);function l0(e){if(!ii(e)||oi(e)!=zP)return!1;var t=np(e);if(t===null)return!0;var n=FP.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&eb.call(n)==LP}function BP(){this.__data__=[],this.size=0}function tb(e,t){return e===t||e!==e&&t!==t}function Nc(e,t){for(var n=e.length;n--;)if(tb(e[n][0],t))return n;return-1}var HP=Array.prototype,WP=HP.splice;function VP(e){var t=this.__data__,n=Nc(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():WP.call(t,n,1),--this.size,!0}function UP(e){var t=this.__data__,n=Nc(t,e);return n<0?void 0:t[n][1]}function $P(e){return Nc(this.__data__,e)>-1}function GP(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=BP;Gr.prototype.delete=VP;Gr.prototype.get=UP;Gr.prototype.has=$P;Gr.prototype.set=GP;function qP(){this.__data__=new Gr,this.size=0}function YP(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function KP(e){return this.__data__.get(e)}function XP(e){return this.__data__.has(e)}function gs(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var QP="[object AsyncFunction]",ZP="[object Function]",JP="[object GeneratorFunction]",eI="[object Proxy]";function nb(e){if(!gs(e))return!1;var t=oi(e);return t==ZP||t==JP||t==QP||t==eI}var tI=Ir["__core-js_shared__"];const Fd=tI;var c0=function(){var e=/[^.]+$/.exec(Fd&&Fd.keys&&Fd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function nI(e){return!!c0&&c0 in e}var rI=Function.prototype,oI=rI.toString;function ai(e){if(e!=null){try{return oI.call(e)}catch{}try{return e+""}catch{}}return""}var iI=/[\\^$.*+?()[\]{}|]/g,aI=/^\[object .+?Constructor\]$/,sI=Function.prototype,lI=Object.prototype,cI=sI.toString,uI=lI.hasOwnProperty,dI=RegExp("^"+cI.call(uI).replace(iI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fI(e){if(!gs(e)||nI(e))return!1;var t=nb(e)?dI:aI;return t.test(ai(e))}function hI(e,t){return e==null?void 0:e[t]}function si(e,t){var n=hI(e,t);return fI(n)?n:void 0}var pI=si(Ir,"Map");const es=pI;var mI=si(Object,"create");const ts=mI;function vI(){this.__data__=ts?ts(null):{},this.size=0}function gI(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var yI="__lodash_hash_undefined__",xI=Object.prototype,bI=xI.hasOwnProperty;function SI(e){var t=this.__data__;if(ts){var n=t[e];return n===yI?void 0:n}return bI.call(t,e)?t[e]:void 0}var CI=Object.prototype,wI=CI.hasOwnProperty;function jI(e){var t=this.__data__;return ts?t[e]!==void 0:wI.call(t,e)}var kI="__lodash_hash_undefined__";function EI(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ts&&t===void 0?kI: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=vI;Jo.prototype.delete=gI;Jo.prototype.get=SI;Jo.prototype.has=jI;Jo.prototype.set=EI;function PI(){this.size=0,this.__data__={hash:new Jo,map:new(es||Gr),string:new Jo}}function II(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 II(t)?n[typeof t=="string"?"string":"hash"]:n.map}function MI(e){var t=Fc(this,e).delete(e);return this.size-=t?1:0,t}function TI(e){return Fc(this,e).get(e)}function _I(e){return Fc(this,e).has(e)}function DI(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=PI;Co.prototype.delete=MI;Co.prototype.get=TI;Co.prototype.has=_I;Co.prototype.set=DI;var AI=200;function OI(e,t){var n=this.__data__;if(n instanceof Gr){var r=n.__data__;if(!es||r.length<AI-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=qP;sa.prototype.delete=YP;sa.prototype.get=KP;sa.prototype.has=XP;sa.prototype.set=OI;function zI(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var RI=function(){try{var e=si(Object,"defineProperty");return e({},"",{}),e}catch{}}();const u0=RI;function rb(e,t,n){t=="__proto__"&&u0?u0(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var NI=Object.prototype,FI=NI.hasOwnProperty;function ob(e,t,n){var r=e[t];(!(FI.call(e,t)&&tb(r,n))||n===void 0&&!(t in e))&&rb(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?rb(n,u,f):ob(n,u,f)}return n}function LI(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var BI="[object Arguments]";function d0(e){return ii(e)&&oi(e)==BI}var ib=Object.prototype,HI=ib.hasOwnProperty,WI=ib.propertyIsEnumerable,VI=d0(function(){return arguments}())?d0:function(e){return ii(e)&&HI.call(e,"callee")&&!WI.call(e,"callee")};const UI=VI;var $I=Array.isArray;const ys=$I;function GI(){return!1}var ab=typeof exports=="object"&&exports&&!exports.nodeType&&exports,f0=ab&&typeof module=="object"&&module&&!module.nodeType&&module,qI=f0&&f0.exports===ab,h0=qI?Ir.Buffer:void 0,YI=h0?h0.isBuffer:void 0,KI=YI||GI;const sb=KI;var XI=9007199254740991,QI=/^(?:0|[1-9]\d*)$/;function ZI(e,t){var n=typeof e;return t=t??XI,!!t&&(n=="number"||n!="symbol"&&QI.test(e))&&e>-1&&e%1==0&&e<t}var JI=9007199254740991;function lb(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=JI}var eM="[object Arguments]",tM="[object Array]",nM="[object Boolean]",rM="[object Date]",oM="[object Error]",iM="[object Function]",aM="[object Map]",sM="[object Number]",lM="[object Object]",cM="[object RegExp]",uM="[object Set]",dM="[object String]",fM="[object WeakMap]",hM="[object ArrayBuffer]",pM="[object DataView]",mM="[object Float32Array]",vM="[object Float64Array]",gM="[object Int8Array]",yM="[object Int16Array]",xM="[object Int32Array]",bM="[object Uint8Array]",SM="[object Uint8ClampedArray]",CM="[object Uint16Array]",wM="[object Uint32Array]",wt={};wt[mM]=wt[vM]=wt[gM]=wt[yM]=wt[xM]=wt[bM]=wt[SM]=wt[CM]=wt[wM]=!0;wt[eM]=wt[tM]=wt[hM]=wt[nM]=wt[pM]=wt[rM]=wt[oM]=wt[iM]=wt[aM]=wt[sM]=wt[lM]=wt[cM]=wt[uM]=wt[dM]=wt[fM]=!1;function jM(e){return ii(e)&&lb(e.length)&&!!wt[oi(e)]}function rp(e){return function(t){return e(t)}}var cb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ba=cb&&typeof module=="object"&&module&&!module.nodeType&&module,kM=Ba&&Ba.exports===cb,Ld=kM&&Qx.process,EM=function(){try{var e=Ba&&Ba.require&&Ba.require("util").types;return e||Ld&&Ld.binding&&Ld.binding("util")}catch{}}();const Qi=EM;var p0=Qi&&Qi.isTypedArray,PM=p0?rp(p0):jM;const IM=PM;var MM=Object.prototype,TM=MM.hasOwnProperty;function ub(e,t){var n=ys(e),r=!n&&UI(e),o=!n&&!r&&sb(e),s=!n&&!r&&!o&&IM(e),c=n||r||o||s,u=c?LI(e.length,String):[],f=u.length;for(var p in e)(t||TM.call(e,p))&&!(c&&(p=="length"||o&&(p=="offset"||p=="parent")||s&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||ZI(p,f)))&&u.push(p);return u}var _M=Object.prototype;function op(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||_M;return e===n}var DM=Jx(Object.keys,Object);const AM=DM;var OM=Object.prototype,zM=OM.hasOwnProperty;function RM(e){if(!op(e))return AM(e);var t=[];for(var n in Object(e))zM.call(e,n)&&n!="constructor"&&t.push(n);return t}function db(e){return e!=null&&lb(e.length)&&!nb(e)}function ip(e){return db(e)?ub(e):RM(e)}function NM(e,t){return e&&Lc(t,ip(t),e)}function FM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var LM=Object.prototype,BM=LM.hasOwnProperty;function HM(e){if(!gs(e))return FM(e);var t=op(e),n=[];for(var r in e)r=="constructor"&&(t||!BM.call(e,r))||n.push(r);return n}function ap(e){return db(e)?ub(e,!0):HM(e)}function WM(e,t){return e&&Lc(t,ap(t),e)}var fb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,m0=fb&&typeof module=="object"&&module&&!module.nodeType&&module,VM=m0&&m0.exports===fb,v0=VM?Ir.Buffer:void 0,g0=v0?v0.allocUnsafe:void 0;function UM(e,t){if(t)return e.slice();var n=e.length,r=g0?g0(n):new e.constructor(n);return e.copy(r),r}function hb(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function $M(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 pb(){return[]}var GM=Object.prototype,qM=GM.propertyIsEnumerable,y0=Object.getOwnPropertySymbols,YM=y0?function(e){return e==null?[]:(e=Object(e),$M(y0(e),function(t){return qM.call(e,t)}))}:pb;const sp=YM;function KM(e,t){return Lc(e,sp(e),t)}function mb(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var XM=Object.getOwnPropertySymbols,QM=XM?function(e){for(var t=[];e;)mb(t,sp(e)),e=np(e);return t}:pb;const vb=QM;function ZM(e,t){return Lc(e,vb(e),t)}function gb(e,t,n){var r=t(e);return ys(e)?r:mb(r,n(e))}function JM(e){return gb(e,ip,sp)}function eT(e){return gb(e,ap,vb)}var tT=si(Ir,"DataView");const Bf=tT;var nT=si(Ir,"Promise");const Hf=nT;var rT=si(Ir,"Set");const Wf=rT;var oT=si(Ir,"WeakMap");const Vf=oT;var x0="[object Map]",iT="[object Object]",b0="[object Promise]",S0="[object Set]",C0="[object WeakMap]",w0="[object DataView]",aT=ai(Bf),sT=ai(es),lT=ai(Hf),cT=ai(Wf),uT=ai(Vf),Bo=oi;(Bf&&Bo(new Bf(new ArrayBuffer(1)))!=w0||es&&Bo(new es)!=x0||Hf&&Bo(Hf.resolve())!=b0||Wf&&Bo(new Wf)!=S0||Vf&&Bo(new Vf)!=C0)&&(Bo=function(e){var t=oi(e),n=t==iT?e.constructor:void 0,r=n?ai(n):"";if(r)switch(r){case aT:return w0;case sT:return x0;case lT:return b0;case cT:return S0;case uT:return C0}return t});const lp=Bo;var dT=Object.prototype,fT=dT.hasOwnProperty;function hT(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&fT.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var pT=Ir.Uint8Array;const j0=pT;function cp(e){var t=new e.constructor(e.byteLength);return new j0(t).set(new j0(e)),t}function mT(e,t){var n=t?cp(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var vT=/\w*$/;function gT(e){var t=new e.constructor(e.source,vT.exec(e));return t.lastIndex=e.lastIndex,t}var k0=go?go.prototype:void 0,E0=k0?k0.valueOf:void 0;function yT(e){return E0?Object(E0.call(e)):{}}function xT(e,t){var n=t?cp(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var bT="[object Boolean]",ST="[object Date]",CT="[object Map]",wT="[object Number]",jT="[object RegExp]",kT="[object Set]",ET="[object String]",PT="[object Symbol]",IT="[object ArrayBuffer]",MT="[object DataView]",TT="[object Float32Array]",_T="[object Float64Array]",DT="[object Int8Array]",AT="[object Int16Array]",OT="[object Int32Array]",zT="[object Uint8Array]",RT="[object Uint8ClampedArray]",NT="[object Uint16Array]",FT="[object Uint32Array]";function LT(e,t,n){var r=e.constructor;switch(t){case IT:return cp(e);case bT:case ST:return new r(+e);case MT:return mT(e,n);case TT:case _T:case DT:case AT:case OT:case zT:case RT:case NT:case FT:return xT(e,n);case CT:return new r;case wT:case ET:return new r(e);case jT:return gT(e);case kT:return new r;case PT:return yT(e)}}var P0=Object.create,BT=function(){function e(){}return function(t){if(!gs(t))return{};if(P0)return P0(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const HT=BT;function WT(e){return typeof e.constructor=="function"&&!op(e)?HT(np(e)):{}}var VT="[object Map]";function UT(e){return ii(e)&&lp(e)==VT}var I0=Qi&&Qi.isMap,$T=I0?rp(I0):UT;const GT=$T;var qT="[object Set]";function YT(e){return ii(e)&&lp(e)==qT}var M0=Qi&&Qi.isSet,KT=M0?rp(M0):YT;const XT=KT;var QT=1,ZT=2,JT=4,yb="[object Arguments]",e_="[object Array]",t_="[object Boolean]",n_="[object Date]",r_="[object Error]",xb="[object Function]",o_="[object GeneratorFunction]",i_="[object Map]",a_="[object Number]",bb="[object Object]",s_="[object RegExp]",l_="[object Set]",c_="[object String]",u_="[object Symbol]",d_="[object WeakMap]",f_="[object ArrayBuffer]",h_="[object DataView]",p_="[object Float32Array]",m_="[object Float64Array]",v_="[object Int8Array]",g_="[object Int16Array]",y_="[object Int32Array]",x_="[object Uint8Array]",b_="[object Uint8ClampedArray]",S_="[object Uint16Array]",C_="[object Uint32Array]",xt={};xt[yb]=xt[e_]=xt[f_]=xt[h_]=xt[t_]=xt[n_]=xt[p_]=xt[m_]=xt[v_]=xt[g_]=xt[y_]=xt[i_]=xt[a_]=xt[bb]=xt[s_]=xt[l_]=xt[c_]=xt[u_]=xt[x_]=xt[b_]=xt[S_]=xt[C_]=!0;xt[r_]=xt[xb]=xt[d_]=!1;function Ha(e,t,n,r,o,s){var c,u=t&QT,f=t&ZT,p=t&JT;if(n&&(c=o?n(e,r,o,s):n(e)),c!==void 0)return c;if(!gs(e))return e;var h=ys(e);if(h){if(c=hT(e),!u)return hb(e,c)}else{var y=lp(e),x=y==xb||y==o_;if(sb(e))return UM(e,u);if(y==bb||y==yb||x&&!o){if(c=f||x?{}:WT(e),!u)return f?ZM(e,WM(c,e)):KM(e,NM(c,e))}else{if(!xt[y])return o?e:{};c=LT(e,y,u)}}s||(s=new sa);var S=s.get(e);if(S)return S;s.set(e,c),XT(e)?e.forEach(function(w){c.add(Ha(w,t,n,w,e,s))}):GT(e)&&e.forEach(function(w,k){c.set(k,Ha(w,t,n,k,e,s))});var j=p?f?eT:JM:f?ap:ip,C=h?void 0:j(e);return zI(C||e,function(w,k){C&&(k=w,w=e[k]),ob(c,k,Ha(w,t,n,k,e,s))}),c}var w_=4;function T0(e){return Ha(e,w_)}function Sb(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 j_="[object Symbol]";function up(e){return typeof e=="symbol"||ii(e)&&oi(e)==j_}var k_="Expected a function";function dp(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(k_);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(dp.Cache||Co),n}dp.Cache=Co;var E_=500;function P_(e){var t=dp(e,function(r){return n.size===E_&&n.clear(),r}),n=t.cache;return t}var I_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,M_=/\\(\\)?/g,T_=P_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(I_,function(n,r,o,s){t.push(o?s.replace(M_,"$1"):r||n)}),t});const __=T_;var D_=1/0;function A_(e){if(typeof e=="string"||up(e))return e;var t=e+"";return t=="0"&&1/e==-D_?"-0":t}var O_=1/0,_0=go?go.prototype:void 0,D0=_0?_0.toString:void 0;function Cb(e){if(typeof e=="string")return e;if(ys(e))return Sb(e,Cb)+"";if(up(e))return D0?D0.call(e):"";var t=e+"";return t=="0"&&1/e==-O_?"-0":t}function z_(e){return e==null?"":Cb(e)}function wb(e){return ys(e)?Sb(e,A_):up(e)?[e]:hb(__(z_(e)))}var R_=!0;function N_(e,t){if(!R_){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}var F_=1,L_=4;function B_(e){return Ha(e,F_|L_)}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 H_(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 A0(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var O0=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"},W_=function(t){return String(Math.floor(Number(t)))===t},Bd=function(t){return Object.prototype.toString.call(t)==="[object String]"},jb=function(t){return g.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=wb(t);e&&r<o.length;)e=e[o[r++]];return e===void 0?n:e}function wr(e,t,n){for(var r=T0(e),o=r,s=0,c=wb(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]=T0(f);else{var p=c[s+1];o=o[u]=W_(p)&&Number(p)>=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 kb(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)?[]:{},kb(u,t,n,r[c])):r[c]=t}return r}var Hc=g.createContext(void 0);Hc.displayName="FormikContext";var V_=Hc.Provider;Hc.Consumer;function Eb(){var e=g.useContext(Hc);return e||N_(!1),e}function U_(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:kb(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 $_(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,p=f===void 0?!1:f,h=e.onSubmit,y=Vo(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),x=pt({validateOnChange:n,validateOnBlur:o,validateOnMount:c,onSubmit:h},y),S=g.useRef(x.initialValues),j=g.useRef(x.initialErrors||No),C=g.useRef(x.initialTouched||Al),w=g.useRef(x.initialStatus),k=g.useRef(!1),I=g.useRef({});g.useEffect(function(){return k.current=!0,function(){k.current=!1}},[]);var P=g.useReducer(U_,{values:x.initialValues,errors:x.initialErrors||No,touched:x.initialTouched||Al,status:x.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),M=P[0],T=P[1],D=g.useCallback(function(N,le){return new Promise(function(ye,je){var q=x.validate(N,le);q==null?ye(No):Hd(q)?q.then(function(ie){ye(ie||No)},function(ie){je(ie)}):ye(q)})},[x.validate]),_=g.useCallback(function(N,le){var ye=x.validationSchema,je=jn(ye)?ye(le):ye,q=le&&je.validateAt?je.validateAt(le,N):q_(N,je);return new Promise(function(ie,Re){q.then(function(){ie(No)},function(Ze){Ze.name==="ValidationError"?ie(G_(Ze)):Re(Ze)})})},[x.validationSchema]),R=g.useCallback(function(N,le){return new Promise(function(ye){return ye(I.current[N].validate(le))})},[]),V=g.useCallback(function(N){var le=Object.keys(I.current).filter(function(je){return jn(I.current[je].validate)}),ye=le.length>0?le.map(function(je){return R(je,en(N,je))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(ye).then(function(je){return je.reduce(function(q,ie,Re){return ie==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||ie&&(q=wr(q,le[Re],ie)),q},{})})},[R]),F=g.useCallback(function(N){return Promise.all([V(N),x.validationSchema?_(N):{},x.validate?D(N):{}]).then(function(le){var ye=le[0],je=le[1],q=le[2],ie=Lf.all([ye,je,q],{arrayMerge:Y_});return ie})},[x.validate,x.validationSchema,V,D,_]),B=Bn(function(N){return N===void 0&&(N=M.values),T({type:"SET_ISVALIDATING",payload:!0}),F(N).then(function(le){return k.current&&(T({type:"SET_ISVALIDATING",payload:!1}),T({type:"SET_ERRORS",payload:le})),le})});g.useEffect(function(){c&&k.current===!0&&ao(S.current,x.initialValues)&&B(S.current)},[c,B]);var Q=g.useCallback(function(N){var le=N&&N.values?N.values:S.current,ye=N&&N.errors?N.errors:j.current?j.current:x.initialErrors||{},je=N&&N.touched?N.touched:C.current?C.current:x.initialTouched||{},q=N&&N.status?N.status:w.current?w.current:x.initialStatus;S.current=le,j.current=ye,C.current=je,w.current=q;var ie=function(){T({type:"RESET_FORM",payload:{isSubmitting:!!N&&!!N.isSubmitting,errors:ye,touched:je,status:q,values:le,isValidating:!!N&&!!N.isValidating,submitCount:N&&N.submitCount&&typeof N.submitCount=="number"?N.submitCount:0}})};if(x.onReset){var Re=x.onReset(M.values,me);Hd(Re)?Re.then(ie):ie()}else ie()},[x.initialErrors,x.initialStatus,x.initialTouched]);g.useEffect(function(){k.current===!0&&!ao(S.current,x.initialValues)&&(p&&(S.current=x.initialValues,Q()),c&&B(S.current))},[p,x.initialValues,Q,c,B]),g.useEffect(function(){p&&k.current===!0&&!ao(j.current,x.initialErrors)&&(j.current=x.initialErrors||No,T({type:"SET_ERRORS",payload:x.initialErrors||No}))},[p,x.initialErrors]),g.useEffect(function(){p&&k.current===!0&&!ao(C.current,x.initialTouched)&&(C.current=x.initialTouched||Al,T({type:"SET_TOUCHED",payload:x.initialTouched||Al}))},[p,x.initialTouched]),g.useEffect(function(){p&&k.current===!0&&!ao(w.current,x.initialStatus)&&(w.current=x.initialStatus,T({type:"SET_STATUS",payload:x.initialStatus}))},[p,x.initialStatus,x.initialTouched]);var U=Bn(function(N){if(I.current[N]&&jn(I.current[N].validate)){var le=en(M.values,N),ye=I.current[N].validate(le);return Hd(ye)?(T({type:"SET_ISVALIDATING",payload:!0}),ye.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:ye}}),Promise.resolve(ye))}else if(x.validationSchema)return T({type:"SET_ISVALIDATING",payload:!0}),_(M.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=g.useCallback(function(N,le){var ye=le.validate;I.current[N]={validate:ye}},[]),te=g.useCallback(function(N){delete I.current[N]},[]),re=Bn(function(N,le){T({type:"SET_TOUCHED",payload:N});var ye=le===void 0?o:le;return ye?B(M.values):Promise.resolve()}),$=g.useCallback(function(N){T({type:"SET_ERRORS",payload:N})},[]),Z=Bn(function(N,le){var ye=jn(N)?N(M.values):N;T({type:"SET_VALUES",payload:ye});var je=le===void 0?n:le;return je?B(ye):Promise.resolve()}),fe=g.useCallback(function(N,le){T({type:"SET_FIELD_ERROR",payload:{field:N,value:le}})},[]),Se=Bn(function(N,le,ye){T({type:"SET_FIELD_VALUE",payload:{field:N,value:le}});var je=ye===void 0?n:ye;return je?B(wr(M.values,N,le)):Promise.resolve()}),Me=g.useCallback(function(N,le){var ye=le,je=N,q;if(!Bd(N)){N.persist&&N.persist();var ie=N.target?N.target:N.currentTarget,Re=ie.type,Ze=ie.name,J=ie.id,Le=ie.value,nt=ie.checked,Nt=ie.outerHTML,de=ie.options,Ae=ie.multiple;ye=le||Ze||J,je=/number|range/.test(Re)?(q=parseFloat(Le),isNaN(q)?"":q):/checkbox/.test(Re)?X_(en(M.values,ye),nt,Le):de&&Ae?K_(de):Le}ye&&Se(ye,je)},[Se,M.values]),Ie=Bn(function(N){if(Bd(N))return function(le){return Me(le,N)};Me(N)}),Pe=Bn(function(N,le,ye){le===void 0&&(le=!0),T({type:"SET_FIELD_TOUCHED",payload:{field:N,value:le}});var je=ye===void 0?o:ye;return je?B(M.values):Promise.resolve()}),he=g.useCallback(function(N,le){N.persist&&N.persist();var ye=N.target,je=ye.name,q=ye.id,ie=ye.outerHTML,Re=le||je||q;Pe(Re,!0)},[Pe]),se=Bn(function(N){if(Bd(N))return function(le){return he(le,N)};he(N)}),Ne=g.useCallback(function(N){jn(N)?T({type:"SET_FORMIK_STATE",payload:N}):T({type:"SET_FORMIK_STATE",payload:function(){return N}})},[]),Ve=g.useCallback(function(N){T({type:"SET_STATUS",payload:N})},[]),Ue=g.useCallback(function(N){T({type:"SET_ISSUBMITTING",payload:N})},[]),$e=Bn(function(){return T({type:"SUBMIT_ATTEMPT"}),B().then(function(N){var le=N instanceof Error,ye=!le&&Object.keys(N).length===0;if(ye){var je;try{if(je=De(),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"}),le))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(le){console.warn("Warning: An unhandled error was caught from submitForm()",le)})}),me={resetForm:Q,validateForm:B,validateField:U,setErrors:$,setFieldError:fe,setFieldTouched:Pe,setFieldValue:Se,setStatus:Ve,setSubmitting:Ue,setTouched:re,setValues:Z,setFormikState:Ne,submitForm:$e},De=Bn(function(){return h(M.values,me)}),Ge=Bn(function(N){N&&N.preventDefault&&jn(N.preventDefault)&&N.preventDefault(),N&&N.stopPropagation&&jn(N.stopPropagation)&&N.stopPropagation(),Q()}),ge=g.useCallback(function(N){return{value:en(M.values,N),error:en(M.errors,N),touched:!!en(M.touched,N),initialValue:en(S.current,N),initialTouched:!!en(C.current,N),initialError:en(j.current,N)}},[M.errors,M.touched,M.values]),Te=g.useCallback(function(N){return{setValue:function(ye,je){return Se(N,ye,je)},setTouched:function(ye,je){return Pe(N,ye,je)},setError:function(ye){return fe(N,ye)}}},[Se,Pe,fe]),et=g.useCallback(function(N){var le=Bc(N),ye=le?N.name:N,je=en(M.values,ye),q={name:ye,value:je,onChange:Ie,onBlur:se};if(le){var ie=N.type,Re=N.value,Ze=N.as,J=N.multiple;ie==="checkbox"?Re===void 0?q.checked=!!je:(q.checked=!!(Array.isArray(je)&&~je.indexOf(Re)),q.value=Re):ie==="radio"?(q.checked=je===Re,q.value=Re):Ze==="select"&&J&&(q.value=q.value||[],q.multiple=!0)}return q},[se,Ie,M.values]),Be=g.useMemo(function(){return!ao(S.current,M.values)},[S.current,M.values]),vt=g.useMemo(function(){return typeof u<"u"?Be?M.errors&&Object.keys(M.errors).length===0:u!==!1&&jn(u)?u(x):u:M.errors&&Object.keys(M.errors).length===0},[u,Be,M.errors,x]),Rt=pt({},M,{initialValues:S.current,initialErrors:j.current,initialTouched:C.current,initialStatus:w.current,handleBlur:se,handleChange:Ie,handleReset:Ge,handleSubmit:Qe,resetForm:Q,setErrors:$,setFormikState:Ne,setFieldTouched:Pe,setFieldValue:Se,setFieldError:fe,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:ge,getFieldHelpers:Te,validateOnBlur:o,validateOnChange:n,validateOnMount:c});return Rt}function xs(e){var t=$_(e),n=e.component,r=e.children,o=e.render,s=e.innerRef;return g.useImperativeHandle(s,function(){return t}),g.createElement(V_,{value:t},n?g.createElement(n,t):o?o(t):r?jn(r)?r(t):jb(r)?null:g.Children.only(r):null)}function G_(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 q_(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||l0(o)?Uf(o):o!==""?o:void 0}):l0(e[r])?t[r]=Uf(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function Y_(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 K_(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function X_(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 Q_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?g.useLayoutEffect:g.useEffect;function Bn(e){var t=g.useRef(e);return Q_(function(){t.current=e}),g.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=Eb(),p=Vo(f,["validate","validationSchema"]),h=p.registerField,y=p.unregisterField;g.useEffect(function(){return h(n,{validate:t}),function(){y(n)}},[h,y,n,t]);var x=p.getFieldProps(pt({name:n},u)),S=p.getFieldMeta(n),j={field:x,form:p};if(r)return r(pt({},j,{meta:S}));if(jn(o))return o(pt({},j,{meta:S}));if(c){if(typeof c=="string"){var C=u.innerRef,w=Vo(u,["innerRef"]);return g.createElement(c,pt({ref:C},x,w),o)}return g.createElement(c,pt({field:x,form:p},u),o)}var k=s||"input";if(typeof k=="string"){var I=u.innerRef,P=Vo(u,["innerRef"]);return g.createElement(k,pt({ref:I},x,P),o)}return g.createElement(k,pt({},x,u),o)}var Z_=g.forwardRef(function(e,t){var n=e.action,r=Vo(e,["action"]),o=n??"#",s=Eb(),c=s.handleReset,u=s.handleSubmit;return g.createElement("form",Object.assign({onSubmit:u,ref:t,onReset:c,action:o},r))});Z_.displayName="Form";var J_=function(t,n,r){var o=Zi(t),s=o[n];return o.splice(n,1),o.splice(r,0,s),o},eD=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},tD=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[]},nD=function(e){H_(t,e);function t(r){var o;return o=e.call(this,r)||this,o.updateArrayField=function(s,c,u){var f=o.props,p=f.name,h=f.formik.setFormikState;h(function(y){var x=typeof u=="function"?u:s,S=typeof c=="function"?c:s,j=wr(y.values,p,s(en(y.values,p))),C=u?x(en(y.errors,p)):void 0,w=c?S(en(y.touched,p)):void 0;return O0(C)&&(C=void 0),O0(w)&&(w=void 0),pt({},y,{values:j,errors:u?wr(y.errors,p,C):y.errors,touched:c?wr(y.touched,p,w):y.touched})})},o.push=function(s){return o.updateArrayField(function(c){return[].concat(Zi(c),[B_(s)])},!1,!1)},o.handlePush=function(s){return function(){return o.push(s)}},o.swap=function(s,c){return o.updateArrayField(function(u){return eD(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 J_(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 tD(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(A0(o)),o.pop=o.pop.bind(A0(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,p=s.name,h=s.formik,y=Vo(h,["validate","validationSchema"]),x=pt({},o,{form:y,name:p});return c?g.createElement(c,x):u?u(x):f?typeof f=="function"?f(x):jb(f)?null:g.Children.only(f):null},t}(g.Component);nD.defaultProps={validateOnChange:!0};const rD=ue((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:p}=e,{isOpen:h,onOpen:y,onClose:x}=po(),S=g.useRef(null),j=()=>{o(),x()},C=()=>{c&&c(),x()};return l.jsxs(l.Fragment,{children:[g.cloneElement(p,{onClick:y,ref:t}),l.jsx(Yy,{isOpen:h,leastDestructiveRef:S,onClose:x,isCentered:!0,children:l.jsx(Hr,{children:l.jsxs(Ky,{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:C,children:s}),l.jsx(Je,{colorScheme:"error",onClick:j,ml:3,children:r})]})]})})})]})}),Wc=g.memo(rD);function oD(e){const{model:t}=e,r=A(j=>j.system.model_list)[t],o=Y(),{t:s}=K(),c=A(j=>j.system.isProcessing),u=A(j=>j.system.isConnected),[f,p]=g.useState("same"),[h,y]=g.useState("");g.useEffect(()=>{p("same")},[t]);const x=()=>{p("same")},S=()=>{o(qS({model_name:t,save_location:f,custom_location:f==="custom"&&h!==""?h: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(vy,{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:j=>p(j),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:h,onChange:j=>{j.target.value!==""&&y(j.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,iD=pe([Et],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),z0=64,R0=2048;function aD(){const{openModel:e,model_list:t}=A(iD),n=A(f=>f.system.isProcessing),r=Y(),{t:o}=K(),[s,c]=g.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});g.useEffect(()=>{var f,p,h,y,x,S,j;if(e){const C=ee.pickBy(t,(w,k)=>ee.isEqual(k,e));c({name:e,description:(f=C[e])==null?void 0:f.description,config:(p=C[e])==null?void 0:p.config,weights:(h=C[e])==null?void 0:h.weights,vae:(y=C[e])==null?void 0:y.vae,width:(x=C[e])==null?void 0:x.width,height:(S=C[e])==null?void 0:S.height,default:(j=C[e])==null?void 0:j.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(oD,{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:p,touched:h})=>l.jsx(bs,{onSubmit:f,children:l.jsxs(Fe,{rowGap:2,alignItems:"start",children:[l.jsxs(rt,{isInvalid:!!p.description&&h.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"}),p.description&&h.description?l.jsx(nr,{children:p.description}):l.jsx(tr,{children:o("modelManager.descriptionValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.config&&h.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"}),p.config&&h.config?l.jsx(nr,{children:p.config}):l.jsx(tr,{children:o("modelManager.configValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.weights&&h.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"}),p.weights&&h.weights?l.jsx(nr,{children:p.weights}):l.jsx(tr,{children:o("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.vae&&h.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"}),p.vae&&h.vae?l.jsx(nr,{children:p.vae}):l.jsx(tr,{children:o("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(oa,{width:"100%",children:[l.jsxs(rt,{isInvalid:!!p.width&&h.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:y,form:x})=>l.jsx(Vr,{id:"width",name:"width",min:z0,max:R0,step:64,value:x.values.width,onChange:S=>x.setFieldValue(y.name,Number(S))})}),p.width&&h.width?l.jsx(nr,{children:p.width}):l.jsx(tr,{children:o("modelManager.widthValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.height&&h.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:y,form:x})=>l.jsx(Vr,{id:"height",name:"height",min:z0,max:R0,step:64,value:x.values.height,onChange:S=>x.setFieldValue(y.name,Number(S))})}),p.height&&h.height?l.jsx(nr,{children:p.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 sD=pe([Et],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function lD(){const{openModel:e,model_list:t}=A(sD),n=A(f=>f.system.isProcessing),r=Y(),{t:o}=K(),[s,c]=g.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});g.useEffect(()=>{var f,p,h,y,x,S,j,C,w,k,I,P,M,T,D,_;if(e){const R=ee.pickBy(t,(V,F)=>ee.isEqual(F,e));c({name:e,description:(f=R[e])==null?void 0:f.description,path:(p=R[e])!=null&&p.path&&((h=R[e])==null?void 0:h.path)!=="None"?(y=R[e])==null?void 0:y.path:"",repo_id:(x=R[e])!=null&&x.repo_id&&((S=R[e])==null?void 0:S.repo_id)!=="None"?(j=R[e])==null?void 0:j.repo_id:"",vae:{repo_id:(w=(C=R[e])==null?void 0:C.vae)!=null&&w.repo_id?(I=(k=R[e])==null?void 0:k.vae)==null?void 0:I.repo_id:"",path:(M=(P=R[e])==null?void 0:P.vae)!=null&&M.path?(D=(T=R[e])==null?void 0:T.vae)==null?void 0:D.path:""},default:(_=R[e])==null?void 0:_.default,format:"diffusers"})}},[t,e]);const u=f=>{const p=f;f.path===""&&delete p.path,f.repo_id===""&&delete p.repo_id,f.vae.path===""&&delete p.vae.path,f.vae.repo_id===""&&delete p.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:p,touched:h})=>{var y,x,S,j,C,w,k,I,P,M;return l.jsx(bs,{onSubmit:f,children:l.jsxs(Fe,{rowGap:2,alignItems:"start",children:[l.jsxs(rt,{isInvalid:!!p.description&&h.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"}),p.description&&h.description?l.jsx(nr,{children:p.description}):l.jsx(tr,{children:o("modelManager.descriptionValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.path&&h.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"}),p.path&&h.path?l.jsx(nr,{children:p.path}):l.jsx(tr,{children:o("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.repo_id&&h.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"}),p.repo_id&&h.repo_id?l.jsx(nr,{children:p.repo_id}):l.jsx(tr,{children:o("modelManager.repoIDValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((y=p.vae)!=null&&y.path)&&((x=h.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=p.vae)!=null&&S.path&&((j=h.vae)!=null&&j.path)?l.jsx(nr,{children:(C=p.vae)==null?void 0:C.path}):l.jsx(tr,{children:o("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((w=p.vae)!=null&&w.repo_id)&&((k=h.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"}),(I=p.vae)!=null&&I.repo_id&&((P=h.vae)!=null&&P.repo_id)?l.jsx(nr,{children:(M=p.vae)==null?void 0:M.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 cD=e=>{const{label:t,...n}=e;return l.jsx(E2,{colorScheme:"accent",...n,children:t})},ft=g.memo(cD),Pb=pe([Et],e=>{const{model_list:t}=e,n=[];return ee.forEach(t,r=>{n.push(r.weights)}),n});function N0({model:e,modelsToAdd:t,setModelsToAdd:n}){const{t:r}=K(),o=A(Pb),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(by,{colorScheme:"accent",children:r("modelManager.modelExists")})]}),l.jsx(Ce,{fontStyle:"italic",variant:"subtext",children:e.location})]})}function uD(){const e=Y(),{t}=K(),n=A(P=>P.system.searchFolder),r=A(P=>P.system.foundModels),o=A(Pb),s=A(P=>P.ui.shouldShowExistingModelsInSearch),c=A(P=>P.system.isProcessing),[u,f]=_e.useState([]),[p,h]=_e.useState("v1"),[y,x]=_e.useState(""),S=()=>{e(KS(null)),e(XS(null)),f([])},j=P=>{e(Iv(P.checkpointFolder))},C=()=>{f([]),r&&r.forEach(P=>{o.includes(P.location)||f(M=>[...M,P.name])})},w=()=>{f([])},k=()=>{const P=r==null?void 0:r.filter(T=>u.includes(T.name)),M={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:y};P==null||P.forEach(T=>{const D={name:T.name,description:"",config:M[p],weights:T.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(os(D))}),f([])},I=()=>{const P=[],M=[];return r&&r.forEach((T,D)=>{o.includes(T.location)?M.push(l.jsx(N0,{model:T,modelsToAdd:u,setModelsToAdd:f},D)):P.push(l.jsx(N0,{model:T,modelsToAdd:u,setModelsToAdd:f},D))}),l.jsxs(L,{flexDirection:"column",rowGap:4,children:[P,s&&M]})};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(ae,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:l.jsx(t0,{}),fontSize:18,disabled:c,onClick:()=>e(Iv(n))}),l.jsx(ae,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:l.jsx(So,{}),onClick:S})]}):l.jsx(xs,{initialValues:{checkpointFolder:""},onSubmit:P=>{j(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(t0,{}),"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:C,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(YS(!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:p,onChange:P=>h(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")})})]})})]}),p==="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:y,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?I():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 F0=64,L0=2048;function dD(){const e=Y(),{t}=K(),n=A(p=>p.system.isProcessing);function r(p){return/\s/.test(p)}function o(p){let h;return r(p)&&(h=t("modelManager.cannotUseSpaces")),h}const s={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},c=p=>{e(os(p)),e(Di(null))},[u,f]=_e.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:p,errors:h,touched:y})=>l.jsx(bs,{onSubmit:p,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:!!h.name&&y.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"}),h.name&&y.name?l.jsx(mn,{children:h.name}):l.jsx(pn,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!h.description&&y.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"}),h.description&&y.description?l.jsx(mn,{children:h.description}):l.jsx(pn,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!h.config&&y.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"}),h.config&&y.config?l.jsx(mn,{children:h.config}):l.jsx(pn,{margin:0,children:t("modelManager.configValidationMsg")})]})]})}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!h.weights&&y.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"}),h.weights&&y.weights?l.jsx(mn,{children:h.weights}):l.jsx(pn,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]})}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!h.vae&&y.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"}),h.vae&&y.vae?l.jsx(mn,{children:h.vae}):l.jsx(pn,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]})}),l.jsxs(oa,{width:"100%",children:[l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!h.width&&y.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:F0,max:L0,step:64,value:S.values.width,onChange:j=>S.setFieldValue(x.name,Number(j))})}),h.width&&y.width?l.jsx(mn,{children:h.width}):l.jsx(pn,{margin:0,children:t("modelManager.widthValidationMsg")})]})]})}),l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!h.height&&y.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:F0,max:L0,step:64,value:S.values.height,onChange:j=>S.setFieldValue(x.name,Number(j))})}),h.height&&y.height?l.jsx(mn,{children:h.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(uD,{})]})}function fD(){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:p})=>{var h,y,x,S,j,C,w,k,I,P;return l.jsx(bs,{onSubmit:u,children:l.jsxs(Fe,{rowGap:2,children:[l.jsx(er,{children:l.jsxs(rt,{isInvalid:!!f.name&&p.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&&p.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&&p.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&&p.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&&p.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&&p.path?l.jsx(mn,{children:f.path}):l.jsx(pn,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!f.repo_id&&p.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&&p.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:!!((h=f.vae)!=null&&h.path)&&((y=p.vae)==null?void 0:y.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=p.vae)!=null&&S.path)?l.jsx(mn,{children:(j=f.vae)==null?void 0:j.path}):l.jsx(pn,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((C=f.vae)!=null&&C.repo_id)&&((w=p.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&&((I=p.vae)!=null&&I.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 B0({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 hD(){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(ae,{"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(Lx,{})}),l.jsx(aa,{}),l.jsxs(Wr,{children:[r==null&&l.jsxs(L,{columnGap:4,children:[l.jsx(B0,{text:s("modelManager.addCheckpointModel"),onClick:()=>o(Di("ckpt"))}),l.jsx(B0,{text:s("modelManager.addDiffuserModel"),onClick:()=>o(Di("diffusers"))})]}),r=="ckpt"&&l.jsx(dD,{}),r=="diffusers"&&l.jsx(fD,{})]}),l.jsx(Lr,{})]})]})]})}var pD=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"})]})}),Ib=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"})]})}),mD=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,p=()=>{s(k1(c))},h=()=>{s(Mv(c))},y=()=>{s(QS(c)),s(Mv(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:h,cursor:"pointer",children:l.jsx(Gt,{label:f,hasArrow:!0,placement:"bottom",children:l.jsx(Ce,{fontWeight:"600",children:c})})}),l.jsx(kc,{onClick:h,cursor:"pointer"}),l.jsxs(L,{gap:2,alignItems:"center",children:[l.jsx(Ce,{color:x(),children:u}),l.jsx(ni,{size:"sm",onClick:p,isDisabled:u==="active"||t||!n,children:o("modelManager.load")}),l.jsx(ae,{icon:l.jsx(pD,{}),size:"sm",onClick:h,"aria-label":o("accessibility.modifyConfig"),isDisabled:u==="active"||t||!n}),l.jsx(Wc,{title:o("modelManager.deleteModel"),acceptCallback:y,acceptButtonText:o("modelManager.delete"),triggerComponent:l.jsx(ae,{icon:l.jsx(mD,{}),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 H0(e){const{children:t,value:n}=e,[r,o]=E1("colors",["base.800","base.200"]);return l.jsx("option",{value:n,style:{background:r,color:o},children:t})}const vD=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(nx,{...c,children:r.map(u=>typeof u=="string"||typeof u=="number"?l.jsx(H0,{value:u,children:u},u):l.jsx(H0,{value:u.value,children:u.key},u.value))})})]})},Mn=g.memo(vD);function gD(e){return ve({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 Mb(e){return ve({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 yD(e){return ve({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 xD(e){return ve({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 bD(e){return ve({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 SD(e){return ve({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 CD=e=>{const[t,n]=g.useState(!1),{label:r,value:o,min:s=1,max:c=100,step:u=1,onChange:f,tooltipSuffix:p="",withSliderMarks:h=!1,withInput:y=!1,isInteger:x=!1,inputWidth:S=16,inputReadOnly:j=!1,withReset:C=!1,hideTooltip:w=!1,isCompact:k=!1,handleReset:I,isResetDisabled:P,isSliderDisabled:M,isInputDisabled:T,sliderFormControlProps:D,sliderFormLabelProps:_,sliderMarkProps:R,sliderTrackProps:V,sliderThumbProps:F,sliderNumberInputProps:B,sliderNumberInputFieldProps:Q,sliderNumberInputStepperProps:U,sliderTooltipProps:X,sliderIAIIconButtonProps:te,...re}=e,{t:$}=K(),[Z,fe]=g.useState(String(o));g.useEffect(()=>{fe(o)},[o]);const Se=g.useMemo(()=>B!=null&&B.max?B.max:c,[c,B==null?void 0:B.max]),Me=se=>{f(se)},Ie=se=>{se.target.value===""&&(se.target.value=String(s));const Ne=ee.clamp(x?Math.floor(Number(se.target.value)):Number(Z),s,Se);f(Ne)},Pe=se=>{fe(se)},he=()=>{I&&I()};return l.jsxs(rt,{sx:k?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},...D,children:[l.jsx(st,{..._,mb:-1,children:r}),l.jsxs(oa,{w:"100%",gap:2,alignItems:"center",children:[l.jsxs(sx,{"aria-label":r,value:o,min:s,max:c,step:u,onChange:Me,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:M,...re,children:[h&&l.jsxs(l.Fragment,{children:[l.jsx(Tf,{value:s,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...R,children:s}),l.jsx(Tf,{value:c,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...R,children:c})]}),l.jsx(cx,{...V,children:l.jsx(ux,{})}),l.jsx(Gt,{hasArrow:!0,placement:"top",isOpen:t,label:`${o}${p}`,hidden:w,...X,children:l.jsx(lx,{...F})})]}),y&&l.jsxs(Nh,{min:s,max:Se,step:u,value:Z,onChange:Pe,onBlur:Ie,isDisabled:T,...B,children:[l.jsx(Lh,{readOnly:j,minWidth:S,...Q}),l.jsxs(Fh,{...U,children:[l.jsx(Hh,{onClick:()=>f(Number(Z))}),l.jsx(Bh,{onClick:()=>f(Number(Z))})]})]}),C&&l.jsx(ae,{size:"sm","aria-label":$("accessibility.reset"),tooltip:"Reset",icon:l.jsx(Mb,{}),onClick:he,isDisabled:P,...te})]})]})},ut=g.memo(CD);function wD(){const e=Y(),{isOpen:t,onOpen:n,onClose:r}=po(),o=A(K9),{t:s}=K(),[c,u]=g.useState(Object.keys(o)[0]),[f,p]=g.useState(Object.keys(o)[1]),[h,y]=g.useState("none"),[x,S]=g.useState(""),[j,C]=g.useState(.5),[w,k]=g.useState("weighted_sum"),[I,P]=g.useState("root"),[M,T]=g.useState(""),[D,_]=g.useState(!1),R=Object.keys(o).filter(U=>U!==f&&U!==h),V=Object.keys(o).filter(U=>U!==c&&U!==h),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,h];U=U.filter(te=>te!=="none");const X={models_to_merge:U,merged_model_name:x!==""?x:U.join("-"),alpha:j,interp:w,model_merge_save_path:I==="root"?null:M,force:D};e(ZS(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:R,onChange:U=>u(U.target.value)}),l.jsx(Mn,{label:s("modelManager.modelTwo"),validValues:V,onChange:U=>p(U.target.value)}),l.jsx(Mn,{label:s("modelManager.modelThree"),validValues:F,onChange:U=>{U.target.value!=="none"?(y(U.target.value),k("add_difference")):(y("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:j,onChange:U=>C(U),withInput:!0,withReset:!0,handleReset:()=>C(.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:h==="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:I,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")})})]})})]}),I==="custom"&&l.jsx(mt,{label:s("modelManager.mergedModelCustomSaveLocation"),value:M,onChange:U=>T(U.target.value)})]}),l.jsx(ft,{label:s("modelManager.ignoreMismatch"),isChecked:D,onChange:U=>_(U.target.checked),fontWeight:"500"}),l.jsx(Je,{onClick:Q,isLoading:B,isDisabled:I==="custom"&&M==="",children:s("modelManager.merge")})]})}),l.jsx(Lr,{})]})]})]})}const jD=pe(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 kD=()=>{const e=A(jD),[t,n]=_e.useState(!1);_e.useEffect(()=>{const x=setTimeout(()=>{n(!0)},200);return()=>clearTimeout(x)},[]);const[r,o]=g.useState(""),[s,c]=g.useState("all"),[u,f]=g.useTransition(),{t:p}=K(),h=x=>{f(()=>{o(x.target.value)})},y=g.useMemo(()=>{const x=[],S=[],j=[],C=[];return e.forEach((w,k)=>{w.name.toLowerCase().includes(r.toLowerCase())&&(j.push(l.jsx(Ol,{name:w.name,status:w.status,description:w.description},k)),w.format===s&&C.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:j}):l.jsx(Ye,{marginTop:4,children:C}):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:p("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:p("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,p,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:p("modelManager.availableModels")}),l.jsx(kc,{}),l.jsx(hD,{}),l.jsx(wD,{})]}),l.jsx(mt,{onChange:h,label:p("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:p("modelManager.allModels"),onClick:()=>c("all"),isActive:s==="all"}),l.jsx(Vd,{label:p("modelManager.checkpointModels"),onClick:()=>c("ckpt"),isActive:s==="ckpt"}),l.jsx(Vd,{label:p("modelManager.diffusersModels"),onClick:()=>c("diffusers"),isActive:s==="diffusers"})]}),t?y:l.jsx(L,{width:"100%",minHeight:96,justifyContent:"center",alignItems:"center",children:l.jsx(yc,{})})]})]})};function ED({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:[g.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(kD,{}),s&&o[s].format==="diffusers"?l.jsx(lD,{}):l.jsx(aD,{})]})}),l.jsx(Lr,{})]})]})]})}const PD=pe([Et],e=>{const{isProcessing:t,model_list:n}=e;return{models:ee.map(n,(o,s)=>s),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),ID=()=>{const e=Y(),{t}=K(),{models:n,isProcessing:r}=A(PD),o=A(Kx),s=c=>{e(k1(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})})},MD=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(dx,{...c})]})},En=g.memo(MD),TD=pe([Et,Pr],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,model_list:s,saveIntermediatesInterval:c,enableImageDebugging:u}=e,{shouldUseCanvasBetaLayout:f,shouldUseSliders:p}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,models:ee.map(s,(h,y)=>y),saveIntermediatesInterval:c,enableImageDebugging:u,shouldUseCanvasBetaLayout:f,shouldUseSliders:p}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Ud={flexDirection:"column",gap:2,p:4,bg:"base.900"},_D=({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:p}=po(),{shouldDisplayInProgressType:h,shouldConfirmOnDelete:y,shouldDisplayGuides:x,saveIntermediatesInterval:S,enableImageDebugging:j,shouldUseCanvasBetaLayout:C,shouldUseSliders:w}=A(TD),k=()=>{i3.purge().then(()=>{c(),f()})},I=P=>{P>r&&(P=r),P<1&&(P=1),t(a3(P))};return l.jsxs(l.Fragment,{children:[g.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:JS,value:h,onChange:P=>t(e3(P.target.value))}),h==="full-res"&&l.jsx(Vr,{label:n("settings.saveSteps"),min:1,max:r,step:1,onChange:I,value:S,width:"auto",textAlign:"center"}),l.jsx(En,{label:n("settings.confirmOnDelete"),isChecked:y,onChange:P=>t(P1(P.target.checked))}),l.jsx(En,{label:n("settings.displayHelpIcons"),isChecked:x,onChange:P=>t(t3(P.target.checked))}),l.jsx(En,{label:n("settings.useCanvasBeta"),isChecked:C,onChange:P=>t(n3(P.target.checked))}),l.jsx(En,{label:n("settings.useSlidersForAll"),isChecked:w,onChange:P=>t(r3(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:j,onChange:P=>t(o3(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:p,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,{})]})]})]})},DD=pe(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}}),AD=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:o,hasError:s,wasErrorSeen:c}=A(DD),u=Y(),{t:f}=K();let p;e&&!s?p="ok":p="error";let h=o;t&&(p="working"),h&&t&&r>1&&(h=`${f(h)} (${n}/${r})`);const y=s&&!c?"Click to clear, check logs for details":void 0,x=s&&!c?"pointer":"initial",S=()=>{(s||!c)&&u(j1())};return l.jsx(Gt,{label:y,children:l.jsx(Ce,{cursor:x,onClick:S,sx:{fontSize:"xs",fontWeight:"600",color:`${p}.400`},children:f(h)})})},OD=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=g.memo(OD);function zD(){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(s3(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(ae,{"aria-label":e("common.themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(F9,{})}),children:l.jsx(Fe,{align:"stretch",children:s()})})}function RD(){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(ae,{"aria-label":e("common.languagePickerLabel"),tooltip:e("common.languagePickerLabel"),icon:l.jsx(z9,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:l.jsx(Fe,{children:r()})})}function ND(e){return ve({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 FD(e){return ve({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 LD(e){return ve({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 BD(e){return ve({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 HD(e){return ve({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 WD(e){return ve({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 W0(e){return ve({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 VD(e){return ve({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 UD(e){return ve({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 fp(e){return ve({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 $D(e){return ve({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 GD(e){return ve({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 qD(e){return ve({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 YD(e){return ve({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 KD=""+new URL("logo-13003d72.png",import.meta.url).href,Tb=()=>{const e=A(t=>t.system.app_version);return l.jsxs(L,{alignItems:"center",gap:3,ps:1,children:[l.jsx(cs,{src:KD,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})]})},_b=()=>{const{t:e}=K();return l.jsxs(ir,{gridTemplateColumns:"auto max-content",children:[l.jsx(Tb,{}),l.jsxs(L,{alignItems:"center",gap:2,children:[l.jsx(AD,{}),l.jsx(ID,{}),l.jsx(ED,{children:l.jsx(ae,{"aria-label":e("modelManager.modelManager"),tooltip:e("modelManager.modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(M9,{})})}),l.jsx(sP,{children:l.jsx(ae,{"aria-label":e("common.hotkeysLabel"),tooltip:e("common.hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(O9,{})})}),l.jsx(zD,{}),l.jsx(RD,{}),l.jsx(qo,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",marginBottom:"-0.25rem",children:l.jsx(ae,{"aria-label":e("common.reportBugLabel"),tooltip:e("common.reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx(I9,{})})}),l.jsx(qo,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",marginBottom:"-0.25rem",children:l.jsx(ae,{"aria-label":e("common.githubLabel"),tooltip:e("common.githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx(C9,{})})}),l.jsx(qo,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",marginBottom:"-0.25rem",children:l.jsx(ae,{"aria-label":e("common.discordLabel"),tooltip:e("common.discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx(S9,{})})}),l.jsx(_D,{children:l.jsx(ae,{"aria-label":e("common.settingsLabel"),tooltip:e("common.settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:l.jsx(LD,{})})})]})]})};_b.displayName="SiteHeader";const hp=e=>{const{children:t}=e;return l.jsx(L,{sx:{width:"100%",height:"100%",bg:"base.850"},children:t})};function XD(){const{t:e}=K();return l.jsx(hp,{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 QD=()=>{const{t:e}=K();return l.jsx(hp,{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 ZD(){const{t:e}=K();return l.jsx(hp,{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=pe(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:ee.isEqual}}),qr=e=>e.gallery,JD=pe([qr,Pr,Ss,bt],(e,t,n,r)=>{const{categories:o,currentCategory:s,currentImageUuid:c,galleryImageMinimumWidth:u,galleryImageObjectFit:f,shouldAutoSwitchToNewImages:p,galleryWidth:h,shouldUseSingleGalleryColumn:y}=e,{shouldPinGallery:x}=t,{isLightboxOpen:S}=n;return{currentImageUuid:c,shouldPinGallery:x,galleryImageMinimumWidth:u,galleryImageObjectFit:f,galleryGridTemplateColumns:y?"auto":`repeat(auto-fill, minmax(${u}px, auto))`,shouldAutoSwitchToNewImages:p,currentCategory:s,images:o[s].images,areMoreImagesAvailable:o[s].areMoreImagesAvailable,galleryWidth:h,shouldEnableResize:!(S||r==="unifiedCanvas"&&x),shouldUseSingleGalleryColumn:y}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),eA=pe([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}}),tA=pe(qr,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),nA=()=>{const{resultImages:e,userImages:t}=A(tA);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}},rA=({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"}),oA=({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",iA="2px",aA="5px",sA=({isPinned:e,isResizable:t,direction:n})=>{if(!t)return{containerStyles:{},handleStyles:{}};const r=e?iA:aA,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:{}}},lA=(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},cA=ne(Rx,{shouldForwardProp:e=>!["sx"].includes(e)}),Db=({direction:e="left",isResizable:t,isPinned:n,isOpen:r,onClose:o,children:s,initialWidth:c,minWidth:u,maxWidth:f,initialHeight:p,minHeight:h,maxHeight:y,onResizeStart:x,onResizeStop:S,onResize:j,sx:C={}})=>{const w=ta().direction,k=g.useRef(null),I=g.useMemo(()=>c??u??(["left","right"].includes(e)?500:"100%"),[c,u,e]),P=g.useMemo(()=>p??h??(["top","bottom"].includes(e)?500:"100%"),[p,h,e]),[M,T]=g.useState(I),[D,_]=g.useState(P);T6({ref:k,handler:()=>{o()},enabled:r&&!n});const R=g.useMemo(()=>t?rA({direction:e,langDirection:w}):{},[t,w,e]),V=g.useMemo(()=>oA({direction:e,minWidth:t?oo(u,18):oo(u),maxWidth:t?oo(f,18):oo(f),minHeight:t?oo(h,18):oo(h),maxHeight:t?oo(y,18):oo(y)}),[u,f,h,y,e,t]),{containerStyles:F,handleStyles:B}=g.useMemo(()=>sA({isPinned:n,isResizable:t,direction:e}),[n,t,e]),Q=g.useMemo(()=>lA(e,w),[e,w]);return g.useEffect(()=>{["left","right"].includes(e)&&_(n?"100%":"100vh"),["top","bottom"].includes(e)&&T(n?"100%":"100vw")},[n,e]),l.jsx(b2,{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(cA,{size:{width:t?M:I,height:t?D:P},enable:R,handleStyles:B,...V,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,...C},onResizeStart:(U,X,te)=>{x&&x(U,X,te)},onResize:(U,X,te,re)=>{j&&j(U,X,te,re)},onResizeStop:(U,X,te,re)=>{["left","right"].includes(X)&&T(Number(M)+re.width),["top","bottom"].includes(X)&&_(Number(D)+re.height),S&&S(U,X,te,re)},children:s})})})},V0={position:"absolute",width:"full",height:24,left:0,pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},Ab=({children:e})=>{const t=g.useRef(null),n=g.useRef(null),r=g.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 g.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:{...V0,bottom:0,boxShadow:"inset 0 -3.5rem 2rem -2rem var(--invokeai-colors-base-900)"}}),l.jsx(Ye,{ref:n,sx:{...V0,top:0,boxShadow:"inset 0 3.5rem 2rem -2rem var(--invokeai-colors-base-900)"}})]})},uA=ee.debounce(e=>{e(I1(!0))},300),cn=()=>(e,t)=>{bt(t())==="unifiedCanvas"&&uA(e)};function Ob(e){return ve({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 zb(e){return ve({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 U0=e=>{const{sx:t}=e,n=Y(),r=A(c=>c.ui.shouldPinParametersPanel),{t:o}=K(),s=()=>{n(l3(!r)),n(cn())};return l.jsx(Gt,{label:o("common.pinOptionsPanel"),children:l.jsx(ae,{...e,"aria-label":o("common.pinOptionsPanel"),onClick:s,icon:r?l.jsx(Ob,{}):l.jsx(zb,{}),variant:"ghost",size:"sm",sx:{color:"base.700",_hover:{color:"base.550"},_active:{color:"base.500"},...t}})})},dA=pe([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}}),fA=({children:e})=>{const t=Y(),{shouldPinParametersPanel:n,shouldShowParametersPanel:r,isResizable:o,isLightboxOpen:s}=A(dA),c=()=>{t(ql(!1))};return ce("o",()=>{t(c3()),n&&t(cn())},{enabled:()=>!s},[n,s]),ce("esc",()=>{t(ql(!1))},{enabled:()=>!n,preventDefault:!0},[n]),ce("shift+o",()=>{t(u3()),t(cn())},[]),l.jsx(Db,{direction:"left",isResizable:o||!n,isOpen:r,onClose:c,isPinned:n||s,sx:{borderColor:"base.700",p:n?0:4,bg:"base.900"},initialWidth:r0,minWidth:r0,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(Tb,{}),l.jsx(U0,{})]}),l.jsx(Ab,{children:e}),n&&l.jsx(U0,{sx:{position:"absolute",top:0,insetInlineEnd:0}})]})})},hA=g.memo(fA),pA=pe([Pr,bt],(e,t)=>{const{shouldPinParametersPanel:n}=e;return{shouldPinParametersPanel:n,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),pp=e=>{const{parametersPanelContent:t,children:n,...r}=e,o=Y(),{activeTabName:s}=A(pA),c=nA(),u=f=>{const p=f.dataTransfer.getData("invokeai/imageUuid"),h=c(p);h&&(s==="img2img"?o(rs(h)):s==="unifiedCanvas"&&o(bc(h)))};return l.jsxs(L,{...r,pos:"relative",w:"full",h:nP,gap:4,children:[l.jsx(hA,{children:t}),l.jsx(Ye,{pos:"relative",w:"100%",h:"100%",onDrop:u,children:n})]})},mA=e=>{const{styleClass:t}=e,n=g.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 vA(){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:d3.concat(),value:e,onChange:r})}function gA(){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 yA(){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 mp=()=>{const e=A(t=>t.postprocessing.facetoolType);return l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(vA,{}),l.jsx(gA,{}),e==="codeformer"&&l.jsx(yA,{})]})};function xA(){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 bA(){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 SA(){const e=A(s=>s.system.isESRGANAvailable),t=A(s=>s.postprocessing.upscalingLevel),{t:n}=K(),r=Y(),o=s=>r(M1(Number(s.target.value)));return l.jsx(Mn,{isDisabled:!e,label:n("parameters.scale"),value:t,onChange:o,validValues:f3})}const vp=()=>l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(SA,{}),l.jsx(xA,{}),l.jsx(bA,{})]}),gp=e=>e.postprocessing,CA=pe(Et,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),hc=ue(({image:e,children:t},n)=>{const{isOpen:r,onOpen:o,onClose:s}=po(),c=Y(),{shouldConfirmOnDelete:u,isConnected:f,isProcessing:p}=A(CA),h=g.useRef(null),y=j=>{j.stopPropagation(),u?o():x()},x=()=>{f&&!p&&e&&c(h3(e)),s()};ce("delete",()=>{u?o():x()},[e,u,f,p]);const S=j=>c(P1(!j.target.checked));return l.jsxs(l.Fragment,{children:[g.cloneElement(t,{onClick:e?y:void 0,ref:n}),l.jsx(Yy,{isOpen:r,leastDestructiveRef:h,onClose:s,children:l.jsx(Hr,{children:l.jsxs(Ky,{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:h,onClick:s,children:"Cancel"}),l.jsx(Je,{colorScheme:"error",onClick:x,ml:3,children:"Delete"})]})]})})})]})});hc.displayName="DeleteImageModal";const yp=()=>{const e=Y();return t=>{const n=typeof t=="string"?t:T1(t),[r,o]=p3(n);e(_1(r)),e(D1(o))}},wA=pe([Et,qr,gp,Pr,Ss,bt],(e,t,n,r,o,s)=>{const{isProcessing:c,isConnected:u,isGFPGANAvailable:f,isESRGANAvailable:p}=e,{upscalingLevel:h,facetoolStrength:y}=n,{isLightboxOpen:x}=o,{shouldShowImageDetails:S,shouldHidePreview:j}=r,{intermediateImage:C,currentImage:w}=t;return{isProcessing:c,isConnected:u,isGFPGANAvailable:f,isESRGANAvailable:p,upscalingLevel:h,facetoolStrength:y,shouldDisableToolbarButtons:Boolean(C)||!w,currentImage:w,shouldShowImageDetails:S,activeTabName:s,isLightboxOpen:x,shouldHidePreview:j}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Rb=e=>{var U,X,te,re,$,Z,fe,Se;const t=Y(),{isProcessing:n,isConnected:r,isGFPGANAvailable:o,isESRGANAvailable:s,upscalingLevel:c,facetoolStrength:u,shouldDisableToolbarButtons:f,shouldShowImageDetails:p,currentImage:h,isLightboxOpen:y,activeTabName:x,shouldHidePreview:S}=A(wA),j=ls(),{t:C}=K(),w=yp(),k=()=>{h&&(y&&t(Uo(!1)),t(rs(h)),t(kn("img2img")))},I=async()=>{if(!h)return;const Me=await fetch(h.url).then(Pe=>Pe.blob()),Ie=[new ClipboardItem({[Me.type]:Me})];await navigator.clipboard.write(Ie),j({title:C("toast.imageCopied"),status:"success",duration:2500,isClosable:!0})},P=()=>{navigator.clipboard.writeText(h?window.location.toString()+h.url:"").then(()=>{j({title:C("toast.imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};ce("shift+i",()=>{h?(k(),j({title:C("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):j({title:C("toast.imageNotLoaded"),description:C("toast.imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[h]);const M=()=>{t(m3(!S))},T=()=>{var Me,Ie;h&&(h.metadata&&t(A1(h.metadata)),((Me=h.metadata)==null?void 0:Me.image.type)==="img2img"?t(kn("img2img")):((Ie=h.metadata)==null?void 0:Ie.image.type)==="txt2img"&&t(kn("txt2img")))};ce("a",()=>{var Me,Ie;["txt2img","img2img"].includes((Ie=(Me=h==null?void 0:h.metadata)==null?void 0:Me.image)==null?void 0:Ie.type)?(T(),j({title:C("toast.parametersSet"),status:"success",duration:2500,isClosable:!0})):j({title:C("toast.parametersNotSet"),description:C("toast.parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[h]);const D=()=>{h!=null&&h.metadata&&t(is(h.metadata.image.seed))};ce("s",()=>{var Me,Ie;(Ie=(Me=h==null?void 0:h.metadata)==null?void 0:Me.image)!=null&&Ie.seed?(D(),j({title:C("toast.seedSet"),status:"success",duration:2500,isClosable:!0})):j({title:C("toast.seedNotSet"),description:C("toast.seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[h]);const _=g.useCallback(()=>{var Me,Ie,Pe,he;(Ie=(Me=h==null?void 0:h.metadata)==null?void 0:Me.image)!=null&&Ie.prompt&&w((he=(Pe=h==null?void 0:h.metadata)==null?void 0:Pe.image)==null?void 0:he.prompt)},[(X=(U=h==null?void 0:h.metadata)==null?void 0:U.image)==null?void 0:X.prompt,w]);ce("p",()=>{var Me,Ie;(Ie=(Me=h==null?void 0:h.metadata)==null?void 0:Me.image)!=null&&Ie.prompt?(_(),j({title:C("toast.promptSet"),status:"success",duration:2500,isClosable:!0})):j({title:C("toast.promptNotSet"),description:C("toast.promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[h]);const R=()=>{h&&t(v3(h))};ce("Shift+U",()=>{s&&!f&&r&&!n&&c?R():j({title:C("toast.upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[h,s,f,r,n,c]);const V=()=>{h&&t(g3(h))};ce("Shift+R",()=>{o&&!f&&r&&!n&&u?V():j({title:C("toast.faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[h,o,f,r,n,u]);const F=()=>t(O1(!p)),B=()=>{h&&(y&&t(Uo(!1)),t(bc(h)),t(cn()),x!=="unifiedCanvas"&&t(kn("unifiedCanvas")),j({title:C("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};ce("i",()=>{h?F():j({title:C("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[h,p]);const Q=()=>{t(Uo(!y))};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(ae,{"aria-label":`${C("parameters.sendTo")}...`,icon:l.jsx(U9,{})}),children:l.jsxs(L,{sx:{flexDirection:"column",rowGap:2},children:[l.jsx(Je,{size:"sm",onClick:k,leftIcon:l.jsx(n0,{}),children:C("parameters.sendToImg2Img")}),l.jsx(Je,{size:"sm",onClick:B,leftIcon:l.jsx(n0,{}),children:C("parameters.sendToUnifiedCanvas")}),l.jsx(Je,{size:"sm",onClick:I,leftIcon:l.jsx(Xi,{}),children:C("parameters.copyImage")}),l.jsx(Je,{size:"sm",onClick:P,leftIcon:l.jsx(Xi,{}),children:C("parameters.copyImageToLink")}),l.jsx(qo,{download:!0,href:h==null?void 0:h.url,children:l.jsx(Je,{leftIcon:l.jsx(Qh,{}),size:"sm",w:"100%",children:C("parameters.downloadImage")})})]})}),l.jsx(ae,{icon:S?l.jsx(Zh,{}):l.jsx($x,{}),tooltip:C(S?"parameters.showPreview":"parameters.hidePreview"),"aria-label":C(S?"parameters.showPreview":"parameters.hidePreview"),isChecked:S,onClick:M}),l.jsx(ae,{icon:l.jsx(_9,{}),tooltip:y?`${C("parameters.closeViewer")} (Z)`:`${C("parameters.openInViewer")} (Z)`,"aria-label":y?`${C("parameters.closeViewer")} (Z)`:`${C("parameters.openInViewer")} (Z)`,isChecked:y,onClick:Q})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(ae,{icon:l.jsx(B9,{}),tooltip:`${C("parameters.usePrompt")} (P)`,"aria-label":`${C("parameters.usePrompt")} (P)`,isDisabled:!((re=(te=h==null?void 0:h.metadata)==null?void 0:te.image)!=null&&re.prompt),onClick:_}),l.jsx(ae,{icon:l.jsx(V9,{}),tooltip:`${C("parameters.useSeed")} (S)`,"aria-label":`${C("parameters.useSeed")} (S)`,isDisabled:!((Z=($=h==null?void 0:h.metadata)==null?void 0:$.image)!=null&&Z.seed),onClick:D}),l.jsx(ae,{icon:l.jsx(P9,{}),tooltip:`${C("parameters.useAll")} (A)`,"aria-label":`${C("parameters.useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((Se=(fe=h==null?void 0:h.metadata)==null?void 0:fe.image)==null?void 0:Se.type),onClick:T})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(or,{triggerComponent:l.jsx(ae,{icon:l.jsx(D9,{}),"aria-label":C("parameters.restoreFaces")}),children:l.jsxs(L,{sx:{flexDirection:"column",rowGap:4},children:[l.jsx(mp,{}),l.jsx(Je,{isDisabled:!o||!h||!(r&&!n)||!u,onClick:V,children:C("parameters.restoreFaces")})]})}),l.jsx(or,{triggerComponent:l.jsx(ae,{icon:l.jsx(T9,{}),"aria-label":C("parameters.upscale")}),children:l.jsxs(L,{sx:{flexDirection:"column",gap:4},children:[l.jsx(vp,{}),l.jsx(Je,{isDisabled:!s||!h||!(r&&!n)||!c,onClick:R,children:C("parameters.upscaleImage")})]})})]}),l.jsx(Qt,{isAttached:!0,children:l.jsx(ae,{icon:l.jsx(Hx,{}),tooltip:`${C("parameters.info")} (I)`,"aria-label":`${C("parameters.info")} (I)`,isChecked:p,onClick:F})}),l.jsx(hc,{image:h,children:l.jsx(ae,{icon:l.jsx(So,{}),tooltip:`${C("parameters.deleteImage")} (Del)`,"aria-label":`${C("parameters.deleteImage")} (Del)`,isDisabled:!h||!r||n,colorScheme:"error"})})]})},jA=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 kA(e){return ve({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(kA,{}),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(Ib,{mx:"2px"})]}):l.jsx(Ce,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]})},EA=(e,t)=>e.image.uuid===t.image.uuid,xp=g.memo(({image:e})=>{var F,B;const t=Y(),n=yp();ce("esc",()=>{t(O1(!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:p,mask_image_path:h,orig_path:y,perlin:x,postprocessing:S,prompt:j,sampler:C,seamless:w,seed:k,steps:I,strength:P,threshold:M,type:T,variations:D,width:_}=r,{t:R}=K(),V=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(Ib,{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:y}),j&&l.jsx(yt,{label:"Prompt",labelPosition:"top",value:typeof j=="string"?j:T1(j),onClick:()=>n(j)}),k!==void 0&&l.jsx(yt,{label:"Seed",value:k,onClick:()=>t(is(k))}),M!==void 0&&l.jsx(yt,{label:"Noise Threshold",value:M,onClick:()=>t(tf(M))}),x!==void 0&&l.jsx(yt,{label:"Perlin Noise",value:x,onClick:()=>t(nf(x))}),C&&l.jsx(yt,{label:"Sampler",value:C,onClick:()=>t(z1(C))}),I&&l.jsx(yt,{label:"Steps",value:I,onClick:()=>t(rf(I))}),s!==void 0&&l.jsx(yt,{label:"CFG scale",value:s,onClick:()=>t(of(s))}),D&&D.length>0&&l.jsx(yt,{label:"Seed-weight pairs",value:Tv(D),onClick:()=>t(R1(Tv(D)))}),w&&l.jsx(yt,{label:"Seamless",value:w,onClick:()=>t(N1(w))}),f&&l.jsx(yt,{label:"High Resolution Optimization",value:f,onClick:()=>t(F1(f))}),_&&l.jsx(yt,{label:"Width",value:_,onClick:()=>t(Fl(_))}),u&&l.jsx(yt,{label:"Height",value:u,onClick:()=>t(Ll(u))}),p&&l.jsx(yt,{label:"Initial image",value:p,isLink:!0,onClick:()=>t(rs(p))}),h&&l.jsx(yt,{label:"Mask image",value:h,isLink:!0,onClick:()=>t(y3(h))}),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(L1(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(M1(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":R("accessibility.copyMetadataJson"),icon:l.jsx(Xi,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(V)})}),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:V})})]})]}):l.jsx(Sy,{width:"100%",pt:10,children:l.jsx(Ce,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})},EA);xp.displayName="ImageMetadataViewer";const $0={height:"100%",width:"15%",alignItems:"center",pointerEvents:"auto"},G0={color:"base.100"},PA=pe(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}}),Nb=()=>{const e=Y(),{t}=K(),{isOnFirstImage:n,isOnLastImage:r}=A(PA),[o,s]=g.useState(!1),c=()=>{s(!0)},u=()=>{s(!1)},f=()=>{e(B1())},p=()=>{e(H1())};return l.jsxs(L,{sx:{justifyContent:"space-between",zIndex:1,height:"100%",width:"100%",pointerEvents:"none"},children:[l.jsx(ir,{sx:{...$0,justifyContent:"flex-start"},onMouseOver:c,onMouseOut:u,children:o&&!n&&l.jsx(ho,{"aria-label":t("accessibility.previousImage"),icon:l.jsx(j9,{size:64}),variant:"unstyled",onClick:f,boxSize:16,sx:G0})}),l.jsx(ir,{sx:{...$0,justifyContent:"flex-end"},onMouseOver:c,onMouseOut:u,children:o&&!r&&l.jsx(ho,{"aria-label":t("accessibility.nextImage"),icon:l.jsx(k9,{size:64}),variant:"unstyled",onClick:p,boxSize:16,sx:G0})})]})},Fb=()=>l.jsx(L,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",position:"absolute",color:"base.400"},children:l.jsx(Zh,{size:"30vh"})}),IA=pe([qr,Pr],(e,t)=>{const{currentImage:n,intermediateImage:r}=e,{shouldShowImageDetails:o,shouldHidePreview:s}=t;return{imageToDisplay:r||n,isIntermediate:Boolean(r),shouldShowImageDetails:o,shouldHidePreview:s}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function MA(){const{shouldShowImageDetails:e,imageToDisplay:t,isIntermediate:n,shouldHidePreview:r}=A(IA);return l.jsxs(L,{sx:{position:"relative",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:[t&&l.jsx(cs,{src:r?void 0:t.url,width:t.width,height:t.height,fallback:r?l.jsx(Fb,{}):n?void 0:l.jsx(jA,{}),sx:{objectFit:"contain",maxWidth:"100%",maxHeight:"100%",height:"auto",position:"absolute",imageRendering:n?"pixelated":"initial",borderRadius:"base"}}),!e&&l.jsx(Nb,{}),e&&t&&l.jsx(Ye,{sx:{position:"absolute",top:"0",width:"100%",height:"100%",borderRadius:"base",overflow:"scroll",maxHeight:rP},children:l.jsx(xp,{image:t})})]})}const TA=pe([qr],e=>{const{currentImage:t,intermediateImage:n}=e;return{hasAnImageToDisplay:t||n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Lb=()=>{const{hasAnImageToDisplay:e}=A(TA);return l.jsx(L,{sx:{flexDirection:"column",height:"100%",width:"100%",rowGap:4,borderRadius:"base"},children:e?l.jsxs(l.Fragment,{children:[l.jsx(Rb,{}),l.jsx(MA,{})]}):l.jsx(L,{sx:{alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:l.jsx(tn,{as:$D,sx:{boxSize:24,color:"base.500"}})})})},_A=()=>{const{t:e}=K(),t=g.useContext(Yh);return l.jsx(ae,{"aria-label":e("accessibility.uploadImage"),tooltip:"Upload Image",icon:l.jsx(Rc,{}),onClick:t||void 0})};function DA(){const e=A(c=>c.generation.initialImage),{shouldHidePreview:t}=A(c=>c.ui),{t:n}=K(),r=Y(),o=ls(),s=()=>{o({title:n("toast.parametersFailed"),description:n("toast.parametersFailedDesc"),status:"error",isClosable:!0}),r(x3())};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:n("parameters.initialImage")}),l.jsx(_A,{})]}),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:t?void 0:typeof e=="string"?e:e.url,fallback:l.jsx(Fb,{}),onError:s})})]})}const q0={flexDirection:"column",height:"100%",width:"100%",gap:4,padding:4},AA=()=>{const t=A(n=>n.generation.initialImage)?l.jsx(L,{flexDirection:"column",gap:4,w:"100%",h:"100%",children:l.jsx(DA,{})}):l.jsx(mA,{});return l.jsxs(ir,{sx:{w:"100%",h:"100%",gridTemplateColumns:"1fr 1fr",borderRadius:"base",bg:"base.850"},children:[l.jsx(L,{sx:{...q0,paddingInlineEnd:2},children:t}),l.jsx(L,{sx:{...q0,paddingInlineStart:2},children:l.jsx(Lb,{})})]})};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 OA=()=>{const{t:e}=K();return g.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])},zA=e=>OA()[e];function Bb(){const e=A(o=>o.system.isGFPGANAvailable),t=A(o=>o.postprocessing.shouldRunFacetool),n=Y(),r=o=>n(b3(o.target.checked));return l.jsx(En,{isDisabled:!e,isChecked:t,onChange:r})}const Hb=()=>{const e=Y(),t=A(o=>o.generation.seamless),n=o=>e(N1(o.target.checked)),{t:r}=K();return l.jsx(En,{label:r("parameters.seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})},RA=()=>l.jsx(Fe,{gap:2,alignItems:"stretch",children:l.jsx(Hb,{})});function bp(){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(_v(s)),min:0,max:n,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>r(_v(0))}),l.jsx(ut,{label:o("parameters.vSymmetryStep"),value:t,onChange:s=>r(Dv(s)),min:0,max:n,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>r(Dv(0))})]})}function Sp(){const e=A(n=>n.generation.shouldUseSymmetry),t=Y();return l.jsx(En,{isChecked:e,onChange:n=>t(S3(n.target.checked))})}function NA(){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 FA(){const e=Y(),{t}=K(),n=A(o=>o.generation.shouldRandomizeSeed),r=o=>e(C3(o.target.checked));return l.jsx(En,{label:t("parameters.randomizeSeed"),isChecked:n,onChange:r})}function LA(){const e=Y(),t=A(o=>o.generation.shouldRandomizeSeed),{t:n}=K(),r=()=>e(is(w3(V1,W1)));return l.jsx(ni,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:l.jsx("p",{children:n("parameters.shuffle")})})}function BA(){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:V1,max:W1,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e,formControlProps:{display:"flex",alignItems:"center",gap:3}}),l.jsx(LA,{})]})}function HA(){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 Cp=()=>l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(FA,{}),l.jsx(BA,{}),l.jsx(HA,{}),l.jsx(NA,{})]});function Wb(){const e=A(o=>o.system.isESRGANAvailable),t=A(o=>o.postprocessing.shouldRunESRGAN),n=Y(),r=o=>n(j3(o.target.checked));return l.jsx(En,{isDisabled:!e,isChecked:t,onChange:r})}function wp(){const e=A(r=>r.generation.shouldGenerateVariations),t=Y(),n=r=>t(k3(r.target.checked));return l.jsx(En,{isChecked:e,width:"auto",onChange:n})}function WA(){const e=A(s=>s.generation.seedWeights),t=A(s=>s.generation.shouldGenerateVariations),{t:n}=K(),r=Y(),o=s=>r(R1(s.target.value));return l.jsx(mt,{label:n("parameters.seedWeights"),value:e,isInvalid:t&&!(U1(e)||e===""),isDisabled:!t,onChange:o})}function VA(){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(Av(o)),handleReset:()=>r(Av(.1)),withInput:!0,withReset:!0,withSliderMarks:!0})}const jp=()=>l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(VA,{}),l.jsx(WA,{})]});function Y0(){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 K0(){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:E3})}function X0(){const e=A(s=>s.generation.iterations),t=A(s=>s.ui.shouldUseSliders),n=Y(),{t:r}=K(),o=s=>n(Ov(s));return t?l.jsx(ut,{label:r("parameters.images"),step:1,min:1,max:16,onChange:o,handleReset:()=>n(Ov(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 Q0(){const e=A(s=>s.generation.sampler),t=A(Kx),n=Y(),{t:r}=K(),o=s=>n(z1(s.target.value));return l.jsx(Mn,{label:r("parameters.sampler"),value:e,onChange:o,validValues:t.format==="diffusers"?P3:I3,minWidth:36})}function Z0(){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($1())};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 J0(){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:M3})}function kp(){return A(t=>t.ui.shouldUseSliders)?l.jsxs(Fe,{gap:2,children:[l.jsx(X0,{}),l.jsx(Z0,{}),l.jsx(Y0,{}),l.jsx(J0,{}),l.jsx(K0,{}),l.jsx(Q0,{})]}):l.jsxs(L,{rowGap:2,flexDirection:"column",children:[l.jsxs(L,{columnGap:1,children:[l.jsx(X0,{}),l.jsx(Z0,{}),l.jsx(Y0,{})]}),l.jsxs(L,{columnGap:1,children:[l.jsx(J0,{}),l.jsx(K0,{}),l.jsx(Q0,{})]})]})}const UA=pe(Et,e=>e.shouldDisplayGuides),$A=({children:e,feature:t})=>{const n=A(UA),{text:r}=zA(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(Qy,{children:r})]})]}):null},GA=g.memo($A),qA=ue(({feature:e,icon:t=FD},n)=>l.jsx(GA,{feature:e,children:l.jsx(Ye,{ref:n,children:l.jsx(tn,{marginBottom:"-.15rem",as:t})})})),YA=g.memo(qA);function KA(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(YA,{feature:n}),l.jsx(Oi,{})]})}),l.jsx(Ri,{children:r})]})}const Ep=e=>{const{accordionInfo:t}=e,n=A(c=>c.system.openAccordions),r=Y(),o=c=>r(T3(c)),s=()=>{const c=[];return t&&Object.keys(t).forEach(u=>{const{header:f,feature:p,content:h,additionalHeaderComponents:y}=t[u];c.push(l.jsx(KA,{header:f,feature:p,content:h,additionalHeaderComponents:y},u))}),c};return l.jsx(ih,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:o,sx:{display:"flex",flexDirection:"column",gap:2},children:s()})},XA=e=>{const{menuType:t="icon",iconTooltip:n,buttonText:r,isLazy:o=!0,menuItems:s,menuProps:c,menuButtonProps:u,menuListProps:f,menuItemProps:p}=e,h=()=>{const y=[];return s.forEach((x,S)=>{y.push(l.jsx(gr,{onClick:x.onClick,fontSize:"sm",...p,children:x.item},S))}),y};return l.jsx(Ah,{...c,isLazy:o,children:({isOpen:y})=>l.jsxs(l.Fragment,{children:[l.jsx(zh,{as:t==="icon"?ho:ni,tooltip:n,"aria-label":n,icon:y?l.jsx(qD,{}):l.jsx(GD,{}),paddingX:0,paddingY:t==="regular"?2:0,...u,children:t==="regular"&&r}),l.jsx(Oh,{zIndex:15,padding:0,...f,children:h()})]})})},QA=g.memo(XA),ZA=pe(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}}),JA=e=>{const t=Y(),{btnGroupWidth:n="auto",...r}=e,{isProcessing:o,isConnected:s,isCancelable:c,currentIteration:u,totalIterations:f,cancelType:p,cancelAfter:h}=A(ZA),y=g.useCallback(()=>{t(_3()),t(fd(null))},[t]),{t:x}=K(),S=h!==null;ce("shift+x",()=>{(s||o)&&c&&y()},[s,o,c]),g.useEffect(()=>{h!==null&&h<u&&y()},[h,u,y]);const j=[{item:x("parameters.cancel.immediate"),onClick:()=>t(zv("immediate"))},{item:x("parameters.cancel.schedule"),onClick:()=>t(zv("scheduled"))}];return l.jsxs(Qt,{isAttached:!0,width:n,children:[p==="immediate"?l.jsx(ae,{icon:l.jsx(YD,{}),tooltip:x("parameters.cancel.immediate"),"aria-label":x("parameters.cancel.immediate"),isDisabled:!s||!o||!c,onClick:y,colorScheme:"error",...r}):l.jsx(ae,{icon:S?l.jsx(tc,{}):l.jsx(ND,{}),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(QA,{menuItems:j,iconTooltip:x("parameters.cancel.setType"),menuButtonProps:{colorScheme:"error",minWidth:5}})]})},Pp=g.memo(JA),tt=e=>e.canvas,Ot=pe([tt,bt,Et],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Vb=e=>e.canvas.layerState.objects.find(G1),Ip=e=>e.generation;pe(Ip,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:ee.isEqual}});const Ub=pe([Ip,Et,Vb,bt],(e,t,n,r)=>{const{prompt:o,shouldGenerateVariations:s,seedWeights:c,initialImage:u,seed:f}=e,{isProcessing:p,isConnected:h}=t;let y=!0;const x=[];return(!o||Boolean(o.match(/^[\s\r\n]+$/)))&&(y=!1,x.push("Missing prompt")),r==="img2img"&&!u&&(y=!1,x.push("No initial image selected")),p&&(y=!1,x.push("System Busy")),h||(y=!1,x.push("System Disconnected")),s&&(!(U1(c)||c==="")||f===-1)&&(y=!1,x.push("Seed-Weights badly formatted.")),{isReady:y,reasonsWhyNotReady:x}},{memoizeOptions:{equalityCheck:ee.isEqual,resultEqualityCheck:ee.isEqual}});function Mp(e){const{iconButton:t=!1,...n}=e,r=Y(),{isReady:o}=A(Ub),s=A(bt),c=()=>{r(sf(s))},{t:u}=K();return ce(["ctrl+enter","meta+enter"],()=>{r($1()),r(sf(s))},{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,s]),l.jsx(Ye,{style:{flexGrow:4},children:t?l.jsx(ae,{"aria-label":u("parameters.invoke"),type:"submit",icon:l.jsx(L9,{}),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 eO=pe(gp,({shouldLoopback:e})=>e),tO=()=>{const e=Y(),t=A(eO),{t:n}=K();return l.jsx(ae,{"aria-label":n("parameters.toggleLoopback"),tooltip:n("parameters.toggleLoopback"),isChecked:t,icon:l.jsx(H9,{}),onClick:()=>{e(D3(!t))}})},Tp=()=>{const e=A(bt);return l.jsxs(L,{gap:2,children:[l.jsx(Mp,{}),e==="img2img"&&l.jsx(tO,{}),l.jsx(Pp,{})]})},_p=()=>{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(D1(r.target.value)),placeholder:n("parameters.negativePrompts"),_focusVisible:{borderColor:"error.600"},fontSize:"sm"})})},nO=pe([e=>e.generation,bt],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Dp=()=>{const e=Y(),{prompt:t,activeTabName:n}=A(nO),{isReady:r}=A(Ub),o=g.useRef(null),{t:s}=K(),c=f=>{e(_1(f.target.value))};ce("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 rO(){const e=Y(),t=A(o=>o.generation.shouldFitToWidthHeight),n=o=>e(L1(o.target.checked)),{t:r}=K();return l.jsx(En,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function $b(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 oO(){const{t:e}=K();return l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx($b,{label:e("parameters.img2imgStrength")}),l.jsx(rO,{})]})}const iO=()=>{const{t:e}=K(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(kp,{})},imageToImage:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:l.jsx(oO,{})},seed:{header:`${e("parameters.seed")}`,feature:ln.SEED,content:l.jsx(Cp,{})},variations:{header:`${e("parameters.variations")}`,feature:ln.VARIATIONS,content:l.jsx(jp,{}),additionalHeaderComponents:l.jsx(wp,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:ln.FACE_CORRECTION,content:l.jsx(mp,{}),additionalHeaderComponents:l.jsx(Bb,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:ln.UPSCALE,content:l.jsx(vp,{}),additionalHeaderComponents:l.jsx(Wb,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(bp,{}),additionalHeaderComponents:l.jsx(Sp,{})},other:{header:`${e("parameters.otherOptions")}`,feature:ln.OTHER,content:l.jsx(RA,{})}};return l.jsxs(L,{flexDir:"column",gap:2,position:"relative",children:[l.jsx(Dp,{}),l.jsx(_p,{}),l.jsx(Tp,{}),l.jsx(Ep,{accordionInfo:t})]})},aO=g.memo(iO);function sO(){return l.jsx(pp,{parametersPanelContent:l.jsx(aO,{}),children:l.jsx(AA,{})})}const lO=()=>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(Lb,{})})}),cO=pe([gp],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),uO=()=>{const{hiresFix:e,hiresStrength:t}=A(cO),n=Y(),{t:r}=K(),o=c=>{n(Rv(c))},s=()=>{n(Rv(.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})},dO=()=>{const e=Y(),t=A(o=>o.postprocessing.hiresFix),{t:n}=K(),r=o=>e(F1(o.target.checked));return l.jsx(En,{label:n("parameters.hiresOptim"),fontSize:"md",isChecked:t,onChange:r})},fO=()=>l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(Hb,{}),l.jsx(dO,{}),l.jsx(uO,{})]}),hO=()=>{const{t:e}=K(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(kp,{})},seed:{header:`${e("parameters.seed")}`,feature:ln.SEED,content:l.jsx(Cp,{})},variations:{header:`${e("parameters.variations")}`,feature:ln.VARIATIONS,content:l.jsx(jp,{}),additionalHeaderComponents:l.jsx(wp,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:ln.FACE_CORRECTION,content:l.jsx(mp,{}),additionalHeaderComponents:l.jsx(Bb,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:ln.UPSCALE,content:l.jsx(vp,{}),additionalHeaderComponents:l.jsx(Wb,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(bp,{}),additionalHeaderComponents:l.jsx(Sp,{})},other:{header:`${e("parameters.otherOptions")}`,feature:ln.OTHER,content:l.jsx(fO,{})}};return l.jsxs(L,{flexDir:"column",gap:2,children:[l.jsx(Dp,{}),l.jsx(_p,{}),l.jsx(Tp,{}),l.jsx(Ep,{accordionInfo:t})]})},pO=g.memo(hO);function mO(){return l.jsx(pp,{parametersPanelContent:l.jsx(pO,{}),children:l.jsx(lO,{})})}var $f={},vO={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 gO=function(t){var n={},r=g,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"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),j=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),T=Symbol.iterator;function D(i){return i===null||typeof i!="object"?null:(i=T&&i[T]||i["@@iterator"],typeof i=="function"?i:null)}function _(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 h:return"Fragment";case p:return"Portal";case x:return"Profiler";case y:return"StrictMode";case w:return"Suspense";case k:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case j:return(i.displayName||"Context")+".Consumer";case S:return(i._context.displayName||"Context")+".Provider";case C:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case I:return a=i.displayName||null,a!==null?a:_(i.type)||"Memo";case P:a=i._payload,i=i._init;try{return _(i(a))}catch{}}return null}function R(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 _(a);case 8:return a===y?"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 V(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(V(i)!==i)throw Error(c(188))}function B(i){var a=i.alternate;if(!a){if(a=V(i),a===null)throw Error(c(188));return a!==i?null:i}for(var d=i,m=a;;){var v=d.return;if(v===null)break;var b=v.alternate;if(b===null){if(m=v.return,m!==null){d=m;continue}break}if(v.child===b.child){for(b=v.child;b;){if(b===d)return F(v),i;if(b===m)return F(v),a;b=b.sibling}throw Error(c(188))}if(d.return!==m.return)d=v,m=b;else{for(var E=!1,O=v.child;O;){if(O===d){E=!0,d=v,m=b;break}if(O===m){E=!0,m=v,d=b;break}O=O.sibling}if(!E){for(O=b.child;O;){if(O===d){E=!0,d=b,m=v;break}if(O===m){E=!0,m=b,d=v;break}O=O.sibling}if(!E)throw Error(c(189))}}if(d.alternate!==m)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,fe=t.prepareForCommit,Se=t.resetAfterCommit,Me=t.createInstance,Ie=t.appendInitialChild,Pe=t.finalizeInitialChildren,he=t.prepareUpdate,se=t.shouldSetTextContent,Ne=t.createTextInstance,Ve=t.scheduleTimeout,Ue=t.cancelTimeout,$e=t.noTimeout,Qe=t.isPrimaryRenderer,me=t.supportsMutation,De=t.supportsPersistence,Ge=t.supportsHydration,ge=t.getInstanceFromNode,Te=t.preparePortalMount,et=t.getCurrentEventPriority,Be=t.detachDeletedInstance,vt=t.supportsMicrotasks,Rt=t.scheduleMicrotask,N=t.supportsTestSelectors,le=t.findFiberRoot,ye=t.getBoundingRect,je=t.getTextContent,q=t.isHiddenSubtree,ie=t.matchAccessibilityRole,Re=t.setFocusIfFocusable,Ze=t.setupIntersectionObserver,J=t.appendChild,Le=t.appendChildToContainer,nt=t.commitTextUpdate,Nt=t.commitMount,de=t.commitUpdate,Ae=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,P4=t.cloneInstance,Bp=t.createContainerChildSet,Hp=t.appendChildToContainerChildSet,I4=t.finalizeContainerChildren,Qc=t.replaceContainerChildren,Wp=t.cloneHiddenInstance,Vp=t.cloneHiddenTextInstance,M4=t.canHydrateInstance,T4=t.canHydrateTextInstance,_4=t.canHydrateSuspenseInstance,Up=t.isSuspenseInstancePending,Zc=t.isSuspenseInstanceFallback,D4=t.getSuspenseInstanceFallbackErrorDetails,A4=t.registerSuspenseInstanceRetry,ws=t.getNextHydratableSibling,O4=t.getFirstHydratableChild,z4=t.getFirstHydratableChildWithinContainer,R4=t.getFirstHydratableChildWithinSuspenseInstance,N4=t.hydrateInstance,F4=t.hydrateTextInstance,L4=t.hydrateSuspenseInstance,B4=t.getNextHydratableInstanceAfterSuspenseInstance,H4=t.commitHydratedContainer,W4=t.commitHydratedSuspenseInstance,V4=t.clearSuspenseBoundary,U4=t.clearSuspenseBoundaryFromContainer,$4=t.shouldDeleteUnhydratedTailInstances,G4=t.didNotMatchHydratedContainerTextInstance,q4=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(oe){var m=oe}Reflect.construct(i,[],a)}else{try{a.call()}catch(oe){m=oe}i.call(a.prototype)}else{try{throw Error()}catch(oe){m=oe}i()}}catch(oe){if(oe&&m&&typeof oe.stack=="string"){for(var v=oe.stack.split(`
|
||
`),b=m.stack.split(`
|
||
`),E=v.length-1,O=b.length-1;1<=E&&0<=O&&v[E]!==b[O];)O--;for(;1<=E&&0<=O;E--,O--)if(v[E]!==b[O]){if(E!==1||O!==1)do if(E--,O--,0>O||v[E]!==b[O]){var W=`
|
||
`+v[E].replace(" at new "," at ");return i.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",i.displayName)),W}while(1<=E&&0<=O);break}}}finally{eu=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?ua(i):""}var Y4=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 m=i.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var v={},b;for(b in d)v[b]=a[b];return m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=a,i.__reactInternalMemoizedMaskedChildContext=v),v}function xn(i){return i=i.childContextTypes,i!=null}function js(){St(yn),St(nn)}function $p(i,a,d){if(nn.current!==Kr)throw Error(c(168));gt(nn,a),gt(yn,d)}function Gp(i,a,d){var m=i.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return d;m=m.getChildContext();for(var v in m)if(!(v in a))throw Error(c(108,R(i)||"Unknown",v));return s({},d,m)}function ks(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Kr,Po=nn.current,gt(nn,i),gt(yn,yn.current),!0}function qp(i,a,d){var m=i.stateNode;if(!m)throw Error(c(169));d?(i=Gp(i,a,Po),m.__reactInternalMemoizedMergedChildContext=i,St(yn),St(nn),gt(nn,i)):St(yn),gt(yn,d)}var qn=Math.clz32?Math.clz32:Q4,K4=Math.log,X4=Math.LN2;function Q4(i){return i>>>=0,i===0?32:31-(K4(i)/X4|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 m=0,v=i.suspendedLanes,b=i.pingedLanes,E=d&268435455;if(E!==0){var O=E&~v;O!==0?m=da(O):(b&=E,b!==0&&(m=da(b)))}else E=d&~v,E!==0?m=da(E):b!==0&&(m=da(b));if(m===0)return 0;if(a!==0&&a!==m&&!(a&v)&&(v=m&-m,b=a&-a,v>=b||v===16&&(b&4194240)!==0))return a;if(m&4&&(m|=d&16),a=i.entangledLanes,a!==0)for(i=i.entanglements,a&=m;0<a;)d=31-qn(a),v=1<<d,m|=i[d],a&=~v;return m}function Z4(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 J4(i,a){for(var d=i.suspendedLanes,m=i.pingedLanes,v=i.expirationTimes,b=i.pendingLanes;0<b;){var E=31-qn(b),O=1<<E,W=v[E];W===-1?(!(O&d)||O&m)&&(v[E]=Z4(O,a)):W<=a&&(i.expiredLanes|=O),b&=~O}}function ru(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function Yp(){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 eS(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 m=i.eventTimes;for(i=i.expirationTimes;0<d;){var v=31-qn(d),b=1<<v;a[v]=0,m[v]=-1,i[v]=-1,d&=~b}}function iu(i,a){var d=i.entangledLanes|=a;for(i=i.entanglements;d;){var m=31-qn(d),v=1<<m;v&a|i[m]&a&&(i[m]|=a),d&=~v}}var ot=0;function Kp(i){return i&=-i,1<i?4<i?i&268435455?16:536870912:4:1}var au=o.unstable_scheduleCallback,Xp=o.unstable_cancelCallback,tS=o.unstable_shouldYield,nS=o.unstable_requestPaint,qt=o.unstable_now,su=o.unstable_ImmediatePriority,rS=o.unstable_UserBlockingPriority,lu=o.unstable_NormalPriority,oS=o.unstable_IdlePriority,Ms=null,lr=null;function iS(i){if(lr&&typeof lr.onCommitFiberRoot=="function")try{lr.onCommitFiberRoot(Ms,i,void 0,(i.current.flags&128)===128)}catch{}}function aS(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var Yn=typeof Object.is=="function"?Object.is:aS,Mr=null,Ts=!1,cu=!1;function Qp(i){Mr===null?Mr=[i]:Mr.push(i)}function sS(i){Ts=!0,Qp(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 m=d[i];do m=m(!0);while(m!==null)}Mr=null,Ts=!1}catch(v){throw Mr!==null&&(Mr=Mr.slice(i+1)),au(su,cr),v}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 Zp(i,a,d){Dn[An++]=Tr,Dn[An++]=_r,Dn[An++]=Io,Io=i;var m=Tr;i=_r;var v=32-qn(m)-1;m&=~(1<<v),d+=1;var b=32-qn(a)+v;if(30<b){var E=v-v%5;b=(m&(1<<E)-1).toString(32),m>>=E,v-=E,Tr=1<<32-qn(a)+v|d<<v|m,_r=b+i}else Tr=1<<b|d<<v|m,_r=i}function uu(i){i.return!==null&&(Mo(i,1),Zp(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 Jp(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 em(i,a){switch(i.tag){case 5:return a=M4(a,i.type,i.pendingProps),a!==null?(i.stateNode=a,Tn=i,On=O4(a),!0):!1;case 6:return a=T4(a,i.pendingProps),a!==null?(i.stateNode=a,Tn=i,On=null,!0):!1;case 13:if(a=_4(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(!em(i,a)){if(fu(i))throw Error(c(418));a=ws(d);var m=Tn;a&&em(i,a)?Jp(m,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 tm(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 tm(i),Pt=!0,!1;if(i.tag!==3&&(i.tag!==5||$4(i.type)&&!se(i.type,i.memoizedProps))){var a=On;if(a){if(fu(i))throw nm(),Error(c(418));for(;a;)Jp(i,a),a=ws(a)}}if(tm(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=B4(i)}else On=Tn?ws(i.stateNode):null;return!0}function nm(){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 lS=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),m=Object.keys(a);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var v=d[m];if(!Y4.call(a,v)||!Yn(i[v],a[v]))return!1}return!0}function cS(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 rm(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 m=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.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 om(i,a,d,m){var v=a.interleaved;return v===null?(d.next=d,xu(a)):(d.next=v.next,v.next=d),a.interleaved=d,ur(i,m)}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 im(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 m=i.updateQueue;if(m===null)return null;if(m=m.shared,Xe&2){var v=m.pending;return v===null?a.next=a:(a.next=v.next,v.next=a),m.pending=a,ur(i,d)}return v=m.interleaved,v===null?(a.next=a,xu(m)):(a.next=v.next,v.next=a),m.interleaved=a,ur(i,d)}function Ns(i,a,d){if(a=a.updateQueue,a!==null&&(a=a.shared,(d&4194240)!==0)){var m=a.lanes;m&=i.pendingLanes,d|=m,a.lanes=d,iu(i,d)}}function am(i,a){var d=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var v=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?v=b=E:b=b.next=E,d=d.next}while(d!==null);b===null?v=b=a:b=b.next=a}else v=b=a;d={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:b,shared:m.shared,effects:m.effects},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=a:i.next=a,d.lastBaseUpdate=a}function Fs(i,a,d,m){var v=i.updateQueue;Xr=!1;var b=v.firstBaseUpdate,E=v.lastBaseUpdate,O=v.shared.pending;if(O!==null){v.shared.pending=null;var W=O,oe=W.next;W.next=null,E===null?b=oe:E.next=oe,E=W;var ke=i.alternate;ke!==null&&(ke=ke.updateQueue,O=ke.lastBaseUpdate,O!==E&&(O===null?ke.firstBaseUpdate=oe:O.next=oe,ke.lastBaseUpdate=W))}if(b!==null){var He=v.baseState;E=0,ke=oe=W=null,O=b;do{var xe=O.lane,Ct=O.eventTime;if((m&xe)===xe){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(xe=a,Ct=d,wn.tag){case 1:if(ht=wn.payload,typeof ht=="function"){He=ht.call(Ct,He,xe);break e}He=ht;break e;case 3:ht.flags=ht.flags&-65537|128;case 0:if(ht=wn.payload,xe=typeof ht=="function"?ht.call(Ct,He,xe):ht,xe==null)break e;He=s({},He,xe);break e;case 2:Xr=!0}}O.callback!==null&&O.lane!==0&&(i.flags|=64,xe=v.effects,xe===null?v.effects=[O]:xe.push(O))}else Ct={eventTime:Ct,lane:xe,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ke===null?(oe=ke=Ct,W=He):ke=ke.next=Ct,E|=xe;if(O=O.next,O===null){if(O=v.shared.pending,O===null)break;xe=O,O=xe.next,xe.next=null,v.lastBaseUpdate=xe,v.shared.pending=null}}while(1);if(ke===null&&(W=He),v.baseState=W,v.firstBaseUpdate=oe,v.lastBaseUpdate=ke,a=v.shared.interleaved,a!==null){v=a;do E|=v.lane,v=v.next;while(v!==a)}else b===null&&(v.shared.lanes=0);Do|=E,i.lanes=E,i.memoizedState=He}}function sm(i,a,d){if(i=a.effects,a.effects=null,i!==null)for(a=0;a<i.length;a++){var m=i[a],v=m.callback;if(v!==null){if(m.callback=null,m=d,typeof v!="function")throw Error(c(191,v));v.call(m)}}}var lm=new r.Component().refs;function Su(i,a,d,m){a=i.memoizedState,d=d(m,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)?V(i)===i:!1},enqueueSetState:function(i,a,d){i=i._reactInternals;var m=sn(),v=eo(i),b=Dr(m,v);b.payload=a,d!=null&&(b.callback=d),a=Qr(i,b,v),a!==null&&(Fn(a,i,v,m),Ns(a,i,v))},enqueueReplaceState:function(i,a,d){i=i._reactInternals;var m=sn(),v=eo(i),b=Dr(m,v);b.tag=1,b.payload=a,d!=null&&(b.callback=d),a=Qr(i,b,v),a!==null&&(Fn(a,i,v,m),Ns(a,i,v))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var d=sn(),m=eo(i),v=Dr(d,m);v.tag=2,a!=null&&(v.callback=a),a=Qr(i,v,m),a!==null&&(Fn(a,i,m,d),Ns(a,i,m))}};function cm(i,a,d,m,v,b,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(m,b,E):a.prototype&&a.prototype.isPureReactComponent?!Os(d,m)||!Os(v,b):!0}function um(i,a,d){var m=!1,v=Kr,b=a.contextType;return typeof b=="object"&&b!==null?b=zn(b):(v=xn(a)?Po:nn.current,m=a.contextTypes,b=(m=m!=null)?ui(i,v):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,m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=v,i.__reactInternalMemoizedMaskedChildContext=b),a}function dm(i,a,d,m){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(d,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(d,m),a.state!==i&&Ls.enqueueReplaceState(a,a.state,null)}function Cu(i,a,d,m){var v=i.stateNode;v.props=d,v.state=i.memoizedState,v.refs=lm,bu(i);var b=a.contextType;typeof b=="object"&&b!==null?v.context=zn(b):(b=xn(a)?Po:nn.current,v.context=ui(i,b)),v.state=i.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(Su(i,a,b,d),v.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(a=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),a!==v.state&&Ls.enqueueReplaceState(v,v.state,null),Fs(i,d,v,m),v.state=i.memoizedState),typeof v.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 m=d.stateNode}if(!m)throw Error(c(147,i));var v=m,b=""+i;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===b?a.ref:(a=function(E){var O=v.refs;O===lm&&(O=v.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 fm(i){var a=i._init;return a(i._payload)}function hm(i){function a(H,z){if(i){var G=H.deletions;G===null?(H.deletions=[z],H.flags|=16):G.push(z)}}function d(H,z){if(!i)return null;for(;z!==null;)a(H,z),z=z.sibling;return null}function m(H,z){for(H=new Map;z!==null;)z.key!==null?H.set(z.key,z):H.set(z.index,z),z=z.sibling;return H}function v(H,z){return H=no(H,z),H.index=0,H.sibling=null,H}function b(H,z,G){return H.index=G,i?(G=H.alternate,G!==null?(G=G.index,G<z?(H.flags|=2,z):G):(H.flags|=2,z)):(H.flags|=1048576,z)}function E(H){return i&&H.alternate===null&&(H.flags|=2),H}function O(H,z,G,be){return z===null||z.tag!==6?(z=cd(G,H.mode,be),z.return=H,z):(z=v(z,G),z.return=H,z)}function W(H,z,G,be){var Oe=G.type;return Oe===h?ke(H,z,G.props.children,be,G.key):z!==null&&(z.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===P&&fm(Oe)===z.type)?(be=v(z,G.props),be.ref=pa(H,z,G),be.return=H,be):(be=fl(G.type,G.key,G.props,null,H.mode,be),be.ref=pa(H,z,G),be.return=H,be)}function oe(H,z,G,be){return z===null||z.tag!==4||z.stateNode.containerInfo!==G.containerInfo||z.stateNode.implementation!==G.implementation?(z=ud(G,H.mode,be),z.return=H,z):(z=v(z,G.children||[]),z.return=H,z)}function ke(H,z,G,be,Oe){return z===null||z.tag!==7?(z=Ro(G,H.mode,be,Oe),z.return=H,z):(z=v(z,G),z.return=H,z)}function He(H,z,G){if(typeof z=="string"&&z!==""||typeof z=="number")return z=cd(""+z,H.mode,G),z.return=H,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case f:return G=fl(z.type,z.key,z.props,null,H.mode,G),G.ref=pa(H,null,z),G.return=H,G;case p:return z=ud(z,H.mode,G),z.return=H,z;case P:var be=z._init;return He(H,be(z._payload),G)}if(te(z)||D(z))return z=Ro(z,H.mode,G,null),z.return=H,z;Bs(H,z)}return null}function xe(H,z,G,be){var Oe=z!==null?z.key:null;if(typeof G=="string"&&G!==""||typeof G=="number")return Oe!==null?null:O(H,z,""+G,be);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case f:return G.key===Oe?W(H,z,G,be):null;case p:return G.key===Oe?oe(H,z,G,be):null;case P:return Oe=G._init,xe(H,z,Oe(G._payload),be)}if(te(G)||D(G))return Oe!==null?null:ke(H,z,G,be,null);Bs(H,G)}return null}function Ct(H,z,G,be,Oe){if(typeof be=="string"&&be!==""||typeof be=="number")return H=H.get(G)||null,O(z,H,""+be,Oe);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case f:return H=H.get(be.key===null?G:be.key)||null,W(z,H,be,Oe);case p:return H=H.get(be.key===null?G:be.key)||null,oe(z,H,be,Oe);case P:var Ke=be._init;return Ct(H,z,G,Ke(be._payload),Oe)}if(te(be)||D(be))return H=H.get(G)||null,ke(z,H,be,Oe,null);Bs(z,be)}return null}function ht(H,z,G,be){for(var Oe=null,Ke=null,We=z,it=z=0,Xt=null;We!==null&&it<G.length;it++){We.index>it?(Xt=We,We=null):Xt=We.sibling;var at=xe(H,We,G[it],be);if(at===null){We===null&&(We=Xt);break}i&&We&&at.alternate===null&&a(H,We),z=b(at,z,it),Ke===null?Oe=at:Ke.sibling=at,Ke=at,We=Xt}if(it===G.length)return d(H,We),Pt&&Mo(H,it),Oe;if(We===null){for(;it<G.length;it++)We=He(H,G[it],be),We!==null&&(z=b(We,z,it),Ke===null?Oe=We:Ke.sibling=We,Ke=We);return Pt&&Mo(H,it),Oe}for(We=m(H,We);it<G.length;it++)Xt=Ct(We,H,it,G[it],be),Xt!==null&&(i&&Xt.alternate!==null&&We.delete(Xt.key===null?it:Xt.key),z=b(Xt,z,it),Ke===null?Oe=Xt:Ke.sibling=Xt,Ke=Xt);return i&&We.forEach(function(ro){return a(H,ro)}),Pt&&Mo(H,it),Oe}function wn(H,z,G,be){var Oe=D(G);if(typeof Oe!="function")throw Error(c(150));if(G=Oe.call(G),G==null)throw Error(c(151));for(var Ke=Oe=null,We=z,it=z=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=xe(H,We,at.value,be);if(ro===null){We===null&&(We=Xt);break}i&&We&&ro.alternate===null&&a(H,We),z=b(ro,z,it),Ke===null?Oe=ro:Ke.sibling=ro,Ke=ro,We=Xt}if(at.done)return d(H,We),Pt&&Mo(H,it),Oe;if(We===null){for(;!at.done;it++,at=G.next())at=He(H,at.value,be),at!==null&&(z=b(at,z,it),Ke===null?Oe=at:Ke.sibling=at,Ke=at);return Pt&&Mo(H,it),Oe}for(We=m(H,We);!at.done;it++,at=G.next())at=Ct(We,H,it,at.value,be),at!==null&&(i&&at.alternate!==null&&We.delete(at.key===null?it:at.key),z=b(at,z,it),Ke===null?Oe=at:Ke.sibling=at,Ke=at);return i&&We.forEach(function(LS){return a(H,LS)}),Pt&&Mo(H,it),Oe}function zr(H,z,G,be){if(typeof G=="object"&&G!==null&&G.type===h&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case f:e:{for(var Oe=G.key,Ke=z;Ke!==null;){if(Ke.key===Oe){if(Oe=G.type,Oe===h){if(Ke.tag===7){d(H,Ke.sibling),z=v(Ke,G.props.children),z.return=H,H=z;break e}}else if(Ke.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===P&&fm(Oe)===Ke.type){d(H,Ke.sibling),z=v(Ke,G.props),z.ref=pa(H,Ke,G),z.return=H,H=z;break e}d(H,Ke);break}else a(H,Ke);Ke=Ke.sibling}G.type===h?(z=Ro(G.props.children,H.mode,be,G.key),z.return=H,H=z):(be=fl(G.type,G.key,G.props,null,H.mode,be),be.ref=pa(H,z,G),be.return=H,H=be)}return E(H);case p:e:{for(Ke=G.key;z!==null;){if(z.key===Ke)if(z.tag===4&&z.stateNode.containerInfo===G.containerInfo&&z.stateNode.implementation===G.implementation){d(H,z.sibling),z=v(z,G.children||[]),z.return=H,H=z;break e}else{d(H,z);break}else a(H,z);z=z.sibling}z=ud(G,H.mode,be),z.return=H,H=z}return E(H);case P:return Ke=G._init,zr(H,z,Ke(G._payload),be)}if(te(G))return ht(H,z,G,be);if(D(G))return wn(H,z,G,be);Bs(H,G)}return typeof G=="string"&&G!==""||typeof G=="number"?(G=""+G,z!==null&&z.tag===6?(d(H,z.sibling),z=v(z,G),z.return=H,H=z):(d(H,z),z=cd(G,H.mode,be),z.return=H,H=z),E(H)):d(H,z)}return zr}var vi=hm(!0),pm=hm(!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 mm(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||Up(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,uS=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,m,v,b){if(_o=b,_t=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Ws.current=i===null||i.memoizedState===null?pS:mS,i=d(m,v),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=vS,i=d(m,v)}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 m=Ut,v=m.baseQueue,b=d.pending;if(b!==null){if(v!==null){var E=v.next;v.next=b.next,b.next=E}m.baseQueue=v=b,d.pending=null}if(v!==null){b=v.next,m=m.baseState;var O=E=null,W=null,oe=b;do{var ke=oe.lane;if((_o&ke)===ke)W!==null&&(W=W.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),m=oe.hasEagerState?oe.eagerState:i(m,oe.action);else{var He={lane:ke,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};W===null?(O=W=He,E=m):W=W.next=He,_t.lanes|=ke,Do|=ke}oe=oe.next}while(oe!==null&&oe!==b);W===null?E=m:W.next=O,Yn(m,a.memoizedState)||(bn=!0),a.memoizedState=m,a.baseState=E,a.baseQueue=W,d.lastRenderedState=m}if(i=d.interleaved,i!==null){v=i;do b=v.lane,_t.lanes|=b,Do|=b,v=v.next;while(v!==i)}else v===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 m=d.dispatch,v=d.pending,b=a.memoizedState;if(v!==null){d.pending=null;var E=v=v.next;do b=i(b,E.action),E=E.next;while(E!==v);Yn(b,a.memoizedState)||(bn=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),d.lastRenderedState=b}return[b,m]}function vm(){}function gm(i,a){var d=_t,m=Nn(),v=a(),b=!Yn(m.memoizedState,v);if(b&&(m.memoizedState=v,bn=!0),m=m.queue,Au(bm.bind(null,d,m,i),[i]),m.getSnapshot!==a||b||Yt!==null&&Yt.memoizedState.tag&1){if(d.flags|=2048,ba(9,xm.bind(null,d,m,v,a),void 0,null),Kt===null)throw Error(c(349));_o&30||ym(d,a,v)}return v}function ym(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 xm(i,a,d,m){a.value=d,a.getSnapshot=m,Sm(a)&&Cm(i)}function bm(i,a,d){return d(function(){Sm(a)&&Cm(i)})}function Sm(i){var a=i.getSnapshot;i=i.value;try{var d=a();return!Yn(i,d)}catch{return!0}}function Cm(i){var a=ur(i,1);a!==null&&Fn(a,i,1,-1)}function wm(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=hS.bind(null,_t,i),[a.memoizedState,i]}function ba(i,a,d,m){return i={tag:i,create:a,destroy:d,deps:m,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:(m=d.next,d.next=i,i.next=m,a.lastEffect=i)),i}function jm(){return Nn().memoizedState}function Us(i,a,d,m){var v=fr();_t.flags|=i,v.memoizedState=ba(1|a,d,void 0,m===void 0?null:m)}function $s(i,a,d,m){var v=Nn();m=m===void 0?null:m;var b=void 0;if(Ut!==null){var E=Ut.memoizedState;if(b=E.destroy,m!==null&&Iu(m,E.deps)){v.memoizedState=ba(a,d,b,m);return}}_t.flags|=i,v.memoizedState=ba(1|a,d,b,m)}function km(i,a){return Us(8390656,8,i,a)}function Au(i,a){return $s(2048,8,i,a)}function Em(i,a){return $s(4,2,i,a)}function Pm(i,a){return $s(4,4,i,a)}function Im(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 Mm(i,a,d){return d=d!=null?d.concat([i]):null,$s(4,4,Im.bind(null,a,i),d)}function Ou(){}function Tm(i,a){var d=Nn();a=a===void 0?null:a;var m=d.memoizedState;return m!==null&&a!==null&&Iu(a,m[1])?m[0]:(d.memoizedState=[i,a],i)}function _m(i,a){var d=Nn();a=a===void 0?null:a;var m=d.memoizedState;return m!==null&&a!==null&&Iu(a,m[1])?m[0]:(i=i(),d.memoizedState=[i,a],i)}function Dm(i,a,d){return _o&21?(Yn(d,a)||(d=Yp(),_t.lanes|=d,Do|=d,i.baseState=!0),a):(i.baseState&&(i.baseState=!1,bn=!0),i.memoizedState=d)}function dS(i,a){var d=ot;ot=d!==0&&4>d?d:4,i(!0);var m=Pu.transition;Pu.transition={};try{i(!1),a()}finally{ot=d,Pu.transition=m}}function Am(){return Nn().memoizedState}function fS(i,a,d){var m=eo(i);if(d={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null},Om(i))zm(a,d);else if(d=om(i,a,d,m),d!==null){var v=sn();Fn(d,i,m,v),Rm(d,a,m)}}function hS(i,a,d){var m=eo(i),v={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null};if(Om(i))zm(a,v);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(v.hasEagerState=!0,v.eagerState=O,Yn(O,E)){var W=a.interleaved;W===null?(v.next=v,xu(a)):(v.next=W.next,W.next=v),a.interleaved=v;return}}catch{}finally{}d=om(i,a,v,m),d!==null&&(v=sn(),Fn(d,i,m,v),Rm(d,a,m))}}function Om(i){var a=i.alternate;return i===_t||a!==null&&a===_t}function zm(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 Rm(i,a,d){if(d&4194240){var m=a.lanes;m&=i.pendingLanes,d|=m,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},pS={readContext:zn,useCallback:function(i,a){return fr().memoizedState=[i,a===void 0?null:a],i},useContext:zn,useEffect:km,useImperativeHandle:function(i,a,d){return d=d!=null?d.concat([i]):null,Us(4194308,4,Im.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 m=fr();return a=d!==void 0?d(a):a,m.memoizedState=m.baseState=a,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:a},m.queue=i,i=i.dispatch=fS.bind(null,_t,i),[m.memoizedState,i]},useRef:function(i){var a=fr();return i={current:i},a.memoizedState=i},useState:wm,useDebugValue:Ou,useDeferredValue:function(i){return fr().memoizedState=i},useTransition:function(){var i=wm(!1),a=i[0];return i=dS.bind(null,i[1]),fr().memoizedState=i,[a,i]},useMutableSource:function(){},useSyncExternalStore:function(i,a,d){var m=_t,v=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||ym(m,a,d)}v.memoizedState=d;var b={value:d,getSnapshot:a};return v.queue=b,km(bm.bind(null,m,b,i),[i]),m.flags|=2048,ba(9,xm.bind(null,m,b,d,a),void 0,null),d},useId:function(){var i=fr(),a=Kt.identifierPrefix;if(Pt){var d=_r,m=Tr;d=(m&~(1<<32-qn(m)-1)).toString(32)+d,a=":"+a+"R"+d,d=ya++,0<d&&(a+="H"+d.toString(32)),a+=":"}else d=uS++,a=":"+a+"r"+d.toString(32)+":";return i.memoizedState=a},unstable_isNewReconciler:!1},mS={readContext:zn,useCallback:Tm,useContext:zn,useEffect:Au,useImperativeHandle:Mm,useInsertionEffect:Em,useLayoutEffect:Pm,useMemo:_m,useReducer:_u,useRef:jm,useState:function(){return _u(xa)},useDebugValue:Ou,useDeferredValue:function(i){var a=Nn();return Dm(a,Ut.memoizedState,i)},useTransition:function(){var i=_u(xa)[0],a=Nn().memoizedState;return[i,a]},useMutableSource:vm,useSyncExternalStore:gm,useId:Am,unstable_isNewReconciler:!1},vS={readContext:zn,useCallback:Tm,useContext:zn,useEffect:Au,useImperativeHandle:Mm,useInsertionEffect:Em,useLayoutEffect:Pm,useMemo:_m,useReducer:Du,useRef:jm,useState:function(){return Du(xa)},useDebugValue:Ou,useDeferredValue:function(i){var a=Nn();return Ut===null?a.memoizedState=i:Dm(a,Ut.memoizedState,i)},useTransition:function(){var i=Du(xa)[0],a=Nn().memoizedState;return[i,a]},useMutableSource:vm,useSyncExternalStore:gm,useId:Am,unstable_isNewReconciler:!1};function xi(i,a){try{var d="",m=a;do d+=cS(m),m=m.return;while(m);var v=d}catch(b){v=`
|
||
Error generating stack: `+b.message+`
|
||
`+b.stack}return{value:i,source:a,stack:v,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 gS=typeof WeakMap=="function"?WeakMap:Map;function Nm(i,a,d){d=Dr(-1,d),d.tag=3,d.payload={element:null};var m=a.value;return d.callback=function(){al||(al=!0,nd=m),Ru(i,a)},d}function Fm(i,a,d){d=Dr(-1,d),d.tag=3;var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var v=a.value;d.payload=function(){return m(v)},d.callback=function(){Ru(i,a)}}var b=i.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(d.callback=function(){Ru(i,a),typeof m!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var E=a.stack;this.componentDidCatch(a.value,{componentStack:E!==null?E:""})}),d}function Lm(i,a,d){var m=i.pingCache;if(m===null){m=i.pingCache=new gS;var v=new Set;m.set(a,v)}else v=m.get(a),v===void 0&&(v=new Set,m.set(a,v));v.has(d)||(v.add(d),i=_S.bind(null,i,a,d),a.then(i,i))}function Bm(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 Hm(i,a,d,m,v){return i.mode&1?(i.flags|=65536,i.lanes=v,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 yS=u.ReactCurrentOwner,bn=!1;function hn(i,a,d,m){a.child=i===null?pm(a,null,d,m):vi(a,i.child,d,m)}function Wm(i,a,d,m,v){d=d.render;var b=a.ref;return mi(a,v),m=Mu(i,a,d,m,b,v),d=Tu(),i!==null&&!bn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~v,Ar(i,a,v)):(Pt&&d&&uu(a),a.flags|=1,hn(i,a,m,v),a.child)}function Vm(i,a,d,m,v){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,Um(i,a,b,m,v)):(i=fl(d.type,null,m,a,a.mode,v),i.ref=a.ref,i.return=a,a.child=i)}if(b=i.child,!(i.lanes&v)){var E=b.memoizedProps;if(d=d.compare,d=d!==null?d:Os,d(E,m)&&i.ref===a.ref)return Ar(i,a,v)}return a.flags|=1,i=no(b,m),i.ref=a.ref,i.return=a,a.child=i}function Um(i,a,d,m,v){if(i!==null){var b=i.memoizedProps;if(Os(b,m)&&i.ref===a.ref)if(bn=!1,a.pendingProps=m=b,(i.lanes&v)!==0)i.flags&131072&&(bn=!0);else return a.lanes=i.lanes,Ar(i,a,v)}return Nu(i,a,d,m,v)}function $m(i,a,d){var m=a.pendingProps,v=m.children,b=i!==null?i.memoizedState:null;if(m.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},m=b!==null?b.baseLanes:d,gt(Si,_n),_n|=m}else b!==null?(m=b.baseLanes|d,a.memoizedState=null):m=d,gt(Si,_n),_n|=m;return hn(i,a,v,d),a.child}function Gm(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,m,v){var b=xn(d)?Po:nn.current;return b=ui(a,b),mi(a,v),d=Mu(i,a,d,m,b,v),m=Tu(),i!==null&&!bn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~v,Ar(i,a,v)):(Pt&&m&&uu(a),a.flags|=1,hn(i,a,d,v),a.child)}function qm(i,a,d,m,v){if(xn(d)){var b=!0;ks(a)}else b=!1;if(mi(a,v),a.stateNode===null)Ys(i,a),um(a,d,m),Cu(a,d,m,v),m=!0;else if(i===null){var E=a.stateNode,O=a.memoizedProps;E.props=O;var W=E.context,oe=d.contextType;typeof oe=="object"&&oe!==null?oe=zn(oe):(oe=xn(d)?Po:nn.current,oe=ui(a,oe));var ke=d.getDerivedStateFromProps,He=typeof ke=="function"||typeof E.getSnapshotBeforeUpdate=="function";He||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(O!==m||W!==oe)&&dm(a,E,m,oe),Xr=!1;var xe=a.memoizedState;E.state=xe,Fs(a,m,E,v),W=a.memoizedState,O!==m||xe!==W||yn.current||Xr?(typeof ke=="function"&&(Su(a,d,ke,m),W=a.memoizedState),(O=Xr||cm(a,d,O,m,xe,W,oe))?(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=m,a.memoizedState=W),E.props=m,E.state=W,E.context=oe,m=O):(typeof E.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{E=a.stateNode,im(i,a),O=a.memoizedProps,oe=a.type===a.elementType?O:Xn(a.type,O),E.props=oe,He=a.pendingProps,xe=E.context,W=d.contextType,typeof W=="object"&&W!==null?W=zn(W):(W=xn(d)?Po:nn.current,W=ui(a,W));var Ct=d.getDerivedStateFromProps;(ke=typeof Ct=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(O!==He||xe!==W)&&dm(a,E,m,W),Xr=!1,xe=a.memoizedState,E.state=xe,Fs(a,m,E,v);var ht=a.memoizedState;O!==He||xe!==ht||yn.current||Xr?(typeof Ct=="function"&&(Su(a,d,Ct,m),ht=a.memoizedState),(oe=Xr||cm(a,d,oe,m,xe,ht,W)||!1)?(ke||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(m,ht,W),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(m,ht,W)),typeof E.componentDidUpdate=="function"&&(a.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof E.componentDidUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(a.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=ht),E.props=m,E.state=ht,E.context=W,m=oe):(typeof E.componentDidUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(a.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&xe===i.memoizedState||(a.flags|=1024),m=!1)}return Fu(i,a,d,m,b,v)}function Fu(i,a,d,m,v,b){Gm(i,a);var E=(a.flags&128)!==0;if(!m&&!E)return v&&qp(a,d,!1),Ar(i,a,b);m=a.stateNode,yS.current=a;var O=E&&typeof d.getDerivedStateFromError!="function"?null:m.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=m.state,v&&qp(a,d,!0),a.child}function Ym(i){var a=i.stateNode;a.pendingContext?$p(i,a.pendingContext,a.pendingContext!==a.context):a.context&&$p(i,a.context,!1),wu(i,a.containerInfo)}function Km(i,a,d,m,v){return hi(),pu(v),a.flags|=256,hn(i,a,d,m),a.child}var Lu={dehydrated:null,treeContext:null,retryLane:0};function Bu(i){return{baseLanes:i,cachePool:null,transitions:null}}function Xm(i,a,d){var m=a.pendingProps,v=Tt.current,b=!1,E=(a.flags&128)!==0,O;if((O=E)||(O=i!==null&&i.memoizedState===null?!1:(v&2)!==0),O?(b=!0,a.flags&=-129):(i===null||i.memoizedState!==null)&&(v|=1),gt(Tt,v&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=m.children,i=m.fallback,b?(m=a.mode,b=a.child,E={mode:"hidden",children:E},!(m&1)&&b!==null?(b.childLanes=0,b.pendingProps=E):b=hl(E,m,0,null),i=Ro(i,m,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(v=i.memoizedState,v!==null&&(O=v.dehydrated,O!==null))return xS(i,a,E,m,O,v,d);if(b){b=m.fallback,E=a.mode,v=i.child,O=v.sibling;var W={mode:"hidden",children:m.children};return!(E&1)&&a.child!==v?(m=a.child,m.childLanes=0,m.pendingProps=W,a.deletions=null):(m=no(v,W),m.subtreeFlags=v.subtreeFlags&14680064),O!==null?b=no(O,b):(b=Ro(b,E,d,null),b.flags|=2),b.return=a,m.return=a,m.sibling=b,a.child=m,m=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,m}return b=i.child,i=b.sibling,m=no(b,{mode:"visible",children:m.children}),!(a.mode&1)&&(m.lanes=d),m.return=a,m.sibling=null,i!==null&&(d=a.deletions,d===null?(a.deletions=[i],a.flags|=16):d.push(i)),a.child=m,a.memoizedState=null,m}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,m){return m!==null&&pu(m),vi(a,i.child,null,d),i=Hu(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function xS(i,a,d,m,v,b,E){if(d)return a.flags&256?(a.flags&=-257,m=zu(Error(c(422))),qs(i,a,E,m)):a.memoizedState!==null?(a.child=i.child,a.flags|=128,null):(b=m.fallback,v=a.mode,m=hl({mode:"visible",children:m.children},v,0,null),b=Ro(b,v,E,null),b.flags|=2,m.return=a,b.return=a,m.sibling=b,a.child=m,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(v))return m=D4(v).digest,b=Error(c(419)),m=zu(b,m,void 0),qs(i,a,E,m);if(d=(E&i.childLanes)!==0,bn||d){if(m=Kt,m!==null){switch(E&-E){case 4:v=2;break;case 16:v=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:v=32;break;case 536870912:v=268435456;break;default:v=0}v=v&(m.suspendedLanes|E)?0:v,v!==0&&v!==b.retryLane&&(b.retryLane=v,ur(i,v),Fn(m,i,v,-1))}return sd(),m=zu(Error(c(421))),qs(i,a,E,m)}return Up(v)?(a.flags|=128,a.child=i.child,a=DS.bind(null,i),A4(v,a),null):(i=b.treeContext,Ge&&(On=R4(v),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,m.children),a.flags|=4096,a)}function Qm(i,a,d){i.lanes|=a;var m=i.alternate;m!==null&&(m.lanes|=a),yu(i.return,a,d)}function Wu(i,a,d,m,v){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:v}:(b.isBackwards=a,b.rendering=null,b.renderingStartTime=0,b.last=m,b.tail=d,b.tailMode=v)}function Zm(i,a,d){var m=a.pendingProps,v=m.revealOrder,b=m.tail;if(hn(i,a,m.children,d),m=Tt.current,m&2)m=m&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&&Qm(i,d,a);else if(i.tag===19)Qm(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}m&=1}if(gt(Tt,m),!(a.mode&1))a.memoizedState=null;else switch(v){case"forwards":for(d=a.child,v=null;d!==null;)i=d.alternate,i!==null&&Hs(i)===null&&(v=d),d=d.sibling;d=v,d===null?(v=a.child,a.child=null):(v=d.sibling,d.sibling=null),Wu(a,!1,v,d,b);break;case"backwards":for(d=null,v=a.child,a.child=null;v!==null;){if(i=v.alternate,i!==null&&Hs(i)===null){a.child=v;break}i=v.sibling,v.sibling=d,d=v,v=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 bS(i,a,d){switch(a.tag){case 3:Ym(a),hi();break;case 5:mm(a);break;case 1:xn(a.type)&&ks(a);break;case 4:wu(a,a.stateNode.containerInfo);break;case 10:rm(a,a.type._context,a.memoizedProps.value);break;case 13:var m=a.memoizedState;if(m!==null)return m.dehydrated!==null?(gt(Tt,Tt.current&1),a.flags|=128,null):d&a.child.childLanes?Xm(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(m=(d&a.childLanes)!==0,i.flags&128){if(m)return Zm(i,a,d);a.flags|=128}var v=a.memoizedState;if(v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),gt(Tt,Tt.current),m)break;return null;case 22:case 23:return a.lanes=0,$m(i,a,d)}return Ar(i,a,d)}function hr(i){i.flags|=4}function Jm(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(me)Sa=function(i,a){for(var d=a.child;d!==null;){if(d.tag===5||d.tag===6)Ie(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,m,v){if(i=i.memoizedProps,i!==m){var b=a.stateNode,E=dr(Rn.current);d=he(b,d,i,m,v,E),(a.updateQueue=d)&&hr(a)}},Xs=function(i,a,d,m){d!==m&&hr(a)};else if(De){Sa=function(i,a,d,m){for(var v=a.child;v!==null;){if(v.tag===5){var b=v.stateNode;d&&m&&(b=Wp(b,v.type,v.memoizedProps,v)),Ie(i,b)}else if(v.tag===6)b=v.stateNode,d&&m&&(b=Vp(b,v.memoizedProps,v)),Ie(i,b);else if(v.tag!==4){if(v.tag===22&&v.memoizedState!==null)b=v.child,b!==null&&(b.return=v),Sa(i,v,!0,!0);else if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v===a)break;for(;v.sibling===null;){if(v.return===null||v.return===a)return;v=v.return}v.sibling.return=v.return,v=v.sibling}};var ev=function(i,a,d,m){for(var v=a.child;v!==null;){if(v.tag===5){var b=v.stateNode;d&&m&&(b=Wp(b,v.type,v.memoizedProps,v)),Hp(i,b)}else if(v.tag===6)b=v.stateNode,d&&m&&(b=Vp(b,v.memoizedProps,v)),Hp(i,b);else if(v.tag!==4){if(v.tag===22&&v.memoizedState!==null)b=v.child,b!==null&&(b.return=v),ev(i,v,!0,!0);else if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v===a)break;for(;v.sibling===null;){if(v.return===null||v.return===a)return;v=v.return}v.sibling.return=v.return,v=v.sibling}};Ca=function(i,a){var d=a.stateNode;if(!Jm(i,a)){i=d.containerInfo;var m=Bp(i);ev(m,a,!1,!1),d.pendingChildren=m,hr(a),I4(i,m)}},Ks=function(i,a,d,m,v){var b=i.stateNode,E=i.memoizedProps;if((i=Jm(i,a))&&E===m)a.stateNode=b;else{var O=a.stateNode,W=dr(Rn.current),oe=null;E!==m&&(oe=he(O,d,E,m,v,W)),i&&oe===null?a.stateNode=b:(b=P4(b,oe,d,E,m,a,i,O),Pe(b,d,m,v,W)&&hr(a),a.stateNode=b,i?hr(a):Sa(b,a,!1,!1))}},Xs=function(i,a,d,m){d!==m?(i=dr(gi.current),d=dr(Rn.current),a.stateNode=Ne(m,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 m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:m.sibling=null}}function on(i){var a=i.alternate!==null&&i.alternate.child===i.child,d=0,m=0;if(a)for(var v=i.child;v!==null;)d|=v.lanes|v.childLanes,m|=v.subtreeFlags&14680064,m|=v.flags&14680064,v.return=i,v=v.sibling;else for(v=i.child;v!==null;)d|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=i,v=v.sibling;return i.subtreeFlags|=m,i.childLanes=d,a}function SS(i,a,d){var m=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 v=a.type;if(i!==null&&a.stateNode!=null)Ks(i,a,v,m,d),i.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!m){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=N4(a.stateNode,a.type,a.memoizedProps,d,i,a,!ha),a.updateQueue=i,i!==null&&hr(a)}else{var b=Me(v,m,d,i,a);Sa(b,a,!1,!1),a.stateNode=b,Pe(b,v,m,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,m);else{if(typeof m!="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,(m=F4(i,d,a,!ha))&&(v=Tn,v!==null))switch(v.tag){case 3:G4(v.stateNode.containerInfo,i,d,(v.mode&1)!==0);break;case 5:q4(v.type,v.memoizedProps,v.stateNode,i,d,(v.mode&1)!==0)}m&&hr(a)}else a.stateNode=Ne(m,i,d,a)}return on(a),null;case 13:if(St(Tt),m=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Pt&&On!==null&&a.mode&1&&!(a.flags&128))nm(),hi(),a.flags|=98560,v=!1;else if(v=As(a),m!==null&&m.dehydrated!==null){if(i===null){if(!v)throw Error(c(318));if(!Ge)throw Error(c(344));if(v=a.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(c(317));L4(v,a)}else hi(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;on(a),v=!1}else Kn!==null&&(id(Kn),Kn=null),v=!0;if(!v)return a.flags&65536?a:null}return a.flags&128?(a.lanes=d,a):(d=m!==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&&Te(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),v=a.memoizedState,v===null)return on(a),null;if(m=(a.flags&128)!==0,b=v.rendering,b===null)if(m)wa(v,!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(v,!1),i=b.updateQueue,i!==null&&(a.updateQueue=i,a.flags|=4),a.subtreeFlags=0,i=d,d=a.child;d!==null;)m=d,v=i,m.flags&=14680066,b=m.alternate,b===null?(m.childLanes=0,m.lanes=v,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=b.childLanes,m.lanes=b.lanes,m.child=b.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=b.memoizedProps,m.memoizedState=b.memoizedState,m.updateQueue=b.updateQueue,m.type=b.type,v=b.dependencies,m.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext}),d=d.sibling;return gt(Tt,Tt.current&1|2),a.child}i=i.sibling}v.tail!==null&&qt()>td&&(a.flags|=128,m=!0,wa(v,!1),a.lanes=4194304)}else{if(!m)if(i=Hs(b),i!==null){if(a.flags|=128,m=!0,i=i.updateQueue,i!==null&&(a.updateQueue=i,a.flags|=4),wa(v,!0),v.tail===null&&v.tailMode==="hidden"&&!b.alternate&&!Pt)return on(a),null}else 2*qt()-v.renderingStartTime>td&&d!==1073741824&&(a.flags|=128,m=!0,wa(v,!1),a.lanes=4194304);v.isBackwards?(b.sibling=a.child,a.child=b):(i=v.last,i!==null?i.sibling=b:a.child=b,v.last=b)}return v.tail!==null?(a=v.tail,v.rendering=a,v.tail=a.sibling,v.renderingStartTime=qt(),a.sibling=null,i=Tt.current,gt(Tt,m?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),me&&a.subtreeFlags&6&&(a.flags|=8192)):on(a),null;case 24:return null;case 25:return null}throw Error(c(156,a.tag))}function CS(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,wS=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(m){It(i,a,m)}else d.current=null}function Vu(i,a,d){try{d()}catch(m){It(i,a,m)}}var tv=!1;function jS(i,a){for(fe(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 m=d.memoizedProps,v=d.memoizedState,b=i.stateNode,E=b.getSnapshotBeforeUpdate(i.elementType===i.type?m:Xn(i.type,m),v);b.__reactInternalSnapshotBeforeUpdate=E}break;case 3:me&&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=tv,tv=!1,d}function ja(i,a,d){var m=a.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var v=m=m.next;do{if((v.tag&i)===i){var b=v.destroy;v.destroy=void 0,b!==void 0&&Vu(a,d,b)}v=v.next}while(v!==m)}}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 m=d.create;d.destroy=m()}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 nv(i){var a=i.alternate;a!==null&&(i.alternate=null,nv(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 rv(i){return i.tag===5||i.tag===3||i.tag===4}function ov(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||rv(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 m=i.tag;if(m===5||m===6)i=i.stateNode,a?dn(d,i,a):Le(d,i);else if(m!==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 m=i.tag;if(m===5||m===6)i=i.stateNode,a?Ae(d,i,a):J(d,i);else if(m!==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(me){var m=Zt,v=Qn;Zt=null,pr(i,a,d),Zt=m,Qn=v,Zt!==null&&(Qn?fn(Zt,d.stateNode):Vt(Zt,d.stateNode))}else pr(i,a,d);break;case 18:me&&Zt!==null&&(Qn?U4(Zt,d.stateNode):V4(Zt,d.stateNode));break;case 4:me?(m=Zt,v=Qn,Zt=d.stateNode.containerInfo,Qn=!0,pr(i,a,d),Zt=m,Qn=v):(De&&(m=d.stateNode.containerInfo,v=Bp(m),Qc(m,v)),pr(i,a,d));break;case 0:case 11:case 14:case 15:if(!an&&(m=d.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){v=m=m.next;do{var b=v,E=b.destroy;b=b.tag,E!==void 0&&(b&2||b&4)&&Vu(d,a,E),v=v.next}while(v!==m)}pr(i,a,d);break;case 1:if(!an&&(bi(d,a),m=d.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=d.memoizedProps,m.state=d.memoizedState,m.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=(m=an)||d.memoizedState!==null,pr(i,a,d),an=m):pr(i,a,d);break;default:pr(i,a,d)}}function iv(i){var a=i.updateQueue;if(a!==null){i.updateQueue=null;var d=i.stateNode;d===null&&(d=i.stateNode=new wS),a.forEach(function(m){var v=AS.bind(null,i,m);d.has(m)||(d.add(m),m.then(v,v))})}}function Zn(i,a){var d=a.deletions;if(d!==null)for(var m=0;m<d.length;m++){var v=d[m];try{var b=i,E=a;if(me){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,v),Zt=null,Qn=!1}else qu(b,E,v);var W=v.alternate;W!==null&&(W.return=null),v.return=null}catch(oe){It(v,a,oe)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)av(a,i),a=a.sibling}function av(i,a){var d=i.alternate,m=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Zn(a,i),mr(i),m&4){try{ja(3,i,i.return),Zs(3,i)}catch(xe){It(i,i.return,xe)}try{ja(5,i,i.return)}catch(xe){It(i,i.return,xe)}}break;case 1:Zn(a,i),mr(i),m&512&&d!==null&&bi(d,d.return);break;case 5:if(Zn(a,i),mr(i),m&512&&d!==null&&bi(d,d.return),me){if(i.flags&32){var v=i.stateNode;try{sr(v)}catch(xe){It(i,i.return,xe)}}if(m&4&&(v=i.stateNode,v!=null)){var b=i.memoizedProps;if(d=d!==null?d.memoizedProps:b,m=i.type,a=i.updateQueue,i.updateQueue=null,a!==null)try{de(v,a,m,d,b,i)}catch(xe){It(i,i.return,xe)}}}break;case 6:if(Zn(a,i),mr(i),m&4&&me){if(i.stateNode===null)throw Error(c(162));v=i.stateNode,b=i.memoizedProps,d=d!==null?d.memoizedProps:b;try{nt(v,d,b)}catch(xe){It(i,i.return,xe)}}break;case 3:if(Zn(a,i),mr(i),m&4){if(me&&Ge&&d!==null&&d.memoizedState.isDehydrated)try{H4(a.containerInfo)}catch(xe){It(i,i.return,xe)}if(De){v=a.containerInfo,b=a.pendingChildren;try{Qc(v,b)}catch(xe){It(i,i.return,xe)}}}break;case 4:if(Zn(a,i),mr(i),m&4&&De){b=i.stateNode,v=b.containerInfo,b=b.pendingChildren;try{Qc(v,b)}catch(xe){It(i,i.return,xe)}}break;case 13:Zn(a,i),mr(i),v=i.child,v.flags&8192&&(b=v.memoizedState!==null,v.stateNode.isHidden=b,!b||v.alternate!==null&&v.alternate.memoizedState!==null||(ed=qt())),m&4&&iv(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),m&8192){if(d=i.memoizedState!==null,(i.stateNode.isHidden=d)&&!E&&i.mode&1)for(we=i,m=i.child;m!==null;){for(a=we=m;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 W=E.stateNode;if(typeof W.componentWillUnmount=="function"){var oe=E,ke=E.return;try{var He=oe;W.props=He.memoizedProps,W.state=He.memoizedState,W.componentWillUnmount()}catch(xe){It(oe,ke,xe)}}break;case 5:bi(E,E.return);break;case 22:if(E.memoizedState!==null){cv(a);continue}}O!==null?(O.return=E,we=O):cv(a)}m=m.sibling}if(me){e:if(m=null,me)for(a=i;;){if(a.tag===5){if(m===null){m=a;try{v=a.stateNode,d?ko(v):Xc(a.stateNode,a.memoizedProps)}catch(xe){It(i,i.return,xe)}}}else if(a.tag===6){if(m===null)try{b=a.stateNode,d?la(b):ca(b,a.memoizedProps)}catch(xe){It(i,i.return,xe)}}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;m===a&&(m=null),a=a.return}m===a&&(m=null),a.sibling.return=a.return,a=a.sibling}}}break;case 19:Zn(a,i),mr(i),m&4&&iv(i);break;case 21:break;default:Zn(a,i),mr(i)}}function mr(i){var a=i.flags;if(a&2){try{if(me){e:{for(var d=i.return;d!==null;){if(rv(d)){var m=d;break e}d=d.return}throw Error(c(160))}switch(m.tag){case 5:var v=m.stateNode;m.flags&32&&(sr(v),m.flags&=-33);var b=ov(i);Gu(i,b,v);break;case 3:case 4:var E=m.stateNode.containerInfo,O=ov(i);$u(i,O,E);break;default:throw Error(c(161))}}}catch(W){It(i,i.return,W)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function kS(i,a,d){we=i,sv(i)}function sv(i,a,d){for(var m=(i.mode&1)!==0;we!==null;){var v=we,b=v.child;if(v.tag===22&&m){var E=v.memoizedState!==null||Qs;if(!E){var O=v.alternate,W=O!==null&&O.memoizedState!==null||an;O=Qs;var oe=an;if(Qs=E,(an=W)&&!oe)for(we=v;we!==null;)E=we,W=E.child,E.tag===22&&E.memoizedState!==null?uv(v):W!==null?(W.return=E,we=W):uv(v);for(;b!==null;)we=b,sv(b),b=b.sibling;we=v,Qs=O,an=oe}lv(i)}else v.subtreeFlags&8772&&b!==null?(b.return=v,we=b):lv(i)}}function lv(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 m=a.stateNode;if(a.flags&4&&!an)if(d===null)m.componentDidMount();else{var v=a.elementType===a.type?d.memoizedProps:Xn(a.type,d.memoizedProps);m.componentDidUpdate(v,d.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var b=a.updateQueue;b!==null&&sm(a,b,m);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}sm(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 W=a.alternate;if(W!==null){var oe=W.memoizedState;if(oe!==null){var ke=oe.dehydrated;ke!==null&&W4(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 cv(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 uv(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(W){It(a,d,W)}break;case 1:var m=a.stateNode;if(typeof m.componentDidMount=="function"){var v=a.return;try{m.componentDidMount()}catch(W){It(a,v,W)}}var b=a.return;try{Uu(a)}catch(W){It(a,b,W)}break;case 5:var E=a.return;try{Uu(a)}catch(W){It(a,E,W)}}}catch(W){It(a,a.return,W)}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=ge(i);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error(c(364));return a}if(i=le(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 m=i[d++],v=i[d++],b=a[v];if(m.tag!==5||!q(m)){for(;b!=null&&Ku(m,b);)v++,b=a[v];if(v===a.length){a=!0;break e}else for(m=m.child;m!==null;)i.push(m,v),m=m.sibling}}a=!1}return a;case tl:if(i.tag===5&&ie(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"<"+(_(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 dv(i,a){var d=[];i=[i,0];for(var m=0;m<i.length;){var v=i[m++],b=i[m++],E=a[b];if(v.tag!==5||!q(v)){for(;E!=null&&Ku(v,E);)b++,E=a[b];if(b===a.length)d.push(v);else for(v=v.child;v!==null;)i.push(v,b),v=v.sibling}}return d}function Qu(i,a){if(!N)throw Error(c(363));i=Yu(i),i=dv(i,a),a=[],i=Array.from(i);for(var d=0;d<i.length;){var m=i[d++];if(m.tag===5)q(m)||a.push(m.stateNode);else for(m=m.child;m!==null;)i.push(m),m=m.sibling}return a}var ES=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:lS.transition!==null?(ul===0&&(ul=Yp()),ul):(i=ot,i!==0?i:et()):1}function Fn(i,a,d,m){if(50<Ia)throw Ia=0,rd=null,Error(c(185));fa(i,d,m),(!(Xe&2)||i!==Kt)&&(i===Kt&&(!(Xe&2)&&(il|=d),$t===4&&to(i,Jt)),Cn(i,m),d===1&&Xe===0&&!(a.mode&1)&&(Ci(),Ts&&cr()))}function Cn(i,a){var d=i.callbackNode;J4(i,a);var m=Is(i,i===Kt?Jt:0);if(m===0)d!==null&&Xp(d),i.callbackNode=null,i.callbackPriority=0;else if(a=m&-m,i.callbackPriority!==a){if(d!=null&&Xp(d),a===1)i.tag===0?sS(hv.bind(null,i)):Qp(hv.bind(null,i)),vt?Rt(function(){!(Xe&6)&&cr()}):au(su,cr),d=null;else{switch(Kp(m)){case 1:d=su;break;case 4:d=rS;break;case 16:d=lu;break;case 536870912:d=oS;break;default:d=lu}d=Cv(d,fv.bind(null,i))}i.callbackPriority=a,i.callbackNode=d}}function fv(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 m=Is(i,i===Kt?Jt:0);if(m===0)return null;if(m&30||m&i.expiredLanes||a)a=dl(i,m);else{a=m;var v=Xe;Xe|=2;var b=vv();(Kt!==i||Jt!==a)&&(Or=null,Ci(),Ao(i,a));do try{MS();break}catch(O){mv(i,O)}while(1);vu(),ol.current=b,Xe=v,Lt!==null?a=0:(Kt=null,Jt=0,a=$t)}if(a!==0){if(a===2&&(v=ru(i),v!==0&&(m=v,a=od(i,v))),a===1)throw d=Ea,Ao(i,0),to(i,m),Cn(i,qt()),d;if(a===6)to(i,m);else{if(v=i.current.alternate,!(m&30)&&!PS(v)&&(a=dl(i,m),a===2&&(b=ru(i),b!==0&&(m=b,a=od(i,b))),a===1))throw d=Ea,Ao(i,0),to(i,m),Cn(i,qt()),d;switch(i.finishedWork=v,i.finishedLanes=m,a){case 0:case 1:throw Error(c(345));case 2:Oo(i,Sn,Or);break;case 3:if(to(i,m),(m&130023424)===m&&(a=ed+500-qt(),10<a)){if(Is(i,0)!==0)break;if(v=i.suspendedLanes,(v&m)!==m){sn(),i.pingedLanes|=i.suspendedLanes&v;break}i.timeoutHandle=Ve(Oo.bind(null,i,Sn,Or),a);break}Oo(i,Sn,Or);break;case 4:if(to(i,m),(m&4194240)===m)break;for(a=i.eventTimes,v=-1;0<m;){var E=31-qn(m);b=1<<E,E=a[E],E>v&&(v=E),m&=~b}if(m=v,m=qt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*ES(m/1960))-m,10<m){i.timeoutHandle=Ve(Oo.bind(null,i,Sn,Or),m);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?fv.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 PS(i){for(var a=i;;){if(a.flags&16384){var d=a.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var m=0;m<d.length;m++){var v=d[m],b=v.getSnapshot;v=v.value;try{if(!Yn(b(),v))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),m=1<<d;i[d]=-1,a&=~m}}function hv(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 m=ru(i);m!==0&&(a=m,d=od(i,m))}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 pv(i){Jr!==null&&Jr.tag===0&&!(Xe&6)&&zo();var a=Xe;Xe|=1;var d=Ft.transition,m=ot;try{if(Ft.transition=null,ot=1,i)return i()}finally{ot=m,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 m=d;switch(du(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&js();break;case 3:yi(),St(yn),St(nn),Eu();break;case 5:ju(m);break;case 4:yi();break;case 13:St(Tt);break;case 19:St(Tt);break;case 10:gu(m.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],m=d.interleaved,m!==null){d.interleaved=null;var v=m.next,b=d.pending;if(b!==null){var E=b.next;b.next=v,m.next=E}d.pending=m}To=null}return i}function mv(i,a){do{var d=Lt;try{if(vu(),Ws.current=Gs,Vs){for(var m=_t.memoizedState;m!==null;){var v=m.queue;v!==null&&(v.pending=null),m=m.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,W=a;if(a=Jt,O.flags|=32768,W!==null&&typeof W=="object"&&typeof W.then=="function"){var oe=W,ke=O,He=ke.tag;if(!(ke.mode&1)&&(He===0||He===11||He===15)){var xe=ke.alternate;xe?(ke.updateQueue=xe.updateQueue,ke.memoizedState=xe.memoizedState,ke.lanes=xe.lanes):(ke.updateQueue=null,ke.memoizedState=null)}var Ct=Bm(E);if(Ct!==null){Ct.flags&=-257,Hm(Ct,E,O,b,a),Ct.mode&1&&Lm(b,oe,a),a=Ct,W=oe;var ht=a.updateQueue;if(ht===null){var wn=new Set;wn.add(W),a.updateQueue=wn}else ht.add(W);break e}else{if(!(a&1)){Lm(b,oe,a),sd();break e}W=Error(c(426))}}else if(Pt&&O.mode&1){var zr=Bm(E);if(zr!==null){!(zr.flags&65536)&&(zr.flags|=256),Hm(zr,E,O,b,a),pu(xi(W,O));break e}}b=W=xi(W,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=Nm(b,W,a);am(b,H);break e;case 1:O=W;var z=b.type,G=b.stateNode;if(!(b.flags&128)&&(typeof z.getDerivedStateFromError=="function"||G!==null&&typeof G.componentDidCatch=="function"&&(Zr===null||!Zr.has(G)))){b.flags|=65536,a&=-a,b.lanes|=a;var be=Fm(b,O,a);am(b,be);break e}}b=b.return}while(b!==null)}yv(d)}catch(Oe){a=Oe,Lt===d&&d!==null&&(Lt=d=d.return);continue}break}while(1)}function vv(){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 m=vv();(Kt!==i||Jt!==a)&&(Or=null,Ao(i,a));do try{IS();break}catch(v){mv(i,v)}while(1);if(vu(),Xe=d,ol.current=m,Lt!==null)throw Error(c(261));return Kt=null,Jt=0,$t}function IS(){for(;Lt!==null;)gv(Lt)}function MS(){for(;Lt!==null&&!tS();)gv(Lt)}function gv(i){var a=Sv(i.alternate,i,_n);i.memoizedProps=i.pendingProps,a===null?yv(i):Lt=a,Zu.current=null}function yv(i){var a=i;do{var d=a.alternate;if(i=a.return,a.flags&32768){if(d=CS(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=SS(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 m=ot,v=Ft.transition;try{Ft.transition=null,ot=1,TS(i,a,d,m)}finally{Ft.transition=v,ot=m}return null}function TS(i,a,d,m){do zo();while(Jr!==null);if(Xe&6)throw Error(c(327));d=i.finishedWork;var v=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(eS(i,b),i===Kt&&(Lt=Kt=null,Jt=0),!(d.subtreeFlags&2064)&&!(d.flags&2064)||sl||(sl=!0,Cv(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,jS(i,d),av(d,i),Se(i.containerInfo),i.current=d,kS(d),nS(),Xe=O,ot=E,Ft.transition=b}else i.current=d;if(sl&&(sl=!1,Jr=i,ll=v),b=i.pendingLanes,b===0&&(Zr=null),iS(d.stateNode),Cn(i,qt()),a!==null)for(m=i.onRecoverableError,d=0;d<a.length;d++)v=a[d],m(v.value,{componentStack:v.stack,digest:v.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=Kp(ll),a=Ft.transition,d=ot;try{if(Ft.transition=null,ot=16>i?16:i,Jr===null)var m=!1;else{if(i=Jr,Jr=null,ll=0,Xe&6)throw Error(c(331));var v=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 W=0;W<O.length;W++){var oe=O[W];for(we=oe;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 xe=ke.sibling,Ct=ke.return;if(nv(ke),ke===oe){we=null;break}if(xe!==null){xe.return=Ct,we=xe;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 z=i.current;for(we=z;we!==null;){E=we;var G=E.child;if(E.subtreeFlags&2064&&G!==null)G.return=E,we=G;else e:for(E=z;we!==null;){if(O=we,O.flags&2048)try{switch(O.tag){case 0:case 11:case 15:Zs(9,O)}}catch(Oe){It(O,O.return,Oe)}if(O===E){we=null;break e}var be=O.sibling;if(be!==null){be.return=O.return,we=be;break e}we=O.return}}if(Xe=v,cr(),lr&&typeof lr.onPostCommitFiberRoot=="function")try{lr.onPostCommitFiberRoot(Ms,i)}catch{}m=!0}return m}finally{ot=d,Ft.transition=a}}return!1}function xv(i,a,d){a=xi(d,a),a=Nm(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)xv(i,i,d);else for(;a!==null;){if(a.tag===3){xv(a,i,d);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Zr===null||!Zr.has(m))){i=xi(d,i),i=Fm(a,i,1),a=Qr(a,i,1),i=sn(),a!==null&&(fa(a,1,i),Cn(a,i));break}}a=a.return}}function _S(i,a,d){var m=i.pingCache;m!==null&&m.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 bv(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 DS(i){var a=i.memoizedState,d=0;a!==null&&(d=a.retryLane),bv(i,d)}function AS(i,a){var d=0;switch(i.tag){case 13:var m=i.stateNode,v=i.memoizedState;v!==null&&(d=v.retryLane);break;case 19:m=i.stateNode;break;default:throw Error(c(314))}m!==null&&m.delete(a),bv(i,d)}var Sv;Sv=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,bS(i,a,d);bn=!!(i.flags&131072)}else bn=!1,Pt&&a.flags&1048576&&Zp(a,Ds,a.index);switch(a.lanes=0,a.tag){case 2:var m=a.type;Ys(i,a),i=a.pendingProps;var v=ui(a,nn.current);mi(a,d),v=Mu(null,a,m,i,v,d);var b=Tu();return a.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,xn(m)?(b=!0,ks(a)):b=!1,a.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,bu(a),v.updater=Ls,a.stateNode=v,v._reactInternals=a,Cu(a,m,i,d),a=Fu(null,a,m,!0,b,d)):(a.tag=0,Pt&&b&&uu(a),hn(null,a,v,d),a=a.child),a;case 16:m=a.elementType;e:{switch(Ys(i,a),i=a.pendingProps,v=m._init,m=v(m._payload),a.type=m,v=a.tag=zS(m),i=Xn(m,i),v){case 0:a=Nu(null,a,m,i,d);break e;case 1:a=qm(null,a,m,i,d);break e;case 11:a=Wm(null,a,m,i,d);break e;case 14:a=Vm(null,a,m,Xn(m.type,i),d);break e}throw Error(c(306,m,""))}return a;case 0:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Xn(m,v),Nu(i,a,m,v,d);case 1:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Xn(m,v),qm(i,a,m,v,d);case 3:e:{if(Ym(a),i===null)throw Error(c(387));m=a.pendingProps,b=a.memoizedState,v=b.element,im(i,a),Fs(a,m,null,d);var E=a.memoizedState;if(m=E.element,Ge&&b.isDehydrated)if(b={element:m,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},a.updateQueue.baseState=b,a.memoizedState=b,a.flags&256){v=xi(Error(c(423)),a),a=Km(i,a,m,d,v);break e}else if(m!==v){v=xi(Error(c(424)),a),a=Km(i,a,m,d,v);break e}else for(Ge&&(On=z4(a.stateNode.containerInfo),Tn=a,Pt=!0,Kn=null,ha=!1),d=pm(a,null,m,d),a.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(hi(),m===v){a=Ar(i,a,d);break e}hn(i,a,m,d)}a=a.child}return a;case 5:return mm(a),i===null&&hu(a),m=a.type,v=a.pendingProps,b=i!==null?i.memoizedProps:null,E=v.children,se(m,v)?E=null:b!==null&&se(m,b)&&(a.flags|=32),Gm(i,a),hn(i,a,E,d),a.child;case 6:return i===null&&hu(a),null;case 13:return Xm(i,a,d);case 4:return wu(a,a.stateNode.containerInfo),m=a.pendingProps,i===null?a.child=vi(a,null,m,d):hn(i,a,m,d),a.child;case 11:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Xn(m,v),Wm(i,a,m,v,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(m=a.type._context,v=a.pendingProps,b=a.memoizedProps,E=v.value,rm(a,m,E),b!==null)if(Yn(b.value,E)){if(b.children===v.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 W=O.firstContext;W!==null;){if(W.context===m){if(b.tag===1){W=Dr(-1,d&-d),W.tag=2;var oe=b.updateQueue;if(oe!==null){oe=oe.shared;var ke=oe.pending;ke===null?W.next=W:(W.next=ke.next,ke.next=W),oe.pending=W}}b.lanes|=d,W=b.alternate,W!==null&&(W.lanes|=d),yu(b.return,d,a),O.lanes|=d;break}W=W.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,v.children,d),a=a.child}return a;case 9:return v=a.type,m=a.pendingProps.children,mi(a,d),v=zn(v),m=m(v),a.flags|=1,hn(i,a,m,d),a.child;case 14:return m=a.type,v=Xn(m,a.pendingProps),v=Xn(m.type,v),Vm(i,a,m,v,d);case 15:return Um(i,a,a.type,a.pendingProps,d);case 17:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Xn(m,v),Ys(i,a),a.tag=1,xn(m)?(i=!0,ks(a)):i=!1,mi(a,d),um(a,m,v),Cu(a,m,v,d),Fu(null,a,m,!0,i,d);case 19:return Zm(i,a,d);case 22:return $m(i,a,d)}throw Error(c(156,a.tag))};function Cv(i,a){return au(i,a)}function OS(i,a,d,m){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=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(i,a,d,m){return new OS(i,a,d,m)}function ld(i){return i=i.prototype,!(!i||!i.isReactComponent)}function zS(i){if(typeof i=="function")return ld(i)?1:0;if(i!=null){if(i=i.$$typeof,i===C)return 11;if(i===I)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,m,v,b){var E=2;if(m=i,typeof i=="function")ld(i)&&(E=1);else if(typeof i=="string")E=5;else e:switch(i){case h:return Ro(d.children,v,b,a);case y:E=8,v|=8;break;case x:return i=Ln(12,d,a,v|2),i.elementType=x,i.lanes=b,i;case w:return i=Ln(13,d,a,v),i.elementType=w,i.lanes=b,i;case k:return i=Ln(19,d,a,v),i.elementType=k,i.lanes=b,i;case M:return hl(d,v,b,a);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case S:E=10;break e;case j:E=9;break e;case C:E=11;break e;case I:E=14;break e;case P:E=16,m=null;break e}throw Error(c(130,i==null?i:typeof i,""))}return a=Ln(E,d,a,v),a.elementType=i,a.type=m,a.lanes=b,a}function Ro(i,a,d,m){return i=Ln(7,i,m,a),i.lanes=d,i}function hl(i,a,d,m){return i=Ln(22,i,m,a),i.elementType=M,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 RS(i,a,d,m,v){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=m,this.onRecoverableError=v,Ge&&(this.mutableSourceEagerHydrationData=null)}function wv(i,a,d,m,v,b,E,O,W){return i=new RS(i,a,d,O,W),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:m,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},bu(b),i}function jv(i){if(!i)return Kr;i=i._reactInternals;e:{if(V(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 Gp(i,d,a)}return a}function kv(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 Ev(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){Ev(i,a),(i=i.alternate)&&Ev(i,a)}function NS(i){return i=Q(i),i===null?null:i.stateNode}function FS(){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 m=sn();Fn(d,i,a,m)}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:pv(function(){var m=ur(i,1);if(m!==null){var v=sn();Fn(m,i,1,v)}}),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,m,v,b,E){return wv(i,a,!1,null,d,m,v,b,E)},n.createHasPseudoClassSelector=function(i){return{$$typeof:el,value:i}},n.createHydrationContainer=function(i,a,d,m,v,b,E,O,W){return i=wv(d,m,!0,i,v,b,E,O,W),i.context=jv(null),d=i.current,m=sn(),v=eo(d),b=Dr(m,v),b.callback=a??null,Qr(d,b,v),i.current.lanes=v,fa(i,v,m),Cn(i,m),i},n.createPortal=function(i,a,d){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:m==null?null:""+m,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,m,v){var b=ot,E=Ft.transition;try{return Ft.transition=null,ot=1,i(a,d,m,v)}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(ye(a[d]));for(a=i.length-1;0<a;a--){d=i[a];for(var m=d.x,v=m+d.width,b=d.y,E=b+d.height,O=a-1;0<=O;O--)if(a!==O){var W=i[O],oe=W.x,ke=oe+W.width,He=W.y,xe=He+W.height;if(m>=oe&&b>=He&&v<=ke&&E<=xe){i.splice(a,1);break}else if(m!==oe||d.width!==W.width||xe<b||He>E){if(!(b!==He||d.height!==W.height||ke<m||oe>v)){oe>m&&(W.width+=oe-m,W.x=m),ke<v&&(W.width=v-oe),i.splice(a,1);break}}else{He>b&&(W.height+=He-b,W.y=b),xe<E&&(W.height=E-He),i.splice(a,1);break}}}return i},n.findHostInstance=kv,n.findHostInstanceWithNoPortals=function(i){return i=B(i),i=i!==null?X(i):null,i===null?null:i.stateNode},n.findHostInstanceWithWarning=function(i){return kv(i)},n.flushControlled=function(i){var a=Xe;Xe|=1;var d=Ft.transition,m=ot;try{Ft.transition=null,ot=1,i()}finally{ot=m,Ft.transition=d,Xe=a,Xe===0&&(Ci(),cr())}},n.flushPassiveEffects=zo,n.flushSync=pv,n.focusWithin=function(i,a){if(!N)throw Error(c(363));for(i=Yu(i),a=dv(i,a),a=Array.from(a),i=0;i<a.length;){var d=a[i++];if(!q(d)){if(d.tag===5&&Re(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,m=[];i=[Yu(i),0];for(var v=0;v<i.length;){var b=i[v++],E=i[v++],O=a[E];if((b.tag!==5||!q(b))&&(Ku(b,O)&&(m.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:
|
||
`+(m.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:NS,findFiberByHostInstance:i.findFiberByHostInstance||FS,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,m){if(!N)throw Error(c(363));i=Qu(i,a);var v=Ze(i,d,m).disconnect;return{disconnect:function(){v()}}},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,m){var v=a.current,b=sn(),E=eo(v);return d=jv(d),a.context===null?a.context=d:a.pendingContext=d,a=Dr(b,E),a.payload={element:i},m=m===void 0?null:m,m!==null&&(a.callback=m),i=Qr(v,a,E),i!==null&&(Fn(i,v,E,b),Ns(i,v,E)),E},n};(function(e){e.exports=gO})(vO);const yO=A3($f);var pc={},xO={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})(xO);const e1={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let t1=!1,n1=!1;const Ap=".react-konva-event",bO=`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
|
||
`,SO=`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
|
||
`,CO={};function Vc(e,t,n=CO){if(!t1&&"zIndex"in t&&(console.warn(SO),t1=!0),!n1&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(bO),n1=!0)}for(var s in n)if(!e1[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 p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var h=t._useStrictMode,y={},x=!1;const S={};for(var s in t)if(!e1[s]){var c=s.slice(0,2)==="on",j=n[s]!==t[s];if(c&&j){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]||h&&t[s]!==e.getAttr(s))&&(x=!0,y[s]=t[s])}x&&(e.setAttrs(y),wo(e));for(var f in S)e.on(f+Ap,S[f])}function wo(e){if(!O3.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const Gb={},wO={};Ua.Node.prototype._applyProps=Vc;function jO(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 kO(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 EO(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function PO(e,t,n){return!1}function IO(e){return e}function MO(){return null}function TO(){return null}function _O(e,t,n,r){return wO}function DO(){}function AO(e){}function OO(e,t){return!1}function zO(){return Gb}function RO(){return Gb}const NO=setTimeout,FO=clearTimeout,LO=-1;function BO(e,t){return!1}const HO=!1,WO=!0,VO=!0;function UO(e,t){t.parent===e?t.moveToTop():e.add(t),wo(e)}function $O(e,t){t.parent===e?t.moveToTop():e.add(t),wo(e)}function qb(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),wo(e)}function GO(e,t,n){qb(e,t,n)}function qO(e,t){t.destroy(),t.off(Ap),wo(e)}function YO(e,t){t.destroy(),t.off(Ap),wo(e)}function KO(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function XO(e,t,n){}function QO(e,t,n,r,o){Vc(e,o,r)}function ZO(e){e.hide(),wo(e)}function JO(e){}function ez(e,t){(t.visible==null||t.visible)&&e.show()}function tz(e,t){}function nz(e){}function rz(){}const oz=()=>pc.DefaultEventPriority,iz=Object.freeze(Object.defineProperty({__proto__:null,appendChild:UO,appendChildToContainer:$O,appendInitialChild:jO,cancelTimeout:FO,clearContainer:nz,commitMount:XO,commitTextUpdate:KO,commitUpdate:QO,createInstance:kO,createTextInstance:EO,detachDeletedInstance:rz,finalizeInitialChildren:PO,getChildHostContext:RO,getCurrentEventPriority:oz,getPublicInstance:IO,getRootHostContext:zO,hideInstance:ZO,hideTextInstance:JO,idlePriority:Bl.unstable_IdlePriority,insertBefore:qb,insertInContainerBefore:GO,isPrimaryRenderer:HO,noTimeout:LO,now:Bl.unstable_now,prepareForCommit:MO,preparePortalMount:TO,prepareUpdate:_O,removeChild:qO,removeChildFromContainer:YO,resetAfterCommit:DO,resetTextContent:AO,run:Bl.unstable_runWithPriority,scheduleTimeout:NO,shouldDeprioritizeSubtree:OO,shouldSetTextContent:BO,supportsMutation:VO,unhideInstance:ez,unhideTextInstance:tz,warnsIfNotActing:WO},Symbol.toStringTag,{value:"Module"}));var az=Object.defineProperty,sz=Object.defineProperties,lz=Object.getOwnPropertyDescriptors,r1=Object.getOwnPropertySymbols,cz=Object.prototype.hasOwnProperty,uz=Object.prototype.propertyIsEnumerable,o1=(e,t,n)=>t in e?az(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,i1=(e,t)=>{for(var n in t||(t={}))cz.call(t,n)&&o1(e,n,t[n]);if(r1)for(var n of r1(t))uz.call(t,n)&&o1(e,n,t[n]);return e},dz=(e,t)=>sz(e,lz(t));function Yb(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=Yb(r,t,n);if(o)return o;r=t?null:r.sibling}}function Kb(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const Op=Kb(g.createContext(null));class Xb extends g.Component{render(){return g.createElement(Op.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:fz,ReactCurrentDispatcher:hz}=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function pz(){const e=g.useContext(Op);if(!e)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=g.useId();return g.useMemo(()=>{var r;return(r=fz.current)!=null?r:Yb(e,!1,o=>{let s=o.memoizedState;for(;s;){if(s.memoizedState===t)return!0;s=s.next}})},[e,t])}function mz(){var e,t;const n=pz(),[r]=g.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==Op&&!r.has(s)&&r.set(s,(t=hz.current)==null?void 0:t.readContext(Kb(s))),o=o.return}return g.useMemo(()=>Array.from(r.keys()).reduce((s,c)=>u=>g.createElement(s,null,g.createElement(c.Provider,dz(i1({},u),{value:r.get(c)}))),s=>g.createElement(Xb,i1({},s))),[r])}function vz(e){const t=_e.useRef();return _e.useLayoutEffect(()=>{t.current=e}),t.current}const gz=e=>{const t=_e.useRef(),n=_e.useRef(),r=_e.useRef(),o=vz(e),s=mz(),c=u=>{const{forwardedRef:f}=e;f&&(typeof f=="function"?f(u):f.current=u)};return _e.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(_e.createElement(s,{},e.children),r.current),()=>{Ua.isBrowser&&(c(null),Na.updateContainer(null,r.current,null),n.current.destroy())}),[]),_e.useLayoutEffect(()=>{c(n.current),Vc(n.current,e,o),Na.updateContainer(_e.createElement(s,{},e.children),r.current,null)}),_e.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",Qb="Image",yz="Transformer",Na=yO(iz);Na.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:_e.version,rendererPackageName:"react-konva"});const xz=_e.forwardRef((e,t)=>_e.createElement(Xb,{},_e.createElement(gz,{...e,forwardedRef:t}))),bz=pe([tt,Ot],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Sz=()=>{const e=Y(),{tool:t,isStaging:n,isMovingBoundingBox:r}=A(bz);return{handleDragStart:g.useCallback(()=>{(t==="move"||n)&&!r&&e(Kl(!0))},[e,r,n,t]),handleDragMove:g.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(q1(s))},[e,r,n,t]),handleDragEnd:g.useCallback(()=>{(t==="move"||n)&&!r&&e(Kl(!1))},[e,r,n,t])}},Cz=pe([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}}),wz=()=>{const e=Y(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:c}=A(Cz),u=g.useRef(null),f=Y1(),p=()=>e(Zf());ce(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const h=()=>e(as(!s));ce(["h"],()=>{h()},{enabled:()=>!o,preventDefault:!0},[s]),ce(["n"],()=>{e(Xl(!c))},{enabled:!0,preventDefault:!0},[c]),ce("esc",()=>{e(z3())},{enabled:()=>!0,preventDefault:!0}),ce("shift+h",()=>{e(R3(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),ce(["space"],y=>{y.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])},zp=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}},Zb=()=>{const e=Y(),t=jr(),n=Y1();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=N3.pixelRatio,[s,c,u,f]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;e(F3({r:s,g:c,b:u,a:f}))},commitColorUnderCursor:()=>{e(L3())}}},jz=pe([bt,tt,Ot],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),kz=e=>{const t=Y(),{tool:n,isStaging:r}=A(jz),{commitColorUnderCursor:o}=Zb();return g.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=zp(e.current);c&&(s.evt.preventDefault(),t(K1(!0)),t(B3([c.x,c.y])))},[e,n,r,t,o])},Ez=pe([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}}),Pz=(e,t,n)=>{const r=Y(),{isDrawing:o,tool:s,isStaging:c}=A(Ez),{updateColorUnderCursor:u}=Zb();return g.useCallback(()=>{if(!e.current)return;const f=zp(e.current);if(f){if(r(H3(f)),n.current=f,s==="colorPicker"){u();return}!o||s==="move"||c||(t.current=!0,r(X1([f.x,f.y])))}},[t,r,o,c,n,e,s,u])},Iz=()=>{const e=Y();return g.useCallback(()=>{e(W3())},[e])},Mz=pe([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}}),Tz=(e,t)=>{const n=Y(),{tool:r,isDrawing:o,isStaging:s}=A(Mz);return g.useCallback(()=>{if(r==="move"||s){n(Kl(!1));return}if(!t.current&&o&&e.current){const c=zp(e.current);if(!c)return;n(X1([c.x,c.y]))}else t.current=!1;n(K1(!1))},[t,n,o,s,e,r])},_z=pe([tt],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Dz=e=>{const t=Y(),{isMoveStageKeyHeld:n,stageScale:r}=A(_z);return g.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*V3**u,U3,$3),p={x:s.x-c.x*f,y:s.y-c.y*f};t(G3(f)),t(q1(p))},[e,n,r,t])},Az=pe(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}}),Oz=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=A(Az);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"})]})},zz=pe([tt],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Rz=()=>{const e=A(f=>f.ui.currentTheme),{stageScale:t,stageCoordinates:n,stageDimensions:r}=A(zz),[o,s]=g.useState([]),[c]=E1("colors",["gridLineColor"]),u=g.useCallback(f=>f/t,[t]);return g.useLayoutEffect(()=>{const{width:f,height:p}=r,{x:h,y}=n,x={x1:0,y1:0,x2:f,y2:p,offset:{x:u(h),y:u(y)}},S={x:Math.ceil(u(h)/64)*64,y:Math.ceil(u(y)/64)*64},j={x1:-S.x,y1:-S.y,x2:u(f)-S.x+64,y2:u(p)-S.y+64},w={x1:Math.min(x.x1,j.x1),y1:Math.min(x.y1,j.y1),x2:Math.max(x.x2,j.x2),y2:Math.max(x.y2,j.y2)},k=w.x2-w.x1,I=w.y2-w.y1,P=Math.round(k/64)+1,M=Math.round(I/64)+1,T=ee.range(0,P).map(_=>l.jsx(mc,{x:w.x1+_*64,y:w.y1,points:[0,0,0,I],stroke:c,strokeWidth:1},`x_${_}`)),D=ee.range(0,M).map(_=>l.jsx(mc,{x:w.x1,y:w.y1+_*64,points:[0,0,k,0],stroke:c,strokeWidth:1},`y_${_}`));s(T.concat(D))},[t,n,r,e,u,c]),l.jsx(Ur,{children:o})},Nz=pe([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Fz=e=>{const{...t}=e,n=A(Nz),[r,o]=g.useState(null);if(g.useEffect(()=>{if(!n)return;const p=new Image;p.onload=()=>{o(p)},p.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(Qb,{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})`},Lz=pe(tt,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Ko(t)}}),a1=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),Bz=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=A(Lz),[c,u]=g.useState(null),[f,p]=g.useState(0),h=g.useRef(null),y=g.useCallback(()=>{p(f+1),setTimeout(y,500)},[f]);return g.useEffect(()=>{if(c)return;const x=new Image;x.onload=()=>{u(x)},x.src=a1(n)},[c,n]),g.useEffect(()=>{c&&(c.src=a1(n))},[c,n]),g.useEffect(()=>{const x=setInterval(()=>p(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:h,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})},Hz=pe([tt],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Wz=e=>{const{...t}=e,{objects:n}=A(Hz);return l.jsx(Ur,{listening:!1,...t,children:n.filter(q3).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=g,Vz=function(t,n,r){const o=Lo.useRef("loading"),s=Lo.useRef(),[c,u]=Lo.useState(0),f=Lo.useRef(),p=Lo.useRef(),h=Lo.useRef();return(f.current!==t||p.current!==n||h.current!==r)&&(o.current="loading",s.current=void 0,f.current=t,p.current=n,h.current=r),Lo.useLayoutEffect(function(){if(!t)return;var y=document.createElement("img");function x(){o.current="loaded",s.current=y,u(Math.random())}function S(){o.current="failed",s.current=void 0,u(Math.random())}return y.addEventListener("load",x),y.addEventListener("error",S),n&&(y.crossOrigin=n),r&&(y.referrerpolicy=r),y.src=t,function(){y.removeEventListener("load",x),y.removeEventListener("error",S)}},[t,n,r]),[s.current,o.current]};const Jb=e=>{const{url:t,x:n,y:r}=e,[o]=Vz(t);return l.jsx(Qb,{x:n,y:r,image:o,listening:!1})},Uz=pe([tt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),$z=()=>{const{objects:e}=A(Uz);return e?l.jsx(Ur,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(G1(t))return l.jsx(Jb,{x:t.x,y:t.y,url:t.image.url},n);if(Y3(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(K3(t))return l.jsx($r,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Ko(t.color)},n);if(X3(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},Gz=pe([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}}),qz=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:c,width:u,height:f}=A(Gz);return l.jsxs(Ur,{...t,children:[r&&n&&l.jsx(Jb,{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})]})]})},Yz=pe([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}}),Kz=()=>{const e=Y(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o}=A(Yz),{t:s}=K(),c=g.useCallback(()=>{e(Nv(!0))},[e]),u=g.useCallback(()=>{e(Nv(!1))},[e]);ce(["left"],()=>{f()},{enabled:()=>!0,preventDefault:!0}),ce(["right"],()=>{p()},{enabled:()=>!0,preventDefault:!0}),ce(["enter"],()=>{h()},{enabled:()=>!0,preventDefault:!0});const f=()=>e(Q3()),p=()=>e(Z3()),h=()=>e(J3());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(ae,{tooltip:`${s("unifiedCanvas.previous")} (Left)`,"aria-label":`${s("unifiedCanvas.previous")} (Left)`,icon:l.jsx(Lx,{}),onClick:f,colorScheme:"accent",isDisabled:t}),l.jsx(ae,{tooltip:`${s("unifiedCanvas.next")} (Right)`,"aria-label":`${s("unifiedCanvas.next")} (Right)`,icon:l.jsx(E9,{}),onClick:p,colorScheme:"accent",isDisabled:n}),l.jsx(ae,{tooltip:`${s("unifiedCanvas.accept")} (Enter)`,"aria-label":`${s("unifiedCanvas.accept")} (Enter)`,icon:l.jsx(Oc,{}),onClick:h,colorScheme:"accent"}),l.jsx(ae,{tooltip:s("unifiedCanvas.showHide"),"aria-label":s("unifiedCanvas.showHide"),"data-alert":!o,icon:o?l.jsx($x,{}):l.jsx(Zh,{}),onClick:()=>e(eC(!o)),colorScheme:"accent"}),l.jsx(ae,{tooltip:s("unifiedCanvas.saveToGallery"),"aria-label":s("unifiedCanvas.saveToGallery"),icon:l.jsx(Jh,{}),onClick:()=>e(tC(r.image.url)),colorScheme:"accent"}),l.jsx(ae,{tooltip:s("unifiedCanvas.discardAll"),"aria-label":s("unifiedCanvas.discardAll"),icon:l.jsx(zc,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(nC()),colorScheme:"error",fontSize:20})]})}):null},Fi=e=>Math.round(e*100)/100,Xz=pe([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 Qz(){const{cursorCoordinatesString:e}=A(Xz),{t}=K();return l.jsx(Ye,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Gf="var(--invokeai-colors-warning-500)",Zz=pe([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:p,y:h},stageScale:y,shouldShowCanvasDebugInfo:x,layer:S,boundingBoxScaleMethod:j,shouldPreserveMaskedArea:C}=e;let w="inherit";return(j==="none"&&(s<512||c<512)||j==="manual"&&u*f<512*512)&&(w=Gf),{activeLayerColor:S==="mask"?Gf:"inherit",activeLayerString:S.charAt(0).toUpperCase()+S.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${Fi(p)}, ${Fi(h)})`,boundingBoxDimensionsString:`${s}×${c}`,scaledBoundingBoxDimensionsString:`${u}×${f}`,canvasCoordinatesString:`${Fi(r)}×${Fi(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(y*100),shouldShowCanvasDebugInfo:x,shouldShowBoundingBox:j!=="auto",shouldShowScaledBoundingBox:j!=="none",shouldPreserveMaskedArea:C}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Jz=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:c,canvasCoordinatesString:u,canvasDimensionsString:f,canvasScaleString:p,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:y,shouldPreserveMaskedArea:x}=A(Zz),{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")}: ${p}%`}),x&&l.jsx(Ye,{style:{color:Gf},children:"Preserve Masked Area: On"}),y&&l.jsx(Ye,{style:{color:n},children:`${S("unifiedCanvas.boundingBox")}: ${o}`}),c&&l.jsx(Ye,{style:{color:n},children:`${S("unifiedCanvas.scaledBoundingBox")}: ${s}`}),h&&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(Qz,{})]})]})},eR=pe(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}}),tR=e=>{const{...t}=e,n=Y(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:c,isTransformingBoundingBox:u,stageScale:f,shouldSnapToGrid:p,tool:h,hitStrokeWidth:y}=A(eR),x=g.useRef(null),S=g.useRef(null),[j,C]=g.useState(!1);g.useEffect(()=>{var Q;!x.current||!S.current||(x.current.nodes([S.current]),(Q=x.current.getLayer())==null||Q.batchDraw())},[]);const w=64*f,k=g.useCallback(Q=>{if(!p){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=Fv(U,64),re=Fv(X,64);Q.target.x(te),Q.target.y(re),n(hd({x:te,y:re}))},[n,p]),I=g.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:p?ml($,64):$,y:p?ml(Z,64):Z})),Q.scaleX(1),Q.scaleY(1)},[n,p]),P=g.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]),M=()=>{n(pd(!0))},T=()=>{n(pd(!1)),n(md(!1)),n(vl(!1)),C(!1)},D=()=>{n(md(!0))},_=()=>{n(pd(!1)),n(md(!1)),n(vl(!1)),C(!1)},R=()=>{C(!0)},V=()=>{!u&&!c&&C(!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:y,listening:!s&&h==="move",onDragStart:D,onDragEnd:_,onDragMove:k,onMouseDown:D,onMouseOut:V,onMouseOver:R,onMouseEnter:R,onMouseUp:_,onTransform:I,onTransformEnd:T,ref:S,stroke:j?"rgba(255,255,255,0.7)":"white",strokeWidth:(j?8:1)/f,width:o.width,x:r.x,y:r.y}),l.jsx(yz,{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:h==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&h==="move",onDragStart:D,onDragEnd:_,onMouseDown:M,onMouseUp:T,onTransformEnd:T,ref:x,rotateEnabled:!1})]})},nR=pe(tt,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:c,layer:u,shouldShowBrush:f,isMovingBoundingBox:p,isTransformingBoundingBox:h,stageScale:y,stageDimensions:x,boundingBoxCoordinates:S,boundingBoxDimensions:j,shouldRestrictStrokesToBox:C}=e,w=C?{clipX:S.x,clipY:S.y,clipWidth:j.width,clipHeight:j.height}:{};return{cursorPosition:t,brushX:t?t.x:x.width/2,brushY:t?t.y:x.height/2,radius:n/2,colorPickerOuterRadius:Lv/y,colorPickerInnerRadius:(Lv-lf+1)/y,maskColorString:Ko({...o,a:.5}),brushColorString:Ko(s),colorPickerColorString:Ko(r),tool:c,layer:u,shouldShowBrush:f,shouldDrawBrushPreview:!(p||h||!t)&&f,strokeWidth:1.5/y,dotRadius:1.5/y,clip:w}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),rR=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:c,layer:u,shouldDrawBrushPreview:f,dotRadius:p,strokeWidth:h,brushColorString:y,colorPickerColorString:x,colorPickerInnerRadius:S,colorPickerOuterRadius:j,clip:C}=A(nR);return f?l.jsxs(Ur,{listening:!1,...C,...t,children:[c==="colorPicker"?l.jsxs(l.Fragment,{children:[l.jsx(Fo,{x:n,y:r,radius:j,stroke:y,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:y,globalCompositeOperation:c==="eraser"?"destination-out":"source-out"}),l.jsx(Fo,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:h*2,strokeEnabled:!0,listening:!1}),l.jsx(Fo,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:h,strokeEnabled:!0,listening:!1})]}),l.jsx(Fo,{x:n,y:r,radius:p*2,fill:"rgba(255,255,255,0.4)",listening:!1}),l.jsx(Fo,{x:n,y:r,radius:p,fill:"rgba(0,0,0,1)",listening:!1})]}):null},oR=pe([tt,Ot],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:c,isMovingBoundingBox:u,stageDimensions:f,stageCoordinates:p,tool:h,isMovingStage:y,shouldShowIntermediates:x,shouldShowGrid:S,shouldRestrictStrokesToBox:j}=e;let C="none";return h==="move"||t?y?C="grabbing":C="grab":s?C=void 0:j&&!c&&(C="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||u,shouldShowBoundingBox:o,shouldShowGrid:S,stageCoordinates:p,stageCursor:C,stageDimensions:f,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:x}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),iR=ne(xz,{shouldForwardProp:e=>!["sx"].includes(e)}),e4=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:c,stageScale:u,tool:f,isStaging:p,shouldShowIntermediates:h}=A(oR);wz();const y=g.useRef(null),x=g.useRef(null),S=g.useCallback(V=>{oC(V),y.current=V},[]),j=g.useCallback(V=>{rC(V),x.current=V},[]),C=g.useRef({x:0,y:0}),w=g.useRef(!1),k=Dz(y),I=kz(y),P=Tz(y,w),M=Pz(y,w,C),T=Iz(),{handleDragStart:D,handleDragMove:_,handleDragEnd:R}=Sz();return l.jsx(L,{sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:l.jsxs(Ye,{sx:{position:"relative"},children:[l.jsxs(iR,{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:I,onTouchMove:M,onTouchEnd:P,onMouseDown:I,onMouseLeave:T,onMouseMove:M,onMouseUp:P,onDragStart:D,onDragMove:_,onDragEnd:R,onContextMenu:V=>V.evt.preventDefault(),onWheel:k,draggable:(f==="move"||p)&&!t,children:[l.jsx(Aa,{id:"grid",visible:r,children:l.jsx(Rz,{})}),l.jsx(Aa,{id:"base",ref:j,listening:!1,imageSmoothingEnabled:!1,children:l.jsx($z,{})}),l.jsxs(Aa,{id:"mask",visible:e,listening:!1,children:[l.jsx(Wz,{visible:!0,listening:!1}),l.jsx(Bz,{listening:!1})]}),l.jsx(Aa,{children:l.jsx(Oz,{})}),l.jsxs(Aa,{id:"preview",imageSmoothingEnabled:!1,children:[!p&&l.jsx(rR,{visible:f!=="move",listening:!1}),l.jsx(qz,{visible:p}),h&&l.jsx(Fz,{}),l.jsx(tR,{visible:n&&!p})]})]}),l.jsx(Jz,{}),l.jsx(Kz,{})]})})},aR=pe(tt,Vb,bt,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}}),t4=()=>{const e=Y(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=A(aR),s=g.useRef(null);return g.useLayoutEffect(()=>{window.setTimeout(()=>{if(!s.current)return;const{clientWidth:c,clientHeight:u}=s.current;e(iC({width:c,height:u})),e(o?aC():Sc()),e(I1(!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"})})},sR=pe([tt,bt,Et],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function n4(){const e=Y(),{canRedo:t,activeTabName:n}=A(sR),{t:r}=K(),o=()=>{e(sC())};return ce(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),l.jsx(ae,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:l.jsx(W9,{}),onClick:o,isDisabled:!t})}const lR=pe([tt,bt,Et],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function r4(){const e=Y(),{t}=K(),{canUndo:n,activeTabName:r}=A(lR),o=()=>{e(lC())};return ce(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),l.jsx(ae,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:l.jsx(G9,{}),onClick:o,isDisabled:!n})}const cR=(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},uR=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},dR=(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:p}=e.getClientRect(),h=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:c,y:u,width:f,height:p},y=e.toDataURL(h);return e.scale(o),{dataURL:y,boundingBox:{x:s.x,y:s.y,width:f,height:p}}},fR={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},co=(e=fR)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:o,shouldSaveToGallery:s,shouldDownload:c,shouldCopy:u,shouldSetAsInitialImage:f}=e;t(cC("Exporting Image")),t(gl(!1));const p=n(),{stageScale:h,boundingBoxCoordinates:y,boundingBoxDimensions:x,stageCoordinates:S}=p.canvas,j=jr();if(!j){t(vd(!1)),t(gl(!0));return}const{dataURL:C,boundingBox:w}=dR(j,h,S,o?{...y,...x}:void 0);if(!C){t(vd(!1)),t(gl(!0));return}const k=new FormData;k.append("data",JSON.stringify({dataURL:C,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:M,width:T,height:D}=P,_={uuid:C1(),category:s?"result":"user",...P};c&&(uR(M),t(yl({title:Ma.t("toast.downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),u&&(cR(M,T,D),t(yl({title:Ma.t("toast.imageCopied"),status:"success",duration:2500,isClosable:!0}))),s&&(t(w1({image:_,category:"result"})),t(yl({title:Ma.t("toast.imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),f&&(t(uC({kind:"image",layer:"base",...w,image:_})),t(yl({title:Ma.t("toast.canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(vd(!1)),t(dC(Ma.t("common.statusConnected"))),t(gl(!0))};function hR(){const e=A(Ot),t=jr(),n=A(u=>u.system.isProcessing),r=A(u=>u.canvas.shouldCropToBoundingBoxOnSave),o=Y(),{t:s}=K();ce(["meta+c","ctrl+c"],()=>{c()},{enabled:()=>!e,preventDefault:!0},[t,n]);const c=()=>{o(co({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return l.jsx(ae,{"aria-label":`${s("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${s("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:l.jsx(Xi,{}),onClick:c,isDisabled:e})}function pR(){const e=Y(),{t}=K(),n=jr(),r=A(Ot),o=A(u=>u.system.isProcessing),s=A(u=>u.canvas.shouldCropToBoundingBoxOnSave);ce(["shift+d"],()=>{c()},{enabled:()=>!r,preventDefault:!0},[n,o]);const c=()=>{e(co({cropVisible:!s,cropToBoundingBox:s,shouldDownload:!0}))};return l.jsx(ae,{"aria-label":`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:l.jsx(Qh,{}),onClick:c,isDisabled:r})}function mR(){const e=A(Ot),{openUploader:t}=Kh(),{t:n}=K();return l.jsx(ae,{"aria-label":n("common.upload"),tooltip:n("common.upload"),icon:l.jsx(Rc,{}),onClick:t,isDisabled:e})}const vR=pe([tt,Ot],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function gR(){const e=Y(),{t}=K(),{layer:n,isMaskEnabled:r,isStaging:o}=A(vR),s=()=>{e(Ql(n==="mask"?"base":"mask"))};ce(["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:Q1,onChange:c,isDisabled:o})}function yR(){const e=Y(),{t}=K(),n=jr(),r=A(Ot),o=A(c=>c.system.isProcessing);ce(["shift+m"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n,o]);const s=()=>{e(co({cropVisible:!1,shouldSetAsInitialImage:!0}))};return l.jsx(ae,{"aria-label":`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:l.jsx(qx,{}),onClick:s,isDisabled:r})}function xR(){const e=A(s=>s.canvas.tool),t=A(Ot),n=Y(),{t:r}=K();ce(["v"],()=>{o()},{enabled:()=>!t,preventDefault:!0},[]);const o=()=>n(Sr("move"));return l.jsx(ae,{"aria-label":`${r("unifiedCanvas.move")} (V)`,tooltip:`${r("unifiedCanvas.move")} (V)`,icon:l.jsx(Bx,{}),isChecked:e==="move"||t,onClick:o})}function bR(){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(ae,{tooltip:`${r("parameters.showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":r("parameters.showOptionsPanel"),onClick:o,children:l.jsx(ep,{})}),l.jsx(L,{children:l.jsx(Mp,{iconButton:!0})}),l.jsx(L,{children:l.jsx(Pp,{width:"100%",height:"40px",btnGroupWidth:"100%"})})]}):null}function SR(){const e=Y(),{t}=K(),n=A(Ot),r=()=>{e(Jf()),e(Sc())};return l.jsx(ae,{"aria-label":t("unifiedCanvas.clearCanvas"),tooltip:t("unifiedCanvas.clearCanvas"),icon:l.jsx(So,{}),onClick:r,isDisabled:n,colorScheme:"error"})}function o4(e,t,n=250){const[r,o]=g.useState(0);return g.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 CR(){const e=jr(),t=Y(),{t:n}=K();ce(["r"],()=>{o()},{enabled:()=>!0,preventDefault:!0},[e]);const r=o4(()=>o(!1),()=>o(!0)),o=(s=!1)=>{const c=jr();if(!c)return;const u=c.getClientRect({skipTransform:!0});t(Z1({contentRect:u,shouldScaleTo1:s}))};return l.jsx(ae,{"aria-label":`${n("unifiedCanvas.resetView")} (R)`,tooltip:`${n("unifiedCanvas.resetView")} (R)`,icon:l.jsx(Wx,{}),onClick:r})}function wR(){const e=A(Ot),t=jr(),n=A(u=>u.system.isProcessing),r=A(u=>u.canvas.shouldCropToBoundingBoxOnSave),o=Y(),{t:s}=K();ce(["shift+s"],()=>{c()},{enabled:()=>!e,preventDefault:!0},[t,n]);const c=()=>{o(co({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return l.jsx(ae,{"aria-label":`${s("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${s("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:l.jsx(Jh,{}),onClick:c,isDisabled:e})}const jR=pe([tt,Ot,Et],(e,t,n)=>{const{isProcessing:r}=n,{tool:o}=e;return{tool:o,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),kR=()=>{const e=Y(),{t}=K(),{tool:n,isStaging:r}=A(jR);ce(["b"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[]),ce(["e"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n]),ce(["c"],()=>{c()},{enabled:()=>!r,preventDefault:!0},[n]),ce(["shift+f"],()=>{u()},{enabled:()=>!r,preventDefault:!0}),ce(["delete","backspace"],()=>{f()},{enabled:()=>!r,preventDefault:!0});const o=()=>e(Sr("brush")),s=()=>e(Sr("eraser")),c=()=>e(Sr("colorPicker")),u=()=>e(J1()),f=()=>e(e2());return l.jsxs(L,{flexDirection:"column",gap:2,children:[l.jsxs(Qt,{children:[l.jsx(ae,{"aria-label":`${t("unifiedCanvas.brush")} (B)`,tooltip:`${t("unifiedCanvas.brush")} (B)`,icon:l.jsx(Yx,{}),isChecked:n==="brush"&&!r,onClick:o,isDisabled:r}),l.jsx(ae,{"aria-label":`${t("unifiedCanvas.eraser")} (E)`,tooltip:`${t("unifiedCanvas.eraser")} (B)`,icon:l.jsx(Vx,{}),isChecked:n==="eraser"&&!r,isDisabled:r,onClick:s})]}),l.jsxs(Qt,{children:[l.jsx(ae,{"aria-label":`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:l.jsx(Gx,{}),isDisabled:r,onClick:u}),l.jsx(ae,{"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(ae,{"aria-label":`${t("unifiedCanvas.colorPicker")} (C)`,tooltip:`${t("unifiedCanvas.colorPicker")} (C)`,icon:l.jsx(Ux,{}),isChecked:n==="colorPicker"&&!r,isDisabled:r,onClick:c,width:"max-content"})]})},i4=()=>{const e=A(Ot),t=Y(),{t:n}=K(),r=()=>{t(fC()),t(Jf()),t(t2())};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")})]})},a4=()=>{const e=A(Ot),t=Y(),{t:n}=K();return l.jsxs(Wc,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(t2()),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")})]})},ER=pe([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}}),PR=()=>{const e=Y(),{t}=K(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:o,shouldShowIntermediates:s}=A(ER);return l.jsx(or,{isLazy:!1,triggerComponent:l.jsx(ae,{tooltip:t("unifiedCanvas.canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedCanvas.canvasSettings"),icon:l.jsx(tp,{})}),children:l.jsxs(L,{direction:"column",gap:2,children:[l.jsx(ft,{label:t("unifiedCanvas.showIntermediates"),isChecked:s,onChange:c=>e(n2(c.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:c=>e(r2(c.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:c=>e(o2(c.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:o,onChange:c=>e(i2(c.target.checked))}),l.jsx(a4,{}),l.jsx(i4,{})]})})},IR=()=>l.jsxs(L,{flexDirection:"column",rowGap:2,children:[l.jsx(gR,{}),l.jsx(kR,{}),l.jsxs(L,{gap:2,children:[l.jsx(xR,{}),l.jsx(CR,{})]}),l.jsxs(L,{columnGap:2,children:[l.jsx(yR,{}),l.jsx(wR,{})]}),l.jsxs(L,{columnGap:2,children:[l.jsx(hR,{}),l.jsx(pR,{})]}),l.jsxs(L,{gap:2,children:[l.jsx(r4,{}),l.jsx(n4,{})]}),l.jsxs(L,{gap:2,children:[l.jsx(mR,{}),l.jsx(SR,{})]}),l.jsx(PR,{}),l.jsx(bR,{})]});function MR(){const e=Y(),t=A(o=>o.canvas.brushSize),{t:n}=K(),r=A(Ot);return ce(["BracketLeft"],()=>{e(Li(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),ce(["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 s4(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=g.useRef(e),n=g.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},s1=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)}},l1=function(e){!Wa(e)&&e.preventDefault()},Rp=_e.memo(function(e){var t=e.onMove,n=e.onKey,r=s4(e,["onMove","onKey"]),o=g.useRef(null),s=qf(t),c=qf(n),u=g.useRef(null),f=g.useRef(!1),p=g.useMemo(function(){var S=function(w){l1(w),(Wa(w)?w.touches.length>0:w.buttons>0)&&o.current?s(s1(o.current,w,u.current)):C(!1)},j=function(){return C(!1)};function C(w){var k=f.current,I=Yf(o.current),P=w?I.addEventListener:I.removeEventListener;P(k?"touchmove":"mousemove",S),P(k?"touchend":"mouseup",j)}return[function(w){var k=w.nativeEvent,I=o.current;if(I&&(l1(k),!function(M,T){return T&&!Wa(M)}(k,f.current)&&I)){if(Wa(k)){f.current=!0;var P=k.changedTouches||[];P.length&&(u.current=P[0].identifier)}I.focus(),s(s1(I,k,u.current)),C(!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}))},C]},[c,s]),h=p[0],y=p[1],x=p[2];return g.useEffect(function(){return x},[x]),_e.createElement("div",Uc({},r,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:o,onKeyDown:y,tabIndex:0,role:"slider"}))}),$c=function(e){return e.filter(Boolean).join(" ")},Np=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 _e.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},_e.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},l4=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=l4(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},$d=function(e){var t=l4(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},TR=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),p=s%6;return{r:gn(255*[r,u,c,c,f,r][p]),g:gn(255*[f,r,r,u,c,c][p]),b:gn(255*[c,c,f,r,r,u][p]),a:gn(o,2)}},_R=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}},DR=_e.memo(function(e){var t=e.hue,n=e.onChange,r=$c(["react-colorful__hue",e.className]);return _e.createElement("div",{className:r},_e.createElement(Rp,{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"},_e.createElement(Np,{className:"react-colorful__hue-pointer",left:t/360,color:Kf({h:t,s:100,v:100,a:1})})))}),AR=_e.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Kf({h:t.h,s:100,v:100,a:1})};return _e.createElement("div",{className:"react-colorful__saturation",style:r},_e.createElement(Rp,{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)+"%"},_e.createElement(Np,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Kf(t)})))}),c4=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function OR(e,t,n){var r=qf(n),o=g.useState(function(){return e.toHsva(t)}),s=o[0],c=o[1],u=g.useRef({color:t,hsva:s});g.useEffect(function(){if(!e.equal(t,u.current.color)){var p=e.toHsva(t);u.current={hsva:p,color:t},c(p)}},[t,e]),g.useEffect(function(){var p;c4(s,u.current.hsva)||e.equal(p=e.fromHsva(s),u.current.color)||(u.current={hsva:s,color:p},r(p))},[s,e,r]);var f=g.useCallback(function(p){c(function(h){return Object.assign({},h,p)})},[]);return[s,f]}var zR=typeof window<"u"?g.useLayoutEffect:g.useEffect,RR=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},c1=new Map,NR=function(e){zR(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!c1.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}`,c1.set(t,n);var r=RR();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},FR=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 _e.createElement("div",{className:s},_e.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),_e.createElement(Rp,{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"},_e.createElement(Np,{className:"react-colorful__alpha-pointer",left:n.a,color:$d(n)})))},LR=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,c=s4(e,["className","colorModel","color","onChange"]),u=g.useRef(null);NR(u);var f=OR(n,o,s),p=f[0],h=f[1],y=$c(["react-colorful",t]);return _e.createElement("div",Uc({},c,{ref:u,className:y}),_e.createElement(AR,{hsva:p,onChange:h}),_e.createElement(DR,{hue:p.h,onChange:h}),_e.createElement(FR,{hsva:p,onChange:h,className:"react-colorful__last-control"}))},BR={defaultColor:{r:0,g:0,b:0,a:1},toHsva:_R,fromHsva:TR,equal:c4},HR=function(e){return _e.createElement(LR,Uc({},e,{colorModel:BR}))};const WR=ne(HR,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),Gd={width:6,height:6,borderColor:"base.100"},VR=e=>{const{styleClass:t="",...n}=e;return l.jsx(WR,{sx:{".react-colorful__hue-pointer":Gd,".react-colorful__saturation-pointer":Gd,".react-colorful__alpha-pointer":Gd},className:t,...n})},vc=g.memo(VR),UR=pe([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 $R(){const e=Y(),{brushColor:t,maskColor:n,layer:r,isStaging:o}=A(UR),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 ce(["shift+BracketLeft"],()=>{e(Bi({...t,a:ee.clamp(t.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),ce(["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(a2(c))})]})})}function u4(){return l.jsxs(L,{columnGap:4,alignItems:"center",children:[l.jsx(MR,{}),l.jsx($R,{})]})}function GR(){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(s2(r.target.checked))})}function qR(){return l.jsxs(L,{gap:4,alignItems:"center",children:[l.jsx(u4,{}),l.jsx(GR,{})]})}function YR(){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 KR(){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 XR(){const e=Y(),{t}=K(),n=A(r=>r.canvas.shouldPreserveMaskedArea);return l.jsx(ft,{label:t("unifiedCanvas.betaPreserveMasked"),isChecked:n,onChange:r=>e(l2(r.target.checked))})}function QR(){return l.jsxs(L,{gap:4,alignItems:"center",children:[l.jsx(u4,{}),l.jsx(KR,{}),l.jsx(XR,{}),l.jsx(YR,{})]})}function ZR(){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(c2(r.target.checked))})}function JR(){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(u2(r.target.checked))})}function eN(){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 tN(){return l.jsxs(L,{alignItems:"center",gap:4,children:[l.jsx(JR,{}),l.jsx(eN,{}),l.jsx(ZR,{})]})}const nN=pe([tt],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function rN(){const{tool:e,layer:t}=A(nN);return l.jsxs(L,{height:8,minHeight:8,maxHeight:8,alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&l.jsx(qR,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&l.jsx(QR,{}),e=="move"&&l.jsx(tN,{})]})}const oN=pe([tt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),iN=()=>{const e=Y(),{doesCanvasNeedScaling:t}=A(oN);return g.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(IR,{}),l.jsxs(L,{width:"100%",height:"100%",flexDirection:"column",rowGap:4,children:[l.jsx(rN,{}),t?l.jsx(t4,{}):l.jsx(e4,{})]})]})})},aN=pe([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}}),sN=()=>{const e=Y(),{t}=K(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:c}=A(aN);ce(["q"],()=>{u()},{enabled:()=>!c,preventDefault:!0},[n]),ce(["shift+c"],()=>{f()},{enabled:()=>!c,preventDefault:!0},[]),ce(["h"],()=>{p()},{enabled:()=>!c,preventDefault:!0},[o]);const u=()=>{e(Ql(n==="mask"?"base":"mask"))},f=()=>e(Zf()),p=()=>e(as(!o));return l.jsx(or,{triggerComponent:l.jsx(Qt,{children:l.jsx(ae,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:l.jsx(R9,{}),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:p}),l.jsx(ft,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:h=>e(l2(h.target.checked))}),l.jsx(vc,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:h=>e(a2(h))}),l.jsxs(Je,{size:"sm",leftIcon:l.jsx(So,{}),onClick:f,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},lN=pe([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}}),cN=()=>{const e=Y(),{t}=K(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:c,shouldShowIntermediates:u,shouldSnapToGrid:f,shouldRestrictStrokesToBox:p}=A(lN);ce(["n"],()=>{e(Xl(!f))},{enabled:!0,preventDefault:!0},[f]);const h=y=>e(Xl(y.target.checked));return l.jsx(or,{isLazy:!1,triggerComponent:l.jsx(ae,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:l.jsx(tp,{})}),children:l.jsxs(L,{direction:"column",gap:2,children:[l.jsx(ft,{label:t("unifiedCanvas.showIntermediates"),isChecked:u,onChange:y=>e(n2(y.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.showGrid"),isChecked:c,onChange:y=>e(u2(y.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.snapToGrid"),isChecked:f,onChange:h}),l.jsx(ft,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:y=>e(c2(y.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:y=>e(r2(y.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:y=>e(o2(y.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:y=>e(s2(y.target.checked))}),l.jsx(ft,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:y=>e(i2(y.target.checked))}),l.jsx(a4,{}),l.jsx(i4,{})]})})},uN=pe([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}}),dN=()=>{const e=Y(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=A(uN),{t:s}=K();ce(["b"],()=>{c()},{enabled:()=>!o,preventDefault:!0},[]),ce(["e"],()=>{u()},{enabled:()=>!o,preventDefault:!0},[t]),ce(["c"],()=>{f()},{enabled:()=>!o,preventDefault:!0},[t]),ce(["shift+f"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),ce(["delete","backspace"],()=>{h()},{enabled:()=>!o,preventDefault:!0}),ce(["BracketLeft"],()=>{e(Li(Math.max(r-5,5)))},{enabled:()=>!o,preventDefault:!0},[r]),ce(["BracketRight"],()=>{e(Li(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),ce(["shift+BracketLeft"],()=>{e(Bi({...n,a:ee.clamp(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),ce(["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")),p=()=>e(J1()),h=()=>e(e2());return l.jsxs(Qt,{isAttached:!0,children:[l.jsx(ae,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:l.jsx(Yx,{}),isChecked:t==="brush"&&!o,onClick:c,isDisabled:o}),l.jsx(ae,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:l.jsx(Vx,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:u}),l.jsx(ae,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:l.jsx(Gx,{}),isDisabled:o,onClick:p}),l.jsx(ae,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:l.jsx(zc,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:h}),l.jsx(ae,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:l.jsx(Ux,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:f}),l.jsx(or,{triggerComponent:l.jsx(ae,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:l.jsx(ep,{})}),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:y=>e(Li(y)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),l.jsx(vc,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:y=>e(Bi(y))})]})})]})},fN=pe([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}}),hN=()=>{const e=Y(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s,shouldCropToBoundingBoxOnSave:c}=A(fN),u=jr(),{t:f}=K(),{openUploader:p}=Kh();ce(["v"],()=>{h()},{enabled:()=>!n,preventDefault:!0},[]),ce(["r"],()=>{x()},{enabled:()=>!0,preventDefault:!0},[u]),ce(["shift+m"],()=>{j()},{enabled:()=>!n,preventDefault:!0},[u,t]),ce(["shift+s"],()=>{C()},{enabled:()=>!n,preventDefault:!0},[u,t]),ce(["meta+c","ctrl+c"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[u,t]),ce(["shift+d"],()=>{k()},{enabled:()=>!n,preventDefault:!0},[u,t]);const h=()=>e(Sr("move")),y=o4(()=>x(!1),()=>x(!0)),x=(P=!1)=>{const M=jr();if(!M)return;const T=M.getClientRect({skipTransform:!0});e(Z1({contentRect:T,shouldScaleTo1:P}))},S=()=>{e(Jf()),e(Sc())},j=()=>{e(co({cropVisible:!1,shouldSetAsInitialImage:!0}))},C=()=>{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}))},I=P=>{const M=P.target.value;e(Ql(M)),M==="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:Q1,onChange:I,isDisabled:n}),l.jsx(sN,{}),l.jsx(dN,{}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(ae,{"aria-label":`${f("unifiedCanvas.move")} (V)`,tooltip:`${f("unifiedCanvas.move")} (V)`,icon:l.jsx(Bx,{}),isChecked:s==="move"||n,onClick:h}),l.jsx(ae,{"aria-label":`${f("unifiedCanvas.resetView")} (R)`,tooltip:`${f("unifiedCanvas.resetView")} (R)`,icon:l.jsx(Wx,{}),onClick:y})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(ae,{"aria-label":`${f("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${f("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:l.jsx(qx,{}),onClick:j,isDisabled:n}),l.jsx(ae,{"aria-label":`${f("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${f("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:l.jsx(Jh,{}),onClick:C,isDisabled:n}),l.jsx(ae,{"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(ae,{"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(r4,{}),l.jsx(n4,{})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(ae,{"aria-label":`${f("common.upload")}`,tooltip:`${f("common.upload")}`,icon:l.jsx(Rc,{}),onClick:p,isDisabled:n}),l.jsx(ae,{"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(cN,{})})]})},pN=pe([tt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),mN=()=>{const e=Y(),{doesCanvasNeedScaling:t}=A(pN);return g.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(hN,{}),l.jsx(L,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,width:"100%",height:"100%"},children:t?l.jsx(t4,{}):l.jsx(e4,{})})]})})},vN=pe(tt,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),gN=()=>{const e=Y(),{boundingBoxDimensions:t}=A(vN),{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})]})},yN=pe([Ip,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}}),xN=()=>{const e=Y(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:o,isManual:s,scaledBoundingBoxDimensions:c}=A(yN),{t:u}=K(),f=S=>{e(xl({...c,width:Math.floor(S)}))},p=S=>{e(xl({...c,height:Math.floor(S)}))},h=()=>{e(xl({...c,width:Math.floor(512)}))},y=()=>{e(xl({...c,height:Math.floor(512)}))},x=S=>{e(mC(S.target.value))};return l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(Mn,{label:u("parameters.scaleBeforeProcessing"),validValues:hC,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:h}),l.jsx(ut,{isInputDisabled:!s,isResetDisabled:!s,isSliderDisabled:!s,label:u("parameters.scaledHeight"),min:64,max:1024,step:64,value:c.height,onChange:p,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:y}),l.jsx(Mn,{label:u("parameters.infillMethod"),value:n,validValues:r,onChange:S=>e(pC(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(Bv(S))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Bv(32))}})]})};function bN(){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(Hv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Hv(16))}})}function SN(){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(Wv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(Wv(96))})}function CN(){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(Vv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(Vv(30))}})}function wN(){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(Uv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Uv(.7))}})}const jN=()=>l.jsxs(Fe,{gap:2,alignItems:"stretch",children:[l.jsx(SN,{}),l.jsx(bN,{}),l.jsx(wN,{}),l.jsx(CN,{})]});function kN(){const{t:e}=K(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(kp,{})},unifiedCanvasImg2Img:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:l.jsx($b,{label:e("parameters.img2imgStrength")})},seed:{header:`${e("parameters.seed")}`,feature:ln.SEED,content:l.jsx(Cp,{})},boundingBox:{header:`${e("parameters.boundingBoxHeader")}`,feature:ln.BOUNDING_BOX,content:l.jsx(gN,{})},seamCorrection:{header:`${e("parameters.seamCorrectionHeader")}`,feature:ln.SEAM_CORRECTION,content:l.jsx(jN,{})},infillAndScaling:{header:`${e("parameters.infillScalingHeader")}`,feature:ln.INFILL_AND_SCALING,content:l.jsx(xN,{})},variations:{header:`${e("parameters.variations")}`,feature:ln.VARIATIONS,content:l.jsx(jp,{}),additionalHeaderComponents:l.jsx(wp,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(bp,{}),additionalHeaderComponents:l.jsx(Sp,{})}};return l.jsxs(L,{flexDir:"column",gap:2,position:"relative",children:[l.jsx(Dp,{}),l.jsx(_p,{}),l.jsx(Tp,{}),l.jsx(Ep,{accordionInfo:t})]})}function EN(){const e=A(n=>n.ui.shouldUseCanvasBetaLayout),t=A(bt);return l.jsx(pp,{parametersPanelContent:l.jsx(kN,{}),children:t==="unifiedCanvas"&&(e?l.jsx(iN,{}):l.jsx(mN,{}))})}const _i={boxSize:6},u1=[{id:"txt2img",icon:l.jsx(tn,{as:BD,sx:_i}),workarea:l.jsx(mO,{})},{id:"img2img",icon:l.jsx(tn,{as:fp,sx:_i}),workarea:l.jsx(sO,{})},{id:"unifiedCanvas",icon:l.jsx(tn,{as:VD,sx:_i}),workarea:l.jsx(EN,{})},{id:"nodes",icon:l.jsx(tn,{as:HD,sx:_i}),workarea:l.jsx(XD,{})},{id:"postprocessing",icon:l.jsx(tn,{as:UD,sx:_i}),workarea:l.jsx(QD,{})},{id:"training",icon:l.jsx(tn,{as:WD,sx:_i}),workarea:l.jsx(ZD,{})}];function PN(){const e=A(eE),t=A(f=>f.lightbox.isLightboxOpen),n=A(f=>f.ui.shouldPinGallery),r=A(f=>f.ui.shouldPinParametersPanel),{t:o}=K(),s=Y();ce("1",()=>{s(kn(0))}),ce("2",()=>{s(kn(1))}),ce("3",()=>{s(kn(2))}),ce("4",()=>{s(kn(3))}),ce("5",()=>{s(kn(4))}),ce("6",()=>{s(kn(5))}),ce("z",()=>{s(Uo(!t))},[t]),ce("f",()=>{s(vC()),(n||r)&&s(cn())},[n,r]);const c=g.useMemo(()=>u1.map(f=>l.jsx(Gt,{hasArrow:!0,label:String(o(`common.${f.id}`)),placement:"end",children:l.jsxs(yx,{children:[l.jsx(w2,{children:String(o(`common.${f.id}`))}),f.icon]})},f.id)),[o]),u=g.useMemo(()=>u1.map(f=>l.jsx(vx,{children:f.workarea},f.id)),[]);return l.jsxs(px,{defaultIndex:e,index:e,onChange:f=>{s(kn(f))},flexGrow:1,children:[l.jsx(mx,{children:c}),l.jsx(gx,{children:u})]})}function IN(){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 MN=()=>{const e=Y(),t=A(Y9),n=ls();g.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(gC())},[e,n,t])},TN=pe([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}}),_N=()=>{const{t:e}=K(),{shouldPinGallery:t,shouldShowGalleryButton:n}=A(TN),r=Y(),o=()=>{r(cf(!0)),t&&r(cn())};return n?l.jsx(ae,{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(fp,{})}):null},qd={borderStartStartRadius:0,borderEndStartRadius:0},DN=pe([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}}),AN=()=>{const e=Y(),{t}=K(),{shouldShowProcessButtons:n,shouldShowParametersPanelButton:r,shouldPinParametersPanel:o}=A(DN),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(ae,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":t("accessibility.showOptionsPanel"),onClick:s,sx:qd,children:l.jsx(ep,{})}),n&&l.jsxs(l.Fragment,{children:[l.jsx(Mp,{iconButton:!0,sx:qd}),l.jsx(Pp,{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 ON(e){var t,n=g.useState(!1),r=n[0],o=n[1],s=g.useState(!1),c=s[0],u=s[1],f=g.useState(!1),p=f[0],h=f[1],y=g.useState([0,0]),x=y[0],S=y[1],j=g.useRef(null);g.useEffect(function(){if(r)setTimeout(function(){u(!0),setTimeout(function(){h(!0)})});else{h(!1);var w=setTimeout(function(){u(r)},1e3);return function(){return clearTimeout(w)}}},[r]),M6("contextmenu",function(w){var k;!((k=j.current)===null||k===void 0)&&k.contains(w.target)||w.target===j.current?(w.preventDefault(),o(!0),S([w.pageX,w.pageY])):o(!1)});var C=g.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 g.createElement(g.Fragment,null,e.children(j),c&&g.createElement($a,Va({},e.portalProps),g.createElement(Ah,Va({isOpen:p,gutter:0},e.menuProps,{onClose:C}),g.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 zN=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,d4=g.memo(e=>{const t=Y(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:o,mayDeleteImage:s,shouldUseSingleGalleryColumn:c}=A(eA),{image:u,isSelected:f}=e,{url:p,thumbnail:h,uuid:y,metadata:x}=u,[S,j]=g.useState(!1),C=ls(),{direction:w}=ta(),{t:k}=K(),I=yp(),P=()=>j(!0),M=()=>j(!1),T=()=>{var X,te,re,$;(te=(X=u.metadata)==null?void 0:X.image)!=null&&te.prompt&&I(($=(re=u.metadata)==null?void 0:re.image)==null?void 0:$.prompt),C({title:k("toast.promptSet"),status:"success",duration:2500,isClosable:!0})},D=()=>{u.metadata&&t(is(u.metadata.image.seed)),C({title:k("toast.seedSet"),status:"success",duration:2500,isClosable:!0})},_=()=>{t(rs(u)),n!=="img2img"&&t(kn("img2img")),C({title:k("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},R=()=>{t(bc(u)),t(Sc()),n!=="unifiedCanvas"&&t(kn("unifiedCanvas")),C({title:k("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},V=()=>{x&&t(A1(x)),C({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(yC(x)),C({title:k("toast.initialImageSet"),status:"success",duration:2500,isClosable:!0});return}C({title:k("toast.initialImageNotSet"),description:k("toast.initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},B=()=>t($v(u)),Q=X=>{X.dataTransfer.setData("invokeai/imageUuid",y),X.dataTransfer.effectAllowed="move"},U=()=>{t($v(u)),t(Uo(!0))};return l.jsx(ON,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>{var X,te,re,$,Z,fe,Se,Me;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:D,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:V,isDisabled:!["txt2img","img2img"].includes((fe=(Z=u==null?void 0:u.metadata)==null?void 0:Z.image)==null?void 0:fe.type),children:k("parameters.useAll")}),l.jsx(gr,{onClickCapture:F,isDisabled:((Me=(Se=u==null?void 0:u.metadata)==null?void 0:Se.image)==null?void 0:Me.type)!=="img2img",children:k("parameters.useInitImg")}),l.jsx(gr,{onClickCapture:_,children:k("parameters.sendToImg2Img")}),l.jsx(gr,{onClickCapture:R,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:M,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:h||p,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(ae,{"aria-label":k("parameters.deleteImage"),icon:l.jsx($9,{}),size:"xs",fontSize:14,isDisabled:!s})})})]},y)})},zN);d4.displayName="HoverableImage";const RN=290,f4=()=>{const e=Y(),{t}=K(),n=g.useRef(null),[r,o]=g.useState(!0),{images:s,currentCategory:c,currentImageUuid:u,shouldPinGallery:f,galleryImageMinimumWidth:p,galleryGridTemplateColumns:h,galleryImageObjectFit:y,shouldAutoSwitchToNewImages:x,areMoreImagesAvailable:S,shouldUseSingleGalleryColumn:j}=A(JD),C=()=>{e(CC(c))},w=I=>{e(Zl(I))},k=()=>{e(d2()),e(cn())};return g.useEffect(()=>{if(!n.current)return;const I=new ResizeObserver(()=>{if(n.current){if(n.current.clientWidth<RN){o(!0);return}o(!1)}});return I.observe(n.current),()=>I.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(ae,{"aria-label":t("gallery.showGenerations"),tooltip:t("gallery.showGenerations"),isChecked:c==="result",role:"radio",icon:l.jsx(A9,{}),onClick:()=>e(bl("result"))}),l.jsx(ae,{"aria-label":t("gallery.showUploads"),tooltip:t("gallery.showUploads"),role:"radio",isChecked:c==="user",icon:l.jsx(q9,{}),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(ae,{size:"sm","aria-label":t("gallery.gallerySettings"),icon:l.jsx(tp,{})}),children:l.jsxs(L,{direction:"column",gap:2,children:[l.jsx(ut,{value:p,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:y==="contain",onChange:()=>e(xC(y==="contain"?"cover":"contain"))}),l.jsx(ft,{label:t("gallery.autoSwitchNewImages"),isChecked:x,onChange:I=>e(bC(I.target.checked))}),l.jsx(ft,{label:t("gallery.singleColumnLayout"),isChecked:j,onChange:I=>e(SC(I.target.checked))})]})}),l.jsx(ae,{size:"sm","aria-label":t("gallery.pinGallery"),tooltip:`${t("gallery.pinGallery")} (Shift+G)`,onClick:k,icon:f?l.jsx(Ob,{}):l.jsx(zb,{})})]})]}),l.jsx(Ab,{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:h},children:s.map(I=>{const{uuid:P}=I,M=u===P;return l.jsx(d4,{image:I,isSelected:M},P)})}),l.jsx(Je,{onClick:C,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:fp,sx:{w:16,h:16}}),l.jsx(Ce,{textAlign:"center",children:t("gallery.noImagesInGallery")})]})})})]})};f4.displayName="ImageGalleryContent";const d1={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}},NN=pe([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 FN(){const e=Y(),{shouldPinGallery:t,shouldShowGallery:n,galleryImageMinimumWidth:r,activeTabName:o,isStaging:s,isResizable:c,isLightboxOpen:u}=A(NN),f=()=>{e(d2()),e(cn())},p=()=>{e(wC()),t&&e(cn())},h=()=>{e(cf(!1)),t&&e(cn())};ce("g",()=>{p()},[t]),ce("left",()=>{e(B1())},{enabled:!s||o!=="unifiedCanvas"},[s,o]),ce("right",()=>{e(H1())},{enabled:!s||o!=="unifiedCanvas"},[s,o]),ce("shift+g",()=>{f()},[t]),ce("esc",()=>{e(cf(!1))},{enabled:()=>!t,preventDefault:!0},[t]);const y=32;return ce("shift+up",()=>{if(r<256){const x=ee.clamp(r+y,32,256);e(Zl(x))}},[r]),ce("shift+down",()=>{if(r>32){const x=ee.clamp(r-y,32,256);e(Zl(x))}},[r]),l.jsx(Db,{direction:"right",isResizable:c||!t,isOpen:n,onClose:h,isPinned:t&&!u,minWidth:t?d1[o].galleryMinWidth:200,maxWidth:t?d1[o].galleryMaxWidth:void 0,children:l.jsx(f4,{})})}var Hn=function(e,t){return Number(e.toFixed(t))},LN=function(e,t){return typeof e=="number"?e:t},Mt=function(e,t,n){n&&typeof n=="function"&&n(e,t)},BN=function(e){return-Math.cos(e*Math.PI)/2+.5},HN=function(e){return e},WN=function(e){return e*e},VN=function(e){return e*(2-e)},UN=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},$N=function(e){return e*e*e},GN=function(e){return--e*e*e+1},qN=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},YN=function(e){return e*e*e*e},KN=function(e){return 1- --e*e*e*e},XN=function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},QN=function(e){return e*e*e*e*e},ZN=function(e){return 1+--e*e*e*e*e},JN=function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},h4={easeOut:BN,linear:HN,easeInQuad:WN,easeOutQuad:VN,easeInOutQuad:UN,easeInCubic:$N,easeOutCubic:GN,easeInOutCubic:qN,easeInQuart:YN,easeOutQuart:KN,easeInOutQuart:XN,easeInQuint:QN,easeOutQuint:ZN,easeInOutQuint:JN},p4=function(e){typeof e=="number"&&cancelAnimationFrame(e)},br=function(e){e.mounted&&(p4(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function m4(e,t,n,r){if(e.mounted){var o=new Date().getTime(),s=1;br(e),e.animation=function(){if(!e.mounted)return p4(e.animation);var c=new Date().getTime()-o,u=c/n,f=h4[t],p=f(u);c>=n?(r(s),e.animation=null):e.animation&&(r(p),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function eF(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=eF(t);if(!(!e.mounted||!o)){var s=e.setTransformState,c=e.transformState,u=c.scale,f=c.positionX,p=c.positionY,h=t.scale-u,y=t.positionX-f,x=t.positionY-p;n===0?s(t.scale,t.positionX,t.positionY):m4(e,r,n,function(S){var j=u+h*S,C=f+y*S,w=p+x*S;s(j,C,w)})}}function tF(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,s=t.offsetWidth,c=t.offsetHeight,u=s*n,f=c*n,p=r-u,h=o-f;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:u,newDiffWidth:p,newContentHeight:f,newDiffHeight:h}}var nF=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,p=e-t-u,h=u,y=r-o-f,x=f;return{minPositionX:p,maxPositionX:h,minPositionY:y,maxPositionY:x}},Fp=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=tF(n,r,t),c=s.wrapperWidth,u=s.wrapperHeight,f=s.newContentWidth,p=s.newDiffWidth,h=s.newContentHeight,y=s.newDiffHeight,x=nF(c,f,p,u,h,y,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=Fp(e,t);return e.bounds=n,n};function Gc(e,t,n,r,o,s,c){var u=n.minPositionX,f=n.minPositionY,p=n.maxPositionX,h=n.maxPositionY,y=0,x=0;c&&(y=o,x=s);var S=Xf(e,u-y,p+y,r),j=Xf(t,f-x,h+x,r);return{x:S,y:j}}function qc(e,t,n,r,o,s){var c=e.transformState,u=c.scale,f=c.positionX,p=c.positionY,h=r-u;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:f,y:p};var y=f-t*h,x=p-n*h,S=Gc(y,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 f1=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},h1=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,o=r.panning.disabled,s=t&&n&&!o;return!!s},rF=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}},oF=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 iF(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,p=e.wrapperComponent;if(!(c||!p||!e.bounds)){var h=e.bounds,y=h.maxPositionX,x=h.minPositionX,S=h.maxPositionY,j=h.minPositionY,C=n>y||n<x,w=r>S||r<j,k=n>y?p.offsetWidth:e.setup.minPositionX||0,I=r>S?p.offsetHeight:e.setup.minPositionY||0,P=qc(e,k,I,o,e.bounds,u||f),M=P.x,T=P.y;return{scale:o,positionX:C?M:n,positionY:w?T:r}}}function aF(e,t,n,r,o){var s=e.setup.limitToBounds,c=e.wrapperComponent,u=e.bounds,f=e.transformState,p=f.scale,h=f.positionX,y=f.positionY;if(!(c===null||u===null||t===h&&n===y)){var x=Gc(t,n,u,s,r,o,c),S=x.x,j=x.y;e.setTransformState(p,S,j)}}var sF=function(e,t,n){var r=e.startCoords,o=e.transformState,s=e.setup.panning,c=s.lockAxisX,u=s.lockAxisY,f=o.positionX,p=o.positionY;if(!r)return{x:f,y:p};var h=t-r.x,y=n-r.y,x=c?f:h,S=u?p:y;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},lF=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},cF=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,p=!f||u>1||!s||t;return!(!p||!n||!r)};function uF(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,s=n.sensitivity;return r?o*t*s:o}function p1(e,t,n,r,o,s,c,u,f,p){if(o){if(t>c&&n>c){var h=c+(e-c)*p;return h>f?f:h<c?c:h}if(t<s&&n<s){var h=s+(e-s)*p;return h<u?u:h>s?s:h}}return r?t:Xf(e,s,c,o)}function dF(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function fF(e,t){var n=lF(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 p=dF(c,u),h=t.x-r.x,y=t.y-r.y,x=h/p,S=y/p,j=f-o,C=h*h+y*y,w=Math.sqrt(C)/j;e.velocity={velocityX:x,velocityY:S,total:w}}e.lastMousePosition=t,e.velocityTime=f}}function hF(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,s=cF(e);if(!(!s||!t||!n||!o)){var c=t.velocityX,u=t.velocityY,f=t.total,p=n.maxPositionX,h=n.minPositionX,y=n.maxPositionY,x=n.minPositionY,S=r.limitToBounds,j=r.alignmentAnimation,C=r.zoomAnimation,w=r.panning,k=w.lockAxisY,I=w.lockAxisX,P=C.animationType,M=j.sizeX,T=j.sizeY,D=j.velocityAlignmentTime,_=D,R=uF(e,f),V=Math.max(R,_),F=gc(e,M),B=gc(e,T),Q=F*o.offsetWidth/100,U=B*o.offsetHeight/100,X=p+Q,te=h-Q,re=y+U,$=x-U,Z=e.transformState,fe=new Date().getTime();m4(e,P,V,function(Se){var Me=e.transformState,Ie=Me.scale,Pe=Me.positionX,he=Me.positionY,se=new Date().getTime()-fe,Ne=se/_,Ve=h4[j.animationType],Ue=1-Ve(Math.min(1,Ne)),$e=1-Se,Qe=Pe+c*$e,me=he+u*$e,De=p1(Qe,Z.positionX,Pe,I,S,h,p,te,X,Ue),Ge=p1(me,Z.positionY,he,k,S,x,y,$,re,Ue);(Pe!==Qe||he!==me)&&e.setTransformState(Ie,De,Ge)})}}function m1(e,t){var n=e.transformState.scale;br(e),ea(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?oF(e,t):rF(e,t)}function v4(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,p=o.animationType,h=s||t<r||!c&&!u;if(!h){var y=iF(e);y&&jo(e,y,f,p)}}function v1(e,t,n){var r=e.startCoords,o=e.setup,s=o.alignmentAnimation,c=s.sizeX,u=s.sizeY;if(r){var f=sF(e,t,n),p=f.x,h=f.y,y=gc(e,c),x=gc(e,u);fF(e,{x:p,y:h}),aF(e,p,h,y,x)}}function pF(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,p=(c==null?void 0:c.width)||0,h=(c==null?void 0:c.height)||0,y=u<p||f<h,x=!t&&n&&(n==null?void 0:n.total)>.1&&y;x?hF(e):v4(e)}}function Lp(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),p=ea(e,f),h=qc(e,n,r,f,p,u),y=h.x,x=h.y;return{scale:f,positionX:y,positionY:x}}function g4(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,c=s.minScale,u=s.limitToBounds,f=s.zoomAnimation,p=f.disabled,h=f.animationTime,y=f.animationType,x=p||r>=c;if((r>=1||u)&&v4(e),!(x||!o||!e.mounted)){var S=t||o.offsetWidth/2,j=n||o.offsetHeight/2,C=Lp(e,c,S,j);C&&jo(e,C,h,y)}}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 g1(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}},y4=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}},y1=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]=g1(g1([],Oa[n],!0),e[n],!0):t[n]=e[n]}}),t},x4=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,c=s.maxScale,u=s.minScale,f=s.zoomAnimation,p=f.size;if(!o)throw new Error("Wrapper is not mounted");var h=r*Math.exp(t*n),y=Cs(Hn(h,3),u,c,p,!1);return y};function b4(e,t,n,r,o){var s=e.wrapperComponent,c=e.transformState,u=c.scale,f=c.positionX,p=c.positionY;if(!s)return console.error("No WrapperComponent found");var h=s.offsetWidth,y=s.offsetHeight,x=(h/2-f)/u,S=(y/2-p)/u,j=x4(e,t,n),C=Lp(e,j,x,S);if(!C)return console.error("Error during zoom event. New transformation state was not calculated.");jo(e,C,r,o)}function S4(e,t,n,r){var o=e.setup,s=e.wrapperComponent,c=o.limitToBounds,u=y4(e.props),f=e.transformState,p=f.scale,h=f.positionX,y=f.positionY;if(s){var x=Fp(e,u.scale),S=Gc(u.positionX,u.positionY,x,c,0,0,s),j={scale:u.scale,positionX:S.x,positionY:S.y};p===u.scale&&h===u.positionX&&y===u.positionY||(r==null||r(),jo(e,j,t,n))}}function mF(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 vF(e,t,n){var r=e.wrapperComponent,o=e.contentComponent,s=e.transformState,c=e.setup,u=c.limitToBounds,f=c.minScale,p=c.maxScale;if(!r||!o)return s;var h=r.getBoundingClientRect(),y=t.getBoundingClientRect(),x=mF(t,r,o,s),S=x.x,j=x.y,C=y.width/s.scale,w=y.height/s.scale,k=r.offsetWidth/C,I=r.offsetHeight/w,P=Cs(n||Math.min(k,I),f,p,0,!1),M=(h.width-C*P)/2,T=(h.height-w*P)/2,D=(h.left-S)*P+M,_=(h.top-j)*P+T,R=Fp(e,P),V=Gc(D,_,R,u,0,0,r),F=V.x,B=V.y;return{positionX:F,positionY:B,scale:P}}var gF=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),b4(e,1,t,n,r)}},yF=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),b4(e,-1,t,n,r)}},xF=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,p=c.scale,h=e.wrapperComponent,y=e.contentComponent,x=e.setup.disabled;if(!(x||!h||!y)){var S={positionX:Number.isNaN(t)?u:t,positionY:Number.isNaN(n)?f:n,scale:Number.isNaN(r)?p:r};jo(e,S,o,s)}}},bF=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),S4(e,t,n)}},SF=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=C4(t||o.scale,s,c);jo(e,u,n,r)}}},CF=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=vF(e,c,n);jo(e,u,r,o)}}},dt=function(e){return{instance:e,state:e.transformState,zoomIn:gF(e),zoomOut:yF(e),setTransform:xF(e),resetTransform:bF(e),centerView:SF(e),zoomToElement:CF(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)},wF=function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")},C4=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 jF(e){return function(t){e.forEach(function(n){typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var kF=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,p=t.target,h=u&&!f&&!r&&p;if(!h||o&&!t.ctrlKey||s&&t.ctrlKey)return!1;var y=Yc(p,c);return!y},EF=function(e){return e?e.deltaY<0?1:-1:0};function PF(e,t){var n=EF(e),r=LN(t,n);return r}function w4(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 IF=function(e,t,n,r,o){var s=e.transformState.scale,c=e.wrapperComponent,u=e.setup,f=u.maxScale,p=u.minScale,h=u.zoomAnimation,y=u.disablePadding,x=h.size,S=h.disabled;if(!c)throw new Error("Wrapper is not mounted");var j=s+t*(s-s*n)*n;if(o)return j;var C=r?!1:!S,w=Cs(Hn(j,3),p,f,x,C&&!y);return w},MF=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},TF=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},_F=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,o=n&&!t&&r;return!!o},DF=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}},j4=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))},AF=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,p=u.size,h=u.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var y=t/r,x=y*n;return Cs(Hn(x,2),c,s,p,!h&&!f)},OF=160,zF=100,RF=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))},NF=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,p=c.limitToBounds,h=c.centerZoomedOut,y=c.zoomAnimation,x=c.wheel,S=c.disablePadding,j=y.size,C=y.disabled,w=x.step;if(!s)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var k=PF(t,null),I=IF(e,k,w,!t.ctrlKey);if(f!==I){var P=ea(e,I),M=w4(t,s,f),T=C||j===0||h||S,D=p&&T,_=qc(e,M.x,M.y,I,P,D),R=_.x,V=_.y;e.previousWheelEvent=t,e.setTransformState(I,R,V),Mt(dt(e),t,r),Mt(dt(e),t,o)}},FF=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;Qf(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(g4(e,t.x,t.y),e.wheelAnimationTimer=null)},zF);var s=MF(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))},OF))},LF=function(e,t){var n=j4(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,br(e)},BF=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,p=f.disabled,h=f.size;if(!(r===null||!n)){var y=DF(t,o,n);if(!(!Number.isFinite(y.x)||!Number.isFinite(y.y))){var x=j4(t),S=AF(e,x);if(S!==o){var j=ea(e,S),C=p||h===0||u,w=c&&C,k=qc(e,y.x,y.y,S,j,w),I=k.x,P=k.y;e.pinchMidpoint=y,e.lastDistance=x,e.setTransformState(S,I,P)}}}},HF=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,g4(e,t==null?void 0:t.x,t==null?void 0:t.y)},k4=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)},WF=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),S4(e,c,u,function(){return Mt(dt(e),t,o)}),k4(e,t)};function VF(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,o=e.transformState,s=e.contentComponent,c=o.scale,u=e.props,f=u.onZoomStart,p=u.onZoom,h=n.doubleClick,y=h.disabled,x=h.mode,S=h.step,j=h.animationTime,C=h.animationType;if(!y&&!r){if(x==="reset")return WF(e,t);if(!s)return console.error("No ContentComponent found");var w=x==="zoomOut"?-1:1,k=x4(e,w,S);if(c!==k){Mt(dt(e),t,f);var I=w4(t,s,c),P=Lp(e,k,I.x,I.y);if(!P)return console.error("Error during zoom event. New transformation state was not calculated.");Mt(dt(e),t,p),jo(e,P,j,C),k4(e,t)}}}var UF=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,p=o==null?void 0:o.contains(f),h=n&&f&&p&&!c;if(!h)return!1;var y=Yc(f,u);return!y},$F=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=y1(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=kF(n,r);if(s){var c=n.isPressingKeys(n.setup.wheel.activationKeys);c&&(RF(n,r),NF(n,r),FF(n,r))}}},this.onPanningStart=function(r){var o=n.setup.disabled,s=n.props.onPanningStart;if(!o){var c=f1(n,r);if(c){var u=n.isPressingKeys(n.setup.panning.activationKeys);u&&(r.preventDefault(),r.stopPropagation(),br(n),m1(n,r),Mt(dt(n),r,s))}}},this.onPanning=function(r){var o=n.setup.disabled,s=n.props.onPanning;if(!o){var c=h1(n);if(c){var u=n.isPressingKeys(n.setup.panning.activationKeys);u&&(r.preventDefault(),r.stopPropagation(),v1(n,r.clientX,r.clientY),Mt(dt(n),r,s))}}},this.onPanningStop=function(r){var o=n.props.onPanningStop;n.isPanning&&(pF(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=TF(n,r);f&&(LF(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=_F(n);f&&(r.preventDefault(),r.stopPropagation(),BF(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&&(HF(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=f1(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,p=f.length===1,h=f.length===2;p&&(br(n),m1(n,r),Mt(dt(n),r,s)),h&&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=h1(n);if(!c)return;r.preventDefault(),r.stopPropagation();var u=r.touches[0];v1(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=UF(n,r);s&&VF(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=C4(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):wF(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=y1(this.props),this.transformState=y4(this.props)}return e}(),Kc=_e.createContext(null),GF=function(e,t){return typeof e=="function"?e(t):e},qF=_e.forwardRef(function(e,t){var n=g.useState(0),r=n[1],o=e.children,s=g.useRef(new $F(e)).current,c=GF(e.children,dt(s)),u=g.useCallback(function(){typeof o=="function"&&r(function(f){return f+1})},[o]);return g.useImperativeHandle(t,function(){return dt(s)},[s]),g.useEffect(function(){s.update(e)},[s,e]),g.useEffect(function(){return s.onChange(u)},[s,e,u]),_e.createElement(Kc.Provider,{value:s},c)});function YF(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 KF=`.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;
|
||
}
|
||
`,x1={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};YF(KF);var XF=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,p=f===void 0?{}:f,h=e.contentProps,y=h===void 0?{}:h,x=g.useContext(Kc).init,S=g.useRef(null),j=g.useRef(null);return g.useEffect(function(){var C=S.current,w=j.current;C!==null&&w!==null&&x&&x(C,w)},[]),_e.createElement("div",fo({},p,{ref:S,className:"react-transform-wrapper ".concat(x1.wrapper," ").concat(r),style:c}),_e.createElement("div",fo({},y,{ref:j,className:"react-transform-component ".concat(x1.content," ").concat(s),style:u}),t))},E4=function(){var e=g.useContext(Kc),t=g.useState(dt(e||{})),n=t[0],r=t[1];if(!e)throw new Error("Transform context mus be placed inside TransformWrapper");return g.useEffect(function(){e.onChange(function(o){r(o)})},[e]),n};_e.forwardRef(function(e,t){var n=g.useRef(null),r=g.useContext(Kc);return g.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]),_e.createElement("div",fo({},e,{ref:jF([n,t])}))});const QF=()=>{const[e,t]=g.useState(0),[n,r]=g.useState(1),[o,s]=g.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)}}},ZF=({flipHorizontally:e,flipVertically:t,rotateCounterClockwise:n,rotateClockwise:r,reset:o})=>{const{zoomIn:s,zoomOut:c,resetTransform:u}=E4(),{t:f}=K();return l.jsxs(Qt,{isAttached:!0,orientation:"vertical",children:[l.jsx(ae,{icon:l.jsx(bD,{}),"aria-label":f("accessibility.zoomIn"),tooltip:f("accessibility.zoomIn"),onClick:()=>s(),fontSize:20}),l.jsx(ae,{icon:l.jsx(SD,{}),"aria-label":f("accessibility.zoomOut"),tooltip:f("accessibility.zoomOut"),onClick:()=>c(),fontSize:20}),l.jsx(ae,{icon:l.jsx(yD,{}),"aria-label":f("accessibility.rotateCounterClockwise"),tooltip:f("accessibility.rotateCounterClockwise"),onClick:n,fontSize:20}),l.jsx(ae,{icon:l.jsx(xD,{}),"aria-label":f("accessibility.rotateClockwise"),tooltip:f("accessibility.rotateClockwise"),onClick:r,fontSize:20}),l.jsx(ae,{icon:l.jsx(W0,{}),"aria-label":f("accessibility.flipHorizontally"),tooltip:f("accessibility.flipHorizontally"),onClick:e,fontSize:20}),l.jsx(ae,{icon:l.jsx(W0,{style:{transform:"rotate(90deg)"}}),"aria-label":f("accessibility.flipVertically"),tooltip:f("accessibility.flipVertically"),onClick:t,fontSize:20}),l.jsx(ae,{icon:l.jsx(Mb,{}),"aria-label":f("accessibility.reset"),tooltip:f("accessibility.reset"),onClick:()=>{u(),o()},fontSize:20})]})};function JF({image:e,alt:t,ref:n,styleClass:r,rotation:o,scaleX:s,scaleY:c}){const{centerView:u}=E4();return l.jsx(XF,{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 eL=pe([qr,Pr],(e,t)=>{const{currentImage:n}=e,{shouldShowImageDetails:r}=t;return{viewerImageToDisplay:n,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function tL(){const e=Y(),t=A(x=>x.lightbox.isLightboxOpen),{rotation:n,scaleX:r,scaleY:o,flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:p}=QF(),{viewerImageToDisplay:h,shouldShowImageDetails:y}=A(eL);return ce("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(qF,{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(ae,{icon:l.jsx(gD,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Uo(!1))},fontSize:20}),l.jsx(ZF,{flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:p})]}),l.jsx(L,{sx:{position:"absolute",top:4,zIndex:3,insetInlineStart:"50%",transform:"translate(-50%, 0)"},children:l.jsx(Rb,{})}),h&&l.jsxs(l.Fragment,{children:[l.jsx(JF,{rotation:n,scaleX:r,scaleY:o,image:h,styleClass:"lightbox-image"}),y&&l.jsx(xp,{image:h}),!y&&l.jsx(Ye,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"100vw",h:"100vh",px:16,pointerEvents:"none"},children:l.jsx(Nb,{})})]})]})},"lightbox")})}IN();const aL=e=>{MN();const t=A(r=>r.ui.currentTheme),{setColorMode:n}=jC();return g.useEffect(()=>{n(["light"].includes(t)?"light":"dark")},[n,t]),l.jsxs(ir,{w:"100vw",h:"100vh",children:[l.jsx(tL,{}),l.jsxs(u9,{children:[l.jsx(iP,{}),l.jsxs(ir,{gap:4,p:4,gridAutoRows:"min-content auto",w:eP,h:tP,children:[e.children||l.jsx(_b,{}),l.jsxs(L,{gap:4,w:"full",h:"full",children:[l.jsx(PN,{}),l.jsx(FN,{})]})]}),l.jsx(Ye,{children:l.jsx(Z9,{})})]}),l.jsx($a,{children:l.jsx(AN,{})}),l.jsx($a,{children:l.jsx(_N,{})})]})};export{aL as default};
|