mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
189 lines
592 KiB
JavaScript
189 lines
592 KiB
JavaScript
import{r as x,f as he,j as l,u as RS,c as re,a as Ae,b as Pe,w as is,d as fn,o as At,S as Qf,e as pi,g as Ye,h as Dr,k as Zi,i as yc,_ as Ql,l as NS,m as FS,R as ke,n as zv,p as LS,q as Kd,s as Ji,t as j1,v as E1,x as BS,y as HS,z as te,A as P1,B as I1,C as bc,D as os,F as B,E as Z,T as Ce,G as WS,H as Hl,I as Zl,J as Qd,K as Zd,L as Jd,U as VS,M as M1,N as T1,O as US,P as _1,Q as D1,V as $S,W as O1,X as A1,Y as Bi,Z as jn,$ as z1,a0 as as,a1 as GS,a2 as qS,a3 as R1,a4 as on,a5 as YS,a6 as vl,a7 as Sc,a8 as XS,a9 as Rv,aa as Fi,ab as KS,ac as QS,ad as Da,ae as gl,af as ZS,ag as JS,ah as eC,ai as tC,aj as nC,ak as N1,al as F1,am as ef,an as tf,ao as L1,ap as nf,aq as rf,ar as Nv,as as B1,at as H1,au as W1,av as Wl,aw as Vl,ax as rC,ay as of,az as V1,aA as iC,aB as dd,aC as Fv,aD as U1,aE as $1,aF as af,aG as Hi,aH as oC,aI as aC,aJ as Lv,aK as Bv,aL as sC,aM as lC,aN as cC,aO as G1,aP as q1,aQ as uC,aR as dC,aS as Hv,aT as fC,aU as Wv,aV as hC,aW as pC,aX as mC,aY as vC,aZ as gC,a_ as xC,a$ as yC,b0 as bC,b1 as Vv,b2 as Ul,b3 as SC,b4 as CC,b5 as qa,b6 as Jl,b7 as Y1,b8 as ec,b9 as wC,ba as kC,bb as xr,bc as X1,bd as Zf,be as ss,bf as jC,bg as EC,bh as PC,bi as Sr,bj as K1,bk as IC,bl as MC,bm as Q1,bn as TC,bo as _C,bp as DC,bq as OC,br as AC,bs as zC,bt as RC,bu as NC,bv as FC,bw as Uv,bx as LC,by as BC,bz as HC,bA as WC,bB as VC,bC as UC,bD as fd,bE as Na,bF as xl,bG as $v,bH as hd,bI as pd,bJ as yl,bK as Gv,bL as sf,bM as $C,bN as GC,bO as qC,bP as YC,bQ as XC,bR as KC,bS as QC,bT as bl,bU as md,bV as Sl,bW as nr,bX as ZC,bY as JC,bZ as Z1,b_ as tc,b$ as Jf,c0 as J1,c1 as e2,c2 as t2,c3 as e3,c4 as n2,c5 as r2,c6 as i2,c7 as o2,c8 as a2,c9 as Wo,ca as Vo,cb as s2,cc as l2,cd as c2,ce as u2,cf as d2,cg as t3,ch as n3,ci as qv,cj as Cl,ck as r3,cl as Yv,cm as Xv,cn as Kv,co as Qv,cp as vd,cq as f2,cr as i3,cs as ls,ct as Zv,cu as o3,cv as a3,cw as s3,cx as Wi,cy as h2,cz as Jv,cA as l3,cB as c3,cC as u3,cD as d3,cE as f3,cF as h3,cG as p3,cH as m3,cI as v3,cJ as g3,cK as x3,cL as y3}from"./index-61f10aa8.js";import{I as Jt,u as b3,c as S3,a as Et,b as Ut,A as ia,m as Wr,d as Uo,e as eo,P as eh,f as C3,C as w3,g as O,h as Y,n as p2}from"./scrollbar-7e342734.js";function th(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var nc="NOT_FOUND";function k3(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:nc},put:function(r,i){t={key:r,value:i}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function j3(e,t){var n=[];function r(u){var f=n.findIndex(function(p){return t(u,p.key)});if(f>-1){var h=n[f];return f>0&&(n.splice(f,1),n.unshift(h)),h.value}return nc}function i(u,f){r(u)===nc&&(n.unshift({key:u,value:f}),n.length>e&&n.pop())}function s(){return n}function c(){n=[]}return{get:r,put:i,getEntries:s,clear:c}}var E3=function(t,n){return t===n};function P3(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,s=0;s<i;s++)if(!e(n[s],r[s]))return!1;return!0}}function I3(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,i=r===void 0?E3:r,s=n.maxSize,c=s===void 0?1:s,u=n.resultEqualityCheck,f=P3(i),h=c===1?k3(f):j3(c,f);function p(){var g=h.get(arguments);if(g===nc){if(g=e.apply(null,arguments),u){var y=h.getEntries(),S=y.find(function(C){return u(C.value,g)});S&&(g=S.value)}h.put(arguments,g)}return g}return p.clearCache=function(){return h.clear()},p}function M3(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 T3(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 i=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];var h=0,p,g={memoizeOptions:void 0},y=u.pop();if(typeof y=="object"&&(g=y,y=u.pop()),typeof y!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof y+"]");var S=g,C=S.memoizeOptions,w=C===void 0?n:C,k=Array.isArray(w)?w:[w],j=M3(u),M=e.apply(void 0,[function(){return h++,y.apply(null,arguments)}].concat(k)),P=e(function(){for(var T=[],D=j.length,_=0;_<D;_++)T.push(j[_].apply(null,arguments));return p=M.apply(null,T),p});return Object.assign(P,{resultFunc:y,memoizedResultFunc:M,dependencies:j,lastResult:function(){return p},recomputations:function(){return h},resetRecomputations:function(){return h=0}}),P};return i}var be=T3(I3);function _3(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var D3=_3();const m2=1/60*1e3,O3=typeof performance<"u"?()=>performance.now():()=>Date.now(),v2=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(O3()),m2);function A3(e){let t=[],n=[],r=0,i=!1,s=!1;const c=new WeakSet,u={schedule:(f,h=!1,p=!1)=>{const g=p&&i,y=g?t:n;return h&&c.add(f),y.indexOf(f)===-1&&(y.push(f),g&&i&&(r=t.length)),f},cancel:f=>{const h=n.indexOf(f);h!==-1&&n.splice(h,1),c.delete(f)},process:f=>{if(i){s=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let h=0;h<r;h++){const p=t[h];p(f),c.has(p)&&(u.schedule(p),e())}i=!1,s&&(s=!1,u.process(f))}};return u}const z3=40;let lf=!0,Ya=!1,cf=!1;const $o={delta:0,timestamp:0},cs=["read","update","preRender","render","postRender"],Cc=cs.reduce((e,t)=>(e[t]=A3(()=>Ya=!0),e),{}),R3=cs.reduce((e,t)=>{const n=Cc[t];return e[t]=(r,i=!1,s=!1)=>(Ya||L3(),n.schedule(r,i,s)),e},{}),N3=cs.reduce((e,t)=>(e[t]=Cc[t].cancel,e),{});cs.reduce((e,t)=>(e[t]=()=>Cc[t].process($o),e),{});const F3=e=>Cc[e].process($o),g2=e=>{Ya=!1,$o.delta=lf?m2:Math.max(Math.min(e-$o.timestamp,z3),1),$o.timestamp=e,cf=!0,cs.forEach(F3),cf=!1,Ya&&(lf=!1,v2(g2))},L3=()=>{Ya=!0,lf=!0,cf||v2(g2)},eg=()=>$o;function nh(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,s=x.Children.toArray(e.path),c=he((u,f)=>l.jsx(Jt,{ref:f,viewBox:t,...i,...u,children:s.length?s:l.jsx("path",{fill:"currentColor",d:n})}));return c.displayName=r,c}function us(e){const{theme:t}=RS(),n=b3();return x.useMemo(()=>S3(t.direction,{...n,...e}),[e,t.direction,n])}var B3=Object.defineProperty,H3=(e,t,n)=>t in e?B3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rt=(e,t,n)=>(H3(e,typeof t!="symbol"?t+"":t,n),n);function tg(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 W3=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function ng(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function rg(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var uf=typeof window<"u"?x.useLayoutEffect:x.useEffect,rc=e=>e,V3=class{constructor(){Rt(this,"descendants",new Map),Rt(this,"register",e=>{if(e!=null)return W3(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),Rt(this,"unregister",e=>{this.descendants.delete(e);const t=tg(Array.from(this.descendants.keys()));this.assignIndex(t)}),Rt(this,"destroy",()=>{this.descendants.clear()}),Rt(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),Rt(this,"count",()=>this.descendants.size),Rt(this,"enabledCount",()=>this.enabledValues().length),Rt(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),Rt(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),Rt(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),Rt(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),Rt(this,"first",()=>this.item(0)),Rt(this,"firstEnabled",()=>this.enabledItem(0)),Rt(this,"last",()=>this.item(this.descendants.size-1)),Rt(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),Rt(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),Rt(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),Rt(this,"next",(e,t=!0)=>{const n=ng(e,this.count(),t);return this.item(n)}),Rt(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=ng(r,this.enabledCount(),t);return this.enabledItem(i)}),Rt(this,"prev",(e,t=!0)=>{const n=rg(e,this.count()-1,t);return this.item(n)}),Rt(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=rg(r,this.enabledCount()-1,t);return this.enabledItem(i)}),Rt(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=tg(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function U3(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=>{U3(n,t)})}}function $3(...e){return x.useMemo(()=>ct(...e),e)}function G3(){const e=x.useRef(new V3);return uf(()=>()=>e.current.destroy()),e.current}var[q3,x2]=Et({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function Y3(e){const t=x2(),[n,r]=x.useState(-1),i=x.useRef(null);uf(()=>()=>{i.current&&t.unregister(i.current)},[]),uf(()=>{if(!i.current)return;const c=Number(i.current.dataset.index);n!=c&&!Number.isNaN(c)&&r(c)});const s=rc(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:ct(s,i)}}function rh(){return[rc(q3),()=>rc(x2()),()=>G3(),i=>Y3(i)]}var[X3,wc]=Et({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[K3,ih]=Et({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[Q3,_F,Z3,J3]=rh(),zo=he(function(t,n){const{getButtonProps:r}=ih(),i=r(t,n),c={display:"flex",alignItems:"center",width:"100%",outline:0,...wc().button};return l.jsx(re.button,{...i,className:Ae("chakra-accordion__button",t.className),__css:c})});zo.displayName="AccordionButton";function oh(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(y,S)=>y!==S}=e,s=Ut(r),c=Ut(i),[u,f]=x.useState(n),h=t!==void 0,p=h?t:u,g=Ut(y=>{const C=typeof y=="function"?y(p):y;c(p,C)&&(h||f(C),s(C))},[h,s,p,c]);return[p,g]}function ew(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:s,...c}=e;rw(e),iw(e);const u=Z3(),[f,h]=x.useState(-1);x.useEffect(()=>()=>{h(-1)},[]);const[p,g]=oh({value:r,defaultValue(){return i?n??[]:n??-1},onChange:t});return{index:p,setIndex:g,htmlProps:c,getAccordionItemProps:S=>{let C=!1;return S!==null&&(C=Array.isArray(p)?p.includes(S):p===S),{isOpen:C,onChange:k=>{if(S!==null)if(i&&Array.isArray(p)){const j=k?p.concat(S):p.filter(M=>M!==S);g(j)}else k?g(S):s&&g(-1)}}},focusedIndex:f,setFocusedIndex:h,descendants:u}}var[tw,ah]=Et({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function nw(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:s,setFocusedIndex:c}=ah(),u=x.useRef(null),f=x.useId(),h=r??f,p=`accordion-button-${h}`,g=`accordion-panel-${h}`;ow(e);const{register:y,index:S,descendants:C}=J3({disabled:t&&!n}),{isOpen:w,onChange:k}=s(S===-1?null:S);aw({isOpen:w,isDisabled:t});const j=()=>{k==null||k(!0)},M=()=>{k==null||k(!1)},P=x.useCallback(()=>{k==null||k(!w),c(S)},[S,c,w,k]),I=x.useCallback(z=>{const F={ArrowDown:()=>{const L=C.nextEnabled(S);L==null||L.node.focus()},ArrowUp:()=>{const L=C.prevEnabled(S);L==null||L.node.focus()},Home:()=>{const L=C.firstEnabled();L==null||L.node.focus()},End:()=>{const L=C.lastEnabled();L==null||L.node.focus()}}[z.key];F&&(z.preventDefault(),F(z))},[C,S]),T=x.useCallback(()=>{c(S)},[c,S]),D=x.useCallback(function(V={},F=null){return{...V,type:"button",ref:ct(y,u,F),id:p,disabled:!!t,"aria-expanded":!!w,"aria-controls":g,onClick:Pe(V.onClick,P),onFocus:Pe(V.onFocus,T),onKeyDown:Pe(V.onKeyDown,I)}},[p,t,w,P,T,I,g,y]),_=x.useCallback(function(V={},F=null){return{...V,ref:F,role:"region",id:g,"aria-labelledby":p,hidden:!w}},[p,w,g]);return{isOpen:w,isDisabled:t,isFocusable:n,onOpen:j,onClose:M,getButtonProps:D,getPanelProps:_,htmlProps:i}}function rw(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;is({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function iw(e){is({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 ow(e){is({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 aw(e){is({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Ro(e){const{isOpen:t,isDisabled:n}=ih(),{reduceMotion:r}=ah(),i=Ae("chakra-accordion__icon",e.className),s=wc(),c={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return l.jsx(Jt,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__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"})})}Ro.displayName="AccordionIcon";var No=he(function(t,n){const{children:r,className:i}=t,{htmlProps:s,...c}=nw(t),f={...wc().container,overflowAnchor:"none"},h=x.useMemo(()=>c,[c]);return l.jsx(K3,{value:h,children:l.jsx(re.div,{ref:n,...s,className:Ae("chakra-accordion__item",i),__css:f,children:typeof r=="function"?r({isExpanded:!!c.isOpen,isDisabled:!!c.isDisabled}):r})})});No.displayName="AccordionItem";var Fo={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Vi={enter:{duration:.2,ease:Fo.easeOut},exit:{duration:.1,ease:Fo.easeIn}},Or={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})},sw=e=>e!=null&&parseInt(e.toString(),10)>0,ig={exit:{height:{duration:.2,ease:Fo.ease},opacity:{duration:.3,ease:Fo.ease}},enter:{height:{duration:.3,ease:Fo.ease},opacity:{duration:.4,ease:Fo.ease}}},lw={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var s;return{...e&&{opacity:sw(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:Or.exit(ig.exit,i)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>{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:Or.enter(ig.enter,i)}}},y2=x.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:s=0,endingHeight:c="auto",style:u,className:f,transition:h,transitionEnd:p,...g}=e,[y,S]=x.useState(!1);x.useEffect(()=>{const M=setTimeout(()=>{S(!0)});return()=>clearTimeout(M)},[]),is({condition:Boolean(s>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const C=parseFloat(s.toString())>0,w={startingHeight:s,endingHeight:c,animateOpacity:i,transition:y?h:{enter:{duration:0}},transitionEnd:{enter:p==null?void 0:p.enter,exit:r?p==null?void 0:p.exit:{...p==null?void 0:p.exit,display:C?"block":"none"}}},k=r?n:!0,j=n||r?"enter":"exit";return l.jsx(ia,{initial:!1,custom:w,children:k&&l.jsx(Wr.div,{ref:t,...g,className:Ae("chakra-collapse",f),style:{overflow:"hidden",display:"block",...u},custom:w,variants:lw,initial:r?"exit":!1,animate:j,exit:"exit"})})});y2.displayName="Collapse";var cw={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Or.enter(Vi.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:Or.exit(Vi.exit,n),transitionEnd:t==null?void 0:t.exit}}},b2={initial:"exit",animate:"enter",exit:"exit",variants:cw},uw=x.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:s,transition:c,transitionEnd:u,delay:f,...h}=t,p=i||r?"enter":"exit",g=r?i&&r:!0,y={transition:c,transitionEnd:u,delay:f};return l.jsx(ia,{custom:y,children:g&&l.jsx(Wr.div,{ref:n,className:Ae("chakra-fade",s),custom:y,...b2,animate:p,...h})})});uw.displayName="Fade";var dw={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>{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:Or.exit(Vi.exit,i)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Or.enter(Vi.enter,n),transitionEnd:e==null?void 0:e.enter}}},S2={initial:"exit",animate:"enter",exit:"exit",variants:dw},fw=x.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:s=!0,initialScale:c=.95,className:u,transition:f,transitionEnd:h,delay:p,...g}=t,y=r?i&&r:!0,S=i||r?"enter":"exit",C={initialScale:c,reverse:s,transition:f,transitionEnd:h,delay:p};return l.jsx(ia,{custom:C,children:y&&l.jsx(Wr.div,{ref:n,className:Ae("chakra-offset-slide",u),...S2,animate:S,custom:C,...g})})});fw.displayName="ScaleFade";var hw={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>{var s;return{opacity:0,x:e,y:t,transition:(s=n==null?void 0:n.exit)!=null?s:Or.exit(Vi.exit,i),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Or.enter(Vi.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:s})=>{var c;const u={x:t,y:e};return{opacity:0,transition:(c=n==null?void 0:n.exit)!=null?c:Or.exit(Vi.exit,s),...i?{...u,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...u,...r==null?void 0:r.exit}}}}},df={initial:"initial",animate:"enter",exit:"exit",variants:hw},pw=x.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:s=!0,className:c,offsetX:u=0,offsetY:f=8,transition:h,transitionEnd:p,delay:g,...y}=t,S=r?i&&r:!0,C=i||r?"enter":"exit",w={offsetX:u,offsetY:f,reverse:s,transition:h,transitionEnd:p,delay:g};return l.jsx(ia,{custom:w,children:S&&l.jsx(Wr.div,{ref:n,className:Ae("chakra-offset-slide",c),custom:w,...df,animate:C,...y})})});pw.displayName="SlideFade";var Lo=he(function(t,n){const{className:r,motionProps:i,...s}=t,{reduceMotion:c}=ah(),{getPanelProps:u,isOpen:f}=ih(),h=u(s,n),p=Ae("chakra-accordion__panel",r),g=wc();c||delete h.hidden;const y=l.jsx(re.div,{...h,__css:g.panel,className:p});return c?y:l.jsx(y2,{in:f,...i,children:y})});Lo.displayName="AccordionPanel";var sh=he(function({children:t,reduceMotion:n,...r},i){const s=fn("Accordion",r),c=At(r),{htmlProps:u,descendants:f,...h}=ew(c),p=x.useMemo(()=>({...h,reduceMotion:!!n}),[h,n]);return l.jsx(Q3,{value:f,children:l.jsx(tw,{value:p,children:l.jsx(X3,{value:s,children:l.jsx(re.div,{ref:i,...u,className:Ae("chakra-accordion",r.className),__css:s.root,children:t})})})})});sh.displayName="Accordion";var ff=he(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:s,...c}=t;return l.jsx("img",{width:r,height:i,ref:n,alt:s,...c})});ff.displayName="NativeImage";function mw(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:s,crossOrigin:c,sizes:u,ignoreFallback:f}=e,[h,p]=x.useState("pending");x.useEffect(()=>{p(n?"loading":"pending")},[n]);const g=x.useRef(),y=x.useCallback(()=>{if(!n)return;S();const C=new Image;C.src=n,c&&(C.crossOrigin=c),r&&(C.srcset=r),u&&(C.sizes=u),t&&(C.loading=t),C.onload=w=>{S(),p("loaded"),i==null||i(w)},C.onerror=w=>{S(),p("failed"),s==null||s(w)},g.current=C},[n,c,r,u,i,s,t]),S=()=>{g.current&&(g.current.onload=null,g.current.onerror=null,g.current=null)};return Uo(()=>{if(!f)return h==="loading"&&y(),()=>{S()}},[h,y,f]),f?"loaded":h}var vw=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function gw(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var ds=he(function(t,n){const{fallbackSrc:r,fallback:i,src:s,srcSet:c,align:u,fit:f,loading:h,ignoreFallback:p,crossOrigin:g,fallbackStrategy:y="beforeLoadOrError",referrerPolicy:S,...C}=t,w=r!==void 0||i!==void 0,k=h!=null||p||!w,j=mw({...t,ignoreFallback:k}),M=vw(j,y),P={ref:n,objectFit:f,objectPosition:u,...k?C:gw(C,["onError","onLoad"])};return M?i||l.jsx(re.img,{as:ff,className:"chakra-image__placeholder",src:r,...P}):l.jsx(re.img,{as:ff,src:s,srcSet:c,crossOrigin:g,loading:h,referrerPolicy:S,className:"chakra-image",...P})});ds.displayName="Image";function lh(e){return x.Children.toArray(e).filter(t=>x.isValidElement(t))}var[xw,yw]=Et({strict:!1,name:"ButtonGroupContext"}),bw={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}}},Sw={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},en=he(function(t,n){const{size:r,colorScheme:i,variant:s,className:c,spacing:u="0.5rem",isAttached:f,isDisabled:h,orientation:p="horizontal",...g}=t,y=Ae("chakra-button__group",c),S=x.useMemo(()=>({size:r,colorScheme:i,variant:s,isDisabled:h}),[r,i,s,h]);let C={display:"inline-flex",...f?bw[p]:Sw[p](u)};const w=p==="vertical";return l.jsx(xw,{value:S,children:l.jsx(re.div,{ref:n,role:"group",__css:C,className:y,"data-attached":f?"":void 0,"data-orientation":p,flexDir:w?"column":void 0,...g})})});en.displayName="ButtonGroup";function Cw(e){const[t,n]=x.useState(!e);return{ref:x.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function hf(e){const{children:t,className:n,...r}=e,i=x.isValidElement(t)?x.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=Ae("chakra-button__icon",n);return l.jsx(re.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:i})}hf.displayName="ButtonIcon";function ic(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=l.jsx(Qf,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:c,...u}=e,f=Ae("chakra-button__spinner",s),h=n==="start"?"marginEnd":"marginStart",p=x.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[h]:t?r:0,fontSize:"1em",lineHeight:"normal",...c}),[c,t,h,r]);return l.jsx(re.div,{className:f,...u,__css:p,children:i})}ic.displayName="ButtonSpinner";var to=he((e,t)=>{const n=yw(),r=pi("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:s,isActive:c,children:u,leftIcon:f,rightIcon:h,loadingText:p,iconSpacing:g="0.5rem",type:y,spinner:S,spinnerPlacement:C="start",className:w,as:k,...j}=At(e),M=x.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:I}=Cw(k),T={rightIcon:h,leftIcon:f,iconSpacing:g,children:u};return l.jsxs(re.button,{ref:$3(t,P),as:k,type:y??I,"data-active":Ye(c),"data-loading":Ye(s),__css:M,className:Ae("chakra-button",w),...j,disabled:i||s,children:[s&&C==="start"&&l.jsx(ic,{className:"chakra-button__spinner--start",label:p,placement:"start",spacing:g,children:S}),s?p||l.jsx(re.span,{opacity:0,children:l.jsx(og,{...T})}):l.jsx(og,{...T}),s&&C==="end"&&l.jsx(ic,{className:"chakra-button__spinner--end",label:p,placement:"end",spacing:g,children:S})]})});to.displayName="Button";function og(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return l.jsxs(l.Fragment,{children:[t&&l.jsx(hf,{marginEnd:i,children:t}),r,n&&l.jsx(hf,{marginStart:i,children:n})]})}var ci=he((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":s,...c}=e,u=n||r,f=x.isValidElement(u)?x.cloneElement(u,{"aria-hidden":!0,focusable:!1}):null;return l.jsx(to,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":s,...c,children:f})});ci.displayName="IconButton";var[DF,ww]=Et({name:"CheckboxGroupContext",strict:!1});function kw(e){return l.jsx(re.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 jw(e){return l.jsx(re.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 Ew(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?jw:kw;return n||t?l.jsx(re.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:l.jsx(i,{...r})}):null}var[Pw,C2]=Et({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[Iw,no]=Et({strict:!1,name:"FormControlContext"});function Mw(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:s,...c}=e,u=x.useId(),f=t||`field-${u}`,h=`${f}-label`,p=`${f}-feedback`,g=`${f}-helptext`,[y,S]=x.useState(!1),[C,w]=x.useState(!1),[k,j]=x.useState(!1),M=x.useCallback((_={},z=null)=>({id:g,..._,ref:ct(z,V=>{V&&w(!0)})}),[g]),P=x.useCallback((_={},z=null)=>{var V,F;return{..._,ref:z,"data-focus":Ye(k),"data-disabled":Ye(i),"data-invalid":Ye(r),"data-readonly":Ye(s),id:(V=_.id)!=null?V:h,htmlFor:(F=_.htmlFor)!=null?F:f}},[f,i,k,r,s,h]),I=x.useCallback((_={},z=null)=>({id:p,..._,ref:ct(z,V=>{V&&S(!0)}),"aria-live":"polite"}),[p]),T=x.useCallback((_={},z=null)=>({..._,...c,ref:z,role:"group"}),[c]),D=x.useCallback((_={},z=null)=>({..._,ref:z,role:"presentation","aria-hidden":!0,children:_.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!i,isFocused:!!k,onFocus:()=>j(!0),onBlur:()=>j(!1),hasFeedbackText:y,setHasFeedbackText:S,hasHelpText:C,setHasHelpText:w,id:f,labelId:h,feedbackId:p,helpTextId:g,htmlProps:c,getHelpTextProps:M,getErrorMessageProps:I,getRootProps:T,getLabelProps:P,getRequiredIndicatorProps:D}}var rt=he(function(t,n){const r=fn("Form",t),i=At(t),{getRootProps:s,htmlProps:c,...u}=Mw(i),f=Ae("chakra-form-control",t.className);return l.jsx(Iw,{value:u,children:l.jsx(Pw,{value:r,children:l.jsx(re.div,{...s({},n),className:f,__css:r.container})})})});rt.displayName="FormControl";var wt=he(function(t,n){const r=no(),i=C2(),s=Ae("chakra-form__helper-text",t.className);return l.jsx(re.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:s})});wt.displayName="FormHelperText";var[Tw,_w]=Et({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormError />" `}),kt=he((e,t)=>{const n=fn("FormError",e),r=At(e),i=no();return i!=null&&i.isInvalid?l.jsx(Tw,{value:n,children:l.jsx(re.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:Ae("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})}):null});kt.displayName="FormErrorMessage";var Dw=he((e,t)=>{const n=_w(),r=no();if(!(r!=null&&r.isInvalid))return null;const i=Ae("chakra-form__error-icon",e.className);return l.jsx(Jt,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i,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"})})});Dw.displayName="FormErrorIcon";var st=he(function(t,n){var r;const i=pi("FormLabel",t),s=At(t),{className:c,children:u,requiredIndicator:f=l.jsx(w2,{}),optionalIndicator:h=null,...p}=s,g=no(),y=(r=g==null?void 0:g.getLabelProps(p,n))!=null?r:{ref:n,...p};return l.jsxs(re.label,{...y,className:Ae("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...i},children:[u,g!=null&&g.isRequired?f:h]})});st.displayName="FormLabel";var w2=he(function(t,n){const r=no(),i=C2();if(!(r!=null&&r.isRequired))return null;const s=Ae("chakra-form__required-indicator",t.className);return l.jsx(re.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:s})});w2.displayName="RequiredIndicator";function ch(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...s}=uh(e);return{...s,disabled:t,readOnly:r,required:i,"aria-invalid":Dr(n),"aria-required":Dr(i),"aria-readonly":Dr(r)}}function uh(e){var t,n,r;const i=no(),{id:s,disabled:c,readOnly:u,required:f,isRequired:h,isInvalid:p,isReadOnly:g,isDisabled:y,onFocus:S,onBlur:C,...w}=e,k=e["aria-describedby"]?[e["aria-describedby"]]:[];return i!=null&&i.hasFeedbackText&&(i!=null&&i.isInvalid)&&k.push(i.feedbackId),i!=null&&i.hasHelpText&&k.push(i.helpTextId),{...w,"aria-describedby":k.join(" ")||void 0,id:s??(i==null?void 0:i.id),isDisabled:(t=c??y)!=null?t:i==null?void 0:i.isDisabled,isReadOnly:(n=u??g)!=null?n:i==null?void 0:i.isReadOnly,isRequired:(r=f??h)!=null?r:i==null?void 0:i.isRequired,isInvalid:p??(i==null?void 0:i.isInvalid),onFocus:Pe(i==null?void 0:i.onFocus,S),onBlur:Pe(i==null?void 0:i.onBlur,C)}}var dh={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},k2=re("span",{baseStyle:dh});k2.displayName="VisuallyHidden";var Ow=re("input",{baseStyle:dh});Ow.displayName="VisuallyHiddenInput";var ag=!1,fs=null,Yi=!1,pf=!1,mf=new Set;function fh(e,t){mf.forEach(n=>n(e,t))}var Aw=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function zw(e){return!(e.metaKey||!Aw&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function sg(e){Yi=!0,zw(e)&&(fs="keyboard",fh("keyboard",e))}function jo(e){if(fs="pointer",e.type==="mousedown"||e.type==="pointerdown"){Yi=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;fh("pointer",e)}}function Rw(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function Nw(e){Rw(e)&&(Yi=!0,fs="virtual")}function Fw(e){e.target===window||e.target===document||(!Yi&&!pf&&(fs="virtual",fh("virtual",e)),Yi=!1,pf=!1)}function Lw(){Yi=!1,pf=!0}function lg(){return fs!=="pointer"}function Bw(){if(typeof window>"u"||ag)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Yi=!0,e.apply(this,n)},document.addEventListener("keydown",sg,!0),document.addEventListener("keyup",sg,!0),document.addEventListener("click",Nw,!0),window.addEventListener("focus",Fw,!0),window.addEventListener("blur",Lw,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",jo,!0),document.addEventListener("pointermove",jo,!0),document.addEventListener("pointerup",jo,!0)):(document.addEventListener("mousedown",jo,!0),document.addEventListener("mousemove",jo,!0),document.addEventListener("mouseup",jo,!0)),ag=!0}function j2(e){Bw(),e(lg());const t=()=>e(lg());return mf.add(t),()=>{mf.delete(t)}}function Hw(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function E2(e={}){const t=uh(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:s,id:c,onBlur:u,onFocus:f,"aria-describedby":h}=t,{defaultChecked:p,isChecked:g,isFocusable:y,onChange:S,isIndeterminate:C,name:w,value:k,tabIndex:j=void 0,"aria-label":M,"aria-labelledby":P,"aria-invalid":I,...T}=e,D=Hw(T,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),_=Ut(S),z=Ut(u),V=Ut(f),[F,L]=x.useState(!1),[X,$]=x.useState(!1),[Q,ie]=x.useState(!1),[oe,U]=x.useState(!1);x.useEffect(()=>j2(L),[]);const K=x.useRef(null),[ne,ce]=x.useState(!0),[Re,ze]=x.useState(!!p),Me=g!==void 0,J=Me?g:Re,ue=x.useCallback(ge=>{if(r||n){ge.preventDefault();return}Me||ze(J?ge.target.checked:C?!0:ge.target.checked),_==null||_(ge)},[r,n,J,Me,C,_]);Uo(()=>{K.current&&(K.current.indeterminate=Boolean(C))},[C]),eo(()=>{n&&$(!1)},[n,$]),Uo(()=>{const ge=K.current;ge!=null&&ge.form&&(ge.form.onreset=()=>{ze(!!p)})},[]);const Ie=n&&!y,Be=x.useCallback(ge=>{ge.key===" "&&U(!0)},[U]),Ne=x.useCallback(ge=>{ge.key===" "&&U(!1)},[U]);Uo(()=>{if(!K.current)return;K.current.checked!==J&&ze(K.current.checked)},[K.current]);const Ge=x.useCallback((ge={},Te=null)=>{const et=Ve=>{X&&Ve.preventDefault(),U(!0)};return{...ge,ref:Te,"data-active":Ye(oe),"data-hover":Ye(Q),"data-checked":Ye(J),"data-focus":Ye(X),"data-focus-visible":Ye(X&&F),"data-indeterminate":Ye(C),"data-disabled":Ye(n),"data-invalid":Ye(s),"data-readonly":Ye(r),"aria-hidden":!0,onMouseDown:Pe(ge.onMouseDown,et),onMouseUp:Pe(ge.onMouseUp,()=>U(!1)),onMouseEnter:Pe(ge.onMouseEnter,()=>ie(!0)),onMouseLeave:Pe(ge.onMouseLeave,()=>ie(!1))}},[oe,J,n,X,F,Q,C,s,r]),Qe=x.useCallback((ge={},Te=null)=>({...D,...ge,ref:ct(Te,et=>{et&&ce(et.tagName==="LABEL")}),onClick:Pe(ge.onClick,()=>{var et;ne||((et=K.current)==null||et.click(),requestAnimationFrame(()=>{var Ve;(Ve=K.current)==null||Ve.focus()}))}),"data-disabled":Ye(n),"data-checked":Ye(J),"data-invalid":Ye(s)}),[D,n,J,s,ne]),ve=x.useCallback((ge={},Te=null)=>({...ge,ref:ct(K,Te),type:"checkbox",name:w,value:k,id:c,tabIndex:j,onChange:Pe(ge.onChange,ue),onBlur:Pe(ge.onBlur,z,()=>$(!1)),onFocus:Pe(ge.onFocus,V,()=>$(!0)),onKeyDown:Pe(ge.onKeyDown,Be),onKeyUp:Pe(ge.onKeyUp,Ne),required:i,checked:J,disabled:Ie,readOnly:r,"aria-label":M,"aria-labelledby":P,"aria-invalid":I?Boolean(I):s,"aria-describedby":h,"aria-disabled":n,style:dh}),[w,k,c,ue,z,V,Be,Ne,i,J,Ie,r,M,P,I,s,h,n,j]),_e=x.useCallback((ge={},Te=null)=>({...ge,ref:Te,onMouseDown:Pe(ge.onMouseDown,cg),onTouchStart:Pe(ge.onTouchStart,cg),"data-disabled":Ye(n),"data-checked":Ye(J),"data-invalid":Ye(s)}),[J,n,s]);return{state:{isInvalid:s,isFocused:X,isChecked:J,isActive:oe,isHovered:Q,isIndeterminate:C,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:Qe,getCheckboxProps:Ge,getInputProps:ve,getLabelProps:_e,htmlProps:D}}function cg(e){e.preventDefault(),e.stopPropagation()}var Ww={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},Vw={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},Uw=Zi({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),$w=Zi({from:{opacity:0},to:{opacity:1}}),Gw=Zi({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),P2=he(function(t,n){const r=ww(),i={...r,...t},s=fn("Checkbox",i),c=At(t),{spacing:u="0.5rem",className:f,children:h,iconColor:p,iconSize:g,icon:y=l.jsx(Ew,{}),isChecked:S,isDisabled:C=r==null?void 0:r.isDisabled,onChange:w,inputProps:k,...j}=c;let M=S;r!=null&&r.value&&c.value&&(M=r.value.includes(c.value));let P=w;r!=null&&r.onChange&&c.value&&(P=yc(r.onChange,w));const{state:I,getInputProps:T,getCheckboxProps:D,getLabelProps:_,getRootProps:z}=E2({...j,isDisabled:C,isChecked:M,onChange:P}),V=x.useMemo(()=>({animation:I.isIndeterminate?`${$w} 20ms linear, ${Gw} 200ms linear`:`${Uw} 200ms linear`,fontSize:g,color:p,...s.icon}),[p,g,,I.isIndeterminate,s.icon]),F=x.cloneElement(y,{__css:V,isIndeterminate:I.isIndeterminate,isChecked:I.isChecked});return l.jsxs(re.label,{__css:{...Vw,...s.container},className:Ae("chakra-checkbox",f),...z(),children:[l.jsx("input",{className:"chakra-checkbox__input",...T(k,n)}),l.jsx(re.span,{__css:{...Ww,...s.control},className:"chakra-checkbox__control",...D(),children:F}),h&&l.jsx(re.span,{className:"chakra-checkbox__label",..._(),__css:{marginStart:u,...s.label},children:h})]})});P2.displayName="Checkbox";function qw(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function hh(e,t){let n=qw(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function vf(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 ug(e,t,n){return(e-t)*100/(n-t)}function Yw(e,t,n){return(n-t)*e+t}function dg(e,t,n){const r=Math.round((e-t)/n)*n+t,i=vf(n);return hh(r,i)}function $l(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 Xw(e={}){const{onChange:t,precision:n,defaultValue:r,value:i,step:s=1,min:c=Number.MIN_SAFE_INTEGER,max:u=Number.MAX_SAFE_INTEGER,keepWithinRange:f=!0}=e,h=Ut(t),[p,g]=x.useState(()=>{var F;return r==null?"":(F=gd(r,s,n))!=null?F:""}),y=typeof i<"u",S=y?i:p,C=I2(ni(S),s),w=n??C,k=x.useCallback(F=>{F!==S&&(y||g(F.toString()),h==null||h(F.toString(),ni(F)))},[h,y,S]),j=x.useCallback(F=>{let L=F;return f&&(L=$l(L,c,u)),hh(L,w)},[w,f,u,c]),M=x.useCallback((F=s)=>{let L;S===""?L=ni(F):L=ni(S)+F,L=j(L),k(L)},[j,s,k,S]),P=x.useCallback((F=s)=>{let L;S===""?L=ni(-F):L=ni(S)-F,L=j(L),k(L)},[j,s,k,S]),I=x.useCallback(()=>{var F;let L;r==null?L="":L=(F=gd(r,s,n))!=null?F:c,k(L)},[r,n,s,k,c]),T=x.useCallback(F=>{var L;const X=(L=gd(F,s,w))!=null?L:c;k(X)},[w,s,k,c]),D=ni(S);return{isOutOfRange:D>u||D<c,isAtMax:D===u,isAtMin:D===c,precision:w,value:S,valueAsNumber:D,update:k,reset:I,increment:M,decrement:P,clamp:j,cast:T,setValue:g}}function ni(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function I2(e,t){return Math.max(vf(t),vf(e))}function gd(e,t,n){const r=ni(e);if(Number.isNaN(r))return;const i=I2(r,t);return hh(r,n??i)}function Ui(e,t,n,r){const i=Ut(n);return x.useEffect(()=>{const s=typeof e=="function"?e():e??document;if(!(!n||!s))return s.addEventListener(t,i,r),()=>{s.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const s=typeof e=="function"?e():e??document;s==null||s.removeEventListener(t,i,r)}}function Kw(e){return"current"in e}var M2=()=>typeof window<"u";function Qw(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var Zw=e=>M2()&&e.test(navigator.vendor),Jw=e=>M2()&&e.test(Qw()),e5=()=>Jw(/mac|iphone|ipad|ipod/i),t5=()=>e5()&&Zw(/apple/i);function n5(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var s,c;return(c=(s=t.current)==null?void 0:s.ownerDocument)!=null?c:document};Ui(i,"pointerdown",s=>{if(!t5()||!r)return;const c=s.target,f=(n??[t]).some(h=>{const p=Kw(h)?h.current:h;return(p==null?void 0:p.contains(c))||p===c});i().activeElement!==c&&f&&(s.preventDefault(),c.focus())})}var lt={},r5={get exports(){return lt},set exports(e){lt=e}},i5="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",o5=i5,a5=o5;function T2(){}function _2(){}_2.resetWarningCache=T2;var s5=function(){function e(r,i,s,c,u,f){if(f!==a5){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:_2,resetWarningCache:T2};return n.PropTypes=n,n};r5.exports=s5();var gf="data-focus-lock",D2="data-focus-lock-disabled",l5="data-no-focus-lock",c5="data-autofocus-inside",u5="data-no-autofocus";function d5(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function f5(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function O2(e,t){return f5(t||null,function(n){return e.forEach(function(r){return d5(r,n)})})}var xd={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},vr=function(){return vr=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},vr.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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function oa(e,t,n,r){function i(s){return s instanceof n?s:new n(function(c){c(s)})}return new(n||(n=Promise))(function(s,c){function u(p){try{h(r.next(p))}catch(g){c(g)}}function f(p){try{h(r.throw(p))}catch(g){c(g)}}function h(p){p.done?s(p.value):i(p.value).then(u,f)}h((r=r.apply(e,t||[])).next())})}function aa(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(h){return function(p){return f([h,p])}}function f(h){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,h[0]&&(n=0)),n;)try{if(r=1,i&&(s=h[0]&2?i.return:h[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,h[1])).done)return s;switch(i=0,s&&(h=[h[0]&2,s.value]),h[0]){case 0:case 1:s=h;break;case 4:return n.label++,{value:h[1],done:!1};case 5:n.label++,i=h[1],h=[0];continue;case 7:h=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(h[0]===6||h[0]===2)){n=0;continue}if(h[0]===3&&(!s||h[1]>s[0]&&h[1]<s[3])){n.label=h[1];break}if(h[0]===6&&n.label<s[1]){n.label=s[1],s=h;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(h);break}s[2]&&n.ops.pop(),n.trys.pop();continue}h=t.call(e,n)}catch(p){h=[6,p],i=0}finally{r=s=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function fg(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],c;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(u){c={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(c)throw c.error}}return s}function xf(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;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 z2(e){return e}function R2(e,t){t===void 0&&(t=z2);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(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 p=c;c=[],p.forEach(s)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(p){c.push(p),h()},filter:function(p){return c=c.filter(p),n}}}};return i}function ph(e,t){return t===void 0&&(t=z2),R2(e,t)}function N2(e){e===void 0&&(e={});var t=R2(null);return t.options=vr({async:!0,ssr:!1},e),t}var F2=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 x.createElement(r,vr({},n))};F2.isSideCarExport=!0;function h5(e,t){return e.useMedium(t),F2}var L2=ph({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),B2=ph(),p5=ph(),m5=N2({async:!0}),v5=[],mh=x.forwardRef(function(t,n){var r,i=x.useState(),s=i[0],c=i[1],u=x.useRef(),f=x.useRef(!1),h=x.useRef(null),p=t.children,g=t.disabled,y=t.noFocusGuards,S=t.persistentFocus,C=t.crossFrame,w=t.autoFocus;t.allowTextSelection;var k=t.group,j=t.className,M=t.whiteList,P=t.hasPositiveIndices,I=t.shards,T=I===void 0?v5:I,D=t.as,_=D===void 0?"div":D,z=t.lockProps,V=z===void 0?{}:z,F=t.sideCar,L=t.returnFocus,X=t.focusOptions,$=t.onActivation,Q=t.onDeactivation,ie=x.useState({}),oe=ie[0],U=x.useCallback(function(){h.current=h.current||document&&document.activeElement,u.current&&$&&$(u.current),f.current=!0},[$]),K=x.useCallback(function(){f.current=!1,Q&&Q(u.current)},[Q]);x.useEffect(function(){g||(h.current=null)},[]);var ne=x.useCallback(function(Be){var Ne=h.current;if(Ne&&Ne.focus){var Ge=typeof L=="function"?L(Ne):L;if(Ge){var Qe=typeof Ge=="object"?Ge:void 0;h.current=null,Be?Promise.resolve().then(function(){return Ne.focus(Qe)}):Ne.focus(Qe)}}},[L]),ce=x.useCallback(function(Be){f.current&&L2.useMedium(Be)},[]),Re=B2.useMedium,ze=x.useCallback(function(Be){u.current!==Be&&(u.current=Be,c(Be))},[]),Me=Ql((r={},r[D2]=g&&"disabled",r[gf]=k,r),V),J=y!==!0,ue=J&&y!=="tail",Ie=O2([n,ze]);return x.createElement(x.Fragment,null,J&&[x.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:g?-1:0,style:xd}),P?x.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:g?-1:1,style:xd}):null],!g&&x.createElement(F,{id:oe,sideCar:m5,observed:s,disabled:g,persistentFocus:S,crossFrame:C,autoFocus:w,whiteList:M,shards:T,onActivation:U,onDeactivation:K,returnFocus:ne,focusOptions:X}),x.createElement(_,Ql({ref:Ie},Me,{className:j,onBlur:Re,onFocus:ce}),p),ue&&x.createElement("div",{"data-focus-guard":!0,tabIndex:g?-1:0,style:xd}))});mh.propTypes={};mh.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 H2=mh;function vh(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,NS(e,t)}function g5(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var s=[],c;function u(){c=e(s.map(function(h){return h.props})),t(c)}var f=function(h){vh(p,h);function p(){return h.apply(this,arguments)||this}p.peek=function(){return c};var g=p.prototype;return g.componentDidMount=function(){s.push(this),u()},g.componentDidUpdate=function(){u()},g.componentWillUnmount=function(){var S=s.indexOf(this);s.splice(S,1),u()},g.render=function(){return ke.createElement(i,this.props)},p}(x.PureComponent);return FS(f,"displayName","SideEffect("+n(i)+")"),f}}var wr=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},oc=function(e){return Array.isArray(e)?e:[e]},W2=function(e){return Array.isArray(e)?e[0]:e},x5=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"},V2=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},U2=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},y5=function(e,t){return!e||U2(e)||!x5(e)&&t(V2(e))},$2=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=y5(t,$2.bind(void 0,e));return e.set(t,r),r},b5=function(e,t){return e&&!U2(e)?w5(e)?t(V2(e)):!1:!0},G2=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=b5(t,G2.bind(void 0,e));return e.set(t,r),r},q2=function(e){return e.dataset},S5=function(e){return e.tagName==="BUTTON"},Y2=function(e){return e.tagName==="INPUT"},X2=function(e){return Y2(e)&&e.type==="radio"},C5=function(e){return!((Y2(e)||S5(e))&&(e.type==="hidden"||e.disabled))},w5=function(e){var t=e.getAttribute(u5);return![!0,"true",""].includes(t)},gh=function(e){var t;return Boolean(e&&((t=q2(e))===null||t===void 0?void 0:t.focusGuard))},ac=function(e){return!gh(e)},k5=function(e){return Boolean(e)},j5=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 wr(e).map(function(r,i){return{node:r,index:i,tabIndex:n&&r.tabIndex===-1?(r.dataset||{}).focusGuard?0:-1:r.tabIndex}}).filter(function(r){return!t||r.tabIndex>=0}).sort(j5)},E5=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],xh=E5.join(","),P5="".concat(xh,", [data-focus-guard]"),Q2=function(e,t){return wr((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?P5:xh)?[r]:[],Q2(r))},[])},I5=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?kc([e.contentDocument.body],t):[e]},kc=function(e,t){return e.reduce(function(n,r){var i,s=Q2(r,t),c=(i=[]).concat.apply(i,s.map(function(u){return I5(u,t)}));return n.concat(c,r.parentNode?wr(r.parentNode.querySelectorAll(xh)).filter(function(u){return u===r}):[])},[])},M5=function(e){var t=e.querySelectorAll("[".concat(c5,"]"));return wr(t).map(function(n){return kc([n])}).reduce(function(n,r){return n.concat(r)},[])},yh=function(e,t){return wr(e).filter(function(n){return $2(t,n)}).filter(function(n){return C5(n)})},hg=function(e,t){return t===void 0&&(t=new Map),wr(e).filter(function(n){return G2(t,n)})},yf=function(e,t,n){return K2(yh(kc(e,n),t),!0,n)},pg=function(e,t){return K2(yh(kc(e),t),!1)},T5=function(e,t){return yh(M5(e),t)},Go=function(e,t){return e.shadowRoot?Go(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:wr(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var i=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return i?Go(i,t):!1}return Go(n,t)})},_5=function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var i=r+1;i<n;i+=1){var s=e[r].compareDocumentPosition(e[i]);(s&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(i),(s&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(c,u){return!t.has(u)})},Z2=function(e){return e.parentNode?Z2(e.parentNode):e},bh=function(e){var t=oc(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(gf);return n.push.apply(n,i?_5(wr(Z2(r).querySelectorAll("[".concat(gf,'="').concat(i,'"]:not([').concat(D2,'="disabled"])')))):[r]),n},[])},D5=function(e){try{return e()}catch{return}},Xa=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Xa(t.shadowRoot):t instanceof HTMLIFrameElement&&D5(function(){return t.contentWindow.document})?Xa(t.contentWindow.document):t}},O5=function(e,t){return e===t},A5=function(e,t){return Boolean(wr(e.querySelectorAll("iframe")).some(function(n){return O5(n,t)}))},J2=function(e,t){return t===void 0&&(t=Xa(W2(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:bh(e).some(function(n){return Go(n,t)||A5(n,t)})},z5=function(e){e===void 0&&(e=document);var t=Xa(e);return t?wr(e.querySelectorAll("[".concat(l5,"]"))).some(function(n){return Go(n,t)}):!1},R5=function(e,t){return t.filter(X2).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Sh=function(e,t){return X2(e)&&e.name?R5(e,t):e},N5=function(e){var t=new Set;return e.forEach(function(n){return t.add(Sh(n,e))}),e.filter(function(n){return t.has(n)})},mg=function(e){return e[0]&&e.length>1?Sh(e[0],e):e[0]},vg=function(e,t){return e.length>1?e.indexOf(Sh(e[t],e)):t},ex="NEW_FOCUS",F5=function(e,t,n,r){var i=e.length,s=e[0],c=e[i-1],u=gh(n);if(!(n&&e.indexOf(n)>=0)){var f=n!==void 0?t.indexOf(n):-1,h=r?t.indexOf(r):f,p=r?e.indexOf(r):-1,g=f-h,y=t.indexOf(s),S=t.indexOf(c),C=N5(t),w=n!==void 0?C.indexOf(n):-1,k=w-(r?C.indexOf(r):f),j=vg(e,0),M=vg(e,i-1);if(f===-1||p===-1)return ex;if(!g&&p>=0)return p;if(f<=y&&u&&Math.abs(g)>1)return M;if(f>=S&&u&&Math.abs(g)>1)return j;if(g&&Math.abs(k)>1)return p;if(f<=y)return M;if(f>S)return j;if(g)return Math.abs(g)>1?p:(i+p+g)%i}},L5=function(e){return function(t){var n,r=(n=q2(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},B5=function(e,t,n){var r=e.map(function(s){var c=s.node;return c}),i=hg(r.filter(L5(n)));return i&&i.length?mg(i):mg(hg(t))},bf=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&bf(e.parentNode.host||e.parentNode,t),t},yd=function(e,t){for(var n=bf(e),r=bf(t),i=0;i<n.length;i+=1){var s=n[i];if(r.indexOf(s)>=0)return s}return!1},tx=function(e,t,n){var r=oc(e),i=oc(t),s=r[0],c=!1;return i.filter(Boolean).forEach(function(u){c=yd(c||u,u)||c,n.filter(Boolean).forEach(function(f){var h=yd(s,f);h&&(!c||Go(h,c)?c=h:c=yd(h,c))})}),c},H5=function(e,t){return e.reduce(function(n,r){return n.concat(T5(r,t))},[])},W5=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(k5)},V5=function(e,t){var n=Xa(oc(e).length>0?document:W2(e).ownerDocument),r=bh(e).filter(ac),i=tx(n||e,e,r),s=new Map,c=pg(r,s),u=yf(r,s).filter(function(S){var C=S.node;return ac(C)});if(!(!u[0]&&(u=c,!u[0]))){var f=pg([i],s).map(function(S){var C=S.node;return C}),h=W5(f,u),p=h.map(function(S){var C=S.node;return C}),g=F5(p,f,n,t);if(g===ex){var y=B5(c,p,H5(r,s));if(y)return{node:y};console.warn("focus-lock: cannot find any node to move focus into");return}return g===void 0?g:h[g]}},U5=function(e){var t=bh(e).filter(ac),n=tx(e,e,t),r=new Map,i=yf([n],r,!0),s=yf(t,r).filter(function(c){var u=c.node;return ac(u)}).map(function(c){var u=c.node;return u});return i.map(function(c){var u=c.node,f=c.index;return{node:u,index:f,lockItem:s.indexOf(u)>=0,guard:gh(u)}})},$5=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},bd=0,Sd=!1,nx=function(e,t,n){n===void 0&&(n={});var r=V5(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++,$5(r.node,n.focusOptions),bd--}};function rx(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var G5=function(){return document&&document.activeElement===document.body},q5=function(){return G5()||z5()},qo=null,Bo=null,Yo=null,Ka=!1,Y5=function(){return!0},X5=function(t){return(qo.whiteList||Y5)(t)},K5=function(t,n){Yo={observerNode:t,portaledElement:n}},Q5=function(t){return Yo&&Yo.portaledElement===t};function gg(e,t,n,r){var i=null,s=e;do{var c=r[s];if(c.guard)c.node.dataset.focusAutoGuard&&(i=c);else if(c.lockItem){if(s!==e)return;i=null}else break}while((s+=n)!==t);i&&(i.node.tabIndex=0)}var Z5=function(t){return t&&"current"in t?t.current:t},J5=function(t){return t?Boolean(Ka):Ka==="meanwhile"},e6=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},t6=function(t,n){return n.some(function(r){return e6(t,r,r)})},sc=function(){var t=!1;if(qo){var n=qo,r=n.observed,i=n.persistentFocus,s=n.autoFocus,c=n.shards,u=n.crossFrame,f=n.focusOptions,h=r||Yo&&Yo.portaledElement,p=document&&document.activeElement;if(h){var g=[h].concat(c.map(Z5).filter(Boolean));if((!p||X5(p))&&(i||J5(u)||!q5()||!Bo&&s)&&(h&&!(J2(g)||p&&t6(p,g)||Q5(p))&&(document&&!Bo&&p&&!s?(p.blur&&p.blur(),document.body.focus()):(t=nx(g,Bo,{focusOptions:f}),Yo={})),Ka=!1,Bo=document&&document.activeElement),document){var y=document&&document.activeElement,S=U5(g),C=S.map(function(w){var k=w.node;return k}).indexOf(y);C>-1&&(S.filter(function(w){var k=w.guard,j=w.node;return k&&j.dataset.focusAutoGuard}).forEach(function(w){var k=w.node;return k.removeAttribute("tabIndex")}),gg(C,S.length,1,S),gg(C,-1,-1,S))}}}return t},ix=function(t){sc()&&t&&(t.stopPropagation(),t.preventDefault())},Ch=function(){return rx(sc)},n6=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||K5(r,n)},r6=function(){return null},ox=function(){Ka="just",setTimeout(function(){Ka="meanwhile"},0)},i6=function(){document.addEventListener("focusin",ix),document.addEventListener("focusout",Ch),window.addEventListener("blur",ox)},o6=function(){document.removeEventListener("focusin",ix),document.removeEventListener("focusout",Ch),window.removeEventListener("blur",ox)};function a6(e){return e.filter(function(t){var n=t.disabled;return!n})}function s6(e){var t=e.slice(-1)[0];t&&!qo&&i6();var n=qo,r=n&&t&&t.id===n.id;qo=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var s=i.id;return s===n.id}).length||n.returnFocus(!t)),t?(Bo=null,(!r||n.observed!==t.observed)&&t.onActivation(),sc(),rx(sc)):(o6(),Bo=null)}L2.assignSyncMedium(n6);B2.assignMedium(Ch);p5.assignMedium(function(e){return e({moveFocusInside:nx,focusInside:J2})});const l6=g5(a6,s6)(r6);var ax=x.forwardRef(function(t,n){return x.createElement(H2,Ql({sideCar:l6,ref:n},t))}),sx=H2.propTypes||{};sx.sideCar;th(sx,["sideCar"]);ax.propTypes={};const xg=ax;function lx(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function cx(e){var t;if(!lx(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function c6(e){var t,n;return(n=(t=ux(e))==null?void 0:t.defaultView)!=null?n:window}function ux(e){return lx(e)?e.ownerDocument:document}function u6(e){return ux(e).activeElement}var dx=e=>e.hasAttribute("tabindex"),d6=e=>dx(e)&&e.tabIndex===-1;function f6(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function fx(e){return e.parentElement&&fx(e.parentElement)?!0:e.hidden}function h6(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function hx(e){if(!cx(e)||fx(e)||f6(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]():h6(e)?!0:dx(e)}function p6(e){return e?cx(e)&&hx(e)&&!d6(e):!1}var m6=["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]"],v6=m6.join(),g6=e=>e.offsetWidth>0&&e.offsetHeight>0;function px(e){const t=Array.from(e.querySelectorAll(v6));return t.unshift(e),t.filter(n=>hx(n)&&g6(n))}var yg,x6=(yg=xg.default)!=null?yg:xg,mx=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:s,isDisabled:c,autoFocus:u,persistentFocus:f,lockFocusAcrossFrames:h}=e,p=x.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&px(r.current).length===0&&requestAnimationFrame(()=>{var C;(C=r.current)==null||C.focus()})},[t,r]),g=x.useCallback(()=>{var S;(S=n==null?void 0:n.current)==null||S.focus()},[n]),y=i&&!n;return l.jsx(x6,{crossFrame:h,persistentFocus:f,autoFocus:u,disabled:c,onActivation:p,onDeactivation:g,returnFocus:y,children:s})};mx.displayName="FocusLock";var y6=D3?x.useLayoutEffect:x.useEffect;function Sf(e,t=[]){const n=x.useRef(e);return y6(()=>{n.current=e}),x.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function b6(e,t,n,r){const i=Sf(t);return x.useEffect(()=>{var s;const c=(s=zv(n))!=null?s:document;if(t)return c.addEventListener(e,i,r),()=>{c.removeEventListener(e,i,r)}},[e,n,r,i,t]),()=>{var s;((s=zv(n))!=null?s:document).removeEventListener(e,i,r)}}function S6(e,t){const n=x.useId();return x.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function C6(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function ui(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,s=Sf(n),c=Sf(t),[u,f]=x.useState(e.defaultIsOpen||!1),[h,p]=C6(r,u),g=S6(i,"disclosure"),y=x.useCallback(()=>{h||f(!1),c==null||c()},[h,c]),S=x.useCallback(()=>{h||f(!0),s==null||s()},[h,s]),C=x.useCallback(()=>{(p?y:S)()},[p,S,y]);return{isOpen:!!p,onOpen:S,onClose:y,onToggle:C,isControlled:h,getButtonProps:(w={})=>({...w,"aria-expanded":p,"aria-controls":g,onClick:LS(w.onClick,C)}),getDisclosureProps:(w={})=>({...w,hidden:!p,id:g})}}var wh=he(function(t,n){const{htmlSize:r,...i}=t,s=fn("Input",i),c=At(i),u=ch(c),f=Ae("chakra-input",t.className);return l.jsx(re.input,{size:r,...u,__css:s.field,ref:n,className:f})});wh.displayName="Input";wh.id="Input";var[w6,vx]=Et({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),kh=he(function(t,n){const r=fn("List",t),{children:i,styleType:s="none",stylePosition:c,spacing:u,...f}=At(t),h=lh(i),g=u?{["& > *:not(style) ~ *:not(style)"]:{mt:u}}:{};return l.jsx(w6,{value:r,children:l.jsx(re.ul,{ref:n,listStyleType:s,listStylePosition:c,role:"list",__css:{...r.container,...g},...f,children:h})})});kh.displayName="List";var k6=he((e,t)=>{const{as:n,...r}=e;return l.jsx(kh,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});k6.displayName="OrderedList";var gx=he(function(t,n){const{as:r,...i}=t;return l.jsx(kh,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});gx.displayName="UnorderedList";var Fa=he(function(t,n){const r=vx();return l.jsx(re.li,{ref:n,...t,__css:r.item})});Fa.displayName="ListItem";var j6=he(function(t,n){const r=vx();return l.jsx(Jt,{ref:n,role:"presentation",...t,__css:r.icon})});j6.displayName="ListIcon";var $n=he(function(t,n){const{templateAreas:r,gap:i,rowGap:s,columnGap:c,column:u,row:f,autoFlow:h,autoRows:p,templateRows:g,autoColumns:y,templateColumns:S,...C}=t,w={display:"grid",gridTemplateAreas:r,gridGap:i,gridRowGap:s,gridColumnGap:c,gridAutoColumns:y,gridColumn:u,gridRow:f,gridAutoFlow:h,gridAutoRows:p,gridTemplateRows:g,gridTemplateColumns:S};return l.jsx(re.div,{ref:n,__css:w,...C})});$n.displayName="Grid";function xx(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Kd(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var jc=re("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});jc.displayName="Spacer";var yx=e=>l.jsx(re.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});yx.displayName="StackItem";var Cf="& > *:not(style) ~ *:not(style)";function E6(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,[Cf]:xx(n,i=>r[i])}}function P6(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{"&":xx(n,i=>r[i])}}var jh=he((e,t)=>{const{isInline:n,direction:r,align:i,justify:s,spacing:c="0.5rem",wrap:u,children:f,divider:h,className:p,shouldWrapChildren:g,...y}=e,S=n?"row":r??"column",C=x.useMemo(()=>E6({direction:S,spacing:c}),[S,c]),w=x.useMemo(()=>P6({spacing:c,direction:S}),[c,S]),k=!!h,j=!g&&!k,M=x.useMemo(()=>{const I=lh(f);return j?I:I.map((T,D)=>{const _=typeof T.key<"u"?T.key:D,z=D+1===I.length,F=g?l.jsx(yx,{children:T},_):T;if(!k)return F;const L=x.cloneElement(h,{__css:w}),X=z?null:L;return l.jsxs(x.Fragment,{children:[F,X]},_)})},[h,w,k,j,g,f]),P=Ae("chakra-stack",p);return l.jsx(re.div,{ref:t,display:"flex",alignItems:i,justifyContent:s,flexDirection:C.flexDirection,flexWrap:u,className:P,__css:k?{}:{[Cf]:C[Cf]},...y,children:M})});jh.displayName="Stack";var Le=he((e,t)=>l.jsx(jh,{align:"center",...e,direction:"column",ref:t}));Le.displayName="VStack";var sa=he((e,t)=>l.jsx(jh,{align:"center",...e,direction:"row",ref:t}));sa.displayName="HStack";var Vn=he(function(t,n){const r=pi("Heading",t),{className:i,...s}=At(t);return l.jsx(re.h2,{ref:n,className:Ae("chakra-heading",t.className),...s,__css:r})});Vn.displayName="Heading";var We=re("div");We.displayName="Box";var bx=he(function(t,n){const{size:r,centerContent:i=!0,...s}=t,c=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return l.jsx(We,{ref:n,boxSize:r,__css:{...c,flexShrink:0,flexGrow:0},...s})});bx.displayName="Square";var I6=he(function(t,n){const{size:r,...i}=t;return l.jsx(bx,{size:r,ref:n,borderRadius:"9999px",...i})});I6.displayName="Circle";var $i=he(function(t,n){const r=pi("Link",t),{className:i,isExternal:s,...c}=At(t);return l.jsx(re.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:Ae("chakra-link",i),...c,__css:r})});$i.displayName="Link";var Sx=he(function(t,n){const r=pi("Badge",t),{className:i,...s}=At(t);return l.jsx(re.span,{ref:n,className:Ae("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Sx.displayName="Badge";var Cx=re("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});Cx.displayName="Center";var M6={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};he(function(t,n){const{axis:r="both",...i}=t;return l.jsx(re.div,{ref:n,__css:M6[r],...i,position:"absolute"})});var wx=he(function(t,n){const{borderLeftWidth:r,borderBottomWidth:i,borderTopWidth:s,borderRightWidth:c,borderWidth:u,borderStyle:f,borderColor:h,...p}=pi("Divider",t),{className:g,orientation:y="horizontal",__css:S,...C}=At(t),w={vertical:{borderLeftWidth:r||c||u||"1px",height:"100%"},horizontal:{borderBottomWidth:i||s||u||"1px",width:"100%"}};return l.jsx(re.hr,{ref:n,"aria-orientation":y,...C,__css:{...p,border:"0",borderColor:h,borderStyle:f,...w[y],...S},className:Ae("chakra-divider",g)})});wx.displayName="Divider";function T6(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function _6(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,i]=x.useState([]),s=x.useRef(),c=()=>{s.current&&(clearTimeout(s.current),s.current=null)},u=()=>{c(),s.current=setTimeout(()=>{i([]),s.current=null},t)};x.useEffect(()=>c,[]);function f(h){return p=>{if(p.key==="Backspace"){const g=[...r];g.pop(),i(g);return}if(T6(p)){const g=r.concat(p.key);n(p)&&(p.preventDefault(),p.stopPropagation()),i(g),h(g.join("")),u()}}}return f}function D6(e,t,n,r){if(t==null)return r;if(!r)return e.find(c=>n(c).toLowerCase().startsWith(t.toLowerCase()));const i=e.filter(s=>n(s).toLowerCase().startsWith(t.toLowerCase()));if(i.length>0){let s;return i.includes(r)?(s=i.indexOf(r)+1,s===i.length&&(s=0),i[s]):(s=e.indexOf(i[0]),e[s])}return r}function O6(){const e=x.useRef(new Map),t=e.current,n=x.useCallback((i,s,c,u)=>{e.current.set(c,{type:s,el:i,options:u}),i.addEventListener(s,c,u)},[]),r=x.useCallback((i,s,c,u)=>{i.removeEventListener(s,c,u),e.current.delete(c)},[]);return x.useEffect(()=>()=>{t.forEach((i,s)=>{r(i.el,i.type,s,i.options)})},[r,t]),{add:n,remove:r}}function Cd(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function kx(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:s=!0,onMouseDown:c,onMouseUp:u,onClick:f,onKeyDown:h,onKeyUp:p,tabIndex:g,onMouseOver:y,onMouseLeave:S,...C}=e,[w,k]=x.useState(!0),[j,M]=x.useState(!1),P=O6(),I=U=>{U&&U.tagName!=="BUTTON"&&k(!1)},T=w?g:g||0,D=n&&!r,_=x.useCallback(U=>{if(n){U.stopPropagation(),U.preventDefault();return}U.currentTarget.focus(),f==null||f(U)},[n,f]),z=x.useCallback(U=>{j&&Cd(U)&&(U.preventDefault(),U.stopPropagation(),M(!1),P.remove(document,"keyup",z,!1))},[j,P]),V=x.useCallback(U=>{if(h==null||h(U),n||U.defaultPrevented||U.metaKey||!Cd(U.nativeEvent)||w)return;const K=i&&U.key==="Enter";s&&U.key===" "&&(U.preventDefault(),M(!0)),K&&(U.preventDefault(),U.currentTarget.click()),P.add(document,"keyup",z,!1)},[n,w,h,i,s,P,z]),F=x.useCallback(U=>{if(p==null||p(U),n||U.defaultPrevented||U.metaKey||!Cd(U.nativeEvent)||w)return;s&&U.key===" "&&(U.preventDefault(),M(!1),U.currentTarget.click())},[s,w,n,p]),L=x.useCallback(U=>{U.button===0&&(M(!1),P.remove(document,"mouseup",L,!1))},[P]),X=x.useCallback(U=>{if(U.button!==0)return;if(n){U.stopPropagation(),U.preventDefault();return}w||M(!0),U.currentTarget.focus({preventScroll:!0}),P.add(document,"mouseup",L,!1),c==null||c(U)},[n,w,c,P,L]),$=x.useCallback(U=>{U.button===0&&(w||M(!1),u==null||u(U))},[u,w]),Q=x.useCallback(U=>{if(n){U.preventDefault();return}y==null||y(U)},[n,y]),ie=x.useCallback(U=>{j&&(U.preventDefault(),M(!1)),S==null||S(U)},[j,S]),oe=ct(t,I);return w?{...C,ref:oe,type:"button","aria-disabled":D?void 0:n,disabled:D,onClick:_,onMouseDown:c,onMouseUp:u,onKeyUp:p,onKeyDown:h,onMouseOver:y,onMouseLeave:S}:{...C,ref:oe,role:"button","data-active":Ye(j),"aria-disabled":n?"true":void 0,tabIndex:D?void 0:T,onClick:_,onMouseDown:X,onMouseUp:$,onKeyUp:F,onKeyDown:V,onMouseOver:Q,onMouseLeave:ie}}function A6(e){const t=e.current;if(!t)return!1;const n=u6(t);return!n||t.contains(n)?!1:!!p6(n)}function jx(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,s=n&&!r;eo(()=>{if(!s||A6(e))return;const c=(i==null?void 0:i.current)||e.current;c&&requestAnimationFrame(()=>{c.focus()})},[s,e,i])}var z6={preventScroll:!0,shouldFocus:!1};function R6(e,t=z6){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:s}=t,c=N6(e)?e.current:e,u=i&&s,f=x.useRef(u),h=x.useRef(s);Uo(()=>{!h.current&&s&&(f.current=u),h.current=s},[s,u]);const p=x.useCallback(()=>{if(!(!s||!c||!f.current)&&(f.current=!1,!c.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var g;(g=n.current)==null||g.focus({preventScroll:r})});else{const g=px(c);g.length>0&&requestAnimationFrame(()=>{g[0].focus({preventScroll:r})})}},[s,r,c,n]);eo(()=>{p()},[p]),Ui(c,"transitionend",p)}function N6(e){return"current"in e}var Eo=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),Vt={arrowShadowColor:Eo("--popper-arrow-shadow-color"),arrowSize:Eo("--popper-arrow-size","8px"),arrowSizeHalf:Eo("--popper-arrow-size-half"),arrowBg:Eo("--popper-arrow-bg"),transformOrigin:Eo("--popper-transform-origin"),arrowOffset:Eo("--popper-arrow-offset")};function F6(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 L6={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"},B6=e=>L6[e],bg={scroll:!0,resize:!0};function H6(e){let t;return typeof e=="object"?t={enabled:!0,options:{...bg,...e}}:t={enabled:e,options:bg},t}var W6={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`}},V6={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{Sg(e)},effect:({state:e})=>()=>{Sg(e)}},Sg=e=>{e.elements.popper.style.setProperty(Vt.transformOrigin.var,B6(e.placement))},U6={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{$6(e)}},$6=e=>{var t;if(!e.placement)return;const n=G6(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:Vt.arrowSize.varRef,height:Vt.arrowSize.varRef,zIndex:-1});const r={[Vt.arrowSizeHalf.var]:`calc(${Vt.arrowSize.varRef} / 2)`,[Vt.arrowOffset.var]:`calc(${Vt.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},G6=e=>{if(e.startsWith("top"))return{property:"bottom",value:Vt.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:Vt.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:Vt.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:Vt.arrowOffset.varRef}},q6={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{Cg(e)},effect:({state:e})=>()=>{Cg(e)}},Cg=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=F6(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:Vt.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},Y6={"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"}},X6={"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 K6(e,t="ltr"){var n,r;const i=((n=Y6[e])==null?void 0:n[t])||e;return t==="ltr"?i:(r=X6[e])!=null?r:i}var Pn="top",Gn="bottom",qn="right",In="left",Eh="auto",hs=[Pn,Gn,qn,In],Xo="start",Qa="end",Q6="clippingParents",Ex="viewport",Oa="popper",Z6="reference",wg=hs.reduce(function(e,t){return e.concat([t+"-"+Xo,t+"-"+Qa])},[]),Px=[].concat(hs,[Eh]).reduce(function(e,t){return e.concat([t,t+"-"+Xo,t+"-"+Qa])},[]),J6="beforeRead",ek="read",tk="afterRead",nk="beforeMain",rk="main",ik="afterMain",ok="beforeWrite",ak="write",sk="afterWrite",lk=[J6,ek,tk,nk,rk,ik,ok,ak,sk];function Cr(e){return e?(e.nodeName||"").toLowerCase():null}function Yn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xi(e){var t=Yn(e).Element;return e instanceof t||e instanceof Element}function Un(e){var t=Yn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Ph(e){if(typeof ShadowRoot>"u")return!1;var t=Yn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function ck(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},s=t.elements[n];!Un(s)||!Cr(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(c){var u=i[c];u===!1?s.removeAttribute(c):s.setAttribute(c,u===!0?"":u)}))})}function uk(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],s=t.attributes[r]||{},c=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=c.reduce(function(f,h){return f[h]="",f},{});!Un(i)||!Cr(i)||(Object.assign(i.style,u),Object.keys(s).forEach(function(f){i.removeAttribute(f)}))})}}const dk={name:"applyStyles",enabled:!0,phase:"write",fn:ck,effect:uk,requires:["computeStyles"]};function yr(e){return e.split("-")[0]}var Gi=Math.max,lc=Math.min,Ko=Math.round;function wf(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Ix(){return!/^((?!chrome|android).)*safari/i.test(wf())}function Qo(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,s=1;t&&Un(e)&&(i=e.offsetWidth>0&&Ko(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Ko(r.height)/e.offsetHeight||1);var c=Xi(e)?Yn(e):window,u=c.visualViewport,f=!Ix()&&n,h=(r.left+(f&&u?u.offsetLeft:0))/i,p=(r.top+(f&&u?u.offsetTop:0))/s,g=r.width/i,y=r.height/s;return{width:g,height:y,top:p,right:h+g,bottom:p+y,left:h,x:h,y:p}}function Ih(e){var t=Qo(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 Mx(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ph(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ar(e){return Yn(e).getComputedStyle(e)}function fk(e){return["table","td","th"].indexOf(Cr(e))>=0}function mi(e){return((Xi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ec(e){return Cr(e)==="html"?e:e.assignedSlot||e.parentNode||(Ph(e)?e.host:null)||mi(e)}function kg(e){return!Un(e)||Ar(e).position==="fixed"?null:e.offsetParent}function hk(e){var t=/firefox/i.test(wf()),n=/Trident/i.test(wf());if(n&&Un(e)){var r=Ar(e);if(r.position==="fixed")return null}var i=Ec(e);for(Ph(i)&&(i=i.host);Un(i)&&["html","body"].indexOf(Cr(i))<0;){var s=Ar(i);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 i;i=i.parentNode}return null}function ps(e){for(var t=Yn(e),n=kg(e);n&&fk(n)&&Ar(n).position==="static";)n=kg(n);return n&&(Cr(n)==="html"||Cr(n)==="body"&&Ar(n).position==="static")?t:n||hk(e)||t}function Mh(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ha(e,t,n){return Gi(e,lc(t,n))}function pk(e,t,n){var r=Ha(e,t,n);return r>n?n:r}function Tx(){return{top:0,right:0,bottom:0,left:0}}function _x(e){return Object.assign({},Tx(),e)}function Dx(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var mk=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,_x(typeof t!="number"?t:Dx(t,hs))};function vk(e){var t,n=e.state,r=e.name,i=e.options,s=n.elements.arrow,c=n.modifiersData.popperOffsets,u=yr(n.placement),f=Mh(u),h=[In,qn].indexOf(u)>=0,p=h?"height":"width";if(!(!s||!c)){var g=mk(i.padding,n),y=Ih(s),S=f==="y"?Pn:In,C=f==="y"?Gn:qn,w=n.rects.reference[p]+n.rects.reference[f]-c[f]-n.rects.popper[p],k=c[f]-n.rects.reference[f],j=ps(s),M=j?f==="y"?j.clientHeight||0:j.clientWidth||0:0,P=w/2-k/2,I=g[S],T=M-y[p]-g[C],D=M/2-y[p]/2+P,_=Ha(I,D,T),z=f;n.modifiersData[r]=(t={},t[z]=_,t.centerOffset=_-D,t)}}function gk(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||Mx(t.elements.popper,i)&&(t.elements.arrow=i))}const xk={name:"arrow",enabled:!0,phase:"main",fn:vk,effect:gk,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Zo(e){return e.split("-")[1]}var yk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function bk(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Ko(t*i)/i||0,y:Ko(n*i)/i||0}}function jg(e){var t,n=e.popper,r=e.popperRect,i=e.placement,s=e.variation,c=e.offsets,u=e.position,f=e.gpuAcceleration,h=e.adaptive,p=e.roundOffsets,g=e.isFixed,y=c.x,S=y===void 0?0:y,C=c.y,w=C===void 0?0:C,k=typeof p=="function"?p({x:S,y:w}):{x:S,y:w};S=k.x,w=k.y;var j=c.hasOwnProperty("x"),M=c.hasOwnProperty("y"),P=In,I=Pn,T=window;if(h){var D=ps(n),_="clientHeight",z="clientWidth";if(D===Yn(n)&&(D=mi(n),Ar(D).position!=="static"&&u==="absolute"&&(_="scrollHeight",z="scrollWidth")),D=D,i===Pn||(i===In||i===qn)&&s===Qa){I=Gn;var V=g&&D===T&&T.visualViewport?T.visualViewport.height:D[_];w-=V-r.height,w*=f?1:-1}if(i===In||(i===Pn||i===Gn)&&s===Qa){P=qn;var F=g&&D===T&&T.visualViewport?T.visualViewport.width:D[z];S-=F-r.width,S*=f?1:-1}}var L=Object.assign({position:u},h&&yk),X=p===!0?bk({x:S,y:w}):{x:S,y:w};if(S=X.x,w=X.y,f){var $;return Object.assign({},L,($={},$[I]=M?"0":"",$[P]=j?"0":"",$.transform=(T.devicePixelRatio||1)<=1?"translate("+S+"px, "+w+"px)":"translate3d("+S+"px, "+w+"px, 0)",$))}return Object.assign({},L,(t={},t[I]=M?w+"px":"",t[P]=j?S+"px":"",t.transform="",t))}function Sk(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,c=s===void 0?!0:s,u=n.roundOffsets,f=u===void 0?!0:u,h={placement:yr(t.placement),variation:Zo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,jg(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:f})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,jg(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Ck={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Sk,data:{}};var wl={passive:!0};function wk(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,s=i===void 0?!0:i,c=r.resize,u=c===void 0?!0:c,f=Yn(t.elements.popper),h=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&h.forEach(function(p){p.addEventListener("scroll",n.update,wl)}),u&&f.addEventListener("resize",n.update,wl),function(){s&&h.forEach(function(p){p.removeEventListener("scroll",n.update,wl)}),u&&f.removeEventListener("resize",n.update,wl)}}const kk={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:wk,data:{}};var jk={left:"right",right:"left",bottom:"top",top:"bottom"};function Gl(e){return e.replace(/left|right|bottom|top/g,function(t){return jk[t]})}var Ek={start:"end",end:"start"};function Eg(e){return e.replace(/start|end/g,function(t){return Ek[t]})}function Th(e){var t=Yn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function _h(e){return Qo(mi(e)).left+Th(e).scrollLeft}function Pk(e,t){var n=Yn(e),r=mi(e),i=n.visualViewport,s=r.clientWidth,c=r.clientHeight,u=0,f=0;if(i){s=i.width,c=i.height;var h=Ix();(h||!h&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}return{width:s,height:c,x:u+_h(e),y:f}}function Ik(e){var t,n=mi(e),r=Th(e),i=(t=e.ownerDocument)==null?void 0:t.body,s=Gi(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),c=Gi(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),u=-r.scrollLeft+_h(e),f=-r.scrollTop;return Ar(i||n).direction==="rtl"&&(u+=Gi(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:c,x:u,y:f}}function Dh(e){var t=Ar(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Ox(e){return["html","body","#document"].indexOf(Cr(e))>=0?e.ownerDocument.body:Un(e)&&Dh(e)?e:Ox(Ec(e))}function Wa(e,t){var n;t===void 0&&(t=[]);var r=Ox(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),s=Yn(r),c=i?[s].concat(s.visualViewport||[],Dh(r)?r:[]):r,u=t.concat(c);return i?u:u.concat(Wa(Ec(c)))}function kf(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Mk(e,t){var n=Qo(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 Pg(e,t,n){return t===Ex?kf(Pk(e,n)):Xi(t)?Mk(t,n):kf(Ik(mi(e)))}function Tk(e){var t=Wa(Ec(e)),n=["absolute","fixed"].indexOf(Ar(e).position)>=0,r=n&&Un(e)?ps(e):e;return Xi(r)?t.filter(function(i){return Xi(i)&&Mx(i,r)&&Cr(i)!=="body"}):[]}function _k(e,t,n,r){var i=t==="clippingParents"?Tk(e):[].concat(t),s=[].concat(i,[n]),c=s[0],u=s.reduce(function(f,h){var p=Pg(e,h,r);return f.top=Gi(p.top,f.top),f.right=lc(p.right,f.right),f.bottom=lc(p.bottom,f.bottom),f.left=Gi(p.left,f.left),f},Pg(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 Ax(e){var t=e.reference,n=e.element,r=e.placement,i=r?yr(r):null,s=r?Zo(r):null,c=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,f;switch(i){case Pn:f={x:c,y:t.y-n.height};break;case Gn:f={x:c,y:t.y+t.height};break;case qn:f={x:t.x+t.width,y:u};break;case In:f={x:t.x-n.width,y:u};break;default:f={x:t.x,y:t.y}}var h=i?Mh(i):null;if(h!=null){var p=h==="y"?"height":"width";switch(s){case Xo:f[h]=f[h]-(t[p]/2-n[p]/2);break;case Qa:f[h]=f[h]+(t[p]/2-n[p]/2);break}}return f}function Za(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,s=n.strategy,c=s===void 0?e.strategy:s,u=n.boundary,f=u===void 0?Q6:u,h=n.rootBoundary,p=h===void 0?Ex:h,g=n.elementContext,y=g===void 0?Oa:g,S=n.altBoundary,C=S===void 0?!1:S,w=n.padding,k=w===void 0?0:w,j=_x(typeof k!="number"?k:Dx(k,hs)),M=y===Oa?Z6:Oa,P=e.rects.popper,I=e.elements[C?M:y],T=_k(Xi(I)?I:I.contextElement||mi(e.elements.popper),f,p,c),D=Qo(e.elements.reference),_=Ax({reference:D,element:P,strategy:"absolute",placement:i}),z=kf(Object.assign({},P,_)),V=y===Oa?z:D,F={top:T.top-V.top+j.top,bottom:V.bottom-T.bottom+j.bottom,left:T.left-V.left+j.left,right:V.right-T.right+j.right},L=e.modifiersData.offset;if(y===Oa&&L){var X=L[i];Object.keys(F).forEach(function($){var Q=[qn,Gn].indexOf($)>=0?1:-1,ie=[Pn,Gn].indexOf($)>=0?"y":"x";F[$]+=X[ie]*Q})}return F}function Dk(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,s=n.rootBoundary,c=n.padding,u=n.flipVariations,f=n.allowedAutoPlacements,h=f===void 0?Px:f,p=Zo(r),g=p?u?wg:wg.filter(function(C){return Zo(C)===p}):hs,y=g.filter(function(C){return h.indexOf(C)>=0});y.length===0&&(y=g);var S=y.reduce(function(C,w){return C[w]=Za(e,{placement:w,boundary:i,rootBoundary:s,padding:c})[yr(w)],C},{});return Object.keys(S).sort(function(C,w){return S[C]-S[w]})}function Ok(e){if(yr(e)===Eh)return[];var t=Gl(e);return[Eg(e),t,Eg(t)]}function Ak(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,c=n.altAxis,u=c===void 0?!0:c,f=n.fallbackPlacements,h=n.padding,p=n.boundary,g=n.rootBoundary,y=n.altBoundary,S=n.flipVariations,C=S===void 0?!0:S,w=n.allowedAutoPlacements,k=t.options.placement,j=yr(k),M=j===k,P=f||(M||!C?[Gl(k)]:Ok(k)),I=[k].concat(P).reduce(function(J,ue){return J.concat(yr(ue)===Eh?Dk(t,{placement:ue,boundary:p,rootBoundary:g,padding:h,flipVariations:C,allowedAutoPlacements:w}):ue)},[]),T=t.rects.reference,D=t.rects.popper,_=new Map,z=!0,V=I[0],F=0;F<I.length;F++){var L=I[F],X=yr(L),$=Zo(L)===Xo,Q=[Pn,Gn].indexOf(X)>=0,ie=Q?"width":"height",oe=Za(t,{placement:L,boundary:p,rootBoundary:g,altBoundary:y,padding:h}),U=Q?$?qn:In:$?Gn:Pn;T[ie]>D[ie]&&(U=Gl(U));var K=Gl(U),ne=[];if(s&&ne.push(oe[X]<=0),u&&ne.push(oe[U]<=0,oe[K]<=0),ne.every(function(J){return J})){V=L,z=!1;break}_.set(L,ne)}if(z)for(var ce=C?3:1,Re=function(ue){var Ie=I.find(function(Be){var Ne=_.get(Be);if(Ne)return Ne.slice(0,ue).every(function(Ge){return Ge})});if(Ie)return V=Ie,"break"},ze=ce;ze>0;ze--){var Me=Re(ze);if(Me==="break")break}t.placement!==V&&(t.modifiersData[r]._skip=!0,t.placement=V,t.reset=!0)}}const zk={name:"flip",enabled:!0,phase:"main",fn:Ak,requiresIfExists:["offset"],data:{_skip:!1}};function Ig(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 Mg(e){return[Pn,qn,Gn,In].some(function(t){return e[t]>=0})}function Rk(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,s=t.modifiersData.preventOverflow,c=Za(t,{elementContext:"reference"}),u=Za(t,{altBoundary:!0}),f=Ig(c,r),h=Ig(u,i,s),p=Mg(f),g=Mg(h);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:h,isReferenceHidden:p,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":g})}const Nk={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Rk};function Fk(e,t,n){var r=yr(e),i=[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)*i,[In,qn].indexOf(r)>=0?{x:u,y:c}:{x:c,y:u}}function Lk(e){var t=e.state,n=e.options,r=e.name,i=n.offset,s=i===void 0?[0,0]:i,c=Px.reduce(function(p,g){return p[g]=Fk(g,t.rects,s),p},{}),u=c[t.placement],f=u.x,h=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=h),t.modifiersData[r]=c}const Bk={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Lk};function Hk(e){var t=e.state,n=e.name;t.modifiersData[n]=Ax({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Wk={name:"popperOffsets",enabled:!0,phase:"read",fn:Hk,data:{}};function Vk(e){return e==="x"?"y":"x"}function Uk(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,s=i===void 0?!0:i,c=n.altAxis,u=c===void 0?!1:c,f=n.boundary,h=n.rootBoundary,p=n.altBoundary,g=n.padding,y=n.tether,S=y===void 0?!0:y,C=n.tetherOffset,w=C===void 0?0:C,k=Za(t,{boundary:f,rootBoundary:h,padding:g,altBoundary:p}),j=yr(t.placement),M=Zo(t.placement),P=!M,I=Mh(j),T=Vk(I),D=t.modifiersData.popperOffsets,_=t.rects.reference,z=t.rects.popper,V=typeof w=="function"?w(Object.assign({},t.rects,{placement:t.placement})):w,F=typeof V=="number"?{mainAxis:V,altAxis:V}:Object.assign({mainAxis:0,altAxis:0},V),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,X={x:0,y:0};if(D){if(s){var $,Q=I==="y"?Pn:In,ie=I==="y"?Gn:qn,oe=I==="y"?"height":"width",U=D[I],K=U+k[Q],ne=U-k[ie],ce=S?-z[oe]/2:0,Re=M===Xo?_[oe]:z[oe],ze=M===Xo?-z[oe]:-_[oe],Me=t.elements.arrow,J=S&&Me?Ih(Me):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Tx(),Ie=ue[Q],Be=ue[ie],Ne=Ha(0,_[oe],J[oe]),Ge=P?_[oe]/2-ce-Ne-Ie-F.mainAxis:Re-Ne-Ie-F.mainAxis,Qe=P?-_[oe]/2+ce+Ne+Be+F.mainAxis:ze+Ne+Be+F.mainAxis,ve=t.elements.arrow&&ps(t.elements.arrow),_e=ve?I==="y"?ve.clientTop||0:ve.clientLeft||0:0,qe=($=L==null?void 0:L[I])!=null?$:0,ge=U+Ge-qe-_e,Te=U+Qe-qe,et=Ha(S?lc(K,ge):K,U,S?Gi(ne,Te):ne);D[I]=et,X[I]=et-U}if(u){var Ve,vt=I==="x"?Pn:In,Nt=I==="x"?Gn:qn,N=D[T],de=T==="y"?"height":"width",xe=N+k[vt],je=N-k[Nt],q=[Pn,In].indexOf(j)!==-1,se=(Ve=L==null?void 0:L[T])!=null?Ve:0,Fe=q?xe:N-_[de]-z[de]-se+F.altAxis,Ze=q?N+_[de]+z[de]-se-F.altAxis:je,ee=S&&q?pk(Fe,N,Ze):Ha(S?Fe:xe,N,S?Ze:je);D[T]=ee,X[T]=ee-N}t.modifiersData[r]=X}}const $k={name:"preventOverflow",enabled:!0,phase:"main",fn:Uk,requiresIfExists:["offset"]};function Gk(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function qk(e){return e===Yn(e)||!Un(e)?Th(e):Gk(e)}function Yk(e){var t=e.getBoundingClientRect(),n=Ko(t.width)/e.offsetWidth||1,r=Ko(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Xk(e,t,n){n===void 0&&(n=!1);var r=Un(t),i=Un(t)&&Yk(t),s=mi(t),c=Qo(e,i,n),u={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((Cr(t)!=="body"||Dh(s))&&(u=qk(t)),Un(t)?(f=Qo(t,!0),f.x+=t.clientLeft,f.y+=t.clientTop):s&&(f.x=_h(s))),{x:c.left+u.scrollLeft-f.x,y:c.top+u.scrollTop-f.y,width:c.width,height:c.height}}function Kk(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function i(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&&i(f)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||i(s)}),r}function Qk(e){var t=Kk(e);return lk.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function Zk(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Jk(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Tg={placement:"bottom",modifiers:[],strategy:"absolute"};function _g(){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 ej(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,s=i===void 0?Tg:i;return function(u,f,h){h===void 0&&(h=s);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},Tg,s),modifiersData:{},elements:{reference:u,popper:f},attributes:{},styles:{}},g=[],y=!1,S={state:p,setOptions:function(j){var M=typeof j=="function"?j(p.options):j;w(),p.options=Object.assign({},s,p.options,M),p.scrollParents={reference:Xi(u)?Wa(u):u.contextElement?Wa(u.contextElement):[],popper:Wa(f)};var P=Qk(Jk([].concat(r,p.options.modifiers)));return p.orderedModifiers=P.filter(function(I){return I.enabled}),C(),S.update()},forceUpdate:function(){if(!y){var j=p.elements,M=j.reference,P=j.popper;if(_g(M,P)){p.rects={reference:Xk(M,ps(P),p.options.strategy==="fixed"),popper:Ih(P)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(F){return p.modifiersData[F.name]=Object.assign({},F.data)});for(var I=0;I<p.orderedModifiers.length;I++){if(p.reset===!0){p.reset=!1,I=-1;continue}var T=p.orderedModifiers[I],D=T.fn,_=T.options,z=_===void 0?{}:_,V=T.name;typeof D=="function"&&(p=D({state:p,options:z,name:V,instance:S})||p)}}}},update:Zk(function(){return new Promise(function(k){S.forceUpdate(),k(p)})}),destroy:function(){w(),y=!0}};if(!_g(u,f))return S;S.setOptions(h).then(function(k){!y&&h.onFirstUpdate&&h.onFirstUpdate(k)});function C(){p.orderedModifiers.forEach(function(k){var j=k.name,M=k.options,P=M===void 0?{}:M,I=k.effect;if(typeof I=="function"){var T=I({state:p,name:j,instance:S,options:P}),D=function(){};g.push(T||D)}})}function w(){g.forEach(function(k){return k()}),g=[]}return S}}var tj=[kk,Wk,Ck,dk,Bk,zk,$k,xk,Nk],nj=ej({defaultModifiers:tj});function Oh(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:i="absolute",arrowPadding:s=8,eventListeners:c=!0,offset:u,gutter:f=8,flip:h=!0,boundary:p="clippingParents",preventOverflow:g=!0,matchWidth:y,direction:S="ltr"}=e,C=x.useRef(null),w=x.useRef(null),k=x.useRef(null),j=K6(r,S),M=x.useRef(()=>{}),P=x.useCallback(()=>{var F;!t||!C.current||!w.current||((F=M.current)==null||F.call(M),k.current=nj(C.current,w.current,{placement:j,modifiers:[q6,U6,V6,{...W6,enabled:!!y},{name:"eventListeners",...H6(c)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:u??[0,f]}},{name:"flip",enabled:!!h,options:{padding:8}},{name:"preventOverflow",enabled:!!g,options:{boundary:p}},...n??[]],strategy:i}),k.current.forceUpdate(),M.current=k.current.destroy)},[j,t,n,y,c,s,u,f,h,g,p,i]);x.useEffect(()=>()=>{var F;!C.current&&!w.current&&((F=k.current)==null||F.destroy(),k.current=null)},[]);const I=x.useCallback(F=>{C.current=F,P()},[P]),T=x.useCallback((F={},L=null)=>({...F,ref:ct(I,L)}),[I]),D=x.useCallback(F=>{w.current=F,P()},[P]),_=x.useCallback((F={},L=null)=>({...F,ref:ct(D,L),style:{...F.style,position:i,minWidth:y?void 0:"max-content",inset:"0 auto auto 0"}}),[i,D,y]),z=x.useCallback((F={},L=null)=>{const{size:X,shadowColor:$,bg:Q,style:ie,...oe}=F;return{...oe,ref:L,"data-popper-arrow":"",style:rj(F)}},[]),V=x.useCallback((F={},L=null)=>({...F,ref:L,"data-popper-arrow-inner":""}),[]);return{update(){var F;(F=k.current)==null||F.update()},forceUpdate(){var F;(F=k.current)==null||F.forceUpdate()},transformOrigin:Vt.transformOrigin.varRef,referenceRef:I,popperRef:D,getPopperProps:_,getArrowProps:z,getArrowInnerProps:V,getReferenceProps:T}}function rj(e){const{size:t,shadowColor:n,bg:r,style:i}=e,s={...i,position:"absolute"};return t&&(s["--popper-arrow-size"]=t),n&&(s["--popper-arrow-shadow-color"]=n),r&&(s["--popper-arrow-bg"]=r),s}function Ah(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,s=Ut(n),c=Ut(t),[u,f]=x.useState(e.defaultIsOpen||!1),h=r!==void 0?r:u,p=r!==void 0,g=x.useId(),y=i??`disclosure-${g}`,S=x.useCallback(()=>{p||f(!1),c==null||c()},[p,c]),C=x.useCallback(()=>{p||f(!0),s==null||s()},[p,s]),w=x.useCallback(()=>{h?S():C()},[h,C,S]);function k(M={}){return{...M,"aria-expanded":h,"aria-controls":y,onClick(P){var I;(I=M.onClick)==null||I.call(M,P),w()}}}function j(M={}){return{...M,hidden:!h,id:y}}return{isOpen:h,onOpen:C,onClose:S,onToggle:w,isControlled:p,getButtonProps:k,getDisclosureProps:j}}function ij(e){const{ref:t,handler:n,enabled:r=!0}=e,i=Ut(n),c=x.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;x.useEffect(()=>{if(!r)return;const u=g=>{wd(g,t)&&(c.isPointerDown=!0)},f=g=>{if(c.ignoreEmulatedMouseEvents){c.ignoreEmulatedMouseEvents=!1;return}c.isPointerDown&&n&&wd(g,t)&&(c.isPointerDown=!1,i(g))},h=g=>{c.ignoreEmulatedMouseEvents=!0,n&&c.isPointerDown&&wd(g,t)&&(c.isPointerDown=!1,i(g))},p=zx(t.current);return p.addEventListener("mousedown",u,!0),p.addEventListener("mouseup",f,!0),p.addEventListener("touchstart",u,!0),p.addEventListener("touchend",h,!0),()=>{p.removeEventListener("mousedown",u,!0),p.removeEventListener("mouseup",f,!0),p.removeEventListener("touchstart",u,!0),p.removeEventListener("touchend",h,!0)}},[n,t,i,c,r])}function wd(e,t){var n;const r=e.target;return e.button>0||r&&!zx(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function zx(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Rx(e){const{isOpen:t,ref:n}=e,[r,i]=x.useState(t),[s,c]=x.useState(!1);return x.useEffect(()=>{s||(i(t),c(!0))},[t,s,r]),Ui(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var f;const h=c6(n.current),p=new h.CustomEvent("animationend",{bubbles:!0});(f=n.current)==null||f.dispatchEvent(p)}}}function zh(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var[oj,aj,sj,lj]=rh(),[cj,ms]=Et({strict:!1,name:"MenuContext"});function uj(e,...t){const n=x.useId(),r=e||n;return x.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}function Nx(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Dg(e){return Nx(e).activeElement===e}function dj(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:i,autoSelect:s=!0,isLazy:c,isOpen:u,defaultIsOpen:f,onClose:h,onOpen:p,placement:g="bottom-start",lazyBehavior:y="unmount",direction:S,computePositionOnMount:C=!1,...w}=e,k=x.useRef(null),j=x.useRef(null),M=sj(),P=x.useCallback(()=>{requestAnimationFrame(()=>{var Me;(Me=k.current)==null||Me.focus({preventScroll:!1})})},[]),I=x.useCallback(()=>{const Me=setTimeout(()=>{var J;if(i)(J=i.current)==null||J.focus();else{const ue=M.firstEnabled();ue&&$(ue.index)}});K.current.add(Me)},[M,i]),T=x.useCallback(()=>{const Me=setTimeout(()=>{const J=M.lastEnabled();J&&$(J.index)});K.current.add(Me)},[M]),D=x.useCallback(()=>{p==null||p(),s?I():P()},[s,I,P,p]),{isOpen:_,onOpen:z,onClose:V,onToggle:F}=Ah({isOpen:u,defaultIsOpen:f,onClose:h,onOpen:D});ij({enabled:_&&r,ref:k,handler:Me=>{var J;(J=j.current)!=null&&J.contains(Me.target)||V()}});const L=Oh({...w,enabled:_||C,placement:g,direction:S}),[X,$]=x.useState(-1);eo(()=>{_||$(-1)},[_]),jx(k,{focusRef:j,visible:_,shouldFocus:!0});const Q=Rx({isOpen:_,ref:k}),[ie,oe]=uj(t,"menu-button","menu-list"),U=x.useCallback(()=>{z(),P()},[z,P]),K=x.useRef(new Set([]));xj(()=>{K.current.forEach(Me=>clearTimeout(Me)),K.current.clear()});const ne=x.useCallback(()=>{z(),I()},[I,z]),ce=x.useCallback(()=>{z(),T()},[z,T]),Re=x.useCallback(()=>{var Me,J;const ue=Nx(k.current),Ie=(Me=k.current)==null?void 0:Me.contains(ue.activeElement);if(!(_&&!Ie))return;const Ne=(J=M.item(X))==null?void 0:J.node;Ne==null||Ne.focus()},[_,X,M]),ze=x.useRef(null);return{openAndFocusMenu:U,openAndFocusFirstItem:ne,openAndFocusLastItem:ce,onTransitionEnd:Re,unstable__animationState:Q,descendants:M,popper:L,buttonId:ie,menuId:oe,forceUpdate:L.forceUpdate,orientation:"vertical",isOpen:_,onToggle:F,onOpen:z,onClose:V,menuRef:k,buttonRef:j,focusedIndex:X,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:$,isLazy:c,lazyBehavior:y,initialFocusRef:i,rafId:ze}}function fj(e={},t=null){const n=ms(),{onToggle:r,popper:i,openAndFocusFirstItem:s,openAndFocusLastItem:c}=n,u=x.useCallback(f=>{const h=f.key,g={Enter:s,ArrowDown:s,ArrowUp:c}[h];g&&(f.preventDefault(),f.stopPropagation(),g(f))},[s,c]);return{...e,ref:ct(n.buttonRef,t,i.referenceRef),id:n.buttonId,"data-active":Ye(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:Pe(e.onClick,r),onKeyDown:Pe(e.onKeyDown,u)}}function jf(e){var t;return vj(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function hj(e={},t=null){const n=ms();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");const{focusedIndex:r,setFocusedIndex:i,menuRef:s,isOpen:c,onClose:u,menuId:f,isLazy:h,lazyBehavior:p,unstable__animationState:g}=n,y=aj(),S=_6({preventDefault:j=>j.key!==" "&&jf(j.target)}),C=x.useCallback(j=>{const M=j.key,I={Tab:D=>D.preventDefault(),Escape:u,ArrowDown:()=>{const D=y.nextEnabled(r);D&&i(D.index)},ArrowUp:()=>{const D=y.prevEnabled(r);D&&i(D.index)}}[M];if(I){j.preventDefault(),I(j);return}const T=S(D=>{const _=D6(y.values(),D,z=>{var V,F;return(F=(V=z==null?void 0:z.node)==null?void 0:V.textContent)!=null?F:""},y.item(r));if(_){const z=y.indexOf(_.node);i(z)}});jf(j.target)&&T(j)},[y,r,S,u,i]),w=x.useRef(!1);c&&(w.current=!0);const k=zh({wasSelected:w.current,enabled:h,mode:p,isSelected:g.present});return{...e,ref:ct(s,t),children:k?e.children:null,tabIndex:-1,role:"menu",id:f,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:Pe(e.onKeyDown,C)}}function pj(e={}){const{popper:t,isOpen:n}=ms();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function mj(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onClick:s,onFocus:c,isDisabled:u,isFocusable:f,closeOnSelect:h,type:p,...g}=e,y=ms(),{setFocusedIndex:S,focusedIndex:C,closeOnSelect:w,onClose:k,menuRef:j,isOpen:M,menuId:P,rafId:I}=y,T=x.useRef(null),D=`${P}-menuitem-${x.useId()}`,{index:_,register:z}=lj({disabled:u&&!f}),V=x.useCallback(U=>{n==null||n(U),!u&&S(_)},[S,_,u,n]),F=x.useCallback(U=>{r==null||r(U),T.current&&!Dg(T.current)&&V(U)},[V,r]),L=x.useCallback(U=>{i==null||i(U),!u&&S(-1)},[S,u,i]),X=x.useCallback(U=>{s==null||s(U),jf(U.currentTarget)&&(h??w)&&k()},[k,s,w,h]),$=x.useCallback(U=>{c==null||c(U),S(_)},[S,c,_]),Q=_===C,ie=u&&!f;eo(()=>{M&&(Q&&!ie&&T.current?(I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{var U;(U=T.current)==null||U.focus(),I.current=null})):j.current&&!Dg(j.current)&&j.current.focus())},[Q,ie,j,M]);const oe=kx({onClick:X,onFocus:$,onMouseEnter:V,onMouseMove:F,onMouseLeave:L,ref:ct(z,T,t),isDisabled:u,isFocusable:f});return{...g,...oe,type:p??oe.type,id:D,role:"menuitem",tabIndex:Q?0:-1}}function vj(e){var t;if(!gj(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function gj(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function xj(e,t=[]){return x.useEffect(()=>()=>e(),t)}var[yj,Pc]=Et({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),Rh=e=>{const{children:t}=e,n=fn("Menu",e),r=At(e),{direction:i}=Ji(),{descendants:s,...c}=dj({...r,direction:i}),u=x.useMemo(()=>c,[c]),{isOpen:f,onClose:h,forceUpdate:p}=u;return l.jsx(oj,{value:s,children:l.jsx(cj,{value:u,children:l.jsx(yj,{value:n,children:j1(t,{isOpen:f,onClose:h,forceUpdate:p})})})})};Rh.displayName="Menu";var Fx=he((e,t)=>{const n=Pc();return l.jsx(re.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});Fx.displayName="MenuCommand";var bj=he((e,t)=>{const{type:n,...r}=e,i=Pc(),s=r.as||n?n??void 0:"button",c=x.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...i.item}),[i.item]);return l.jsx(re.button,{ref:t,type:s,...r,__css:c})}),Lx=e=>{const{className:t,children:n,...r}=e,i=x.Children.only(n),s=x.isValidElement(i)?x.cloneElement(i,{focusable:"false","aria-hidden":!0,className:Ae("chakra-menu__icon",i.props.className)}):null,c=Ae("chakra-menu__icon-wrapper",t);return l.jsx(re.span,{className:c,...r,__css:{flexShrink:0},children:s})};Lx.displayName="MenuIcon";var pr=he((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:i,commandSpacing:s="0.75rem",children:c,...u}=e,f=mj(u,t),p=n||i?l.jsx("span",{style:{pointerEvents:"none",flex:1},children:c}):c;return l.jsxs(bj,{...f,className:Ae("chakra-menu__menuitem",f.className),children:[n&&l.jsx(Lx,{fontSize:"0.8em",marginEnd:r,children:n}),p,i&&l.jsx(Fx,{marginStart:s,children:i})]})});pr.displayName="MenuItem";var Sj={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"}}},Cj=re(Wr.div),Nh=he(function(t,n){var r,i;const{rootProps:s,motionProps:c,...u}=t,{isOpen:f,onTransitionEnd:h,unstable__animationState:p}=ms(),g=hj(u,n),y=pj(s),S=Pc();return l.jsx(re.div,{...y,__css:{zIndex:(i=t.zIndex)!=null?i:(r=S.list)==null?void 0:r.zIndex},children:l.jsx(Cj,{variants:Sj,initial:!1,animate:f?"enter":"exit",__css:{outline:0,...S.list},...c,className:Ae("chakra-menu__menu-list",g.className),...g,onUpdate:h,onAnimationComplete:yc(p.onComplete,g.onAnimationComplete)})})});Nh.displayName="MenuList";var wj=he((e,t)=>{const n=Pc();return l.jsx(re.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Fh=he((e,t)=>{const{children:n,as:r,...i}=e,s=fj(i,t),c=r||wj;return l.jsx(c,{...s,className:Ae("chakra-menu__menu-button",e.className),children:l.jsx(re.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Fh.displayName="MenuButton";var kj={slideInBottom:{...df,custom:{offsetY:16,reverse:!0}},slideInRight:{...df,custom:{offsetX:16,reverse:!0}},scale:{...S2,custom:{initialScale:.95,reverse:!0}},none:{}},jj=re(Wr.section),Ej=e=>kj[e||"none"],Bx=x.forwardRef((e,t)=>{const{preset:n,motionProps:r=Ej(n),...i}=e;return l.jsx(jj,{ref:t,...r,...i})});Bx.displayName="ModalTransition";var Pj=Object.defineProperty,Ij=(e,t,n)=>t in e?Pj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mj=(e,t,n)=>(Ij(e,typeof t!="symbol"?t+"":t,n),n),Tj=class{constructor(){Mj(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}},Ef=new Tj;function Hx(e,t){const[n,r]=x.useState(0);return x.useEffect(()=>{const i=e.current;if(i){if(t){const s=Ef.add(i);r(s)}return()=>{Ef.remove(i),r(0)}}},[t,e]),n}var _j=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Po=new WeakMap,kl=new WeakMap,jl={},kd=0,Wx=function(e){return e&&(e.host||Wx(e.parentNode))},Dj=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Wx(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)})},Oj=function(e,t,n,r){var i=Dj(t,Array.isArray(e)?e:[e]);jl[n]||(jl[n]=new WeakMap);var s=jl[n],c=[],u=new Set,f=new Set(i),h=function(g){!g||u.has(g)||(u.add(g),h(g.parentNode))};i.forEach(h);var p=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(y){if(u.has(y))p(y);else{var S=y.getAttribute(r),C=S!==null&&S!=="false",w=(Po.get(y)||0)+1,k=(s.get(y)||0)+1;Po.set(y,w),s.set(y,k),c.push(y),w===1&&C&&kl.set(y,!0),k===1&&y.setAttribute(n,"true"),C||y.setAttribute(r,"true")}})};return p(t),u.clear(),kd++,function(){c.forEach(function(g){var y=Po.get(g)-1,S=s.get(g)-1;Po.set(g,y),s.set(g,S),y||(kl.has(g)||g.removeAttribute(r),kl.delete(g)),S||g.removeAttribute(n)}),kd--,kd||(Po=new WeakMap,Po=new WeakMap,kl=new WeakMap,jl={})}},Aj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||_j(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Oj(r,i,n,"aria-hidden")):function(){return null}};function zj(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:s=!0,useInert:c=!0,onOverlayClick:u,onEsc:f}=e,h=x.useRef(null),p=x.useRef(null),[g,y,S]=Nj(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Rj(h,t&&c),Hx(h,t);const C=x.useRef(null),w=x.useCallback(z=>{C.current=z.target},[]),k=x.useCallback(z=>{z.key==="Escape"&&(z.stopPropagation(),s&&(n==null||n()),f==null||f())},[s,n,f]),[j,M]=x.useState(!1),[P,I]=x.useState(!1),T=x.useCallback((z={},V=null)=>({role:"dialog",...z,ref:ct(V,h),id:g,tabIndex:-1,"aria-modal":!0,"aria-labelledby":j?y:void 0,"aria-describedby":P?S:void 0,onClick:Pe(z.onClick,F=>F.stopPropagation())}),[S,P,g,y,j]),D=x.useCallback(z=>{z.stopPropagation(),C.current===z.target&&Ef.isTopModal(h.current)&&(i&&(n==null||n()),u==null||u())},[n,i,u]),_=x.useCallback((z={},V=null)=>({...z,ref:ct(V,p),onClick:Pe(z.onClick,D),onKeyDown:Pe(z.onKeyDown,k),onMouseDown:Pe(z.onMouseDown,w)}),[k,w,D]);return{isOpen:t,onClose:n,headerId:y,bodyId:S,setBodyMounted:I,setHeaderMounted:M,dialogRef:h,overlayRef:p,getDialogProps:T,getDialogContainerProps:_}}function Rj(e,t){const n=e.current;x.useEffect(()=>{if(!(!e.current||!t))return Aj(e.current)},[t,e,n])}function Nj(e,...t){const n=x.useId(),r=e||n;return x.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[Fj,la]=Et({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[Lj,Ki]=Et({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),di=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:i,trapFocus:s,initialFocusRef:c,finalFocusRef:u,returnFocusOnClose:f,blockScrollOnMount:h,allowPinchZoom:p,preserveScrollBarGap:g,motionPreset:y,lockFocusAcrossFrames:S,onCloseComplete:C}=t,w=fn("Modal",t),j={...zj(t),autoFocus:i,trapFocus:s,initialFocusRef:c,finalFocusRef:u,returnFocusOnClose:f,blockScrollOnMount:h,allowPinchZoom:p,preserveScrollBarGap:g,motionPreset:y,lockFocusAcrossFrames:S};return l.jsx(Lj,{value:j,children:l.jsx(Fj,{value:w,children:l.jsx(ia,{onExitComplete:C,children:j.isOpen&&l.jsx(eh,{...n,children:r})})})})};di.displayName="Modal";var ql="right-scroll-bar-position",Yl="width-before-scroll-bar",Bj="with-scroll-bars-hidden",Hj="--removed-body-scroll-bar-size",Vx=N2(),jd=function(){},Ic=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:jd,onWheelCapture:jd,onTouchMoveCapture:jd}),i=r[0],s=r[1],c=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,g=e.shards,y=e.sideCar,S=e.noIsolation,C=e.inert,w=e.allowPinchZoom,k=e.as,j=k===void 0?"div":k,M=A2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),P=y,I=O2([n,t]),T=vr(vr({},M),i);return x.createElement(x.Fragment,null,p&&x.createElement(P,{sideCar:Vx,removeScrollBar:h,shards:g,noIsolation:S,inert:C,setCallbacks:s,allowPinchZoom:!!w,lockRef:n}),c?x.cloneElement(x.Children.only(u),vr(vr({},T),{ref:I})):x.createElement(j,vr({},T,{className:f,ref:I}),u))});Ic.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ic.classNames={fullWidth:Yl,zeroRight:ql};var Og,Wj=function(){if(Og)return Og;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vj(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Wj();return t&&e.setAttribute("nonce",t),e}function Uj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $j(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Gj=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vj())&&(Uj(t,n),$j(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qj=function(){var e=Gj();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ux=function(){var e=qj(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Yj={left:0,top:0,right:0,gap:0},Ed=function(e){return parseInt(e||"",10)||0},Xj=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Ed(n),Ed(r),Ed(i)]},Kj=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Yj;var t=Xj(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])}},Qj=Ux(),Zj=function(e,t,n,r){var i=e.left,s=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(Bj,` {
|
||
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(i,`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(ql,` {
|
||
right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Yl,` {
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(ql," .").concat(ql,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(Yl," .").concat(Yl,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body {
|
||
`).concat(Hj,": ").concat(u,`px;
|
||
}
|
||
`)},Jj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,s=x.useMemo(function(){return Kj(i)},[i]);return x.createElement(Qj,{styles:Zj(s,!t,i,n?"":"!important")})},Pf=!1;if(typeof window<"u")try{var El=Object.defineProperty({},"passive",{get:function(){return Pf=!0,!0}});window.addEventListener("test",El,El),window.removeEventListener("test",El,El)}catch{Pf=!1}var Io=Pf?{passive:!1}:!1,eE=function(e){return e.tagName==="TEXTAREA"},$x=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!eE(e)&&n[t]==="visible")},tE=function(e){return $x(e,"overflowY")},nE=function(e){return $x(e,"overflowX")},Ag=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Gx(e,n);if(r){var i=qx(e,n),s=i[1],c=i[2];if(s>c)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},rE=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},iE=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Gx=function(e,t){return e==="v"?tE(t):nE(t)},qx=function(e,t){return e==="v"?rE(t):iE(t)},oE=function(e,t){return e==="h"&&t==="rtl"?-1:1},aE=function(e,t,n,r,i){var s=oE(e,window.getComputedStyle(t).direction),c=s*r,u=n.target,f=t.contains(u),h=!1,p=c>0,g=0,y=0;do{var S=qx(e,u),C=S[0],w=S[1],k=S[2],j=w-k-s*C;(C||j)&&Gx(e,u)&&(g+=j,y+=C),u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&(i&&g===0||!i&&c>g)||!p&&(i&&y===0||!i&&-c>y))&&(h=!0),h},Pl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zg=function(e){return[e.deltaX,e.deltaY]},Rg=function(e){return e&&"current"in e?e.current:e},sE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lE=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},cE=0,Mo=[];function uE(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(cE++)[0],s=x.useState(function(){return Ux()})[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=xf([e.lockRef.current],(e.shards||[]).map(Rg),!0).filter(Boolean);return w.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(w,k){if("touches"in w&&w.touches.length===2)return!c.current.allowPinchZoom;var j=Pl(w),M=n.current,P="deltaX"in w?w.deltaX:M[0]-j[0],I="deltaY"in w?w.deltaY:M[1]-j[1],T,D=w.target,_=Math.abs(P)>Math.abs(I)?"h":"v";if("touches"in w&&_==="h"&&D.type==="range")return!1;var z=Ag(_,D);if(!z)return!0;if(z?T=_:(T=_==="v"?"h":"v",z=Ag(_,D)),!z)return!1;if(!r.current&&"changedTouches"in w&&(P||I)&&(r.current=T),!T)return!0;var V=r.current||T;return aE(V,k,w,V==="h"?P:I,!0)},[]),f=x.useCallback(function(w){var k=w;if(!(!Mo.length||Mo[Mo.length-1]!==s)){var j="deltaY"in k?zg(k):Pl(k),M=t.current.filter(function(T){return T.name===k.type&&T.target===k.target&&sE(T.delta,j)})[0];if(M&&M.should){k.cancelable&&k.preventDefault();return}if(!M){var P=(c.current.shards||[]).map(Rg).filter(Boolean).filter(function(T){return T.contains(k.target)}),I=P.length>0?u(k,P[0]):!c.current.noIsolation;I&&k.cancelable&&k.preventDefault()}}},[]),h=x.useCallback(function(w,k,j,M){var P={name:w,delta:k,target:j,should:M};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(I){return I!==P})},1)},[]),p=x.useCallback(function(w){n.current=Pl(w),r.current=void 0},[]),g=x.useCallback(function(w){h(w.type,zg(w),w.target,u(w,e.lockRef.current))},[]),y=x.useCallback(function(w){h(w.type,Pl(w),w.target,u(w,e.lockRef.current))},[]);x.useEffect(function(){return Mo.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Io),document.addEventListener("touchmove",f,Io),document.addEventListener("touchstart",p,Io),function(){Mo=Mo.filter(function(w){return w!==s}),document.removeEventListener("wheel",f,Io),document.removeEventListener("touchmove",f,Io),document.removeEventListener("touchstart",p,Io)}},[]);var S=e.removeScrollBar,C=e.inert;return x.createElement(x.Fragment,null,C?x.createElement(s,{styles:lE(i)}):null,S?x.createElement(Jj,{gapMode:"margin"}):null)}const dE=h5(Vx,uE);var Yx=x.forwardRef(function(e,t){return x.createElement(Ic,vr({},e,{ref:t,sideCar:dE}))});Yx.classNames=Ic.classNames;const fE=Yx;function hE(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:s,allowPinchZoom:c,finalFocusRef:u,returnFocusOnClose:f,preserveScrollBarGap:h,lockFocusAcrossFrames:p,isOpen:g}=Ki(),[y,S]=C3();x.useEffect(()=>{!y&&S&&setTimeout(S)},[y,S]);const C=Hx(r,g);return l.jsx(mx,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:u,restoreFocus:f,contentRef:r,lockFocusAcrossFrames:p,children:l.jsx(fE,{removeScrollBar:!h,allowPinchZoom:c,enabled:C===1&&s,forwardProps:!0,children:e.children})})}var fi=he((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:s,...c}=e,{getDialogProps:u,getDialogContainerProps:f}=Ki(),h=u(c,t),p=f(i),g=Ae("chakra-modal__content",n),y=la(),S={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...y.dialog},C={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...y.dialogContainer},{motionPreset:w}=Ki();return l.jsx(hE,{children:l.jsx(re.div,{...p,className:"chakra-modal__content-container",tabIndex:-1,__css:C,children:l.jsx(Bx,{preset:w,motionProps:s,className:g,...h,__css:S,children:r})})})});fi.displayName="ModalContent";function Xx(e){const{leastDestructiveRef:t,...n}=e;return l.jsx(di,{...n,initialFocusRef:t})}var Kx=he((e,t)=>l.jsx(fi,{ref:t,role:"alertdialog",...e})),zr=he((e,t)=>{const{className:n,...r}=e,i=Ae("chakra-modal__footer",n),c={display:"flex",alignItems:"center",justifyContent:"flex-end",...la().footer};return l.jsx(re.footer,{ref:t,...r,__css:c,className:i})});zr.displayName="ModalFooter";var Rr=he((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:s}=Ki();x.useEffect(()=>(s(!0),()=>s(!1)),[s]);const c=Ae("chakra-modal__header",n),f={flex:0,...la().header};return l.jsx(re.header,{ref:t,className:c,id:i,...r,__css:f})});Rr.displayName="ModalHeader";var pE=re(Wr.div),Nr=he((e,t)=>{const{className:n,transition:r,motionProps:i,...s}=e,c=Ae("chakra-modal__overlay",n),f={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...la().overlay},{motionPreset:h}=Ki(),g=i||(h==="none"?{}:b2);return l.jsx(pE,{...g,__css:f,ref:t,className:c,...s})});Nr.displayName="ModalOverlay";var Fr=he((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:s}=Ki();x.useEffect(()=>(s(!0),()=>s(!1)),[s]);const c=Ae("chakra-modal__body",n),u=la();return l.jsx(re.div,{ref:t,className:c,id:i,...r,__css:u.body})});Fr.displayName="ModalBody";var ca=he((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:s}=Ki(),c=Ae("chakra-modal__close-btn",r),u=la();return l.jsx(w3,{ref:t,__css:u.closeButton,className:c,onClick:Pe(n,f=>{f.stopPropagation(),s()}),...i})});ca.displayName="ModalCloseButton";var mE=e=>l.jsx(Jt,{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"})}),vE=e=>l.jsx(Jt,{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 Ng(e,t,n,r){x.useEffect(()=>{var i;if(!e.current||!r)return;const s=(i=e.current.ownerDocument.defaultView)!=null?i:window,c=Array.isArray(t)?t:[t],u=new s.MutationObserver(f=>{for(const h of f)h.type==="attributes"&&h.attributeName&&c.includes(h.attributeName)&&n(h)});return u.observe(e.current,{attributes:!0,attributeFilter:c}),()=>u.disconnect()})}function gE(e,t){const n=Ut(e);x.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var xE=50,Fg=300;function yE(e,t){const[n,r]=x.useState(!1),[i,s]=x.useState(null),[c,u]=x.useState(!0),f=x.useRef(null),h=()=>clearTimeout(f.current);gE(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?xE:null);const p=x.useCallback(()=>{c&&e(),f.current=setTimeout(()=>{u(!1),r(!0),s("increment")},Fg)},[e,c]),g=x.useCallback(()=>{c&&t(),f.current=setTimeout(()=>{u(!1),r(!0),s("decrement")},Fg)},[t,c]),y=x.useCallback(()=>{u(!0),r(!1),h()},[]);return x.useEffect(()=>()=>h(),[]),{up:p,down:g,stop:y,isSpinning:n}}var bE=/^[Ee0-9+\-.]$/;function SE(e){return bE.test(e)}function CE(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 wE(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:c=1,isReadOnly:u,isDisabled:f,isRequired:h,isInvalid:p,pattern:g="[0-9]*(.[0-9]+)?",inputMode:y="decimal",allowMouseWheel:S,id:C,onChange:w,precision:k,name:j,"aria-describedby":M,"aria-label":P,"aria-labelledby":I,onFocus:T,onBlur:D,onInvalid:_,getAriaValueText:z,isValidCharacter:V,format:F,parse:L,...X}=e,$=Ut(T),Q=Ut(D),ie=Ut(_),oe=Ut(V??SE),U=Ut(z),K=Xw(e),{update:ne,increment:ce,decrement:Re}=K,[ze,Me]=x.useState(!1),J=!(u||f),ue=x.useRef(null),Ie=x.useRef(null),Be=x.useRef(null),Ne=x.useRef(null),Ge=x.useCallback(ee=>ee.split("").filter(oe).join(""),[oe]),Qe=x.useCallback(ee=>{var He;return(He=L==null?void 0:L(ee))!=null?He:ee},[L]),ve=x.useCallback(ee=>{var He;return((He=F==null?void 0:F(ee))!=null?He:ee).toString()},[F]);eo(()=>{(K.valueAsNumber>s||K.valueAsNumber<i)&&(ie==null||ie("rangeOverflow",ve(K.value),K.valueAsNumber))},[K.valueAsNumber,K.value,ve,ie]),Uo(()=>{if(!ue.current)return;if(ue.current.value!=K.value){const He=Qe(ue.current.value);K.setValue(Ge(He))}},[Qe,Ge]);const _e=x.useCallback((ee=c)=>{J&&ce(ee)},[ce,J,c]),qe=x.useCallback((ee=c)=>{J&&Re(ee)},[Re,J,c]),ge=yE(_e,qe);Ng(Be,"disabled",ge.stop,ge.isSpinning),Ng(Ne,"disabled",ge.stop,ge.isSpinning);const Te=x.useCallback(ee=>{if(ee.nativeEvent.isComposing)return;const nt=Qe(ee.currentTarget.value);ne(Ge(nt)),Ie.current={start:ee.currentTarget.selectionStart,end:ee.currentTarget.selectionEnd}},[ne,Ge,Qe]),et=x.useCallback(ee=>{var He,nt,Ft;$==null||$(ee),Ie.current&&(ee.target.selectionStart=(nt=Ie.current.start)!=null?nt:(He=ee.currentTarget.value)==null?void 0:He.length,ee.currentTarget.selectionEnd=(Ft=Ie.current.end)!=null?Ft:ee.currentTarget.selectionStart)},[$]),Ve=x.useCallback(ee=>{if(ee.nativeEvent.isComposing)return;CE(ee,oe)||ee.preventDefault();const He=vt(ee)*c,nt=ee.key,pe={ArrowUp:()=>_e(He),ArrowDown:()=>qe(He),Home:()=>ne(i),End:()=>ne(s)}[nt];pe&&(ee.preventDefault(),pe(ee))},[oe,c,_e,qe,ne,i,s]),vt=ee=>{let He=1;return(ee.metaKey||ee.ctrlKey)&&(He=.1),ee.shiftKey&&(He=10),He},Nt=x.useMemo(()=>{const ee=U==null?void 0:U(K.value);if(ee!=null)return ee;const He=K.value.toString();return He||void 0},[K.value,U]),N=x.useCallback(()=>{let ee=K.value;if(K.value==="")return;/^[eE]/.test(K.value.toString())?K.setValue(""):(K.valueAsNumber<i&&(ee=i),K.valueAsNumber>s&&(ee=s),K.cast(ee))},[K,s,i]),de=x.useCallback(()=>{Me(!1),n&&N()},[n,Me,N]),xe=x.useCallback(()=>{t&&requestAnimationFrame(()=>{var ee;(ee=ue.current)==null||ee.focus()})},[t]),je=x.useCallback(ee=>{ee.preventDefault(),ge.up(),xe()},[xe,ge]),q=x.useCallback(ee=>{ee.preventDefault(),ge.down(),xe()},[xe,ge]);Ui(()=>ue.current,"wheel",ee=>{var He,nt;const pe=((nt=(He=ue.current)==null?void 0:He.ownerDocument)!=null?nt:document).activeElement===ue.current;if(!S||!pe)return;ee.preventDefault();const De=vt(ee)*c,hn=Math.sign(ee.deltaY);hn===-1?_e(De):hn===1&&qe(De)},{passive:!1});const se=x.useCallback((ee={},He=null)=>{const nt=f||r&&K.isAtMax;return{...ee,ref:ct(He,Be),role:"button",tabIndex:-1,onPointerDown:Pe(ee.onPointerDown,Ft=>{Ft.button!==0||nt||je(Ft)}),onPointerLeave:Pe(ee.onPointerLeave,ge.stop),onPointerUp:Pe(ee.onPointerUp,ge.stop),disabled:nt,"aria-disabled":Dr(nt)}},[K.isAtMax,r,je,ge.stop,f]),Fe=x.useCallback((ee={},He=null)=>{const nt=f||r&&K.isAtMin;return{...ee,ref:ct(He,Ne),role:"button",tabIndex:-1,onPointerDown:Pe(ee.onPointerDown,Ft=>{Ft.button!==0||nt||q(Ft)}),onPointerLeave:Pe(ee.onPointerLeave,ge.stop),onPointerUp:Pe(ee.onPointerUp,ge.stop),disabled:nt,"aria-disabled":Dr(nt)}},[K.isAtMin,r,q,ge.stop,f]),Ze=x.useCallback((ee={},He=null)=>{var nt,Ft,pe,De;return{name:j,inputMode:y,type:"text",pattern:g,"aria-labelledby":I,"aria-label":P,"aria-describedby":M,id:C,disabled:f,...ee,readOnly:(nt=ee.readOnly)!=null?nt:u,"aria-readonly":(Ft=ee.readOnly)!=null?Ft:u,"aria-required":(pe=ee.required)!=null?pe:h,required:(De=ee.required)!=null?De:h,ref:ct(ue,He),value:ve(K.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":s,"aria-valuenow":Number.isNaN(K.valueAsNumber)?void 0:K.valueAsNumber,"aria-invalid":Dr(p??K.isOutOfRange),"aria-valuetext":Nt,autoComplete:"off",autoCorrect:"off",onChange:Pe(ee.onChange,Te),onKeyDown:Pe(ee.onKeyDown,Ve),onFocus:Pe(ee.onFocus,et,()=>Me(!0)),onBlur:Pe(ee.onBlur,Q,de)}},[j,y,g,I,P,ve,M,C,f,h,u,p,K.value,K.valueAsNumber,K.isOutOfRange,i,s,Nt,Te,Ve,et,Q,de]);return{value:ve(K.value),valueAsNumber:K.valueAsNumber,isFocused:ze,isDisabled:f,isReadOnly:u,getIncrementButtonProps:se,getDecrementButtonProps:Fe,getInputProps:Ze,htmlProps:X}}var[kE,Mc]=Et({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[jE,Lh]=Et({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Bh=he(function(t,n){const r=fn("NumberInput",t),i=At(t),s=uh(i),{htmlProps:c,...u}=wE(s),f=x.useMemo(()=>u,[u]);return l.jsx(jE,{value:f,children:l.jsx(kE,{value:r,children:l.jsx(re.div,{...c,ref:n,className:Ae("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Bh.displayName="NumberInput";var Hh=he(function(t,n){const r=Mc();return l.jsx(re.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}})});Hh.displayName="NumberInputStepper";var Wh=he(function(t,n){const{getInputProps:r}=Lh(),i=r(t,n),s=Mc();return l.jsx(re.input,{...i,className:Ae("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Wh.displayName="NumberInputField";var Qx=re("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Vh=he(function(t,n){var r;const i=Mc(),{getDecrementButtonProps:s}=Lh(),c=s(t,n);return l.jsx(Qx,{...c,__css:i.stepper,children:(r=t.children)!=null?r:l.jsx(mE,{})})});Vh.displayName="NumberDecrementStepper";var Uh=he(function(t,n){var r;const{getIncrementButtonProps:i}=Lh(),s=i(t,n),c=Mc();return l.jsx(Qx,{...s,__css:c.stepper,children:(r=t.children)!=null?r:l.jsx(vE,{})})});Uh.displayName="NumberIncrementStepper";var[EE,vs]=Et({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[PE,$h]=Et({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Gh(e){const t=x.Children.only(e.children),{getTriggerProps:n}=vs();return x.cloneElement(t,n(t.props,t.ref))}Gh.displayName="PopoverTrigger";var To={click:"click",hover:"hover"};function IE(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:s=!0,autoFocus:c=!0,arrowSize:u,arrowShadowColor:f,trigger:h=To.click,openDelay:p=200,closeDelay:g=200,isLazy:y,lazyBehavior:S="unmount",computePositionOnMount:C,...w}=e,{isOpen:k,onClose:j,onOpen:M,onToggle:P}=Ah(e),I=x.useRef(null),T=x.useRef(null),D=x.useRef(null),_=x.useRef(!1),z=x.useRef(!1);k&&(z.current=!0);const[V,F]=x.useState(!1),[L,X]=x.useState(!1),$=x.useId(),Q=i??$,[ie,oe,U,K]=["popover-trigger","popover-content","popover-header","popover-body"].map(Te=>`${Te}-${Q}`),{referenceRef:ne,getArrowProps:ce,getPopperProps:Re,getArrowInnerProps:ze,forceUpdate:Me}=Oh({...w,enabled:k||!!C}),J=Rx({isOpen:k,ref:D});n5({enabled:k,ref:T}),jx(D,{focusRef:T,visible:k,shouldFocus:s&&h===To.click}),R6(D,{focusRef:r,visible:k,shouldFocus:c&&h===To.click});const ue=zh({wasSelected:z.current,enabled:y,mode:S,isSelected:J.present}),Ie=x.useCallback((Te={},et=null)=>{const Ve={...Te,style:{...Te.style,transformOrigin:Vt.transformOrigin.varRef,[Vt.arrowSize.var]:u?`${u}px`:void 0,[Vt.arrowShadowColor.var]:f},ref:ct(D,et),children:ue?Te.children:null,id:oe,tabIndex:-1,role:"dialog",onKeyDown:Pe(Te.onKeyDown,vt=>{n&&vt.key==="Escape"&&j()}),onBlur:Pe(Te.onBlur,vt=>{const Nt=Lg(vt),N=Pd(D.current,Nt),de=Pd(T.current,Nt);k&&t&&(!N&&!de)&&j()}),"aria-labelledby":V?U:void 0,"aria-describedby":L?K:void 0};return h===To.hover&&(Ve.role="tooltip",Ve.onMouseEnter=Pe(Te.onMouseEnter,()=>{_.current=!0}),Ve.onMouseLeave=Pe(Te.onMouseLeave,vt=>{vt.nativeEvent.relatedTarget!==null&&(_.current=!1,setTimeout(()=>j(),g))})),Ve},[ue,oe,V,U,L,K,h,n,j,k,t,g,f,u]),Be=x.useCallback((Te={},et=null)=>Re({...Te,style:{visibility:k?"visible":"hidden",...Te.style}},et),[k,Re]),Ne=x.useCallback((Te,et=null)=>({...Te,ref:ct(et,I,ne)}),[I,ne]),Ge=x.useRef(),Qe=x.useRef(),ve=x.useCallback(Te=>{I.current==null&&ne(Te)},[ne]),_e=x.useCallback((Te={},et=null)=>{const Ve={...Te,ref:ct(T,et,ve),id:ie,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":oe};return h===To.click&&(Ve.onClick=Pe(Te.onClick,P)),h===To.hover&&(Ve.onFocus=Pe(Te.onFocus,()=>{Ge.current===void 0&&M()}),Ve.onBlur=Pe(Te.onBlur,vt=>{const Nt=Lg(vt),N=!Pd(D.current,Nt);k&&t&&N&&j()}),Ve.onKeyDown=Pe(Te.onKeyDown,vt=>{vt.key==="Escape"&&j()}),Ve.onMouseEnter=Pe(Te.onMouseEnter,()=>{_.current=!0,Ge.current=window.setTimeout(()=>M(),p)}),Ve.onMouseLeave=Pe(Te.onMouseLeave,()=>{_.current=!1,Ge.current&&(clearTimeout(Ge.current),Ge.current=void 0),Qe.current=window.setTimeout(()=>{_.current===!1&&j()},g)})),Ve},[ie,k,oe,h,ve,P,M,t,j,p,g]);x.useEffect(()=>()=>{Ge.current&&clearTimeout(Ge.current),Qe.current&&clearTimeout(Qe.current)},[]);const qe=x.useCallback((Te={},et=null)=>({...Te,id:U,ref:ct(et,Ve=>{F(!!Ve)})}),[U]),ge=x.useCallback((Te={},et=null)=>({...Te,id:K,ref:ct(et,Ve=>{X(!!Ve)})}),[K]);return{forceUpdate:Me,isOpen:k,onAnimationComplete:J.onComplete,onClose:j,getAnchorProps:Ne,getArrowProps:ce,getArrowInnerProps:ze,getPopoverPositionerProps:Be,getPopoverProps:Ie,getTriggerProps:_e,getHeaderProps:qe,getBodyProps:ge}}function Pd(e,t){return e===t||(e==null?void 0:e.contains(t))}function Lg(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function qh(e){const t=fn("Popover",e),{children:n,...r}=At(e),i=Ji(),s=IE({...r,direction:i.direction});return l.jsx(EE,{value:s,children:l.jsx(PE,{value:t,children:j1(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}qh.displayName="Popover";function Yh(e){var t;const{bg:n,bgColor:r,backgroundColor:i,shadow:s,boxShadow:c}=e,{getArrowProps:u,getArrowInnerProps:f}=vs(),h=$h(),p=(t=n??r)!=null?t:i,g=s??c;return l.jsx(re.div,{...u(),className:"chakra-popover__arrow-positioner",children:l.jsx(re.div,{className:Ae("chakra-popover__arrow",e.className),...f(e),__css:{"--popper-arrow-bg":p?`colors.${p}, ${p}`:void 0,"--popper-arrow-shadow":g?`shadows.${g}, ${g}`:void 0,...h.arrow}})})}Yh.displayName="PopoverArrow";var Zx=he(function(t,n){const{getBodyProps:r}=vs(),i=$h();return l.jsx(re.div,{...r(t,n),className:Ae("chakra-popover__body",t.className),__css:i.body})});Zx.displayName="PopoverBody";function ME(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var TE={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]}}},_E=re(Wr.section),Jx=he(function(t,n){const{variants:r=TE,...i}=t,{isOpen:s}=vs();return l.jsx(_E,{ref:n,variants:ME(r),initial:!1,animate:s?"enter":"exit",...i})});Jx.displayName="PopoverTransition";var Xh=he(function(t,n){const{rootProps:r,motionProps:i,...s}=t,{getPopoverProps:c,getPopoverPositionerProps:u,onAnimationComplete:f}=vs(),h=$h(),p={position:"relative",display:"flex",flexDirection:"column",...h.content};return l.jsx(re.div,{...u(r),__css:h.popper,className:"chakra-popover__popper",children:l.jsx(Jx,{...i,...c(s,n),onAnimationComplete:yc(f,s.onAnimationComplete),className:Ae("chakra-popover__content",t.className),__css:p})})});Xh.displayName="PopoverContent";function DE(e,t,n){return(e-t)*100/(n-t)}Zi({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});Zi({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var OE=Zi({"0%":{left:"-40%"},"100%":{left:"100%"}}),AE=Zi({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function zE(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:s,isIndeterminate:c,role:u="progressbar"}=e,f=DE(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):i})(),role:u},percent:f,value:t}}var[RE,NE]=Et({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),FE=he((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:s,role:c,...u}=e,f=zE({value:i,min:n,max:r,isIndeterminate:s,role:c}),p={height:"100%",...NE().filledTrack};return l.jsx(re.div,{ref:t,style:{width:`${f.percent}%`,...u.style},...f.bind,...u,__css:p})}),ey=he((e,t)=>{var n;const{value:r,min:i=0,max:s=100,hasStripe:c,isAnimated:u,children:f,borderRadius:h,isIndeterminate:p,"aria-label":g,"aria-labelledby":y,"aria-valuetext":S,title:C,role:w,...k}=At(e),j=fn("Progress",e),M=h??((n=j.track)==null?void 0:n.borderRadius),P={animation:`${AE} 1s linear infinite`},D={...!p&&c&&u&&P,...p&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${OE} 1s ease infinite normal none running`}},_={overflow:"hidden",position:"relative",...j.track};return l.jsx(re.div,{ref:t,borderRadius:M,__css:_,...k,children:l.jsxs(RE,{value:j,children:[l.jsx(FE,{"aria-label":g,"aria-labelledby":y,"aria-valuetext":S,min:i,max:s,value:r,isIndeterminate:p,css:D,borderRadius:M,title:C,role:w}),f]})})});ey.displayName="Progress";function LE(e){return e&&Kd(e)&&Kd(e.target)}function BE(e={}){const{onChange:t,value:n,defaultValue:r,name:i,isDisabled:s,isFocusable:c,isNative:u,...f}=e,[h,p]=x.useState(r||""),g=typeof n<"u",y=g?n:h,S=x.useRef(null),C=x.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 z=T.querySelector(D);z==null||z.focus()},[]),k=`radio-${x.useId()}`,j=i||k,M=x.useCallback(T=>{const D=LE(T)?T.target.value:T;g||p(D),t==null||t(String(D))},[t,g]),P=x.useCallback((T={},D=null)=>({...T,ref:ct(D,S),role:"radiogroup"}),[]),I=x.useCallback((T={},D=null)=>({...T,ref:D,name:j,[u?"checked":"isChecked"]:y!=null?T.value===y:void 0,onChange(z){M(z)},"data-radiogroup":!0}),[u,j,M,y]);return{getRootProps:P,getRadioProps:I,name:j,ref:S,focus:C,setValue:p,value:y,onChange:M,isDisabled:s,isFocusable:c,htmlProps:f}}var[HE,ty]=Et({name:"RadioGroupContext",strict:!1}),Ja=he((e,t)=>{const{colorScheme:n,size:r,variant:i,children:s,className:c,isDisabled:u,isFocusable:f,...h}=e,{value:p,onChange:g,getRootProps:y,name:S,htmlProps:C}=BE(h),w=x.useMemo(()=>({name:S,size:r,onChange:g,colorScheme:n,value:p,variant:i,isDisabled:u,isFocusable:f}),[S,r,g,n,p,i,u,f]);return l.jsx(HE,{value:w,children:l.jsx(re.div,{...y(C,t),className:Ae("chakra-radio-group",c),children:s})})});Ja.displayName="RadioGroup";var WE={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function VE(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:i,isReadOnly:s,isRequired:c,onChange:u,isInvalid:f,name:h,value:p,id:g,"data-radiogroup":y,"aria-describedby":S,...C}=e,w=`radio-${x.useId()}`,k=no(),M=!!ty()||!!y;let I=!!k&&!M?k.id:w;I=g??I;const T=i??(k==null?void 0:k.isDisabled),D=s??(k==null?void 0:k.isReadOnly),_=c??(k==null?void 0:k.isRequired),z=f??(k==null?void 0:k.isInvalid),[V,F]=x.useState(!1),[L,X]=x.useState(!1),[$,Q]=x.useState(!1),[ie,oe]=x.useState(!1),[U,K]=x.useState(Boolean(t)),ne=typeof n<"u",ce=ne?n:U;x.useEffect(()=>j2(F),[]);const Re=x.useCallback(ve=>{if(D||T){ve.preventDefault();return}ne||K(ve.target.checked),u==null||u(ve)},[ne,T,D,u]),ze=x.useCallback(ve=>{ve.key===" "&&oe(!0)},[oe]),Me=x.useCallback(ve=>{ve.key===" "&&oe(!1)},[oe]),J=x.useCallback((ve={},_e=null)=>({...ve,ref:_e,"data-active":Ye(ie),"data-hover":Ye($),"data-disabled":Ye(T),"data-invalid":Ye(z),"data-checked":Ye(ce),"data-focus":Ye(L),"data-focus-visible":Ye(L&&V),"data-readonly":Ye(D),"aria-hidden":!0,onMouseDown:Pe(ve.onMouseDown,()=>oe(!0)),onMouseUp:Pe(ve.onMouseUp,()=>oe(!1)),onMouseEnter:Pe(ve.onMouseEnter,()=>Q(!0)),onMouseLeave:Pe(ve.onMouseLeave,()=>Q(!1))}),[ie,$,T,z,ce,L,D,V]),{onFocus:ue,onBlur:Ie}=k??{},Be=x.useCallback((ve={},_e=null)=>{const qe=T&&!r;return{...ve,id:I,ref:_e,type:"radio",name:h,value:p,onChange:Pe(ve.onChange,Re),onBlur:Pe(Ie,ve.onBlur,()=>X(!1)),onFocus:Pe(ue,ve.onFocus,()=>X(!0)),onKeyDown:Pe(ve.onKeyDown,ze),onKeyUp:Pe(ve.onKeyUp,Me),checked:ce,disabled:qe,readOnly:D,required:_,"aria-invalid":Dr(z),"aria-disabled":Dr(qe),"aria-required":Dr(_),"data-readonly":Ye(D),"aria-describedby":S,style:WE}},[T,r,I,h,p,Re,Ie,ue,ze,Me,ce,D,_,z,S]);return{state:{isInvalid:z,isFocused:L,isChecked:ce,isActive:ie,isHovered:$,isDisabled:T,isReadOnly:D,isRequired:_},getCheckboxProps:J,getInputProps:Be,getLabelProps:(ve={},_e=null)=>({...ve,ref:_e,onMouseDown:Pe(ve.onMouseDown,Bg),onTouchStart:Pe(ve.onTouchStart,Bg),"data-disabled":Ye(T),"data-checked":Ye(ce),"data-invalid":Ye(z)}),getRootProps:(ve,_e=null)=>({...ve,ref:_e,"data-disabled":Ye(T),"data-checked":Ye(ce),"data-invalid":Ye(z)}),htmlProps:C}}function Bg(e){e.preventDefault(),e.stopPropagation()}function UE(e,t){const n={},r={};for(const[i,s]of Object.entries(e))t.includes(i)?n[i]=s:r[i]=s;return[n,r]}var vn=he((e,t)=>{var n;const r=ty(),{onChange:i,value:s}=e,c=fn("Radio",{...r,...e}),u=At(e),{spacing:f="0.5rem",children:h,isDisabled:p=r==null?void 0:r.isDisabled,isFocusable:g=r==null?void 0:r.isFocusable,inputProps:y,...S}=u;let C=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(C=r.value===s);let w=i;r!=null&&r.onChange&&s!=null&&(w=yc(r.onChange,i));const k=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:j,getCheckboxProps:M,getLabelProps:P,getRootProps:I,htmlProps:T}=VE({...S,isChecked:C,isFocusable:g,isDisabled:p,onChange:w,name:k}),[D,_]=UE(T,E1),z=M(_),V=j(y,t),F=P(),L=Object.assign({},D,I()),X={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...c.container},$={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...c.control},Q={userSelect:"none",marginStart:f,...c.label};return l.jsxs(re.label,{className:"chakra-radio",...L,__css:X,children:[l.jsx("input",{className:"chakra-radio__input",...V}),l.jsx(re.span,{className:"chakra-radio__control",...z,__css:$}),h&&l.jsx(re.span,{className:"chakra-radio__label",...F,__css:Q,children:h})]})});vn.displayName="Radio";var ny=he(function(t,n){const{children:r,placeholder:i,className:s,...c}=t;return l.jsxs(re.select,{...c,ref:n,className:Ae("chakra-select",s),children:[i&&l.jsx("option",{value:"",children:i}),r]})});ny.displayName="SelectField";function $E(e,t){const n={},r={};for(const[i,s]of Object.entries(e))t.includes(i)?n[i]=s:r[i]=s;return[n,r]}var ry=he((e,t)=>{var n;const r=fn("Select",e),{rootProps:i,placeholder:s,icon:c,color:u,height:f,h,minH:p,minHeight:g,iconColor:y,iconSize:S,...C}=At(e),[w,k]=$E(C,E1),j=ch(k),M={width:"100%",height:"fit-content",position:"relative",color:u},P={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return l.jsxs(re.div,{className:"chakra-select__wrapper",__css:M,...w,...i,children:[l.jsx(ny,{ref:t,height:h??f,minH:p??g,placeholder:s,...j,__css:P,children:e.children}),l.jsx(iy,{"data-disabled":Ye(j.disabled),...(y||u)&&{color:y||u},__css:r.icon,...S&&{fontSize:S},children:c})]})});ry.displayName="Select";var GE=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"})}),qE=re("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),iy=e=>{const{children:t=l.jsx(GE,{}),...n}=e,r=x.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return l.jsx(qE,{...n,className:"chakra-select__icon-wrapper",children:x.isValidElement(t)?r:null})};iy.displayName="SelectIcon";var _o=e=>e?"":void 0,Id=e=>e?!0:void 0,gs=(...e)=>e.filter(Boolean).join(" ");function Md(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Il(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var Xl={width:0,height:0},Ml=e=>e||Xl;function YE(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,s=w=>{var k;const j=(k=r[w])!=null?k:Xl;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Il({orientation:t,vertical:{bottom:`calc(${n[w]}% - ${j.height/2}px)`},horizontal:{left:`calc(${n[w]}% - ${j.width/2}px)`}})}},c=t==="vertical"?r.reduce((w,k)=>Ml(w).height>Ml(k).height?w:k,Xl):r.reduce((w,k)=>Ml(w).width>Ml(k).width?w:k,Xl),u={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Il({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",...Il({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},h=n.length===1,p=[0,i?100-n[0]:n[0]],g=h?p:n;let y=g[0];!h&&i&&(y=100-y);const S=Math.abs(g[g.length-1]-g[0]),C={...f,...Il({orientation:t,vertical:i?{height:`${S}%`,top:`${y}%`}:{height:`${S}%`,bottom:`${y}%`},horizontal:i?{width:`${S}%`,right:`${y}%`}:{width:`${S}%`,left:`${y}%`}})};return{trackStyle:f,innerTrackStyle:C,rootStyle:u,getThumbStyle:s}}function XE(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function KE(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function QE(e){const t=JE(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function oy(e){return!!e.touches}function ZE(e){return oy(e)&&e.touches.length>1}function JE(e){var t;return(t=e.view)!=null?t:window}function e7(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function t7(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function ay(e,t="page"){return oy(e)?e7(e,t):t7(e,t)}function n7(e){return t=>{const n=QE(t);(!n||n&&t.button===0)&&e(t)}}function r7(e,t=!1){function n(i){e(i,{point:ay(i)})}return t?n7(n):n}function Kl(e,t,n,r){return KE(e,t,r7(n,t==="pointerdown"),r)}var i7=Object.defineProperty,o7=(e,t,n)=>t in e?i7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tr=(e,t,n)=>(o7(e,typeof t!="symbol"?t+"":t,n),n),a7=class{constructor(e,t,n){tr(this,"history",[]),tr(this,"startEvent",null),tr(this,"lastEvent",null),tr(this,"lastEventInfo",null),tr(this,"handlers",{}),tr(this,"removeListeners",()=>{}),tr(this,"threshold",3),tr(this,"win"),tr(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const u=Td(this.lastEventInfo,this.history),f=this.startEvent!==null,h=u7(u.offset,{x:0,y:0})>=this.threshold;if(!f&&!h)return;const{timestamp:p}=eg();this.history.push({...u.point,timestamp:p});const{onStart:g,onMove:y}=this.handlers;f||(g==null||g(this.lastEvent,u),this.startEvent=this.lastEvent),y==null||y(this.lastEvent,u)}),tr(this,"onPointerMove",(u,f)=>{this.lastEvent=u,this.lastEventInfo=f,R3.update(this.updatePoint,!0)}),tr(this,"onPointerUp",(u,f)=>{const h=Td(f,this.history),{onEnd:p,onSessionEnd:g}=this.handlers;g==null||g(u,h),this.end(),!(!p||!this.startEvent)&&(p==null||p(u,h))});var r;if(this.win=(r=e.view)!=null?r:window,ZE(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const i={point:ay(e)},{timestamp:s}=eg();this.history=[{...i.point,timestamp:s}];const{onSessionStart:c}=t;c==null||c(e,Td(i,this.history)),this.removeListeners=c7(Kl(this.win,"pointermove",this.onPointerMove),Kl(this.win,"pointerup",this.onPointerUp),Kl(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),N3.update(this.updatePoint)}};function Hg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Td(e,t){return{point:e.point,delta:Hg(e.point,t[t.length-1]),offset:Hg(e.point,t[0]),velocity:l7(t,.1)}}var s7=e=>e*1e3;function l7(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>s7(t)));)n--;if(!r)return{x:0,y:0};const s=(i.timestamp-r.timestamp)/1e3;if(s===0)return{x:0,y:0};const c={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function c7(...e){return t=>e.reduce((n,r)=>r(n),t)}function _d(e,t){return Math.abs(e-t)}function Wg(e){return"x"in e&&"y"in e}function u7(e,t){if(typeof e=="number"&&typeof t=="number")return _d(e,t);if(Wg(e)&&Wg(t)){const n=_d(e.x,t.x),r=_d(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function sy(e){const t=x.useRef(null);return t.current=e,t}function d7(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:s,onPanSessionEnd:c,threshold:u}=t,f=Boolean(n||r||i||s||c),h=x.useRef(null),p=sy({onSessionStart:s,onSessionEnd:c,onStart:r,onMove:n,onEnd(g,y){h.current=null,i==null||i(g,y)}});x.useEffect(()=>{var g;(g=h.current)==null||g.updateHandlers(p.current)}),x.useEffect(()=>{const g=e.current;if(!g||!f)return;function y(S){h.current=new a7(S,p.current,u)}return Kl(g,"pointerdown",y)},[e,f,p,u]),x.useEffect(()=>()=>{var g;(g=h.current)==null||g.end(),h.current=null},[])}function f7(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,i=new r.ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const[c]=s;let u,f;if("borderBoxSize"in c){const h=c.borderBoxSize,p=Array.isArray(h)?h[0]:h;u=p.inlineSize,f=p.blockSize}else u=e.offsetWidth,f=e.offsetHeight;t({width:u,height:f})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}var h7=Boolean(globalThis==null?void 0:globalThis.document)?x.useLayoutEffect:x.useEffect;function p7(e,t){var n,r;if(!e||!e.parentElement)return;const i=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window,s=new i.MutationObserver(()=>{t()});return s.observe(e.parentElement,{childList:!0}),()=>{s.disconnect()}}function m7({getNodes:e,observeMutation:t=!0}){const[n,r]=x.useState([]),[i,s]=x.useState(0);return h7(()=>{const c=e(),u=c.map((f,h)=>f7(f,p=>{r(g=>[...g.slice(0,h),p,...g.slice(h+1)])}));if(t){const f=c[0];u.push(p7(f,()=>{s(h=>h+1)}))}return()=>{u.forEach(f=>{f==null||f()})}},[i]),n}function v7(e){return typeof e=="object"&&e!==null&&"current"in e}function g7(e){const[t]=m7({observeMutation:!1,getNodes(){return[v7(e)?e.current:e]}});return t}function x7(e){var t;const{min:n=0,max:r=100,onChange:i,value:s,defaultValue:c,isReversed:u,direction:f="ltr",orientation:h="horizontal",id:p,isDisabled:g,isReadOnly:y,onChangeStart:S,onChangeEnd:C,step:w=1,getAriaValueText:k,"aria-valuetext":j,"aria-label":M,"aria-labelledby":P,name:I,focusThumbOnChange:T=!0,...D}=e,_=Ut(S),z=Ut(C),V=Ut(k),F=XE({isReversed:u,direction:f,orientation:h}),[L,X]=oh({value:s,defaultValue:c??b7(n,r),onChange:i}),[$,Q]=x.useState(!1),[ie,oe]=x.useState(!1),U=!(g||y),K=(r-n)/10,ne=w||(r-n)/100,ce=$l(L,n,r),Re=r-ce+n,Me=ug(F?Re:ce,n,r),J=h==="vertical",ue=sy({min:n,max:r,step:w,isDisabled:g,value:ce,isInteractive:U,isReversed:F,isVertical:J,eventSource:null,focusThumbOnChange:T,orientation:h}),Ie=x.useRef(null),Be=x.useRef(null),Ne=x.useRef(null),Ge=x.useId(),Qe=p??Ge,[ve,_e]=[`slider-thumb-${Qe}`,`slider-track-${Qe}`],qe=x.useCallback(pe=>{var De,hn;if(!Ie.current)return;const $t=ue.current;$t.eventSource="pointer";const pn=Ie.current.getBoundingClientRect(),{clientX:ir,clientY:yi}=(hn=(De=pe.touches)==null?void 0:De[0])!=null?hn:pe,da=J?pn.bottom-yi:ir-pn.left,Kc=J?pn.height:pn.width;let fa=da/Kc;F&&(fa=1-fa);let bi=Yw(fa,$t.min,$t.max);return $t.step&&(bi=parseFloat(dg(bi,$t.min,$t.step))),bi=$l(bi,$t.min,$t.max),bi},[J,F,ue]),ge=x.useCallback(pe=>{const De=ue.current;De.isInteractive&&(pe=parseFloat(dg(pe,De.min,ne)),pe=$l(pe,De.min,De.max),X(pe))},[ne,X,ue]),Te=x.useMemo(()=>({stepUp(pe=ne){const De=F?ce-pe:ce+pe;ge(De)},stepDown(pe=ne){const De=F?ce+pe:ce-pe;ge(De)},reset(){ge(c||0)},stepTo(pe){ge(pe)}}),[ge,F,ce,ne,c]),et=x.useCallback(pe=>{const De=ue.current,$t={ArrowRight:()=>Te.stepUp(),ArrowUp:()=>Te.stepUp(),ArrowLeft:()=>Te.stepDown(),ArrowDown:()=>Te.stepDown(),PageUp:()=>Te.stepUp(K),PageDown:()=>Te.stepDown(K),Home:()=>ge(De.min),End:()=>ge(De.max)}[pe.key];$t&&(pe.preventDefault(),pe.stopPropagation(),$t(pe),De.eventSource="keyboard")},[Te,ge,K,ue]),Ve=(t=V==null?void 0:V(ce))!=null?t:j,vt=g7(Be),{getThumbStyle:Nt,rootStyle:N,trackStyle:de,innerTrackStyle:xe}=x.useMemo(()=>{const pe=ue.current,De=vt??{width:0,height:0};return YE({isReversed:F,orientation:pe.orientation,thumbRects:[De],thumbPercents:[Me]})},[F,vt,Me,ue]),je=x.useCallback(()=>{ue.current.focusThumbOnChange&&setTimeout(()=>{var De;return(De=Be.current)==null?void 0:De.focus()})},[ue]);eo(()=>{const pe=ue.current;je(),pe.eventSource==="keyboard"&&(z==null||z(pe.value))},[ce,z]);function q(pe){const De=qe(pe);De!=null&&De!==ue.current.value&&X(De)}d7(Ne,{onPanSessionStart(pe){const De=ue.current;De.isInteractive&&(Q(!0),je(),q(pe),_==null||_(De.value))},onPanSessionEnd(){const pe=ue.current;pe.isInteractive&&(Q(!1),z==null||z(pe.value))},onPan(pe){ue.current.isInteractive&&q(pe)}});const se=x.useCallback((pe={},De=null)=>({...pe,...D,ref:ct(De,Ne),tabIndex:-1,"aria-disabled":Id(g),"data-focused":_o(ie),style:{...pe.style,...N}}),[D,g,ie,N]),Fe=x.useCallback((pe={},De=null)=>({...pe,ref:ct(De,Ie),id:_e,"data-disabled":_o(g),style:{...pe.style,...de}}),[g,_e,de]),Ze=x.useCallback((pe={},De=null)=>({...pe,ref:De,style:{...pe.style,...xe}}),[xe]),ee=x.useCallback((pe={},De=null)=>({...pe,ref:ct(De,Be),role:"slider",tabIndex:U?0:void 0,id:ve,"data-active":_o($),"aria-valuetext":Ve,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":ce,"aria-orientation":h,"aria-disabled":Id(g),"aria-readonly":Id(y),"aria-label":M,"aria-labelledby":M?void 0:P,style:{...pe.style,...Nt(0)},onKeyDown:Md(pe.onKeyDown,et),onFocus:Md(pe.onFocus,()=>oe(!0)),onBlur:Md(pe.onBlur,()=>oe(!1))}),[U,ve,$,Ve,n,r,ce,h,g,y,M,P,Nt,et]),He=x.useCallback((pe,De=null)=>{const hn=!(pe.value<n||pe.value>r),$t=ce>=pe.value,pn=ug(pe.value,n,r),ir={position:"absolute",pointerEvents:"none",...y7({orientation:h,vertical:{bottom:F?`${100-pn}%`:`${pn}%`},horizontal:{left:F?`${100-pn}%`:`${pn}%`}})};return{...pe,ref:De,role:"presentation","aria-hidden":!0,"data-disabled":_o(g),"data-invalid":_o(!hn),"data-highlighted":_o($t),style:{...pe.style,...ir}}},[g,F,r,n,h,ce]),nt=x.useCallback((pe={},De=null)=>({...pe,ref:De,type:"hidden",value:ce,name:I}),[I,ce]);return{state:{value:ce,isFocused:ie,isDragging:$},actions:Te,getRootProps:se,getTrackProps:Fe,getInnerTrackProps:Ze,getThumbProps:ee,getMarkerProps:He,getInputProps:nt}}function y7(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function b7(e,t){return t<e?e:e+(t-e)/2}var[S7,Tc]=Et({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[C7,_c]=Et({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),ly=he((e,t)=>{const n={orientation:"horizontal",...e},r=fn("Slider",n),i=At(n),{direction:s}=Ji();i.direction=s;const{getInputProps:c,getRootProps:u,...f}=x7(i),h=u(),p=c({},t);return l.jsx(S7,{value:f,children:l.jsx(C7,{value:r,children:l.jsxs(re.div,{...h,className:gs("chakra-slider",n.className),__css:r.container,children:[n.children,l.jsx("input",{...p})]})})})});ly.displayName="Slider";var cy=he((e,t)=>{const{getThumbProps:n}=Tc(),r=_c(),i=n(e,t);return l.jsx(re.div,{...i,className:gs("chakra-slider__thumb",e.className),__css:r.thumb})});cy.displayName="SliderThumb";var uy=he((e,t)=>{const{getTrackProps:n}=Tc(),r=_c(),i=n(e,t);return l.jsx(re.div,{...i,className:gs("chakra-slider__track",e.className),__css:r.track})});uy.displayName="SliderTrack";var dy=he((e,t)=>{const{getInnerTrackProps:n}=Tc(),r=_c(),i=n(e,t);return l.jsx(re.div,{...i,className:gs("chakra-slider__filled-track",e.className),__css:r.filledTrack})});dy.displayName="SliderFilledTrack";var If=he((e,t)=>{const{getMarkerProps:n}=Tc(),r=_c(),i=n(e,t);return l.jsx(re.div,{...i,className:gs("chakra-slider__marker",e.className),__css:r.mark})});If.displayName="SliderMark";var fy=he(function(t,n){const r=fn("Switch",t),{spacing:i="0.5rem",children:s,...c}=At(t),{state:u,getInputProps:f,getCheckboxProps:h,getRootProps:p,getLabelProps:g}=E2(c),y=x.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),S=x.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),C=x.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return l.jsxs(re.label,{...p(),className:Ae("chakra-switch",t.className),__css:y,children:[l.jsx("input",{className:"chakra-switch__input",...f({},n)}),l.jsx(re.span,{...h(),className:"chakra-switch__track",__css:S,children:l.jsx(re.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":Ye(u.isChecked),"data-hover":Ye(u.isHovered)})}),s&&l.jsx(re.span,{className:"chakra-switch__label",...g(),__css:C,children:s})]})});fy.displayName="Switch";var[w7,k7,j7,E7]=rh();function P7(e){var t;const{defaultIndex:n,onChange:r,index:i,isManual:s,isLazy:c,lazyBehavior:u="unmount",orientation:f="horizontal",direction:h="ltr",...p}=e,[g,y]=x.useState(n??0),[S,C]=oh({defaultValue:n??0,value:i,onChange:r});x.useEffect(()=>{i!=null&&y(i)},[i]);const w=j7(),k=x.useId();return{id:`tabs-${(t=e.id)!=null?t:k}`,selectedIndex:S,focusedIndex:g,setSelectedIndex:C,setFocusedIndex:y,isManual:s,isLazy:c,lazyBehavior:u,orientation:f,descendants:w,direction:h,htmlProps:p}}var[I7,Dc]=Et({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function M7(e){const{focusedIndex:t,orientation:n,direction:r}=Dc(),i=k7(),s=x.useCallback(c=>{const u=()=>{var M;const P=i.nextEnabled(t);P&&((M=P.node)==null||M.focus())},f=()=>{var M;const P=i.prevEnabled(t);P&&((M=P.node)==null||M.focus())},h=()=>{var M;const P=i.firstEnabled();P&&((M=P.node)==null||M.focus())},p=()=>{var M;const P=i.lastEnabled();P&&((M=P.node)==null||M.focus())},g=n==="horizontal",y=n==="vertical",S=c.key,C=r==="ltr"?"ArrowLeft":"ArrowRight",w=r==="ltr"?"ArrowRight":"ArrowLeft",j={[C]:()=>g&&f(),[w]:()=>g&&u(),ArrowDown:()=>y&&u(),ArrowUp:()=>y&&f(),Home:h,End:p}[S];j&&(c.preventDefault(),j(c))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Pe(e.onKeyDown,s)}}function T7(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:s,id:c,setFocusedIndex:u,selectedIndex:f}=Dc(),{index:h,register:p}=E7({disabled:t&&!n}),g=h===f,y=()=>{i(h)},S=()=>{u(h),!s&&!(t&&n)&&i(h)},C=kx({...r,ref:ct(p,e.ref),isDisabled:t,isFocusable:n,onClick:Pe(e.onClick,y)}),w="button";return{...C,id:hy(c,h),role:"tab",tabIndex:g?0:-1,type:w,"aria-selected":g,"aria-controls":py(c,h),onFocus:t?void 0:Pe(e.onFocus,S)}}var[_7,D7]=Et({});function O7(e){const t=Dc(),{id:n,selectedIndex:r}=t,s=lh(e.children).map((c,u)=>x.createElement(_7,{key:u,value:{isSelected:u===r,id:py(n,u),tabId:hy(n,u),selectedIndex:r}},c));return{...e,children:s}}function A7(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=Dc(),{isSelected:s,id:c,tabId:u}=D7(),f=x.useRef(!1);s&&(f.current=!0);const h=zh({wasSelected:f.current,isSelected:s,enabled:r,mode:i});return{tabIndex:0,...n,children:h?t:null,role:"tabpanel","aria-labelledby":u,hidden:!s,id:c}}function hy(e,t){return`${e}--tab-${t}`}function py(e,t){return`${e}--tabpanel-${t}`}var[z7,Oc]=Et({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),my=he(function(t,n){const r=fn("Tabs",t),{children:i,className:s,...c}=At(t),{htmlProps:u,descendants:f,...h}=P7(c),p=x.useMemo(()=>h,[h]),{isFitted:g,...y}=u;return l.jsx(w7,{value:f,children:l.jsx(I7,{value:p,children:l.jsx(z7,{value:r,children:l.jsx(re.div,{className:Ae("chakra-tabs",s),ref:n,...y,__css:r.root,children:i})})})})});my.displayName="Tabs";var vy=he(function(t,n){const r=M7({...t,ref:n}),s={display:"flex",...Oc().tablist};return l.jsx(re.div,{...r,className:Ae("chakra-tabs__tablist",t.className),__css:s})});vy.displayName="TabList";var gy=he(function(t,n){const r=A7({...t,ref:n}),i=Oc();return l.jsx(re.div,{outline:"0",...r,className:Ae("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});gy.displayName="TabPanel";var xy=he(function(t,n){const r=O7(t),i=Oc();return l.jsx(re.div,{...r,width:"100%",ref:n,className:Ae("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});xy.displayName="TabPanels";var yy=he(function(t,n){const r=Oc(),i=T7({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return l.jsx(re.button,{...i,className:Ae("chakra-tabs__tab",t.className),__css:s})});yy.displayName="Tab";function R7(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var N7=["h","minH","height","minHeight"],Kh=he((e,t)=>{const n=pi("Textarea",e),{className:r,rows:i,...s}=At(e),c=ch(s),u=i?R7(n,N7):n;return l.jsx(re.textarea,{ref:t,rows:i,...c,className:Ae("chakra-textarea",r),__css:u})});Kh.displayName="Textarea";var F7={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]}}}},cc=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Mf=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function L7(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:s,closeOnPointerDown:c=i,closeOnEsc:u=!0,onOpen:f,onClose:h,placement:p,id:g,isOpen:y,defaultIsOpen:S,arrowSize:C=10,arrowShadowColor:w,arrowPadding:k,modifiers:j,isDisabled:M,gutter:P,offset:I,direction:T,...D}=e,{isOpen:_,onOpen:z,onClose:V}=Ah({isOpen:y,defaultIsOpen:S,onOpen:f,onClose:h}),{referenceRef:F,getPopperProps:L,getArrowInnerProps:X,getArrowProps:$}=Oh({enabled:_,placement:p,arrowPadding:k,modifiers:j,gutter:P,offset:I,direction:T}),Q=x.useId(),oe=`tooltip-${g??Q}`,U=x.useRef(null),K=x.useRef(),ne=x.useCallback(()=>{K.current&&(clearTimeout(K.current),K.current=void 0)},[]),ce=x.useRef(),Re=x.useCallback(()=>{ce.current&&(clearTimeout(ce.current),ce.current=void 0)},[]),ze=x.useCallback(()=>{Re(),V()},[V,Re]),Me=B7(U,ze),J=x.useCallback(()=>{if(!M&&!K.current){Me();const _e=Mf(U);K.current=_e.setTimeout(z,t)}},[Me,M,z,t]),ue=x.useCallback(()=>{ne();const _e=Mf(U);ce.current=_e.setTimeout(ze,n)},[n,ze,ne]),Ie=x.useCallback(()=>{_&&r&&ue()},[r,ue,_]),Be=x.useCallback(()=>{_&&c&&ue()},[c,ue,_]),Ne=x.useCallback(_e=>{_&&_e.key==="Escape"&&ue()},[_,ue]);Ui(()=>cc(U),"keydown",u?Ne:void 0),Ui(()=>cc(U),"scroll",()=>{_&&s&&ze()}),x.useEffect(()=>{M&&(ne(),_&&V())},[M,_,V,ne]),x.useEffect(()=>()=>{ne(),Re()},[ne,Re]),Ui(()=>U.current,"pointerleave",ue);const Ge=x.useCallback((_e={},qe=null)=>({..._e,ref:ct(U,qe,F),onPointerEnter:Pe(_e.onPointerEnter,Te=>{Te.pointerType!=="touch"&&J()}),onClick:Pe(_e.onClick,Ie),onPointerDown:Pe(_e.onPointerDown,Be),onFocus:Pe(_e.onFocus,J),onBlur:Pe(_e.onBlur,ue),"aria-describedby":_?oe:void 0}),[J,ue,Be,_,oe,Ie,F]),Qe=x.useCallback((_e={},qe=null)=>L({..._e,style:{..._e.style,[Vt.arrowSize.var]:C?`${C}px`:void 0,[Vt.arrowShadowColor.var]:w}},qe),[L,C,w]),ve=x.useCallback((_e={},qe=null)=>{const ge={..._e.style,position:"relative",transformOrigin:Vt.transformOrigin.varRef};return{ref:qe,...D,..._e,id:oe,role:"tooltip",style:ge}},[D,oe]);return{isOpen:_,show:J,hide:ue,getTriggerProps:Ge,getTooltipProps:ve,getTooltipPositionerProps:Qe,getArrowProps:$,getArrowInnerProps:X}}var Dd="chakra-ui:close-tooltip";function B7(e,t){return x.useEffect(()=>{const n=cc(e);return n.addEventListener(Dd,t),()=>n.removeEventListener(Dd,t)},[t,e]),()=>{const n=cc(e),r=Mf(e);n.dispatchEvent(new r.CustomEvent(Dd))}}function H7(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function W7(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var V7=re(Wr.div),Yt=he((e,t)=>{var n,r;const i=pi("Tooltip",e),s=At(e),c=Ji(),{children:u,label:f,shouldWrapChildren:h,"aria-label":p,hasArrow:g,bg:y,portalProps:S,background:C,backgroundColor:w,bgColor:k,motionProps:j,...M}=s,P=(r=(n=C??w)!=null?n:y)!=null?r:k;if(P){i.bg=P;const L=BS(c,"colors",P);i[Vt.arrowBg.var]=L}const I=L7({...M,direction:c.direction}),T=typeof u=="string"||h;let D;if(T)D=l.jsx(re.span,{display:"inline-block",tabIndex:0,...I.getTriggerProps(),children:u});else{const L=x.Children.only(u);D=x.cloneElement(L,I.getTriggerProps(L.props,L.ref))}const _=!!p,z=I.getTooltipProps({},t),V=_?H7(z,["role","id"]):z,F=W7(z,["role","id"]);return f?l.jsxs(l.Fragment,{children:[D,l.jsx(ia,{children:I.isOpen&&l.jsx(eh,{...S,children:l.jsx(re.div,{...I.getTooltipPositionerProps(),__css:{zIndex:i.zIndex,pointerEvents:"none"},children:l.jsxs(V7,{variants:F7,initial:"exit",animate:"enter",exit:"exit",...j,...V,__css:i,children:[f,_&&l.jsx(re.span,{srOnly:!0,...F,children:p}),g&&l.jsx(re.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:l.jsx(re.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:i.bg}})})]})})})})]}):l.jsx(l.Fragment,{children:u})});Yt.displayName="Tooltip";const Qh=x.createContext(null);let Vg;const Zh=()=>({setOpenUploader:e=>{e&&(Vg=e)},openUploader:Vg}),Bt=be(e=>e.ui,e=>HS[e.activeTab],{memoizeOptions:{equalityCheck:te.isEqual}}),U7=be(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:te.isEqual}}),ro=be(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:te.isEqual}}),Ug=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),s=Bt(i),c=new FormData;c.append("file",r,r.name),c.append("data",JSON.stringify({kind:"init"}));const f=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:c})).json(),h={uuid:P1(),category:"user",...f};t(I1({image:h,category:"user"})),s==="unifiedCanvas"?t(bc(h)):s==="img2img"&&t(os(h))},Jh=e=>{const{children:t}=e;return l.jsx(B,{sx:{width:"100%",height:"100%",bg:"base.850"},children:t})};function $7(){const{t:e}=Z();return l.jsx(Jh,{children:l.jsxs(B,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",w:"100%",h:"100%",gap:4,textAlign:"center"},children:[l.jsx(Vn,{children:e("common.nodes")}),l.jsx(Le,{maxW:"50rem",gap:4,children:l.jsx(Ce,{children:e("common.nodesDesc")})})]})})}const G7=()=>{const{t:e}=Z();return l.jsx(Jh,{children:l.jsxs(B,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",w:"100%",h:"100%",gap:4,textAlign:"center"},children:[l.jsx(Vn,{children:e("common.postProcessing")}),l.jsxs(Le,{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 q7(){const{t:e}=Z();return l.jsx(Jh,{children:l.jsxs(B,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",w:"100%",h:"100%",gap:4,textAlign:"center"},children:[l.jsx(Vn,{children:e("common.training")}),l.jsxs(Le,{maxW:"50rem",gap:4,children:[l.jsx(Ce,{children:e("common.trainingDesc1")}),l.jsx(Ce,{children:e("common.trainingDesc2")})]})]})})}function Y7(e){const{i18n:t}=Z(),n=localStorage.getItem("i18nextLng");ke.useEffect(()=>{e()},[e]),ke.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const le=he((e,t)=>{const{tooltip:n="",tooltipProps:r,isChecked:i,...s}=e;return l.jsx(Yt,{label:n,hasArrow:!0,...r,...r!=null&&r.placement?{placement:r.placement}:{placement:"top"},children:l.jsx(ci,{ref:t,"aria-checked":i!==void 0?i:void 0,...s})})}),Je=he((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,isChecked:s,...c}=e;return l.jsx(Yt,{label:r,...i,children:l.jsx(to,{ref:t,"aria-checked":s,...c,children:n})})}),rr=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:i=!0,...s}=e;return l.jsxs(qh,{isLazy:i,...s,children:[l.jsx(Gh,{children:t}),l.jsxs(Xh,{children:[r&&l.jsx(Yh,{}),n]})]})},Ac=be(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:te.isEqual}}),Mn=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,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(Yt,{label:i,...s,children:l.jsx(ry,{...c,children:r.map(u=>typeof u=="string"||typeof u=="number"?l.jsx("option",{value:u,children:u},u):l.jsx("option",{value:u.value,children:u.key},u.value))})})]})};function X7(){const e=O(i=>i.postprocessing.facetoolType),t=Y(),{t:n}=Z(),r=i=>t(Hl(i.target.value));return l.jsx(Mn,{label:n("parameters.type"),validValues:WS.concat(),value:e,onChange:r})}var by={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},$g=ke.createContext&&ke.createContext(by),si=globalThis&&globalThis.__assign||function(){return si=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},si.apply(this,arguments)},K7=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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function Sy(e){return e&&e.map(function(t,n){return ke.createElement(t.tag,si({key:n},t.attr),Sy(t.child))})}function me(e){return function(t){return ke.createElement(Q7,si({attr:si({},e.attr)},t),Sy(e.child))}}function Q7(e){var t=function(n){var r=e.attr,i=e.size,s=e.title,c=K7(e,["attr","size","title"]),u=i||n.size||"1em",f;return n.className&&(f=n.className),e.className&&(f=(f?f+" ":"")+e.className),ke.createElement("svg",si({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,c,{className:f,style:si(si({color:e.color||n.color},n.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),s&&ke.createElement("title",null,s),e.children)};return $g!==void 0?ke.createElement($g.Consumer,null,function(n){return t(n)}):t(by)}function Cy(e){return me({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 11H6.414l5.293-5.293-1.414-1.414L2.586 12l7.707 7.707 1.414-1.414L6.414 13H21z"}}]})(e)}function Z7(e){return me({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 ep(e){return me({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 J7(e){return me({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 e8(e){return me({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 t8(e){return me({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 n8(e){return me({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}function ut(e){const[t,n]=x.useState(!1),{label:r,value:i,min:s=1,max:c=100,step:u=1,onChange:f,tooltipSuffix:h="",withSliderMarks:p=!1,withInput:g=!1,isInteger:y=!1,inputWidth:S=16,inputReadOnly:C=!1,withReset:w=!1,hideTooltip:k=!1,isCompact:j=!1,handleReset:M,isResetDisabled:P,isSliderDisabled:I,isInputDisabled:T,sliderFormControlProps:D,sliderFormLabelProps:_,sliderMarkProps:z,sliderTrackProps:V,sliderThumbProps:F,sliderNumberInputProps:L,sliderNumberInputFieldProps:X,sliderNumberInputStepperProps:$,sliderTooltipProps:Q,sliderIAIIconButtonProps:ie,...oe}=e,[U,K]=x.useState(String(i));x.useEffect(()=>{K(i)},[i]);const ne=x.useMemo(()=>L!=null&&L.max?L.max:c,[c,L==null?void 0:L.max]),ce=J=>{f(J)},Re=J=>{J.target.value===""&&(J.target.value=String(s));const ue=te.clamp(y?Math.floor(Number(J.target.value)):Number(U),s,ne);f(ue)},ze=J=>{K(J)},Me=()=>{M&&M()};return l.jsxs(rt,{sx:j?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},...D,children:[l.jsx(st,{..._,mb:-1,children:r}),l.jsxs(sa,{w:"100%",gap:2,alignItems:"center",children:[l.jsxs(ly,{"aria-label":r,value:i,min:s,max:c,step:u,onChange:ce,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:I,...oe,children:[p&&l.jsxs(l.Fragment,{children:[l.jsx(If,{value:s,insetInlineStart:0,sx:{insetInlineStart:"unset !important"},...z,children:s}),l.jsx(If,{value:c,insetInlineEnd:0,sx:{insetInlineStart:"unset !important"},...z,children:c})]}),l.jsx(uy,{...V,children:l.jsx(dy,{})}),l.jsx(Yt,{hasArrow:!0,placement:"top",isOpen:t,label:`${i}${h}`,hidden:k,...Q,children:l.jsx(cy,{...F})})]}),g&&l.jsxs(Bh,{min:s,max:ne,step:u,value:U,onChange:ze,onBlur:Re,isDisabled:T,...L,children:[l.jsx(Wh,{readOnly:C,minWidth:S,...X}),l.jsxs(Hh,{...$,children:[l.jsx(Uh,{onClick:()=>f(Number(U))}),l.jsx(Vh,{onClick:()=>f(Number(U))})]})]}),w&&l.jsx(le,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:l.jsx(ep,{}),onClick:Me,isDisabled:P,...ie})]})]})}function r8(){const e=O(i=>i.system.isGFPGANAvailable),t=O(i=>i.postprocessing.facetoolStrength),{t:n}=Z(),r=Y();return l.jsx(ut,{isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,label:n("parameters.strength"),step:.05,min:0,max:1,onChange:i=>r(Zl(i)),handleReset:()=>r(Zl(.75)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}function i8(){const e=O(i=>i.system.isGFPGANAvailable),t=O(i=>i.postprocessing.codeformerFidelity),{t:n}=Z(),r=Y();return l.jsx(ut,{isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,label:n("parameters.codeformerFidelity"),step:.05,min:0,max:1,onChange:i=>r(Qd(i)),handleReset:()=>r(Qd(1)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}const tp=()=>{const e=O(t=>t.postprocessing.facetoolType);return l.jsxs(Le,{gap:2,alignItems:"stretch",children:[l.jsx(X7,{}),l.jsx(r8,{}),e==="codeformer"&&l.jsx(i8,{})]})};function o8(){const e=O(i=>i.system.isESRGANAvailable),t=O(i=>i.postprocessing.upscalingDenoising),{t:n}=Z(),r=Y();return l.jsx(ut,{label:n("parameters.denoisingStrength"),value:t,min:0,max:1,step:.01,onChange:i=>{r(Zd(i))},handleReset:()=>r(Zd(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})}function a8(){const e=O(i=>i.system.isESRGANAvailable),t=O(i=>i.postprocessing.upscalingStrength),{t:n}=Z(),r=Y();return l.jsx(ut,{label:`${n("parameters.upscale")} ${n("parameters.strength")}`,value:t,min:0,max:1,step:.05,onChange:i=>r(Jd(i)),handleReset:()=>r(Jd(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})}function s8(){const e=O(s=>s.system.isESRGANAvailable),t=O(s=>s.postprocessing.upscalingLevel),{t:n}=Z(),r=Y(),i=s=>r(M1(Number(s.target.value)));return l.jsx(Mn,{isDisabled:!e,label:n("parameters.scale"),value:t,onChange:i,validValues:VS})}const np=()=>l.jsxs(Le,{gap:2,alignItems:"stretch",children:[l.jsx(s8,{}),l.jsx(o8,{}),l.jsx(a8,{})]}),rp=e=>e.postprocessing,Pt=e=>e.system,l8=e=>e.system.toastQueue,wy=be(Pt,e=>{const{model_list:t}=e,n=te.reduce(t,(r,i,s)=>(i.status==="active"&&(r=s),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),c8=be(Pt,e=>{const{model_list:t}=e;return te.pickBy(t,(r,i)=>{if(r.format==="diffusers")return{name:i,...r}})},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function Tf(){return Tf=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},Tf.apply(this,arguments)}var ky=["shift","alt","meta","mod","ctrl"],u8={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 ii(e){return(u8[e]||e).trim().toLowerCase().replace("key","").replace("digit","").replace("numpad","").replace("arrow","")}function d8(e){return ky.includes(e)}function Od(e,t){return t===void 0&&(t=","),typeof e=="string"?e.split(t):e}function Ad(e,t){t===void 0&&(t="+");var n=e.toLocaleLowerCase().split(t).map(function(s){return ii(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")},i=n.filter(function(s){return!ky.includes(s)});return Tf({},r,{keys:i})}var oi=new Set;function f8(e,t){t===void 0&&(t=",");var n=Array.isArray(e)?e:e.split(t);return n.every(function(r){return oi.has(r.trim().toLowerCase())})}function jy(e){var t=Array.isArray(e)?e:[e];oi.has("meta")&&oi.forEach(function(n){return!d8(n)&&oi.delete(n.toLowerCase())}),t.forEach(function(n){return oi.add(n.toLowerCase())})}function Ey(e){var t=Array.isArray(e)?e:[e];e==="meta"?oi.clear():t.forEach(function(n){return oi.delete(n.toLowerCase())})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&jy([ii(e.key),ii(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&Ey([ii(e.key),ii(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){oi.clear()})})();function h8(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function p8(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function m8(e){return Py(e,["input","textarea","select"])}function Py(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(i){return i.toLowerCase()===r.toLowerCase()})):Boolean(r&&t&&t===!0)}function v8(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 g8=function(t,n,r){r===void 0&&(r=!1);var i=n.alt,s=n.meta,c=n.mod,u=n.shift,f=n.ctrl,h=n.keys,p=t.key,g=t.code,y=t.ctrlKey,S=t.metaKey,C=t.shiftKey,w=t.altKey,k=ii(g),j=p.toLowerCase();if(!r){if(i===!w&&j!=="alt"||u===!C&&j!=="shift")return!1;if(c){if(!S&&!y)return!1}else if(s===!S&&j!=="meta"||f===!y&&j!=="ctrl")return!1}return h&&h.length===1&&(h.includes(j)||h.includes(k))?!0:h?f8(h):!h},x8=x.createContext(void 0),y8=function(){return x.useContext(x8)};function Iy(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&&Iy(e[r],t[r])},!0):e===t}var b8=x.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),S8=function(){return x.useContext(b8)};function C8(e){var t=x.useRef(void 0);return Iy(t.current,e)||(t.current=e),t.current}var Gg=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},w8=typeof window<"u"?x.useLayoutEffect:x.useEffect;function fe(e,t,n,r){var i=x.useRef(null),s=x.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=x.useCallback(t,u??[]),h=x.useRef(f);u?h.current=f:h.current=t;var p=C8(c),g=S8(),y=g.enabledScopes,S=y8();return w8(function(){if(!((p==null?void 0:p.enabled)===!1||!v8(y,p==null?void 0:p.scopes))){var C=function(M,P){var I;if(P===void 0&&(P=!1),!(m8(M)&&!Py(M,p==null?void 0:p.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){Gg(M);return}(I=M.target)!=null&&I.isContentEditable&&!(p!=null&&p.enableOnContentEditable)||Od(e,p==null?void 0:p.splitKey).forEach(function(T){var D,_=Ad(T,p==null?void 0:p.combinationKey);if(g8(M,_,p==null?void 0:p.ignoreModifiers)||(D=_.keys)!=null&&D.includes("*")){if(P&&s.current)return;if(h8(M,_,p==null?void 0:p.preventDefault),!p8(M,_,p==null?void 0:p.enabled)){Gg(M);return}h.current(M,_),P||(s.current=!0)}})}},w=function(M){M.key!==void 0&&(jy(ii(M.code)),((p==null?void 0:p.keydown)===void 0&&(p==null?void 0:p.keyup)!==!0||p!=null&&p.keydown)&&C(M))},k=function(M){M.key!==void 0&&(Ey(ii(M.code)),s.current=!1,p!=null&&p.keyup&&C(M,!0))};return(i.current||(c==null?void 0:c.document)||document).addEventListener("keyup",k),(i.current||(c==null?void 0:c.document)||document).addEventListener("keydown",w),S&&Od(e,p==null?void 0:p.splitKey).forEach(function(j){return S.addHotkey(Ad(j,p==null?void 0:p.combinationKey))}),function(){(i.current||(c==null?void 0:c.document)||document).removeEventListener("keyup",k),(i.current||(c==null?void 0:c.document)||document).removeEventListener("keydown",w),S&&Od(e,p==null?void 0:p.splitKey).forEach(function(j){return S.removeHotkey(Ad(j,p==null?void 0:p.combinationKey))})}}},[e,p,y]),i}function k8(e){return me({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 j8(e){return me({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 E8(e){return me({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 P8(e){return me({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 I8(e){return me({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 M8(e){return me({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 T8(e){return me({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 My(e){return me({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 _8(e){return me({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 D8(e){return me({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 zc(e){return me({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 Ty(e){return me({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 Jo(e){return me({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 _y(e){return me({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 O8(e){return me({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 ip(e){return me({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 Dy(e){return me({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 A8(e){return me({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 z8(e){return me({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 Oy(e){return me({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 R8(e){return me({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 N8(e){return me({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 Ay(e){return me({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 F8(e){return me({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 L8(e){return me({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 B8(e){return me({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 H8(e){return me({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 zy(e){return me({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 W8(e){return me({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 V8(e){return me({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 Ry(e){return me({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 U8(e){return me({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 $8(e){return me({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 xs(e){return me({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 G8(e){return me({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 q8(e){return me({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 Y8(e){return me({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 op(e){return me({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 X8(e){return me({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 K8(e){return me({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 Q8(e){return me({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 qg(e){return me({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 ap(e){return me({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 Z8(e){return me({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 io(e){return me({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 J8(e){return me({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 me({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 e9(e){return me({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 sp(e){return me({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 tt=e=>e.canvas,zt=be([tt,Bt,Pt],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Ny=e=>e.canvas.layerState.objects.find(T1),Vr=e=>e.gallery,t9=be([Vr,Ac,zt,Bt],(e,t,n,r)=>{const{categories:i,currentCategory:s,currentImageUuid:c,shouldPinGallery:u,shouldShowGallery:f,galleryImageMinimumWidth:h,galleryImageObjectFit:p,shouldHoldGalleryOpen:g,shouldAutoSwitchToNewImages:y,galleryWidth:S,shouldUseSingleGalleryColumn:C}=e,{isLightboxOpen:w}=t;return{currentImageUuid:c,shouldPinGallery:u,shouldShowGallery:f,galleryImageMinimumWidth:h,galleryImageObjectFit:p,galleryGridTemplateColumns:C?"auto":`repeat(auto-fill, minmax(${h}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:g,shouldAutoSwitchToNewImages:y,images:i[s].images,areMoreImagesAvailable:i[s].areMoreImagesAvailable,currentCategory:s,galleryWidth:S,isLightboxOpen:w,isStaging:n,shouldEnableResize:!(w||r==="unifiedCanvas"&&u),shouldUseSingleGalleryColumn:C}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),n9=be([Vr,Pt,Ac,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:te.isEqual}}),En=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:s,...c}=e;return l.jsxs(rt,{isDisabled:n,width:r,display:"flex",gap:4,alignItems:"center",justifyContent:"space-between",...i,children:[l.jsx(st,{my:1,...s,children:t}),l.jsx(fy,{...c})]})},r9=be(Pt,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),uc=he(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:s}=ui(),c=Y(),{shouldConfirmOnDelete:u,isConnected:f,isProcessing:h}=O(r9),p=x.useRef(null),g=C=>{C.stopPropagation(),u?i():y()},y=()=>{f&&!h&&e&&c(US(e)),s()};fe("delete",()=>{u?i():y()},[e,u,f,h]);const S=C=>c(_1(!C.target.checked));return l.jsxs(l.Fragment,{children:[x.cloneElement(t,{onClick:e?g:void 0,ref:n}),l.jsx(Xx,{isOpen:r,leastDestructiveRef:p,onClose:s,children:l.jsx(Nr,{children:l.jsxs(Kx,{children:[l.jsx(Rr,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),l.jsx(Fr,{children:l.jsxs(B,{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(zr,{children:[l.jsx(Je,{ref:p,onClick:s,children:"Cancel"}),l.jsx(Je,{colorScheme:"error",onClick:y,ml:3,children:"Delete"})]})]})})})]})});uc.displayName="DeleteImageModal";const lp=()=>{const e=Y();return t=>{const n=typeof t=="string"?t:D1(t),[r,i]=$S(n);e(O1(r)),e(A1(i))}},i9=be([Pt,Vr,rp,ro,Ac,Bt],(e,t,n,r,i,s)=>{const{isProcessing:c,isConnected:u,isGFPGANAvailable:f,isESRGANAvailable:h}=e,{upscalingLevel:p,facetoolStrength:g}=n,{isLightboxOpen:y}=i,{shouldShowImageDetails:S}=r,{intermediateImage:C,currentImage:w}=t;return{isProcessing:c,isConnected:u,isGFPGANAvailable:f,isESRGANAvailable:h,upscalingLevel:p,facetoolStrength:g,shouldDisableToolbarButtons:Boolean(C)||!w,currentImage:w,shouldShowImageDetails:S,activeTabName:s,isLightboxOpen:y}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),Fy=e=>{var L,X,$,Q,ie,oe,U,K;const t=Y(),{isProcessing:n,isConnected:r,isGFPGANAvailable:i,isESRGANAvailable:s,upscalingLevel:c,facetoolStrength:u,shouldDisableToolbarButtons:f,shouldShowImageDetails:h,currentImage:p,isLightboxOpen:g,activeTabName:y}=O(i9),S=us(),{t:C}=Z(),w=lp(),k=()=>{p&&(g&&t(Bi(!1)),t(os(p)),t(jn("img2img")))},j=async()=>{if(!p)return;const ne=await fetch(p.url).then(Re=>Re.blob()),ce=[new ClipboardItem({[ne.type]:ne})];await navigator.clipboard.write(ce),S({title:C("toast.imageCopied"),status:"success",duration:2500,isClosable:!0})},M=()=>{navigator.clipboard.writeText(p?window.location.toString()+p.url:"").then(()=>{S({title:C("toast.imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};fe("shift+i",()=>{p?(k(),S({title:C("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.imageNotLoaded"),description:C("toast.imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[p]);const P=()=>{var ne,ce;p&&(p.metadata&&t(z1(p.metadata)),((ne=p.metadata)==null?void 0:ne.image.type)==="img2img"?t(jn("img2img")):((ce=p.metadata)==null?void 0:ce.image.type)==="txt2img"&&t(jn("txt2img")))};fe("a",()=>{var ne,ce;["txt2img","img2img"].includes((ce=(ne=p==null?void 0:p.metadata)==null?void 0:ne.image)==null?void 0:ce.type)?(P(),S({title:C("toast.parametersSet"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.parametersNotSet"),description:C("toast.parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[p]);const I=()=>{p!=null&&p.metadata&&t(as(p.metadata.image.seed))};fe("s",()=>{var ne,ce;(ce=(ne=p==null?void 0:p.metadata)==null?void 0:ne.image)!=null&&ce.seed?(I(),S({title:C("toast.seedSet"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.seedNotSet"),description:C("toast.seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[p]);const T=x.useCallback(()=>{var ne,ce,Re,ze;(ce=(ne=p==null?void 0:p.metadata)==null?void 0:ne.image)!=null&&ce.prompt&&w((ze=(Re=p==null?void 0:p.metadata)==null?void 0:Re.image)==null?void 0:ze.prompt)},[(X=(L=p==null?void 0:p.metadata)==null?void 0:L.image)==null?void 0:X.prompt,w]);fe("p",()=>{var ne,ce;(ce=(ne=p==null?void 0:p.metadata)==null?void 0:ne.image)!=null&&ce.prompt?(T(),S({title:C("toast.promptSet"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.promptNotSet"),description:C("toast.promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[p]);const D=()=>{p&&t(GS(p))};fe("Shift+U",()=>{s&&!f&&r&&!n&&c?D():S({title:C("toast.upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[p,s,f,r,n,c]);const _=()=>{p&&t(qS(p))};fe("Shift+R",()=>{i&&!f&&r&&!n&&u?_():S({title:C("toast.faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[p,i,f,r,n,u]);const z=()=>t(R1(!h)),V=()=>{p&&(g&&t(Bi(!1)),t(bc(p)),t(on(!0)),y!=="unifiedCanvas"&&t(jn("unifiedCanvas")),S({title:C("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};fe("i",()=>{p?z():S({title:C("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[p,h]);const F=()=>{t(Bi(!g))};return l.jsxs(B,{sx:{justifyContent:"center",alignItems:"center",columnGap:"0.5em"},...e,children:[l.jsxs(en,{isAttached:!0,children:[l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(le,{"aria-label":`${C("parameters.sendTo")}...`,icon:l.jsx(Q8,{})}),children:l.jsxs(B,{sx:{flexDirection:"column",rowGap:2,w:52},children:[l.jsx(Je,{size:"sm",onClick:k,leftIcon:l.jsx(qg,{}),children:C("parameters.sendToImg2Img")}),l.jsx(Je,{size:"sm",onClick:V,leftIcon:l.jsx(qg,{}),children:C("parameters.sendToUnifiedCanvas")}),l.jsx(Je,{size:"sm",onClick:j,leftIcon:l.jsx(Jo,{}),children:C("parameters.copyImage")}),l.jsx(Je,{size:"sm",onClick:M,leftIcon:l.jsx(Jo,{}),children:C("parameters.copyImageToLink")}),l.jsx($i,{download:!0,href:p==null?void 0:p.url,children:l.jsx(Je,{leftIcon:l.jsx(ip,{}),size:"sm",w:"100%",children:C("parameters.downloadImage")})})]})}),l.jsx(le,{icon:l.jsx(z8,{}),tooltip:g?`${C("parameters.closeViewer")} (Z)`:`${C("parameters.openInViewer")} (Z)`,"aria-label":g?`${C("parameters.closeViewer")} (Z)`:`${C("parameters.openInViewer")} (Z)`,isChecked:g,onClick:F})]}),l.jsxs(en,{isAttached:!0,children:[l.jsx(le,{icon:l.jsx(G8,{}),tooltip:`${C("parameters.usePrompt")} (P)`,"aria-label":`${C("parameters.usePrompt")} (P)`,isDisabled:!((Q=($=p==null?void 0:p.metadata)==null?void 0:$.image)!=null&&Q.prompt),onClick:T}),l.jsx(le,{icon:l.jsx(K8,{}),tooltip:`${C("parameters.useSeed")} (S)`,"aria-label":`${C("parameters.useSeed")} (S)`,isDisabled:!((oe=(ie=p==null?void 0:p.metadata)==null?void 0:ie.image)!=null&&oe.seed),onClick:I}),l.jsx(le,{icon:l.jsx(_8,{}),tooltip:`${C("parameters.useAll")} (A)`,"aria-label":`${C("parameters.useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((K=(U=p==null?void 0:p.metadata)==null?void 0:U.image)==null?void 0:K.type),onClick:P})]}),l.jsxs(en,{isAttached:!0,children:[l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(le,{icon:l.jsx(F8,{}),"aria-label":C("parameters.restoreFaces")}),children:l.jsxs(B,{sx:{flexDirection:"column",rowGap:4},children:[l.jsx(tp,{}),l.jsx(Je,{isDisabled:!i||!p||!(r&&!n)||!u,onClick:_,children:C("parameters.restoreFaces")})]})}),l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(le,{icon:l.jsx(A8,{}),"aria-label":C("parameters.upscale")}),children:l.jsxs(B,{sx:{flexDirection:"column",gap:4},children:[l.jsx(np,{}),l.jsx(Je,{isDisabled:!s||!p||!(r&&!n)||!c,onClick:D,children:C("parameters.upscaleImage")})]})})]}),l.jsx(en,{isAttached:!0,children:l.jsx(le,{icon:l.jsx(Ty,{}),tooltip:`${C("parameters.info")} (I)`,"aria-label":`${C("parameters.info")} (I)`,isChecked:h,onClick:z})}),l.jsx(uc,{image:p,children:l.jsx(le,{icon:l.jsx(io,{}),tooltip:`${C("parameters.deleteImage")} (Del)`,"aria-label":`${C("parameters.deleteImage")} (Del)`,isDisabled:!p||!r||n,colorScheme:"error"})})]})};var o9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[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)}}(),Wt=globalThis&&globalThis.__assign||function(){return Wt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Wt.apply(this,arguments)},Yg={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Xg={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Tl={width:"20px",height:"20px",position:"absolute"},a9={top:Wt(Wt({},Yg),{top:"-5px"}),right:Wt(Wt({},Xg),{left:void 0,right:"-5px"}),bottom:Wt(Wt({},Yg),{top:void 0,bottom:"-5px"}),left:Wt(Wt({},Xg),{left:"-5px"}),topRight:Wt(Wt({},Tl),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Wt(Wt({},Tl),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Wt(Wt({},Tl),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Wt(Wt({},Tl),{left:"-10px",top:"-10px",cursor:"nw-resize"})},s9=function(e){o9(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 x.createElement("div",{className:this.props.className||"",style:Wt(Wt({position:"absolute",userSelect:"none"},a9[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(x.PureComponent),l9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[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)}}(),mr=globalThis&&globalThis.__assign||function(){return mr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},mr.apply(this,arguments)},c9={width:"auto",height:"auto"},_l=function(e,t,n){return Math.max(Math.min(e,n),t)},Kg=function(e,t){return Math.round(e/t)*t},Do=function(e,t){return new RegExp(e,"i").test(t)},Dl=function(e){return Boolean(e.touches&&e.touches.length)},u9=function(e){return Boolean((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},Qg=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(s,c,u){return Math.abs(c-e)<Math.abs(t[s]-e)?u:s},0),i=Math.abs(t[r]-e);return n===0||i<n?t[r]:e},zd=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"},Ol=function(e,t,n,r){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var i=Number(e.replace("%",""))/100;return t*i}if(e.endsWith("vw")){var i=Number(e.replace("vw",""))/100;return n*i}if(e.endsWith("vh")){var i=Number(e.replace("vh",""))/100;return r*i}}return e},d9=function(e,t,n,r,i,s,c){return r=Ol(r,e.width,t,n),i=Ol(i,e.height,t,n),s=Ol(s,e.width,t,n),c=Ol(c,e.height,t,n),{maxWidth:typeof r>"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof s>"u"?void 0:Number(s),minHeight:typeof c>"u"?void 0:Number(c)}},f9=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Zg="__resizable_base__",Ly=function(e){l9(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var i=r.parentNode;if(!i)return null;var s=r.window.document.createElement("div");return s.style.width="100%",s.style.height="100%",s.style.position="absolute",s.style.transform="scale(0, 0)",s.style.left="0",s.style.flex="0 0 100%",s.classList?s.classList.add(Zg):s.className+=Zg,i.appendChild(s),s},r.removeBase=function(i){var s=r.parentNode;s&&s.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||c9},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,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:i,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,i=function(u){if(typeof n.state[u]>"u"||n.state[u]==="auto")return"auto";if(n.propsSize&&n.propsSize[u]&&n.propsSize[u].toString().endsWith("%")){if(n.state[u].toString().endsWith("%"))return n.state[u].toString();var f=n.getParentSize(),h=Number(n.state[u].toString().replace("px","")),p=h/f[u]*100;return p+"%"}return zd(n.state[u])},s=r&&typeof r.width<"u"&&!this.state.isResizing?zd(r.width):i("width"),c=r&&typeof r.height<"u"&&!this.state.isResizing?zd(r.height):i("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,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var s={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),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 i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,s=this.state.direction,c=i&&Do("left",s),u=i&&Do("top",s),f,h;if(this.props.bounds==="parent"){var p=this.parentNode;p&&(f=c?this.resizableRight-this.parentLeft:p.offsetWidth+(this.parentLeft-this.resizableLeft),h=u?this.resizableBottom-this.parentTop:p.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(f=c?this.resizableRight:this.window.innerWidth-this.resizableLeft,h=u?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(f=c?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),h=u?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return f&&Number.isFinite(f)&&(n=n&&n<f?n:f),h&&Number.isFinite(h)&&(r=r&&r<h?r:h),{maxWidth:n,maxHeight:r}},t.prototype.calculateNewSizeFromDirection=function(n,r){var i=this.props.scale||1,s=this.props.resizeRatio||1,c=this.state,u=c.direction,f=c.original,h=this.props,p=h.lockAspectRatio,g=h.lockAspectRatioExtraHeight,y=h.lockAspectRatioExtraWidth,S=f.width,C=f.height,w=g||0,k=y||0;return Do("right",u)&&(S=f.width+(n-f.x)*s/i,p&&(C=(S-k)/this.ratio+w)),Do("left",u)&&(S=f.width-(n-f.x)*s/i,p&&(C=(S-k)/this.ratio+w)),Do("bottom",u)&&(C=f.height+(r-f.y)*s/i,p&&(S=(C-w)*this.ratio+k)),Do("top",u)&&(C=f.height-(r-f.y)*s/i,p&&(S=(C-w)*this.ratio+k)),{newWidth:S,newHeight:C}},t.prototype.calculateNewSizeFromAspectRatio=function(n,r,i,s){var c=this.props,u=c.lockAspectRatio,f=c.lockAspectRatioExtraHeight,h=c.lockAspectRatioExtraWidth,p=typeof s.width>"u"?10:s.width,g=typeof i.width>"u"||i.width<0?n:i.width,y=typeof s.height>"u"?10:s.height,S=typeof i.height>"u"||i.height<0?r:i.height,C=f||0,w=h||0;if(u){var k=(y-C)*this.ratio+w,j=(S-C)*this.ratio+w,M=(p-w)/this.ratio+C,P=(g-w)/this.ratio+C,I=Math.max(p,k),T=Math.min(g,j),D=Math.max(y,M),_=Math.min(S,P);n=_l(n,I,T),r=_l(r,D,_)}else n=_l(n,p,g),r=_l(r,y,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 i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var s=this.resizable.getBoundingClientRect(),c=s.left,u=s.top,f=s.right,h=s.bottom;this.resizableLeft=c,this.resizableRight=f,this.resizableTop=u,this.resizableBottom=h}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,s=0;if(n.nativeEvent&&u9(n.nativeEvent)?(i=n.nativeEvent.clientX,s=n.nativeEvent.clientY):n.nativeEvent&&Dl(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,s=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var c=this.props.onResizeStart(n,r,this.resizable);if(c===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var u,f=this.window.getComputedStyle(this.resizable);if(f.flexBasis!=="auto"){var h=this.parentNode;if(h){var p=this.window.getComputedStyle(h).flexDirection;this.flexDir=p.startsWith("row")?"row":"column",u=f.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var g={original:{x:i,y:s,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:mr(mr({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:u};this.setState(g)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Dl(n))try{n.preventDefault(),n.stopPropagation()}catch{}var i=this.props,s=i.maxWidth,c=i.maxHeight,u=i.minWidth,f=i.minHeight,h=Dl(n)?n.touches[0].clientX:n.clientX,p=Dl(n)?n.touches[0].clientY:n.clientY,g=this.state,y=g.direction,S=g.original,C=g.width,w=g.height,k=this.getParentSize(),j=d9(k,this.window.innerWidth,this.window.innerHeight,s,c,u,f);s=j.maxWidth,c=j.maxHeight,u=j.minWidth,f=j.minHeight;var M=this.calculateNewSizeFromDirection(h,p),P=M.newHeight,I=M.newWidth,T=this.calculateNewMaxFromBoundary(s,c);this.props.snap&&this.props.snap.x&&(I=Qg(I,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(P=Qg(P,this.props.snap.y,this.props.snapGap));var D=this.calculateNewSizeFromAspectRatio(I,P,{width:T.maxWidth,height:T.maxHeight},{width:u,height:f});if(I=D.newWidth,P=D.newHeight,this.props.grid){var _=Kg(I,this.props.grid[0]),z=Kg(P,this.props.grid[1]),V=this.props.snapGap||0;I=V===0||Math.abs(_-I)<=V?_:I,P=V===0||Math.abs(z-P)<=V?z:P}var F={width:I-S.width,height:P-S.height};if(C&&typeof C=="string"){if(C.endsWith("%")){var L=I/k.width*100;I=L+"%"}else if(C.endsWith("vw")){var X=I/this.window.innerWidth*100;I=X+"vw"}else if(C.endsWith("vh")){var $=I/this.window.innerHeight*100;I=$+"vh"}}if(w&&typeof w=="string"){if(w.endsWith("%")){var L=P/k.height*100;P=L+"%"}else if(w.endsWith("vw")){var X=P/this.window.innerWidth*100;P=X+"vw"}else if(w.endsWith("vh")){var $=P/this.window.innerHeight*100;P=$+"vh"}}var Q={width:this.createSizeForCssProperty(I,"width"),height:this.createSizeForCssProperty(P,"height")};this.flexDir==="row"?Q.flexBasis=Q.width:this.flexDir==="column"&&(Q.flexBasis=Q.height),YS.flushSync(function(){r.setState(Q)}),this.props.onResize&&this.props.onResize(n,y,this.resizable,F)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,s=r.direction,c=r.original;if(!(!i||!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:mr(mr({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,i=r.enable,s=r.handleStyles,c=r.handleClasses,u=r.handleWrapperStyle,f=r.handleWrapperClass,h=r.handleComponent;if(!i)return null;var p=Object.keys(i).map(function(g){return i[g]!==!1?x.createElement(s9,{key:g,direction:g,onResizeStart:n.onResizeStart,replaceStyles:s&&s[g],className:c&&c[g]},h&&h[g]?h[g]:null):null});return x.createElement("div",{className:f,style:u},p)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(c,u){return f9.indexOf(u)!==-1||(c[u]=n.props[u]),c},{}),i=mr(mr(mr({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(i.flexBasis=this.state.flexBasis);var s=this.props.as||"div";return x.createElement(s,mr({ref:this.ref,style:i,className:this.props.className},r),this.state.isResizing&&x.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}(x.PureComponent);const pt=e=>{const{label:t,...n}=e;return l.jsx(P2,{colorScheme:"accent",...n,children:t})};function By(e){return me({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 Hy(e){return me({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function h9(e){return me({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 p9(e){return me({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 m9(e){return me({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 v9(e){return me({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 g9(e){return me({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 x9(e){return me({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 Jg(e){return me({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 y9(e){return me({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 b9(e){return me({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 cp(e){return me({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 S9(e){return me({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 C9(e){return me({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 w9(e){return me({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 k9(e){return me({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)}function j9(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function E9(e,t){e.classList?e.classList.add(t):j9(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function e0(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function P9(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=e0(e.className,t):e.setAttribute("class",e0(e.className&&e.className.baseVal||"",t))}const t0={disabled:!1},Wy=ke.createContext(null);var Vy=function(t){return t.scrollTop},La="unmounted",Ai="exited",zi="entering",Ao="entered",_f="exiting",Ur=function(e){vh(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var c=i,u=c&&!c.isMounting?r.enter:r.appear,f;return s.appearStatus=null,r.in?u?(f=Ai,s.appearStatus=zi):f=Ao:r.unmountOnExit||r.mountOnEnter?f=La:f=Ai,s.state={status:f},s.nextCallback=null,s}t.getDerivedStateFromProps=function(i,s){var c=i.in;return c&&s.status===La?{status:Ai}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var s=null;if(i!==this.props){var c=this.state.status;this.props.in?c!==zi&&c!==Ao&&(s=zi):(c===zi||c===Ao)&&(s=_f)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,s,c,u;return s=c=u=i,i!=null&&typeof i!="number"&&(s=i.exit,c=i.enter,u=i.appear!==void 0?i.appear:c),{exit:s,enter:c,appear:u}},n.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===zi){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:vl.findDOMNode(this);c&&Vy(c)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ai&&this.setState({status:La})},n.performEnter=function(i){var s=this,c=this.props.enter,u=this.context?this.context.isMounting:i,f=this.props.nodeRef?[u]:[vl.findDOMNode(this),u],h=f[0],p=f[1],g=this.getTimeouts(),y=u?g.appear:g.enter;if(!i&&!c||t0.disabled){this.safeSetState({status:Ao},function(){s.props.onEntered(h)});return}this.props.onEnter(h,p),this.safeSetState({status:zi},function(){s.props.onEntering(h,p),s.onTransitionEnd(y,function(){s.safeSetState({status:Ao},function(){s.props.onEntered(h,p)})})})},n.performExit=function(){var i=this,s=this.props.exit,c=this.getTimeouts(),u=this.props.nodeRef?void 0:vl.findDOMNode(this);if(!s||t0.disabled){this.safeSetState({status:Ai},function(){i.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:_f},function(){i.props.onExiting(u),i.onTransitionEnd(c.exit,function(){i.safeSetState({status:Ai},function(){i.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},n.setNextCallback=function(i){var s=this,c=!0;return this.nextCallback=function(u){c&&(c=!1,s.nextCallback=null,i(u))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(i,s){this.setNextCallback(s);var c=this.props.nodeRef?this.props.nodeRef.current:vl.findDOMNode(this),u=i==null&&!this.props.addEndListener;if(!c||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var f=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],h=f[0],p=f[1];this.props.addEndListener(h,p)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===La)return null;var s=this.props,c=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var u=th(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return ke.createElement(Wy.Provider,{value:null},typeof c=="function"?c(i,u):ke.cloneElement(ke.Children.only(c),u))},t}(ke.Component);Ur.contextType=Wy;Ur.propTypes={};function Oo(){}Ur.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Oo,onEntering:Oo,onEntered:Oo,onExit:Oo,onExiting:Oo,onExited:Oo};Ur.UNMOUNTED=La;Ur.EXITED=Ai;Ur.ENTERING=zi;Ur.ENTERED=Ao;Ur.EXITING=_f;const I9=Ur;var M9=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return E9(t,r)})},Rd=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return P9(t,r)})},up=function(e){vh(t,e);function t(){for(var r,i=arguments.length,s=new Array(i),c=0;c<i;c++)s[c]=arguments[c];return r=e.call.apply(e,[this].concat(s))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(u,f){var h=r.resolveArguments(u,f),p=h[0],g=h[1];r.removeClasses(p,"exit"),r.addClass(p,g?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(u,f)},r.onEntering=function(u,f){var h=r.resolveArguments(u,f),p=h[0],g=h[1],y=g?"appear":"enter";r.addClass(p,y,"active"),r.props.onEntering&&r.props.onEntering(u,f)},r.onEntered=function(u,f){var h=r.resolveArguments(u,f),p=h[0],g=h[1],y=g?"appear":"enter";r.removeClasses(p,y),r.addClass(p,y,"done"),r.props.onEntered&&r.props.onEntered(u,f)},r.onExit=function(u){var f=r.resolveArguments(u),h=f[0];r.removeClasses(h,"appear"),r.removeClasses(h,"enter"),r.addClass(h,"exit","base"),r.props.onExit&&r.props.onExit(u)},r.onExiting=function(u){var f=r.resolveArguments(u),h=f[0];r.addClass(h,"exit","active"),r.props.onExiting&&r.props.onExiting(u)},r.onExited=function(u){var f=r.resolveArguments(u),h=f[0];r.removeClasses(h,"exit"),r.addClass(h,"exit","done"),r.props.onExited&&r.props.onExited(u)},r.resolveArguments=function(u,f){return r.props.nodeRef?[r.props.nodeRef.current,u]:[u,f]},r.getClassNames=function(u){var f=r.props.classNames,h=typeof f=="string",p=h&&f?f+"-":"",g=h?""+p+u:f[u],y=h?g+"-active":f[u+"Active"],S=h?g+"-done":f[u+"Done"];return{baseClassName:g,activeClassName:y,doneClassName:S}},r}var n=t.prototype;return n.addClass=function(i,s,c){var u=this.getClassNames(s)[c+"ClassName"],f=this.getClassNames("enter"),h=f.doneClassName;s==="appear"&&c==="done"&&h&&(u+=" "+h),c==="active"&&i&&Vy(i),u&&(this.appliedClasses[s][c]=u,M9(i,u))},n.removeClasses=function(i,s){var c=this.appliedClasses[s],u=c.base,f=c.active,h=c.done;this.appliedClasses[s]={},u&&Rd(i,u),f&&Rd(i,f),h&&Rd(i,h)},n.render=function(){var i=this.props;i.classNames;var s=th(i,["classNames"]);return ke.createElement(I9,Ql({},s,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(ke.Component);up.defaultProps={classNames:""};up.propTypes={};const Uy=up;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 i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Va.apply(this,arguments)};function T9(e){var t,n=x.useState(!1),r=n[0],i=n[1],s=x.useState(!1),c=s[0],u=s[1],f=x.useState(!1),h=f[0],p=f[1],g=x.useState([0,0]),y=g[0],S=g[1],C=x.useRef(null);x.useEffect(function(){if(r)setTimeout(function(){u(!0),setTimeout(function(){p(!0)})});else{p(!1);var k=setTimeout(function(){u(r)},1e3);return function(){return clearTimeout(k)}}},[r]),b6("contextmenu",function(k){var j;!((j=C.current)===null||j===void 0)&&j.contains(k.target)||k.target===C.current?(k.preventDefault(),i(!0),S([k.pageX,k.pageY])):i(!1)});var w=x.useCallback(function(){var k,j;(j=(k=e.menuProps)===null||k===void 0?void 0:k.onClose)===null||j===void 0||j.call(k),i(!1)},[(t=e.menuProps)===null||t===void 0?void 0:t.onClose,i]);return x.createElement(x.Fragment,null,e.children(C),c&&x.createElement(eh,Va({},e.portalProps),x.createElement(Rh,Va({isOpen:h,gutter:0},e.menuProps,{onClose:w}),x.createElement(Fh,Va({"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:y[0],top:y[1],cursor:"default"}},e.menuButtonProps)),e.renderMenu())))}const _9=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,$y=x.memo(e=>{const t=Y(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:s,shouldUseSingleGalleryColumn:c}=O(n9),{image:u,isSelected:f}=e,{url:h,thumbnail:p,uuid:g,metadata:y}=u,[S,C]=x.useState(!1),w=us(),{direction:k}=Ji(),{t:j}=Z(),M=lp(),P=()=>C(!0),I=()=>C(!1),T=()=>{var Q,ie,oe,U;(ie=(Q=u.metadata)==null?void 0:Q.image)!=null&&ie.prompt&&M((U=(oe=u.metadata)==null?void 0:oe.image)==null?void 0:U.prompt),w({title:j("toast.promptSet"),status:"success",duration:2500,isClosable:!0})},D=()=>{u.metadata&&t(as(u.metadata.image.seed)),w({title:j("toast.seedSet"),status:"success",duration:2500,isClosable:!0})},_=()=>{t(os(u)),n!=="img2img"&&t(jn("img2img")),w({title:j("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},z=()=>{t(bc(u)),t(Sc()),n!=="unifiedCanvas"&&t(jn("unifiedCanvas")),w({title:j("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},V=()=>{y&&t(z1(y)),w({title:j("toast.parametersSet"),status:"success",duration:2500,isClosable:!0})},F=async()=>{var Q;if((Q=y==null?void 0:y.image)!=null&&Q.init_image_path&&(await fetch(y.image.init_image_path)).ok){t(jn("img2img")),t(XS(y)),w({title:j("toast.initialImageSet"),status:"success",duration:2500,isClosable:!0});return}w({title:j("toast.initialImageNotSet"),description:j("toast.initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},L=()=>t(Rv(u)),X=Q=>{Q.dataTransfer.setData("invokeai/imageUuid",g),Q.dataTransfer.effectAllowed="move"},$=()=>{t(Rv(u)),t(Bi(!0))};return l.jsx(T9,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>{var Q,ie,oe,U,K,ne,ce,Re;return l.jsxs(Nh,{children:[l.jsx(pr,{onClickCapture:$,children:j("parameters.openInViewer")}),l.jsx(pr,{onClickCapture:T,isDisabled:((ie=(Q=u==null?void 0:u.metadata)==null?void 0:Q.image)==null?void 0:ie.prompt)===void 0,children:j("parameters.usePrompt")}),l.jsx(pr,{onClickCapture:D,isDisabled:((U=(oe=u==null?void 0:u.metadata)==null?void 0:oe.image)==null?void 0:U.seed)===void 0,children:j("parameters.useSeed")}),l.jsx(pr,{onClickCapture:V,isDisabled:!["txt2img","img2img"].includes((ne=(K=u==null?void 0:u.metadata)==null?void 0:K.image)==null?void 0:ne.type),children:j("parameters.useAll")}),l.jsx(pr,{onClickCapture:F,isDisabled:((Re=(ce=u==null?void 0:u.metadata)==null?void 0:ce.image)==null?void 0:Re.type)!=="img2img",children:j("parameters.useInitImg")}),l.jsx(pr,{onClickCapture:_,children:j("parameters.sendToImg2Img")}),l.jsx(pr,{onClickCapture:z,children:j("parameters.sendToUnifiedCanvas")}),l.jsx(pr,{"data-warning":!0,children:l.jsx(uc,{image:u,children:l.jsx("p",{children:j("parameters.deleteImage")})})})]})},children:Q=>l.jsxs(We,{position:"relative",onMouseOver:P,onMouseOut:I,userSelect:"none",draggable:!0,onDragStart:X,ref:Q,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(ds,{objectFit:c?"contain":r,rounded:"md",src:p||h,loading:"lazy",sx:{position:"absolute",width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",top:"50%",transform:"translate(-50%,-50%)",...k==="rtl"?{insetInlineEnd:"50%"}:{insetInlineStart:"50%"}}}),l.jsx(B,{onClick:L,sx:{position:"absolute",top:"0",insetInlineStart:"0",width:"100%",height:"100%",alignItems:"center",justifyContent:"center"},children:f&&l.jsx(Jt,{as:zc,sx:{width:"50%",height:"50%",fill:"ok.500"}})}),S&&i>=64&&l.jsx(We,{sx:{position:"absolute",top:1,insetInlineEnd:1},children:l.jsx(uc,{image:u,children:l.jsx(le,{"aria-label":j("parameters.deleteImage"),icon:l.jsx(Z8,{}),size:"xs",fontSize:14,isDisabled:!s})})})]},g)})},_9);$y.displayName="HoverableImage";const D9="0px",dp="calc(70px + 1rem)",O9=4,fp=1.5,A9=`calc(100vw - ${D9})`,z9=`calc(100vh - ${fp*4}px)`,R9=`calc(100vh - ${dp})`,n0=`calc(100vh - (${dp} + 6rem))`,N9=`calc(100vh - (${dp} + 4.4rem))`,Al="22.5rem";const F9=re(Ly,{shouldForwardProp:e=>!["sx"].includes(e)}),zl=320,r0=40,L9={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},i0=400;function Gy(){const e=Y(),{direction:t}=Ji(),{t:n}=Z(),{images:r,currentCategory:i,currentImageUuid:s,shouldPinGallery:c,shouldShowGallery:u,galleryImageMinimumWidth:f,galleryGridTemplateColumns:h,activeTabName:p,galleryImageObjectFit:g,shouldHoldGalleryOpen:y,shouldAutoSwitchToNewImages:S,areMoreImagesAvailable:C,galleryWidth:w,isLightboxOpen:k,isStaging:j,shouldEnableResize:M,shouldUseSingleGalleryColumn:P}=O(t9),{galleryMinWidth:I,galleryMaxWidth:T}=k?{galleryMinWidth:i0,galleryMaxWidth:i0}:L9[p],[D,_]=x.useState(w>=zl),[z,V]=x.useState(!1),[F,L]=x.useState(0),X=x.useRef(null),$=x.useRef(null),Q=x.useRef(null);x.useEffect(()=>{_(w>=zl)},[w]);const ie=()=>{!c&&e(Fi(!0)),e(tC(!c)),e(on(!0))},oe=()=>{u?K():U()},U=()=>{e(Fi(!0)),c&&e(on(!0))},K=x.useCallback(()=>{e(Fi(!1)),e(KS(!1)),setTimeout(()=>c&&e(on(!0)),400)},[e,c]),ne=()=>{e(nC(i))},ce=J=>{e(Da(J))},Re=()=>{y||(Q.current=window.setTimeout(()=>K(),500))},ze=()=>{Q.current&&window.clearTimeout(Q.current)};fe("g",()=>{oe()},[u,c]),fe("left",()=>{e(N1())},{enabled:!j||p!=="unifiedCanvas"},[j]),fe("right",()=>{e(F1())},{enabled:!j||p!=="unifiedCanvas"},[j]),fe("shift+g",()=>{ie()},[c]),fe("esc",()=>{e(Fi(!1))},{enabled:()=>!c,preventDefault:!0},[c]);const Me=32;return fe("shift+up",()=>{if(f<256){const J=te.clamp(f+Me,32,256);e(Da(J))}},[f]),fe("shift+down",()=>{if(f>32){const J=te.clamp(f-Me,32,256);e(Da(J))}},[f]),x.useEffect(()=>{function J(ue){!c&&X.current&&!X.current.contains(ue.target)&&K()}return document.addEventListener("mousedown",J),()=>{document.removeEventListener("mousedown",J)}},[K,c]),l.jsx(Uy,{nodeRef:X,in:u||y,unmountOnExit:!0,timeout:200,classNames:`${t}-image-gallery-css-transition`,children:l.jsxs(We,{className:`${t}-image-gallery-css-transition`,sx:c?{zIndex:1,insetInlineEnd:0}:{zIndex:100,position:"fixed",height:"100vh",top:0,insetInlineEnd:0},ref:X,onMouseLeave:c?void 0:Re,onMouseEnter:c?void 0:ze,onMouseOver:c?void 0:ze,children:[l.jsxs(F9,{sx:{padding:4,display:"flex",flexDirection:"column",rowGap:4,borderRadius:c?"base":0,borderInlineStartWidth:5,bg:"base.850",borderColor:"base.700"},minWidth:I,maxWidth:c?T:window.innerWidth,"data-pinned":c,handleStyles:t==="rtl"?{right:{width:"15px"}}:{left:{width:"15px"}},enable:t==="rtl"?{right:M}:{left:M},size:{width:w,height:c?"100%":"100vh"},onResizeStart:(J,ue,Ie)=>{L(Ie.clientHeight),Ie.style.height=`${Ie.clientHeight}px`,c&&(Ie.style.position="fixed",Ie.style.insetInlineEnd="1rem",V(!0))},onResizeStop:(J,ue,Ie,Be)=>{const Ne=c?te.clamp(Number(w)+Be.width,I,Number(T)):Number(w)+Be.width;e(QS(Ne)),Ie.removeAttribute("data-resize-alert"),c&&(console.log("unpin"),Ie.style.position="relative",Ie.style.removeProperty("inset-inline-end"),Ie.style.setProperty("height",c?"100%":"100vh"),V(!1),e(on(!0)))},onResize:(J,ue,Ie,Be)=>{const Ne=te.clamp(Number(w)+Be.width,I,Number(c?T:.95*window.innerWidth));Ne>=zl&&!D?_(!0):Ne<zl&&D&&_(!1),f>Ne-r0&&e(Da(Ne-r0)),c&&(Ne>=T?Ie.setAttribute("data-resize-alert","true"):Ie.removeAttribute("data-resize-alert")),Ie.style.height=`${F}px`},children:[l.jsxs(B,{alignItems:"center",gap:2,justifyContent:"space-between",children:[l.jsx(en,{size:"sm",isAttached:!0,w:"max-content",justifyContent:"stretch",children:D?l.jsxs(l.Fragment,{children:[l.jsx(Je,{size:"sm",isChecked:i==="result",onClick:()=>e(gl("result")),flexGrow:1,children:n("gallery.generations")}),l.jsx(Je,{size:"sm",isChecked:i==="user",onClick:()=>e(gl("user")),flexGrow:1,children:n("gallery.uploads")})]}):l.jsxs(l.Fragment,{children:[l.jsx(le,{"aria-label":n("gallery.showGenerations"),tooltip:n("gallery.showGenerations"),isChecked:i==="result",icon:l.jsx(L8,{}),onClick:()=>e(gl("result"))}),l.jsx(le,{"aria-label":n("gallery.showUploads"),tooltip:n("gallery.showUploads"),isChecked:i==="user",icon:l.jsx(e9,{}),onClick:()=>e(gl("user"))})]})}),l.jsxs(B,{gap:2,children:[l.jsx(rr,{triggerComponent:l.jsx(le,{size:"sm","aria-label":n("gallery.gallerySettings"),icon:l.jsx(sp,{})}),children:l.jsxs(B,{direction:"column",gap:2,children:[l.jsx(ut,{value:f,onChange:ce,min:32,max:256,hideTooltip:!0,label:n("gallery.galleryImageSize"),withReset:!0,handleReset:()=>e(Da(64))}),l.jsx(pt,{label:n("gallery.maintainAspectRatio"),isChecked:g==="contain",onChange:()=>e(ZS(g==="contain"?"cover":"contain"))}),l.jsx(pt,{label:n("gallery.autoSwitchNewImages"),isChecked:S,onChange:J=>e(JS(J.target.checked))}),l.jsx(pt,{label:n("gallery.singleColumnLayout"),isChecked:P,onChange:J=>e(eC(J.target.checked))})]})}),l.jsx(le,{size:"sm","aria-label":n("gallery.pinGallery"),tooltip:`${n("gallery.pinGallery")} (Shift+G)`,onClick:ie,icon:c?l.jsx(By,{}):l.jsx(Hy,{})})]})]}),l.jsx(B,{direction:"column",gap:2,h:c?n0:"100vh",maxH:c?n0:"100vh",overflowY:"scroll",ref:$,sx:{...p2},children:r.length||C?l.jsxs(l.Fragment,{children:[l.jsx($n,{gap:2,style:{gridTemplateColumns:h},children:r.map(J=>{const{uuid:ue}=J,Ie=s===ue;return l.jsx($y,{image:J,isSelected:Ie},ue)})}),l.jsx(Je,{onClick:ne,isDisabled:!C,flexShrink:0,children:n(C?"gallery.loadMore":"gallery.allImagesLoaded")})]}):l.jsxs(B,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,padding:8,h:"100%",w:"100%",color:"base.500"},children:[l.jsx(Jt,{as:cp,sx:{w:16,h:16}}),l.jsx("p",{children:n("gallery.noImagesInGallery")})]})})]}),z&&l.jsx(We,{style:{width:`${w}px`,height:"100%"}})]})})}var B9=nh({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"})]})}),qy=nh({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"})]})}),H9=nh({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 W9(e){return me({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 xt=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:s=!1})=>l.jsxs(B,{gap:2,children:[n&&l.jsx(Yt,{label:`Recall ${e}`,children:l.jsx(ci,{"aria-label":"Use this parameter",icon:l.jsx(W9,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&l.jsx(Yt,{label:`Copy ${e}`,children:l.jsx(ci,{"aria-label":`Copy ${e}`,icon:l.jsx(Jo,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),l.jsxs(B,{direction:i?"column":"row",children:[l.jsxs(Ce,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?l.jsxs($i,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",l.jsx(qy,{mx:"2px"})]}):l.jsx(Ce,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),V9=(e,t)=>e.image.uuid===t.image.uuid,hp=x.memo(({image:e,styleClass:t})=>{var F,L;const n=Y(),r=lp();fe("esc",()=>{n(R1(!1))});const i=((F=e==null?void 0:e.metadata)==null?void 0:F.image)||{},s=e==null?void 0:e.dreamPrompt,{cfg_scale:c,fit:u,height:f,hires_fix:h,init_image_path:p,mask_image_path:g,orig_path:y,perlin:S,postprocessing:C,prompt:w,sampler:k,seamless:j,seed:M,steps:P,strength:I,threshold:T,type:D,variations:_,width:z}=i,V=JSON.stringify(e.metadata,null,2);return l.jsx(We,{className:t,sx:{position:"absolute",top:"0",width:"100%",borderRadius:"base",padding:4,overflow:"scroll",maxHeight:N9,height:"100%",zIndex:"10",backdropFilter:"blur(10px)",bg:"blackAlpha.600"},children:l.jsxs(B,{gap:1,direction:"column",width:"100%",children:[l.jsxs(B,{gap:2,children:[l.jsx(Ce,{fontWeight:"semibold",children:"File:"}),l.jsxs($i,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,l.jsx(qy,{mx:"2px"})]})]}),Object.keys(i).length>0?l.jsxs(l.Fragment,{children:[D&&l.jsx(xt,{label:"Generation type",value:D}),((L=e.metadata)==null?void 0:L.model_weights)&&l.jsx(xt,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(D)&&l.jsx(xt,{label:"Original image",value:y}),w&&l.jsx(xt,{label:"Prompt",labelPosition:"top",value:typeof w=="string"?w:D1(w),onClick:()=>r(w)}),M!==void 0&&l.jsx(xt,{label:"Seed",value:M,onClick:()=>n(as(M))}),T!==void 0&&l.jsx(xt,{label:"Noise Threshold",value:T,onClick:()=>n(ef(T))}),S!==void 0&&l.jsx(xt,{label:"Perlin Noise",value:S,onClick:()=>n(tf(S))}),k&&l.jsx(xt,{label:"Sampler",value:k,onClick:()=>n(L1(k))}),P&&l.jsx(xt,{label:"Steps",value:P,onClick:()=>n(nf(P))}),c!==void 0&&l.jsx(xt,{label:"CFG scale",value:c,onClick:()=>n(rf(c))}),_&&_.length>0&&l.jsx(xt,{label:"Seed-weight pairs",value:Nv(_),onClick:()=>n(B1(Nv(_)))}),j&&l.jsx(xt,{label:"Seamless",value:j,onClick:()=>n(H1(j))}),h&&l.jsx(xt,{label:"High Resolution Optimization",value:h,onClick:()=>n(W1(h))}),z&&l.jsx(xt,{label:"Width",value:z,onClick:()=>n(Wl(z))}),f&&l.jsx(xt,{label:"Height",value:f,onClick:()=>n(Vl(f))}),p&&l.jsx(xt,{label:"Initial image",value:p,isLink:!0,onClick:()=>n(os(p))}),g&&l.jsx(xt,{label:"Mask image",value:g,isLink:!0,onClick:()=>n(rC(g))}),D==="img2img"&&I&&l.jsx(xt,{label:"Image to image strength",value:I,onClick:()=>n(of(I))}),u&&l.jsx(xt,{label:"Image to image fit",value:u,onClick:()=>n(V1(u))}),C&&C.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(Vn,{size:"sm",children:"Postprocessing"}),C.map((X,$)=>{if(X.type==="esrgan"){const{scale:Q,strength:ie,denoise_str:oe}=X;return l.jsxs(B,{pl:8,gap:1,direction:"column",children:[l.jsx(Ce,{size:"md",children:`${$+1}: Upscale (ESRGAN)`}),l.jsx(xt,{label:"Scale",value:Q,onClick:()=>n(M1(Q))}),l.jsx(xt,{label:"Strength",value:ie,onClick:()=>n(Jd(ie))}),oe!==void 0&&l.jsx(xt,{label:"Denoising strength",value:oe,onClick:()=>n(Zd(oe))})]},$)}else if(X.type==="gfpgan"){const{strength:Q}=X;return l.jsxs(B,{pl:8,gap:1,direction:"column",children:[l.jsx(Ce,{size:"md",children:`${$+1}: Face restoration (GFPGAN)`}),l.jsx(xt,{label:"Strength",value:Q,onClick:()=>{n(Zl(Q)),n(Hl("gfpgan"))}})]},$)}else if(X.type==="codeformer"){const{strength:Q,fidelity:ie}=X;return l.jsxs(B,{pl:8,gap:1,direction:"column",children:[l.jsx(Ce,{size:"md",children:`${$+1}: Face restoration (Codeformer)`}),l.jsx(xt,{label:"Strength",value:Q,onClick:()=>{n(Zl(Q)),n(Hl("codeformer"))}}),ie&&l.jsx(xt,{label:"Fidelity",value:ie,onClick:()=>{n(Qd(ie)),n(Hl("codeformer"))}})]},$)}})]}),s&&l.jsx(xt,{withCopy:!0,label:"Dream Prompt",value:s}),l.jsxs(B,{gap:2,direction:"column",children:[l.jsxs(B,{gap:2,children:[l.jsx(Yt,{label:"Copy metadata JSON",children:l.jsx(ci,{"aria-label":"Copy metadata JSON",icon:l.jsx(Jo,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(V)})}),l.jsx(Ce,{fontWeight:"semibold",children:"Metadata JSON:"})]}),l.jsx(We,{sx:{mt:0,mr:2,mb:4,ml:2,padding:4,borderRadius:"base",overflowX:"scroll",wordBreak:"break-all",bg:"whiteAlpha.100"},children:l.jsx("pre",{children:V})})]})]}):l.jsx(Cx,{width:"100%",pt:10,children:l.jsx(Ce,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},V9);hp.displayName="ImageMetadataViewer";const o0={height:"100%",width:"15%",alignItems:"center",pointerEvents:"auto"},a0={color:"base.100"},U9=be(Vr,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)}),i=n.length;return{isOnFirstImage:r===0,isOnLastImage:!isNaN(r)&&r===i-1}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),Yy=()=>{const e=Y(),{isOnFirstImage:t,isOnLastImage:n}=O(U9),[r,i]=x.useState(!1),s=()=>{i(!0)},c=()=>{i(!1)},u=()=>{e(N1())},f=()=>{e(F1())};return l.jsxs(B,{sx:{justifyContent:"space-between",zIndex:1,height:"100%",width:"100%",pointerEvents:"none"},children:[l.jsx($n,{sx:{...o0,justifyContent:"flex-start"},onMouseOver:s,onMouseOut:c,children:r&&!t&&l.jsx(ci,{"aria-label":"Previous image",icon:l.jsx(P8,{size:64}),variant:"unstyled",onClick:u,boxSize:16,sx:a0})}),l.jsx($n,{sx:{...o0,justifyContent:"flex-end"},onMouseOver:s,onMouseOut:c,children:r&&!n&&l.jsx(ci,{"aria-label":"Next image",icon:l.jsx(I8,{size:64}),variant:"unstyled",onClick:f,boxSize:16,sx:a0})})]})};var Wn=function(e,t){return Number(e.toFixed(t))},$9=function(e,t){return typeof e=="number"?e:t},Tt=function(e,t,n){n&&typeof n=="function"&&n(e,t)},G9=function(e){return-Math.cos(e*Math.PI)/2+.5},q9=function(e){return e},Y9=function(e){return e*e},X9=function(e){return e*(2-e)},K9=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},Q9=function(e){return e*e*e},Z9=function(e){return--e*e*e+1},J9=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},eP=function(e){return e*e*e*e},tP=function(e){return 1- --e*e*e*e},nP=function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},rP=function(e){return e*e*e*e*e},iP=function(e){return 1+--e*e*e*e*e},oP=function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},Xy={easeOut:G9,linear:q9,easeInQuad:Y9,easeOutQuad:X9,easeInOutQuad:K9,easeInCubic:Q9,easeOutCubic:Z9,easeInOutCubic:J9,easeInQuart:eP,easeOutQuart:tP,easeInOutQuart:nP,easeInQuint:rP,easeOutQuint:iP,easeInOutQuint:oP},Ky=function(e){typeof e=="number"&&cancelAnimationFrame(e)},gr=function(e){e.mounted&&(Ky(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function Qy(e,t,n,r){if(e.mounted){var i=new Date().getTime(),s=1;gr(e),e.animation=function(){if(!e.mounted)return Ky(e.animation);var c=new Date().getTime()-i,u=c/n,f=Xy[t],h=f(u);c>=n?(r(s),e.animation=null):e.animation&&(r(h),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function aP(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function vi(e,t,n,r){var i=aP(t);if(!(!e.mounted||!i)){var s=e.setTransformState,c=e.transformState,u=c.scale,f=c.positionX,h=c.positionY,p=t.scale-u,g=t.positionX-f,y=t.positionY-h;n===0?s(t.scale,t.positionX,t.positionY):Qy(e,r,n,function(S){var C=u+p*S,w=f+g*S,k=h+y*S;s(C,w,k)})}}function sP(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,s=t.offsetWidth,c=t.offsetHeight,u=s*n,f=c*n,h=r-u,p=i-f;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:u,newDiffWidth:h,newContentHeight:f,newDiffHeight:p}}var lP=function(e,t,n,r,i,s,c){var u=e>t?n*(c?1:.5):0,f=r>i?s*(c?1:.5):0,h=e-t-u,p=u,g=r-i-f,y=f;return{minPositionX:h,maxPositionX:p,minPositionY:g,maxPositionY:y}},pp=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var s=sP(n,r,t),c=s.wrapperWidth,u=s.wrapperHeight,f=s.newContentWidth,h=s.newDiffWidth,p=s.newContentHeight,g=s.newDiffHeight,y=lP(c,f,h,u,p,g,Boolean(i));return y},Df=function(e,t,n,r){return r?e<t?Wn(t,2):e>n?Wn(n,2):Wn(e,2):Wn(e,2)},ea=function(e,t){var n=pp(e,t);return e.bounds=n,n};function Nc(e,t,n,r,i,s,c){var u=n.minPositionX,f=n.minPositionY,h=n.maxPositionX,p=n.maxPositionY,g=0,y=0;c&&(g=i,y=s);var S=Df(e,u-g,h+g,r),C=Df(t,f-y,p+y,r);return{x:S,y:C}}function Fc(e,t,n,r,i,s){var c=e.transformState,u=c.scale,f=c.positionX,h=c.positionY,p=r-u;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:f,y:h};var g=f-t*p,y=h-n*p,S=Nc(g,y,i,s,0,0,null);return S}function ys(e,t,n,r,i){var s=i?r:0,c=t-s;return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=c?c:e}var s0=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,s=t.target,c=i==null?void 0:i.contains(s),u=r&&s&&c;if(!u)return!1;var f=Lc(s,n);return!f},l0=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,s=t&&n&&!i;return!!s},cP=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var s=t.clientX,c=t.clientY;e.startCoords={x:s-r,y:c-i}},uP=function(e,t){var n=t.touches,r=e.transformState,i=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-i,y:f-s}}};function dP(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,s=e.setup,c=s.disabled,u=s.limitToBounds,f=s.centerZoomedOut,h=e.wrapperComponent;if(!(c||!h||!e.bounds)){var p=e.bounds,g=p.maxPositionX,y=p.minPositionX,S=p.maxPositionY,C=p.minPositionY,w=n>g||n<y,k=r>S||r<C,j=n>g?h.offsetWidth:e.setup.minPositionX||0,M=r>S?h.offsetHeight:e.setup.minPositionY||0,P=Fc(e,j,M,i,e.bounds,u||f),I=P.x,T=P.y;return{scale:i,positionX:w?I:n,positionY:k?T:r}}}function fP(e,t,n,r,i){var s=e.setup.limitToBounds,c=e.wrapperComponent,u=e.bounds,f=e.transformState,h=f.scale,p=f.positionX,g=f.positionY;if(!(c===null||u===null||t===p&&n===g)){var y=Nc(t,n,u,s,r,i,c),S=y.x,C=y.y;e.setTransformState(h,S,C)}}var hP=function(e,t,n){var r=e.startCoords,i=e.transformState,s=e.setup.panning,c=s.lockAxisX,u=s.lockAxisY,f=i.positionX,h=i.positionY;if(!r)return{x:f,y:h};var p=t-r.x,g=n-r.y,y=c?f:p,S=u?h:g;return{x:y,y:S}},dc=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,s=n.minScale,c=n.disablePadding;return t>0&&i>=s&&!c?t:0},pP=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,s=e.transformState.scale,c=i.disabled,u=!c||s>1||!r||t;return!!u},mP=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,s=i.disabled,c=i.velocityAnimation,u=e.transformState.scale,f=c.disabled,h=!f||u>1||!s||t;return!(!h||!n||!r)};function vP(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,s=n.sensitivity;return r?i*t*s:i}function c0(e,t,n,r,i,s,c,u,f,h){if(i){if(t>c&&n>c){var p=c+(e-c)*h;return p>f?f:p<c?c:p}if(t<s&&n<s){var p=s+(e-s)*h;return p<u?u:p>s?s:p}}return r?t:Df(e,s,c,i)}function gP(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function xP(e,t){var n=pP(e);if(n){var r=e.lastMousePosition,i=e.velocityTime,s=e.setup,c=e.wrapperComponent,u=s.velocityAnimation.equalToMove,f=Date.now();if(r&&i&&c){var h=gP(c,u),p=t.x-r.x,g=t.y-r.y,y=p/h,S=g/h,C=f-i,w=p*p+g*g,k=Math.sqrt(w)/C;e.velocity={velocityX:y,velocityY:S,total:k}}e.lastMousePosition=t,e.velocityTime=f}}function yP(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,s=mP(e);if(!(!s||!t||!n||!i)){var c=t.velocityX,u=t.velocityY,f=t.total,h=n.maxPositionX,p=n.minPositionX,g=n.maxPositionY,y=n.minPositionY,S=r.limitToBounds,C=r.alignmentAnimation,w=r.zoomAnimation,k=r.panning,j=k.lockAxisY,M=k.lockAxisX,P=w.animationType,I=C.sizeX,T=C.sizeY,D=C.velocityAlignmentTime,_=D,z=vP(e,f),V=Math.max(z,_),F=dc(e,I),L=dc(e,T),X=F*i.offsetWidth/100,$=L*i.offsetHeight/100,Q=h+X,ie=p-X,oe=g+$,U=y-$,K=e.transformState,ne=new Date().getTime();Qy(e,P,V,function(ce){var Re=e.transformState,ze=Re.scale,Me=Re.positionX,J=Re.positionY,ue=new Date().getTime()-ne,Ie=ue/_,Be=Xy[C.animationType],Ne=1-Be(Math.min(1,Ie)),Ge=1-ce,Qe=Me+c*Ge,ve=J+u*Ge,_e=c0(Qe,K.positionX,Me,M,S,p,h,ie,Q,Ne),qe=c0(ve,K.positionY,J,j,S,y,g,U,oe,Ne);(Me!==Qe||J!==ve)&&e.setTransformState(ze,_e,qe)})}}function u0(e,t){var n=e.transformState.scale;gr(e),ea(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?uP(e,t):cP(e,t)}function Zy(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,s=i.disabled,c=i.sizeX,u=i.sizeY,f=i.animationTime,h=i.animationType,p=s||t<r||!c&&!u;if(!p){var g=dP(e);g&&vi(e,g,f,h)}}function d0(e,t,n){var r=e.startCoords,i=e.setup,s=i.alignmentAnimation,c=s.sizeX,u=s.sizeY;if(r){var f=hP(e,t,n),h=f.x,p=f.y,g=dc(e,c),y=dc(e,u);xP(e,{x:h,y:p}),fP(e,h,p,g,y)}}function bP(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var s=r==null?void 0:r.getBoundingClientRect(),c=i==null?void 0:i.getBoundingClientRect(),u=(s==null?void 0:s.width)||0,f=(s==null?void 0:s.height)||0,h=(c==null?void 0:c.width)||0,p=(c==null?void 0:c.height)||0,g=u<h||f<p,y=!t&&n&&(n==null?void 0:n.total)>.1&&g;y?yP(e):Zy(e)}}function mp(e,t,n,r){var i=e.setup,s=i.minScale,c=i.maxScale,u=i.limitToBounds,f=ys(Wn(t,2),s,c,0,!1),h=ea(e,f),p=Fc(e,n,r,f,h,u),g=p.x,y=p.y;return{scale:f,positionX:g,positionY:y}}function Jy(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,s=e.setup,c=s.minScale,u=s.limitToBounds,f=s.zoomAnimation,h=f.disabled,p=f.animationTime,g=f.animationType,y=h||r>=c;if((r>=1||u)&&Zy(e),!(y||!i||!e.mounted)){var S=t||i.offsetWidth/2,C=n||i.offsetHeight/2,w=mp(e,c,S,C);w&&vi(e,w,p,g)}}var li=function(){return li=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},li.apply(this,arguments)};function f0(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;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},Aa={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}},e4=function(e){var t,n,r,i;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:(i=e.initialPositionY)!==null&&i!==void 0?i:Rl.positionY}},h0=function(e){var t=li({},Aa);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof Aa[n]<"u";if(i&&r){var s=Object.prototype.toString.call(Aa[n]),c=s==="[object Object]",u=s==="[object Array]";c?t[n]=li(li({},Aa[n]),e[n]):u?t[n]=f0(f0([],Aa[n],!0),e[n],!0):t[n]=e[n]}}),t},t4=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,s=e.setup,c=s.maxScale,u=s.minScale,f=s.zoomAnimation,h=f.size;if(!i)throw new Error("Wrapper is not mounted");var p=r*Math.exp(t*n),g=ys(Wn(p,3),u,c,h,!1);return g};function n4(e,t,n,r,i){var s=e.wrapperComponent,c=e.transformState,u=c.scale,f=c.positionX,h=c.positionY;if(!s)return console.error("No WrapperComponent found");var p=s.offsetWidth,g=s.offsetHeight,y=(p/2-f)/u,S=(g/2-h)/u,C=t4(e,t,n),w=mp(e,C,y,S);if(!w)return console.error("Error during zoom event. New transformation state was not calculated.");vi(e,w,r,i)}function r4(e,t,n,r){var i=e.setup,s=e.wrapperComponent,c=i.limitToBounds,u=e4(e.props),f=e.transformState,h=f.scale,p=f.positionX,g=f.positionY;if(s){var y=pp(e,u.scale),S=Nc(u.positionX,u.positionY,y,c,0,0,s),C={scale:u.scale,positionX:S.x,positionY:S.y};h===u.scale&&p===u.positionX&&g===u.positionY||(r==null||r(),vi(e,C,t,n))}}function SP(e,t,n,r){var i=e.getBoundingClientRect(),s=t.getBoundingClientRect(),c=n.getBoundingClientRect(),u=s.x*r.scale,f=s.y*r.scale;return{x:(i.x-c.x+u)/r.scale,y:(i.y-c.y+f)/r.scale}}function CP(e,t,n){var r=e.wrapperComponent,i=e.contentComponent,s=e.transformState,c=e.setup,u=c.limitToBounds,f=c.minScale,h=c.maxScale;if(!r||!i)return s;var p=r.getBoundingClientRect(),g=t.getBoundingClientRect(),y=SP(t,r,i,s),S=y.x,C=y.y,w=g.width/s.scale,k=g.height/s.scale,j=r.offsetWidth/w,M=r.offsetHeight/k,P=ys(n||Math.min(j,M),f,h,0,!1),I=(p.width-w*P)/2,T=(p.height-k*P)/2,D=(p.left-S)*P+I,_=(p.top-C)*P+T,z=pp(e,P),V=Nc(D,_,z,u,0,0,r),F=V.x,L=V.y;return{positionX:F,positionY:L,scale:P}}var wP=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),n4(e,1,t,n,r)}},kP=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),n4(e,-1,t,n,r)}},jP=function(e){return function(t,n,r,i,s){i===void 0&&(i=300),s===void 0&&(s="easeOut");var c=e.transformState,u=c.positionX,f=c.positionY,h=c.scale,p=e.wrapperComponent,g=e.contentComponent,y=e.setup.disabled;if(!(y||!p||!g)){var S={positionX:Number.isNaN(t)?u:t,positionY:Number.isNaN(n)?f:n,scale:Number.isNaN(r)?h:r};vi(e,S,i,s)}}},EP=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),r4(e,t,n)}},PP=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,s=e.wrapperComponent,c=e.contentComponent;if(s&&c){var u=i4(t||i.scale,s,c);vi(e,u,n,r)}}},IP=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),gr(e);var s=e.wrapperComponent,c=typeof t=="string"?document.getElementById(t):t;if(s&&c&&s.contains(c)){var u=CP(e,c,n);vi(e,u,r,i)}}},dt=function(e){return{instance:e,state:e.transformState,zoomIn:wP(e),zoomOut:kP(e),setTransform:jP(e),resetTransform:EP(e),centerView:PP(e),zoomToElement:IP(e)}},Nd=!1;function Fd(){try{var e={get passive(){return Nd=!0,!1}};return e}catch{return Nd=!1,Nd}}var Lc=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(s){return s.toUpperCase()===n});if(r)return!0;var i=t.find(function(s){return e.classList.contains(s)});return!!i},Of=function(e){e&&clearTimeout(e)},MP=function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")},i4=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,s=(t.offsetWidth-r)/2,c=(t.offsetHeight-i)/2;return{scale:e,positionX:s,positionY:c}};function TP(e){return function(t){e.forEach(function(n){typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var _P=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,s=n.touchPadDisabled,c=n.excluded,u=e.isInitialized,f=e.isPanning,h=t.target,p=u&&!f&&!r&&h;if(!p||i&&!t.ctrlKey||s&&t.ctrlKey)return!1;var g=Lc(h,c);return!g},DP=function(e){return e?e.deltaY<0?1:-1:0};function OP(e,t){var n=DP(e),r=$9(t,n);return r}function o4(e,t,n){var r=t.getBoundingClientRect(),i=0,s=0;if("clientX"in e)i=(e.clientX-r.left)/n,s=(e.clientY-r.top)/n;else{var c=e.touches[0];i=(c.clientX-r.left)/n,s=(c.clientY-r.top)/n}return(Number.isNaN(i)||Number.isNaN(s))&&console.error("No mouse or touch offset found"),{x:i,y:s}}var AP=function(e,t,n,r,i){var s=e.transformState.scale,c=e.wrapperComponent,u=e.setup,f=u.maxScale,h=u.minScale,p=u.zoomAnimation,g=u.disablePadding,y=p.size,S=p.disabled;if(!c)throw new Error("Wrapper is not mounted");var C=s+t*(s-s*n)*n;if(i)return C;var w=r?!1:!S,k=ys(Wn(C,3),h,f,y,w&&!g);return k},zP=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,s=i.maxScale,c=i.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},RP=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,s=e.isInitialized,c=t.target,u=s&&!r&&c;if(!u)return!1;var f=Lc(c,i);return!f},NP=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},FP=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,s=Wn(i[0].clientX-r.left,5),c=Wn(i[0].clientY-r.top,5),u=Wn(i[1].clientX-r.left,5),f=Wn(i[1].clientY-r.top,5);return{x:(s+u)/2/t,y:(c+f)/2/t}},a4=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))},LP=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,s=i.maxScale,c=i.minScale,u=i.zoomAnimation,f=i.disablePadding,h=u.size,p=u.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var g=t/r,y=g*n;return ys(Wn(y,2),c,s,h,!p&&!f)},BP=160,HP=100,WP=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(gr(e),Tt(dt(e),t,r),Tt(dt(e),t,i))},VP=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,s=e.contentComponent,c=e.setup,u=e.transformState,f=u.scale,h=c.limitToBounds,p=c.centerZoomedOut,g=c.zoomAnimation,y=c.wheel,S=c.disablePadding,C=g.size,w=g.disabled,k=y.step;if(!s)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var j=OP(t,null),M=AP(e,j,k,!t.ctrlKey);if(f!==M){var P=ea(e,M),I=o4(t,s,f),T=w||C===0||p||S,D=h&&T,_=Fc(e,I.x,I.y,M,P,D),z=_.x,V=_.y;e.previousWheelEvent=t,e.setTransformState(M,z,V),Tt(dt(e),t,r),Tt(dt(e),t,i)}},UP=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;Of(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(Jy(e,t.x,t.y),e.wheelAnimationTimer=null)},HP);var s=zP(e,t);s&&(Of(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Tt(dt(e),t,r),Tt(dt(e),t,i))},BP))},$P=function(e,t){var n=a4(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,gr(e)},GP=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,s=e.setup,c=s.limitToBounds,u=s.centerZoomedOut,f=s.zoomAnimation,h=f.disabled,p=f.size;if(!(r===null||!n)){var g=FP(t,i,n);if(!(!Number.isFinite(g.x)||!Number.isFinite(g.y))){var y=a4(t),S=LP(e,y);if(S!==i){var C=ea(e,S),w=h||p===0||u,k=c&&w,j=Fc(e,g.x,g.y,S,C,k),M=j.x,P=j.y;e.pinchMidpoint=g,e.lastDistance=y,e.setTransformState(S,M,P)}}}},qP=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,Jy(e,t==null?void 0:t.x,t==null?void 0:t.y)},s4=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;Of(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,Tt(dt(e),t,n)},r)},YP=function(e,t){var n=e.props,r=n.onZoomStart,i=n.onZoom,s=e.setup.doubleClick,c=s.animationTime,u=s.animationType;Tt(dt(e),t,r),r4(e,c,u,function(){return Tt(dt(e),t,i)}),s4(e,t)};function XP(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,i=e.transformState,s=e.contentComponent,c=i.scale,u=e.props,f=u.onZoomStart,h=u.onZoom,p=n.doubleClick,g=p.disabled,y=p.mode,S=p.step,C=p.animationTime,w=p.animationType;if(!g&&!r){if(y==="reset")return YP(e,t);if(!s)return console.error("No ContentComponent found");var k=y==="zoomOut"?-1:1,j=t4(e,k,S);if(c!==j){Tt(dt(e),t,f);var M=o4(t,s,c),P=mp(e,j,M.x,M.y);if(!P)return console.error("Error during zoom event. New transformation state was not calculated.");Tt(dt(e),t,h),vi(e,P,C,w),s4(e,t)}}}var KP=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,s=r.doubleClick,c=s.disabled,u=s.excluded,f=t.target,h=i==null?void 0:i.contains(f),p=n&&f&&h&&!c;if(!p)return!1;var g=Lc(f,u);return!g},QP=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=h0(r)},this.initializeWindowEvents=function(){var r,i=Fd(),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,i),c==null||c.addEventListener("mousemove",n.onPanning,i),c==null||c.addEventListener("mouseup",n.onPanningStop,i),s==null||s.addEventListener("mouseleave",n.clearPanning,i),c==null||c.addEventListener("keyup",n.setKeyUnPressed,i),c==null||c.addEventListener("keydown",n.setKeyPressed,i)},this.cleanupWindowEvents=function(){var r,i,s=Fd(),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),gr(n),(i=n.observer)===null||i===void 0||i.disconnect()},this.handleInitializeWrapperEvents=function(r){var i=Fd();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},this.handleInitialize=function(r){var i=n.setup.centerOnInit;n.applyTransformation(),i&&(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 i=n.setup.disabled;if(!i){var s=_P(n,r);if(s){var c=n.isPressingKeys(n.setup.wheel.activationKeys);c&&(WP(n,r),VP(n,r),UP(n,r))}}},this.onPanningStart=function(r){var i=n.setup.disabled,s=n.props.onPanningStart;if(!i){var c=s0(n,r);if(c){var u=n.isPressingKeys(n.setup.panning.activationKeys);u&&(r.preventDefault(),r.stopPropagation(),gr(n),u0(n,r),Tt(dt(n),r,s))}}},this.onPanning=function(r){var i=n.setup.disabled,s=n.props.onPanning;if(!i){var c=l0(n);if(c){var u=n.isPressingKeys(n.setup.panning.activationKeys);u&&(r.preventDefault(),r.stopPropagation(),d0(n,r.clientX,r.clientY),Tt(dt(n),r,s))}}},this.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(bP(n),Tt(dt(n),r,i))},this.onPinchStart=function(r){var i=n.setup.disabled,s=n.props,c=s.onPinchingStart,u=s.onZoomStart;if(!i){var f=RP(n,r);f&&($P(n,r),gr(n),Tt(dt(n),r,c),Tt(dt(n),r,u))}},this.onPinch=function(r){var i=n.setup.disabled,s=n.props,c=s.onPinching,u=s.onZoom;if(!i){var f=NP(n);f&&(r.preventDefault(),r.stopPropagation(),GP(n,r),Tt(dt(n),r,c),Tt(dt(n),r,u))}},this.onPinchStop=function(r){var i=n.props,s=i.onPinchingStop,c=i.onZoomStop;n.pinchStartScale&&(qP(n),Tt(dt(n),r,s),Tt(dt(n),r,c))},this.onTouchPanningStart=function(r){var i=n.setup.disabled,s=n.props.onPanningStart;if(!i){var c=s0(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,gr(n);var f=r.touches,h=f.length===1,p=f.length===2;h&&(gr(n),u0(n,r),Tt(dt(n),r,s)),p&&n.onPinchStart(r)}}}},this.onTouchPanning=function(r){var i=n.setup.disabled,s=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var c=l0(n);if(!c)return;r.preventDefault(),r.stopPropagation();var u=r.touches[0];d0(n,u.clientX,u.clientY),Tt(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 i=n.setup.disabled;if(!i){var s=KP(n,r);s&&XP(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(i){return n.pressedKeys[i]})):!0},this.setTransformState=function(r,i,s){var c=n.props.onTransformed;if(!Number.isNaN(r)&&!Number.isNaN(i)&&!Number.isNaN(s)){r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=s;var u=dt(n);n.onChangeCallbacks.forEach(function(f){return f(u)}),Tt(u,{scale:r,positionX:i,positionY:s},c),n.applyTransformation()}else console.error("Detected NaN set state values")},this.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=i4(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},this.handleTransformStyles=function(r,i,s){return n.props.customTransform?n.props.customTransform(r,i,s):MP(r,i,s)},this.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,s=r.positionX,c=r.positionY,u=n.handleTransformStyles(s,c,i);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,i){n.cleanupWindowEvents(),n.wrapperComponent=r,n.contentComponent=i,ea(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(i),n.initializeWindowEvents(),n.isInitialized=!0,Tt(dt(n),void 0,n.props.onInit)},this.props=t,this.setup=h0(this.props),this.transformState=e4(this.props)}return e}(),Bc=ke.createContext(null),ZP=function(e,t){return typeof e=="function"?e(t):e},JP=ke.forwardRef(function(e,t){var n=x.useState(0),r=n[1],i=e.children,s=x.useRef(new QP(e)).current,c=ZP(e.children,dt(s)),u=x.useCallback(function(){typeof i=="function"&&r(function(f){return f+1})},[i]);return x.useImperativeHandle(t,function(){return dt(s)},[s]),x.useEffect(function(){s.update(e)},[s,e]),x.useEffect(function(){return s.onChange(u)},[s,e,u]),ke.createElement(Bc.Provider,{value:s},c)});function eI(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var tI=`.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;
|
||
}
|
||
`,p0={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};eI(tI);var nI=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,s=i===void 0?"":i,c=e.wrapperStyle,u=e.contentStyle,f=e.wrapperProps,h=f===void 0?{}:f,p=e.contentProps,g=p===void 0?{}:p,y=x.useContext(Bc).init,S=x.useRef(null),C=x.useRef(null);return x.useEffect(function(){var w=S.current,k=C.current;w!==null&&k!==null&&y&&y(w,k)},[]),ke.createElement("div",li({},h,{ref:S,className:"react-transform-wrapper ".concat(p0.wrapper," ").concat(r),style:c}),ke.createElement("div",li({},g,{ref:C,className:"react-transform-component ".concat(p0.content," ").concat(s),style:u}),t))},l4=function(){var e=x.useContext(Bc),t=x.useState(dt(e||{})),n=t[0],r=t[1];if(!e)throw new Error("Transform context mus be placed inside TransformWrapper");return x.useEffect(function(){e.onChange(function(i){r(i)})},[e]),n};ke.forwardRef(function(e,t){var n=x.useRef(null),r=x.useContext(Bc);return x.useEffect(function(){return r.onChange(function(i){if(n.current){var s=0,c=0;n.current.style.transform=r.handleTransformStyles(s,c,1/i.state.scale)}})},[r]),ke.createElement("div",li({},e,{ref:TP([n,t])}))});const rI=()=>{const[e,t]=x.useState(0),[n,r]=x.useState(1),[i,s]=x.useState(1);return{rotation:e,scaleX:n,scaleY:i,flipHorizontally:()=>{r(n*-1)},flipVertically:()=>{s(i*-1)},rotateCounterClockwise:()=>{t(e===-270?0:e-90)},rotateClockwise:()=>{t(e===270?0:e+90)},reset:()=>{t(0),r(1),s(1)}}},iI=({flipHorizontally:e,flipVertically:t,rotateCounterClockwise:n,rotateClockwise:r,reset:i})=>{const{zoomIn:s,zoomOut:c,resetTransform:u}=l4();return l.jsxs(en,{isAttached:!0,orientation:"vertical",children:[l.jsx(le,{icon:l.jsx(t8,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>s(),fontSize:20}),l.jsx(le,{icon:l.jsx(n8,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>c(),fontSize:20}),l.jsx(le,{icon:l.jsx(J7,{}),"aria-label":"Rotate Counter-Clockwise",tooltip:"Rotate Counter-Clockwise",onClick:n,fontSize:20}),l.jsx(le,{icon:l.jsx(e8,{}),"aria-label":"Rotate Clockwise",tooltip:"Rotate Clockwise",onClick:r,fontSize:20}),l.jsx(le,{icon:l.jsx(Jg,{}),"aria-label":"Flip Horizontally",tooltip:"Flip Horizontally",onClick:e,fontSize:20}),l.jsx(le,{icon:l.jsx(Jg,{style:{transform:"rotate(90deg)"}}),"aria-label":"Flip Vertically",tooltip:"Flip Vertically",onClick:t,fontSize:20}),l.jsx(le,{icon:l.jsx(ep,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{u(),i()},fontSize:20})]})};function oI({image:e,alt:t,ref:n,styleClass:r,rotation:i,scaleX:s,scaleY:c}){const{centerView:u}=l4();return l.jsx(nI,{wrapperStyle:{width:"100%",height:"100%"},children:l.jsx("img",{style:{transform:`rotate(${i}deg) scaleX(${s}) scaleY(${c})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>u(1,0,"easeOut")})})}const aI=be([Vr,ro],(e,t)=>{const{currentImage:n}=e,{shouldShowImageDetails:r}=t;return{viewerImageToDisplay:n,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function sI(){const e=Y(),t=O(y=>y.lightbox.isLightboxOpen),{rotation:n,scaleX:r,scaleY:i,flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:h}=rI(),{viewerImageToDisplay:p,shouldShowImageDetails:g}=O(aI);return fe("Esc",()=>{t&&e(Bi(!1))},[t]),l.jsx(JP,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:l.jsxs(We,{sx:{width:"100%",height:"100%",overflow:"hidden",position:"absolute",insetInlineStart:0,top:0,zIndex:30,animation:"popIn 0.3s ease-in",bg:"base.800"},children:[l.jsxs(B,{sx:{flexDir:"column",position:"absolute",top:4,insetInlineStart:4,gap:4,zIndex:3},children:[l.jsx(le,{icon:l.jsx(Z7,{}),"aria-label":"Exit Viewer",onClick:()=>{e(Bi(!1))},fontSize:20}),l.jsx(iI,{flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:h})]}),l.jsxs(B,{children:[l.jsxs($n,{sx:{overflow:"hidden",gridTemplateColumns:"auto max-content",placeItems:"center",width:"100vw",height:"100vh",bg:"base.850"},children:[p&&l.jsxs(l.Fragment,{children:[l.jsx(oI,{rotation:n,scaleX:r,scaleY:i,image:p.url,styleClass:"lightbox-image"}),g&&l.jsx(hp,{image:p})]}),!g&&l.jsx(We,{sx:{position:"absolute",top:0,insetInlineStart:0,w:`calc(100vw - ${8*2*4}px)`,h:"100vh",mx:8,pointerEvents:"none"},children:l.jsx(Yy,{})}),l.jsx(We,{sx:{position:"absolute",top:4},children:l.jsx(Fy,{})})]}),l.jsx(Gy,{})]})]})})}function lI(e){const{menuType:t="icon",iconTooltip:n,buttonText:r,isLazy:i=!0,menuItems:s,menuProps:c,menuButtonProps:u,menuListProps:f,menuItemProps:h}=e,p=()=>{const g=[];return s.forEach((y,S)=>{g.push(l.jsx(pr,{onClick:y.onClick,fontSize:"sm",...h,children:y.item},S))}),g};return l.jsx(Rh,{...c,isLazy:i,children:({isOpen:g})=>l.jsxs(l.Fragment,{children:[l.jsx(Fh,{as:t==="icon"?ci:to,tooltip:n,"aria-label":n,icon:g?l.jsx(w9,{}):l.jsx(C9,{}),paddingX:0,paddingY:t==="regular"?2:0,...u,children:t==="regular"&&r}),l.jsx(Nh,{zIndex:15,padding:0,...f,children:p()})]})})}const cI=be(Pt,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:te.isEqual}});function vp(e){const t=Y(),{btnGroupWidth:n="auto",...r}=e,{isProcessing:i,isConnected:s,isCancelable:c,currentIteration:u,totalIterations:f,cancelType:h,cancelAfter:p}=O(cI),g=x.useCallback(()=>{t(iC()),t(dd(null))},[t]),{t:y}=Z(),S=p!==null;fe("shift+x",()=>{(s||i)&&c&&g()},[s,i,c]),x.useEffect(()=>{p!==null&&p<u&&g()},[p,u,g]);const C=[{item:y("parameters.cancel.immediate"),onClick:()=>t(Fv("immediate"))},{item:y("parameters.cancel.schedule"),onClick:()=>t(Fv("scheduled"))}];return l.jsxs(en,{isAttached:!0,width:n,children:[h==="immediate"?l.jsx(le,{icon:l.jsx(k9,{}),tooltip:y("parameters.cancel.immediate"),"aria-label":y("parameters.cancel.immediate"),isDisabled:!s||!i||!c,onClick:g,colorScheme:"error",...r}):l.jsx(le,{icon:S?l.jsx(ic,{}):l.jsx(h9,{}),tooltip:y(S?"parameters.cancel.isScheduled":"parameters.cancel.schedule"),"aria-label":y(S?"parameters.cancel.isScheduled":"parameters.cancel.schedule"),isDisabled:!s||!i||!c||u===f,onClick:()=>{t(S?dd(null):dd(u))},colorScheme:"error",...r}),l.jsx(lI,{menuItems:C,iconTooltip:y("parameters.cancel.setType"),menuButtonProps:{colorScheme:"error",minWidth:5}})]})}const gp=e=>e.generation;be(gp,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:te.isEqual}});const c4=be([gp,Pt,Ny,Bt],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:s,seedWeights:c,initialImage:u,seed:f}=e,{isProcessing:h,isConnected:p}=t;let g=!0;const y=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(g=!1,y.push("Missing prompt")),r==="img2img"&&!u&&(g=!1,y.push("No initial image selected")),h&&(g=!1,y.push("System Busy")),p||(g=!1,y.push("System Disconnected")),s&&(!(U1(c)||c==="")||f===-1)&&(g=!1,y.push("Seed-Weights badly formatted.")),{isReady:g,reasonsWhyNotReady:y}},{memoizeOptions:{equalityCheck:te.isEqual,resultEqualityCheck:te.isEqual}});function xp(e){const{iconButton:t=!1,...n}=e,r=Y(),{isReady:i}=O(c4),s=O(Bt),c=()=>{r(af(s))},{t:u}=Z();return fe(["ctrl+enter","meta+enter"],()=>{r($1()),r(af(s))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,s]),l.jsx(We,{style:{flexGrow:4},children:t?l.jsx(le,{"aria-label":u("parameters.invoke"),type:"submit",icon:l.jsx($8,{}),isDisabled:!i,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:!i,onClick:c,flexGrow:1,w:"100%",colorScheme:"accent",fontWeight:700,...n,children:"Invoke"})})}const Ld={borderStartStartRadius:0,borderEndStartRadius:0},yp=be([Vr,ro,Bt],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:i,shouldHoldParametersPanelOpen:s,shouldUseCanvasBetaLayout:c}=t,{shouldShowGallery:u,shouldPinGallery:f,shouldHoldGalleryOpen:h}=e,p=c&&n==="unifiedCanvas",g=!p&&!(i||s&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),y=!(u||h&&!f)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinParametersPanel:r,shouldShowProcessButtons:!p&&(!r||!i),shouldShowParametersPanelButton:g,shouldShowParametersPanel:i,shouldShowGallery:u,shouldPinGallery:f,shouldShowGalleryButton:y}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),uI=()=>{const e=Y(),{shouldShowParametersPanelButton:t,shouldShowProcessButtons:n,shouldPinParametersPanel:r}=O(yp),i=()=>{e(Hi(!0)),r&&setTimeout(()=>e(on(!0)),400)};return t?l.jsxs(B,{pos:"absolute",transform:"translate(0, -50%)",zIndex:20,minW:8,top:"50%",insetInlineStart:"4.5rem",direction:"column",gap:2,children:[l.jsx(le,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:i,sx:Ld,children:l.jsx(ap,{})}),n&&l.jsxs(l.Fragment,{children:[l.jsx(xp,{iconButton:!0,sx:Ld}),l.jsx(vp,{sx:Ld})]})]}):null},dI=be(Vr,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),fI=()=>{const{resultImages:e,userImages:t}=O(dI);return n=>{const r=e.find(s=>s.uuid===n);if(r)return r;const i=t.find(s=>s.uuid===n);if(i)return i}},hI=be([ro,Ac,Bt],(e,t,n)=>{const{shouldPinParametersPanel:r}=e,{isLightboxOpen:i}=t;return{shouldPinParametersPanel:r,isLightboxOpen:i,activeTabName:n}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),bp=e=>{const t=Y(),{optionsPanel:n,children:r,...i}=e,{activeTabName:s,isLightboxOpen:c}=O(hI),u=fI(),f=h=>{const p=h.dataTransfer.getData("invokeai/imageUuid"),g=u(p);g&&(s==="img2img"?t(os(g)):s==="unifiedCanvas"&&t(bc(g)))};return l.jsx(We,{...i,pos:"relative",w:"100%",h:"100%",children:l.jsxs(B,{gap:4,h:"100%",children:[n,l.jsx(We,{pos:"relative",w:"100%",h:"100%",onDrop:f,children:r}),!c&&l.jsx(Gy,{})]})})},pI=e=>{const{styleClass:t}=e,n=x.useContext(Qh),r=()=>{n&&n()};return l.jsx(B,{sx:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center"},className:t,children:l.jsxs(B,{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(Jt,{as:Rc,boxSize:24}),l.jsx(Vn,{size:"md",children:"Click or Drag and Drop"})]})})},mI=be([Vr,ro],(e,t)=>{const{currentImage:n,intermediateImage:r}=e,{shouldShowImageDetails:i}=t;return{imageToDisplay:r||n,isIntermediate:Boolean(r),shouldShowImageDetails:i}},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function vI(){const{shouldShowImageDetails:e,imageToDisplay:t,isIntermediate:n}=O(mI);return l.jsxs(B,{sx:{position:"relative",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:[t&&l.jsx(ds,{src:t.url,sx:{objectFit:"contain",maxWidth:"100%",maxHeight:"100%",height:"auto",position:"absolute",imageRendering:n?"pixelated":"initial",borderRadius:"base"},...n&&{width:t.width,height:t.height}}),!e&&l.jsx(Yy,{}),e&&t&&l.jsx(hp,{image:t,styleClass:"current-image-metadata"})]})}const gI=be([Vr],e=>{const{currentImage:t,intermediateImage:n}=e;return{hasAnImageToDisplay:t||n}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),u4=()=>{const{hasAnImageToDisplay:e}=O(gI);return l.jsx(B,{sx:{flexDirection:"column",height:"100%",width:"100%",rowGap:4,borderRadius:"base"},children:e?l.jsxs(l.Fragment,{children:[l.jsx(Fy,{}),l.jsx(vI,{})]}):l.jsx(B,{sx:{alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:l.jsx(Jt,{as:S9,sx:{boxSize:24,color:"base.500"}})})})},xI=()=>{const e=x.useContext(Qh);return l.jsx(le,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:l.jsx(Rc,{}),onClick:e||void 0})};function yI(){const e=O(s=>s.generation.initialImage),{t}=Z(),n=Y(),r=us(),i=()=>{r({title:t("toast.parametersFailed"),description:t("toast.parametersFailedDesc"),status:"error",isClosable:!0}),n(oC())};return l.jsxs(l.Fragment,{children:[l.jsxs(B,{sx:{alignItems:"center",justifyContent:"center",w:"100%",gap:4},children:[l.jsx(Ce,{sx:{fontSize:"lg"},variant:"subtext",children:t("parameters.initialImage")}),l.jsx(xI,{})]}),e&&l.jsx(B,{sx:{position:"relative",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},children:l.jsx(ds,{sx:{fit:"contain",maxWidth:"100%",maxHeight:"100%",borderRadius:"base",objectFit:"contain",position:"absolute"},src:typeof e=="string"?e:e.url,onError:i})})]})}const m0={flexDirection:"column",height:"100%",width:"100%",gap:4,padding:4},bI=()=>{const t=O(n=>n.generation.initialImage)?l.jsx(B,{flexDirection:"column",gap:4,w:"100%",h:"100%",children:l.jsx(yI,{})}):l.jsx(pI,{});return l.jsxs($n,{sx:{w:"100%",h:"100%",gridTemplateColumns:"1fr 1fr",borderRadius:"base",bg:"base.850"},children:[l.jsx(B,{sx:{...m0,paddingInlineEnd:2},children:t}),l.jsx(B,{sx:{...m0,paddingInlineStart:2},children:l.jsx(u4,{})})]})};var dn=(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))(dn||{});const SI=()=>{const{t:e}=Z();return x.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])},CI=e=>SI()[e];function d4(){const e=O(i=>i.system.isGFPGANAvailable),t=O(i=>i.postprocessing.shouldRunFacetool),n=Y(),r=i=>n(aC(i.target.checked));return l.jsx(En,{isDisabled:!e,isChecked:t,onChange:r})}const f4=()=>{const e=Y(),t=O(i=>i.generation.seamless),n=i=>e(H1(i.target.checked)),{t:r}=Z();return l.jsx(En,{label:r("parameters.seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})},wI=()=>l.jsx(Le,{gap:2,alignItems:"stretch",children:l.jsx(f4,{})});function Sp(){const e=O(s=>s.generation.horizontalSymmetrySteps),t=O(s=>s.generation.verticalSymmetrySteps),n=O(s=>s.generation.steps),r=Y(),{t:i}=Z();return l.jsxs(Le,{gap:2,alignItems:"stretch",children:[l.jsx(ut,{label:i("parameters.hSymmetryStep"),value:e,onChange:s=>r(Lv(s)),min:0,max:n,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>r(Lv(0))}),l.jsx(ut,{label:i("parameters.vSymmetryStep"),value:t,onChange:s=>r(Bv(s)),min:0,max:n,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>r(Bv(0))})]})}function Cp(){const e=O(n=>n.generation.shouldUseSymmetry),t=Y();return l.jsx(En,{isChecked:e,onChange:n=>t(sC(n.target.checked))})}function kI(){const e=Y(),t=O(r=>r.generation.perlin),{t:n}=Z();return l.jsx(ut,{label:n("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:r=>e(tf(r)),handleReset:()=>e(tf(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}function jI(){const e=Y(),{t}=Z(),n=O(i=>i.generation.shouldRandomizeSeed),r=i=>e(lC(i.target.checked));return l.jsx(En,{label:t("parameters.randomizeSeed"),isChecked:n,onChange:r})}const v0=/^-?(0\.)?\.?$/,Lr=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:i,value:s,onChange:c,min:u,max:f,isInteger:h=!0,formControlProps:p,formLabelProps:g,numberInputFieldProps:y,numberInputStepperProps:S,tooltipProps:C,...w}=e,[k,j]=x.useState(String(s));x.useEffect(()=>{!k.match(v0)&&s!==Number(k)&&j(String(s))},[s,k]);const M=I=>{j(I),I.match(v0)||c(h?Math.floor(Number(I)):Number(I))},P=I=>{const T=te.clamp(h?Math.floor(Number(I.target.value)):Number(I.target.value),u,f);j(String(T)),c(T)};return l.jsx(Yt,{...C,children:l.jsxs(rt,{isDisabled:n,isInvalid:i,...p,children:[t&&l.jsx(st,{...g,children:t}),l.jsxs(Bh,{value:k,min:u,max:f,keepWithinRange:!0,clampValueOnBlur:!1,onChange:M,onBlur:P,...w,children:[l.jsx(Wh,{...y}),r&&l.jsxs(Hh,{children:[l.jsx(Uh,{...S}),l.jsx(Vh,{...S})]})]})]})})};function EI(){const e=Y(),t=O(i=>i.generation.shouldRandomizeSeed),{t:n}=Z(),r=()=>e(as(cC(q1,G1)));return l.jsx(to,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:l.jsx("p",{children:n("parameters.shuffle")})})}function PI(){const e=O(c=>c.generation.seed),t=O(c=>c.generation.shouldRandomizeSeed),n=O(c=>c.generation.shouldGenerateVariations),{t:r}=Z(),i=Y(),s=c=>i(as(c));return l.jsxs(sa,{gap:2,children:[l.jsx(Lr,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:q1,max:G1,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e,formControlProps:{display:"flex",alignItems:"center",gap:3}}),l.jsx(EI,{})]})}function II(){const e=Y(),t=O(r=>r.generation.threshold),{t:n}=Z();return l.jsx(ut,{label:n("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:r=>e(ef(r)),handleReset:()=>e(ef(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const wp=()=>l.jsxs(Le,{gap:2,alignItems:"stretch",children:[l.jsx(jI,{}),l.jsx(PI,{}),l.jsx(II,{}),l.jsx(kI,{})]});function h4(){const e=O(i=>i.system.isESRGANAvailable),t=O(i=>i.postprocessing.shouldRunESRGAN),n=Y(),r=i=>n(uC(i.target.checked));return l.jsx(En,{isDisabled:!e,isChecked:t,onChange:r})}function kp(){const e=O(r=>r.generation.shouldGenerateVariations),t=Y(),n=r=>t(dC(r.target.checked));return l.jsx(En,{isChecked:e,width:"auto",onChange:n})}function mt(e){const{label:t="",isDisabled:n=!1,isInvalid:r,formControlProps:i,...s}=e;return l.jsxs(rt,{isInvalid:r,isDisabled:n,...i,children:[t!==""&&l.jsx(st,{children:t}),l.jsx(wh,{...s})]})}function MI(){const e=O(s=>s.generation.seedWeights),t=O(s=>s.generation.shouldGenerateVariations),{t:n}=Z(),r=Y(),i=s=>r(B1(s.target.value));return l.jsx(mt,{label:n("parameters.seedWeights"),value:e,isInvalid:t&&!(U1(e)||e===""),isDisabled:!t,onChange:i})}function TI(){const e=O(i=>i.generation.variationAmount),t=O(i=>i.generation.shouldGenerateVariations),{t:n}=Z(),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:i=>r(Hv(i)),handleReset:()=>r(Hv(.1)),withInput:!0,withReset:!0,withSliderMarks:!0})}const jp=()=>l.jsxs(Le,{gap:2,alignItems:"stretch",children:[l.jsx(TI,{}),l.jsx(MI,{})]});function g0(){const e=Y(),t=O(s=>s.generation.cfgScale),n=O(s=>s.ui.shouldUseSliders),{t:r}=Z(),i=s=>e(rf(s));return n?l.jsx(ut,{label:r("parameters.cfgScale"),step:.5,min:1.01,max:30,onChange:i,handleReset:()=>e(rf(7.5)),value:t,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0}):l.jsx(Lr,{label:r("parameters.cfgScale"),step:.5,min:1.01,max:200,onChange:i,value:t,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})}function x0(){const e=O(s=>s.generation.height),t=O(s=>s.ui.shouldUseSliders),n=O(Bt),r=Y(),{t:i}=Z();return t?l.jsx(ut,{isSliderDisabled:n==="unifiedCanvas",isInputDisabled:n==="unifiedCanvas",isResetDisabled:n==="unifiedCanvas",label:i("parameters.height"),value:e,min:64,step:64,max:2048,onChange:s=>r(Vl(s)),handleReset:()=>r(Vl(512)),withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:15360}}):l.jsx(Mn,{isDisabled:n==="unifiedCanvas",label:i("parameters.height"),value:e,flexGrow:1,onChange:s=>r(Vl(Number(s.target.value))),validValues:fC})}function y0(){const e=O(s=>s.generation.iterations),t=O(s=>s.ui.shouldUseSliders),n=Y(),{t:r}=Z(),i=s=>n(Wv(s));return t?l.jsx(ut,{label:r("parameters.images"),step:1,min:1,max:16,onChange:i,handleReset:()=>n(Wv(1)),value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:9999}}):l.jsx(Lr,{label:r("parameters.images"),step:1,min:1,max:9999,onChange:i,value:e,numberInputFieldProps:{textAlign:"center"}})}function b0(){const e=O(s=>s.generation.sampler),t=O(wy),n=Y(),{t:r}=Z(),i=s=>n(L1(s.target.value));return l.jsx(Mn,{label:r("parameters.sampler"),value:e,onChange:i,validValues:t.format==="diffusers"?hC:pC,minWidth:36})}function S0(){const e=Y(),t=O(c=>c.generation.steps),n=O(c=>c.ui.shouldUseSliders),{t:r}=Z(),i=c=>{e(nf(c))},s=()=>{e($1())};return n?l.jsx(ut,{label:r("parameters.steps"),min:1,step:1,onChange:i,handleReset:()=>e(nf(20)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:9999}}):l.jsx(Lr,{label:r("parameters.steps"),min:1,max:9999,step:1,onChange:i,value:t,numberInputFieldProps:{textAlign:"center"},onBlur:s})}function C0(){const e=O(s=>s.generation.width),t=O(s=>s.ui.shouldUseSliders),n=O(Bt),{t:r}=Z(),i=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=>i(Wl(s)),handleReset:()=>i(Wl(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=>i(Wl(Number(s.target.value))),validValues:mC})}function Ep(){return O(t=>t.ui.shouldUseSliders)?l.jsxs(Le,{gap:2,children:[l.jsx(y0,{}),l.jsx(S0,{}),l.jsx(g0,{}),l.jsx(C0,{}),l.jsx(x0,{}),l.jsx(b0,{})]}):l.jsxs(B,{rowGap:2,flexDirection:"column",children:[l.jsxs(B,{columnGap:1,children:[l.jsx(y0,{}),l.jsx(S0,{}),l.jsx(g0,{})]}),l.jsxs(B,{columnGap:1,children:[l.jsx(C0,{}),l.jsx(x0,{}),l.jsx(b0,{})]})]})}const _I=be(Pt,e=>e.shouldDisplayGuides),DI=({children:e,feature:t})=>{const n=O(_I),{text:r}=CI(t);return n?l.jsxs(qh,{trigger:"hover",children:[l.jsx(Gh,{children:l.jsx(We,{children:e})}),l.jsxs(Xh,{maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[l.jsx(Yh,{}),l.jsx(Zx,{children:r})]})]}):null},OI=he(({feature:e,icon:t=p9},n)=>l.jsx(DI,{feature:e,children:l.jsx(We,{ref:n,children:l.jsx(Jt,{marginBottom:"-.15rem",as:t})})}));function AI(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return l.jsxs(No,{children:[l.jsx(zo,{children:l.jsxs(B,{width:"100%",gap:2,align:"center",children:[l.jsx(We,{flexGrow:1,textAlign:"start",children:t}),i,n&&l.jsx(OI,{feature:n}),l.jsx(Ro,{})]})}),l.jsx(Lo,{children:r})]})}const Pp=e=>{const{accordionInfo:t}=e,n=O(c=>c.system.openAccordions),r=Y(),i=c=>r(vC(c)),s=()=>{const c=[];return t&&Object.keys(t).forEach(u=>{const{header:f,feature:h,content:p,additionalHeaderComponents:g}=t[u];c.push(l.jsx(AI,{header:f,feature:h,content:p,additionalHeaderComponents:g},u))}),c};return l.jsx(sh,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:i,children:s()})},zI=be(rp,({shouldLoopback:e})=>e),RI=()=>{const e=Y(),t=O(zI),{t:n}=Z();return l.jsx(le,{"aria-label":n("parameters.toggleLoopback"),tooltip:n("parameters.toggleLoopback"),isChecked:t,icon:l.jsx(q8,{}),onClick:()=>{e(gC(!t))}})},Ip=()=>{const e=O(Bt);return l.jsxs(B,{gap:2,children:[l.jsx(xp,{}),e==="img2img"&&l.jsx(RI,{}),l.jsx(vp,{})]})},Mp=()=>{const e=O(r=>r.generation.negativePrompt),t=Y(),{t:n}=Z();return l.jsx(rt,{children:l.jsx(Kh,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(A1(r.target.value)),placeholder:n("parameters.negativePrompts"),_focusVisible:{borderColor:"error.600"},fontSize:"sm"})})},NI=be([e=>e.generation,Bt],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),Tp=()=>{const e=Y(),{prompt:t,activeTabName:n}=O(NI),{isReady:r}=O(c4),i=x.useRef(null),{t:s}=Z(),c=f=>{e(O1(f.target.value))};fe("alt+a",()=>{var f;(f=i.current)==null||f.focus()},[]);const u=f=>{f.key==="Enter"&&f.shiftKey===!1&&r&&(f.preventDefault(),e(af(n)))};return l.jsx(We,{children:l.jsx(rt,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:l.jsx(Kh,{id:"prompt",name:"prompt",placeholder:s("parameters.promptPlaceholder"),value:t,onChange:c,onKeyDown:u,resize:"vertical",ref:i,minH:40})})})},FI=""+new URL("logo-13003d72.png",import.meta.url).href,p4=()=>{const e=O(t=>t.system.app_version);return l.jsxs(B,{alignItems:"center",gap:3,ps:1,children:[l.jsx(ds,{src:FI,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})]})};const LI=be(ro,e=>{const{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}=e;return{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),_p=e=>{const t=Y(),{direction:n}=Ji(),{shouldShowParametersPanel:r,shouldHoldParametersPanelOpen:i,shouldPinParametersPanel:s}=O(LI),c=x.useRef(null),u=x.useRef(null),f=x.useRef(null),{children:h}=e,{t:p}=Z();fe("o",()=>{t(Hi(!r)),s&&setTimeout(()=>t(on(!0)),400)},[r,s]),fe("esc",()=>{t(Hi(!1))},{enabled:()=>!s,preventDefault:!0},[s]),fe("shift+o",()=>{C(),t(on(!0))},[s]);const g=x.useCallback(()=>{s||(t(xC(u.current?u.current.scrollTop:0)),t(Hi(!1)),t(yC(!1)))},[t,s]),y=()=>{f.current=window.setTimeout(()=>g(),500)},S=()=>{f.current&&window.clearTimeout(f.current)},C=()=>{t(bC(!s)),t(on(!0))};return x.useEffect(()=>{function w(k){c.current&&!c.current.contains(k.target)&&g()}return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w)}},[g]),l.jsx(Uy,{nodeRef:c,in:r||i&&!s,unmountOnExit:!0,timeout:200,classNames:`${n}-parameters-panel-transition`,children:l.jsx(We,{className:`${n}-parameters-panel-transition`,tabIndex:1,ref:c,onMouseEnter:s?void 0:S,onMouseOver:s?void 0:S,sx:{borderInlineEndWidth:s?0:5,borderInlineEndStyle:"solid",bg:"base.900",borderColor:"base.700",height:R9,width:Al,maxWidth:Al,flexShrink:0,position:"relative",overflowY:"scroll",overflowX:"hidden",...p2,...!s&&{zIndex:20,position:"fixed",top:0,insetInlineStart:0,width:`calc(${Al} + 2rem)`,maxWidth:`calc(${Al} + 2rem)`,height:"100%"}},children:l.jsx(We,{sx:{margin:!s&&4},children:l.jsxs(B,{ref:u,onMouseLeave:w=>{w.target!==u.current?S():!s&&y()},sx:{display:"flex",flexDirection:"column",rowGap:2,height:"100%"},children:[l.jsx(Yt,{label:p("common.pinOptionsPanel"),children:l.jsx(We,{onClick:C,sx:{position:"absolute",cursor:"pointer",padding:2,top:4,insetInlineEnd:4,zIndex:20,...s&&{top:0,insetInlineEnd:0}},children:l.jsx(Jt,{sx:{opacity:.2},as:s?By:Hy})})}),!s&&l.jsx(We,{sx:{pt:fp,pb:2},children:l.jsx(p4,{})}),h]})})})})};function BI(){const e=Y(),t=O(i=>i.generation.shouldFitToWidthHeight),n=i=>e(V1(i.target.checked)),{t:r}=Z();return l.jsx(En,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function m4(e){const{t}=Z(),{label:n=`${t("parameters.strength")}`}=e,r=O(u=>u.generation.img2imgStrength),i=Y(),s=u=>i(of(u)),c=()=>{i(of(.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 HI(){const{t:e}=Z();return l.jsxs(Le,{gap:2,alignItems:"stretch",children:[l.jsx(m4,{label:e("parameters.img2imgStrength")}),l.jsx(BI,{})]})}function WI(){const{t:e}=Z(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(Ep,{})},imageToImage:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:l.jsx(HI,{})},seed:{header:`${e("parameters.seed")}`,feature:dn.SEED,content:l.jsx(wp,{})},variations:{header:`${e("parameters.variations")}`,feature:dn.VARIATIONS,content:l.jsx(jp,{}),additionalHeaderComponents:l.jsx(kp,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:dn.FACE_CORRECTION,content:l.jsx(tp,{}),additionalHeaderComponents:l.jsx(d4,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:dn.UPSCALE,content:l.jsx(np,{}),additionalHeaderComponents:l.jsx(h4,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(Sp,{}),additionalHeaderComponents:l.jsx(Cp,{})},other:{header:`${e("parameters.otherOptions")}`,feature:dn.OTHER,content:l.jsx(wI,{})}};return l.jsxs(_p,{children:[l.jsxs(B,{flexDir:"column",rowGap:2,children:[l.jsx(Tp,{}),l.jsx(Mp,{})]}),l.jsx(Ip,{}),l.jsx(Pp,{accordionInfo:t})]})}function VI(){return l.jsx(bp,{optionsPanel:l.jsx(WI,{}),children:l.jsx(bI,{})})}const UI=()=>l.jsx(We,{sx:{width:"100%",height:"100%",borderRadius:"base",bg:"base.850"},children:l.jsx(B,{sx:{p:4,width:"100%",height:"100%"},children:l.jsx(u4,{})})}),$I=be([rp],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),GI=()=>{const{hiresFix:e,hiresStrength:t}=O($I),n=Y(),{t:r}=Z(),i=c=>{n(Vv(c))},s=()=>{n(Vv(.75))};return l.jsx(ut,{label:r("parameters.hiresStrength"),step:.01,min:.01,max:.99,onChange:i,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})},qI=()=>{const e=Y(),t=O(i=>i.postprocessing.hiresFix),{t:n}=Z(),r=i=>e(W1(i.target.checked));return l.jsx(En,{label:n("parameters.hiresOptim"),fontSize:"md",isChecked:t,onChange:r})},YI=()=>l.jsxs(Le,{gap:2,alignItems:"stretch",children:[l.jsx(f4,{}),l.jsx(qI,{}),l.jsx(GI,{})]});function XI(){const{t:e}=Z(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(Ep,{})},seed:{header:`${e("parameters.seed")}`,feature:dn.SEED,content:l.jsx(wp,{})},variations:{header:`${e("parameters.variations")}`,feature:dn.VARIATIONS,content:l.jsx(jp,{}),additionalHeaderComponents:l.jsx(kp,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:dn.FACE_CORRECTION,content:l.jsx(tp,{}),additionalHeaderComponents:l.jsx(d4,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:dn.UPSCALE,content:l.jsx(np,{}),additionalHeaderComponents:l.jsx(h4,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(Sp,{}),additionalHeaderComponents:l.jsx(Cp,{})},other:{header:`${e("parameters.otherOptions")}`,feature:dn.OTHER,content:l.jsx(YI,{})}};return l.jsxs(_p,{children:[l.jsxs(B,{flexDir:"column",rowGap:2,children:[l.jsx(Tp,{}),l.jsx(Mp,{})]}),l.jsx(Ip,{}),l.jsx(Pp,{accordionInfo:t})]})}function KI(){return l.jsx(bp,{optionsPanel:l.jsx(XI,{}),children:l.jsx(UI,{})})}var Af={},QI={get exports(){return Af},set exports(e){Af=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 ZI=function(t){var n={},r=x,i=Ul,s=Object.assign;function c(o){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+o,d=1;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+o+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=Symbol.for("react.element"),h=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),T=Symbol.iterator;function D(o){return o===null||typeof o!="object"?null:(o=T&&o[T]||o["@@iterator"],typeof o=="function"?o:null)}function _(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case p:return"Fragment";case h:return"Portal";case y:return"Profiler";case g:return"StrictMode";case k:return"Suspense";case j:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case C:return(o.displayName||"Context")+".Consumer";case S:return(o._context.displayName||"Context")+".Provider";case w:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case M:return a=o.displayName||null,a!==null?a:_(o.type)||"Memo";case P:a=o._payload,o=o._init;try{return _(o(a))}catch{}}return null}function z(o){var a=o.type;switch(o.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 o=a.render,o=o.displayName||o.name||"",a.displayName||(o!==""?"ForwardRef("+o+")":"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===g?"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(o){var a=o,d=o;if(o.alternate)for(;a.return;)a=a.return;else{o=a;do a=o,a.flags&4098&&(d=a.return),o=a.return;while(o)}return a.tag===3?d:null}function F(o){if(V(o)!==o)throw Error(c(188))}function L(o){var a=o.alternate;if(!a){if(a=V(o),a===null)throw Error(c(188));return a!==o?null:o}for(var d=o,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),o;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,A=v.child;A;){if(A===d){E=!0,d=v,m=b;break}if(A===m){E=!0,m=v,d=b;break}A=A.sibling}if(!E){for(A=b.child;A;){if(A===d){E=!0,d=b,m=v;break}if(A===m){E=!0,m=b,d=v;break}A=A.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?o:a}function X(o){return o=L(o),o!==null?$(o):null}function $(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var a=$(o);if(a!==null)return a;o=o.sibling}return null}function Q(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){if(o.tag!==4){var a=Q(o);if(a!==null)return a}o=o.sibling}return null}var ie=Array.isArray,oe=t.getPublicInstance,U=t.getRootHostContext,K=t.getChildHostContext,ne=t.prepareForCommit,ce=t.resetAfterCommit,Re=t.createInstance,ze=t.appendInitialChild,Me=t.finalizeInitialChildren,J=t.prepareUpdate,ue=t.shouldSetTextContent,Ie=t.createTextInstance,Be=t.scheduleTimeout,Ne=t.cancelTimeout,Ge=t.noTimeout,Qe=t.isPrimaryRenderer,ve=t.supportsMutation,_e=t.supportsPersistence,qe=t.supportsHydration,ge=t.getInstanceFromNode,Te=t.preparePortalMount,et=t.getCurrentEventPriority,Ve=t.detachDeletedInstance,vt=t.supportsMicrotasks,Nt=t.scheduleMicrotask,N=t.supportsTestSelectors,de=t.findFiberRoot,xe=t.getBoundingRect,je=t.getTextContent,q=t.isHiddenSubtree,se=t.matchAccessibilityRole,Fe=t.setFocusIfFocusable,Ze=t.setupIntersectionObserver,ee=t.appendChild,He=t.appendChildToContainer,nt=t.commitTextUpdate,Ft=t.commitMount,pe=t.commitUpdate,De=t.insertBefore,hn=t.insertInContainerBefore,$t=t.removeChild,pn=t.removeChildFromContainer,ir=t.resetTextContent,yi=t.hideInstance,da=t.hideTextInstance,Kc=t.unhideInstance,fa=t.unhideTextInstance,bi=t.clearContainer,wb=t.cloneInstance,Yp=t.createContainerChildSet,Xp=t.appendChildToContainerChildSet,kb=t.finalizeContainerChildren,Qc=t.replaceContainerChildren,Kp=t.cloneHiddenInstance,Qp=t.cloneHiddenTextInstance,jb=t.canHydrateInstance,Eb=t.canHydrateTextInstance,Pb=t.canHydrateSuspenseInstance,Zp=t.isSuspenseInstancePending,Zc=t.isSuspenseInstanceFallback,Ib=t.getSuspenseInstanceFallbackErrorDetails,Mb=t.registerSuspenseInstanceRetry,ks=t.getNextHydratableSibling,Tb=t.getFirstHydratableChild,_b=t.getFirstHydratableChildWithinContainer,Db=t.getFirstHydratableChildWithinSuspenseInstance,Ob=t.hydrateInstance,Ab=t.hydrateTextInstance,zb=t.hydrateSuspenseInstance,Rb=t.getNextHydratableInstanceAfterSuspenseInstance,Nb=t.commitHydratedContainer,Fb=t.commitHydratedSuspenseInstance,Lb=t.clearSuspenseBoundary,Bb=t.clearSuspenseBoundaryFromContainer,Hb=t.shouldDeleteUnhydratedTailInstances,Wb=t.didNotMatchHydratedContainerTextInstance,Vb=t.didNotMatchHydratedTextInstance,Jc;function ha(o){if(Jc===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);Jc=a&&a[1]||""}return`
|
||
`+Jc+o}var eu=!1;function tu(o,a){if(!o||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(ae){var m=ae}Reflect.construct(o,[],a)}else{try{a.call()}catch(ae){m=ae}o.call(a.prototype)}else{try{throw Error()}catch(ae){m=ae}o()}}catch(ae){if(ae&&m&&typeof ae.stack=="string"){for(var v=ae.stack.split(`
|
||
`),b=m.stack.split(`
|
||
`),E=v.length-1,A=b.length-1;1<=E&&0<=A&&v[E]!==b[A];)A--;for(;1<=E&&0<=A;E--,A--)if(v[E]!==b[A]){if(E!==1||A!==1)do if(E--,A--,0>A||v[E]!==b[A]){var W=`
|
||
`+v[E].replace(" at new "," at ");return o.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",o.displayName)),W}while(1<=E&&0<=A);break}}}finally{eu=!1,Error.prepareStackTrace=d}return(o=o?o.displayName||o.name:"")?ha(o):""}var Ub=Object.prototype.hasOwnProperty,nu=[],uo=-1;function Gr(o){return{current:o}}function bt(o){0>uo||(o.current=nu[uo],nu[uo]=null,uo--)}function gt(o,a){uo++,nu[uo]=o.current,o.current=a}var qr={},an=Gr(qr),xn=Gr(!1),Si=qr;function fo(o,a){var d=o.type.contextTypes;if(!d)return qr;var m=o.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var v={},b;for(b in d)v[b]=a[b];return m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=a,o.__reactInternalMemoizedMaskedChildContext=v),v}function yn(o){return o=o.childContextTypes,o!=null}function js(){bt(xn),bt(an)}function Jp(o,a,d){if(an.current!==qr)throw Error(c(168));gt(an,a),gt(xn,d)}function em(o,a,d){var m=o.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,z(o)||"Unknown",v));return s({},d,m)}function Es(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||qr,Si=an.current,gt(an,o),gt(xn,xn.current),!0}function tm(o,a,d){var m=o.stateNode;if(!m)throw Error(c(169));d?(o=em(o,a,Si),m.__reactInternalMemoizedMergedChildContext=o,bt(xn),bt(an),gt(an,o)):bt(xn),gt(xn,d)}var Xn=Math.clz32?Math.clz32:qb,$b=Math.log,Gb=Math.LN2;function qb(o){return o>>>=0,o===0?32:31-($b(o)/Gb|0)|0}var Ps=64,Is=4194304;function pa(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Ms(o,a){var d=o.pendingLanes;if(d===0)return 0;var m=0,v=o.suspendedLanes,b=o.pingedLanes,E=d&268435455;if(E!==0){var A=E&~v;A!==0?m=pa(A):(b&=E,b!==0&&(m=pa(b)))}else E=d&~v,E!==0?m=pa(E):b!==0&&(m=pa(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=o.entangledLanes,a!==0)for(o=o.entanglements,a&=m;0<a;)d=31-Xn(a),v=1<<d,m|=o[d],a&=~v;return m}function Yb(o,a){switch(o){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 Xb(o,a){for(var d=o.suspendedLanes,m=o.pingedLanes,v=o.expirationTimes,b=o.pendingLanes;0<b;){var E=31-Xn(b),A=1<<E,W=v[E];W===-1?(!(A&d)||A&m)&&(v[E]=Yb(A,a)):W<=a&&(o.expiredLanes|=A),b&=~A}}function ru(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function nm(){var o=Ps;return Ps<<=1,!(Ps&4194240)&&(Ps=64),o}function iu(o){for(var a=[],d=0;31>d;d++)a.push(o);return a}function ma(o,a,d){o.pendingLanes|=a,a!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,a=31-Xn(a),o[a]=d}function Kb(o,a){var d=o.pendingLanes&~a;o.pendingLanes=a,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=a,o.mutableReadLanes&=a,o.entangledLanes&=a,a=o.entanglements;var m=o.eventTimes;for(o=o.expirationTimes;0<d;){var v=31-Xn(d),b=1<<v;a[v]=0,m[v]=-1,o[v]=-1,d&=~b}}function ou(o,a){var d=o.entangledLanes|=a;for(o=o.entanglements;d;){var m=31-Xn(d),v=1<<m;v&a|o[m]&a&&(o[m]|=a),d&=~v}}var it=0;function rm(o){return o&=-o,1<o?4<o?o&268435455?16:536870912:4:1}var au=i.unstable_scheduleCallback,im=i.unstable_cancelCallback,Qb=i.unstable_shouldYield,Zb=i.unstable_requestPaint,Xt=i.unstable_now,su=i.unstable_ImmediatePriority,Jb=i.unstable_UserBlockingPriority,lu=i.unstable_NormalPriority,eS=i.unstable_IdlePriority,Ts=null,or=null;function tS(o){if(or&&typeof or.onCommitFiberRoot=="function")try{or.onCommitFiberRoot(Ts,o,void 0,(o.current.flags&128)===128)}catch{}}function nS(o,a){return o===a&&(o!==0||1/o===1/a)||o!==o&&a!==a}var Kn=typeof Object.is=="function"?Object.is:nS,jr=null,_s=!1,cu=!1;function om(o){jr===null?jr=[o]:jr.push(o)}function rS(o){_s=!0,om(o)}function ar(){if(!cu&&jr!==null){cu=!0;var o=0,a=it;try{var d=jr;for(it=1;o<d.length;o++){var m=d[o];do m=m(!0);while(m!==null)}jr=null,_s=!1}catch(v){throw jr!==null&&(jr=jr.slice(o+1)),au(su,ar),v}finally{it=a,cu=!1}}return null}var ho=[],po=0,Ds=null,Os=0,On=[],An=0,Ci=null,Er=1,Pr="";function wi(o,a){ho[po++]=Os,ho[po++]=Ds,Ds=o,Os=a}function am(o,a,d){On[An++]=Er,On[An++]=Pr,On[An++]=Ci,Ci=o;var m=Er;o=Pr;var v=32-Xn(m)-1;m&=~(1<<v),d+=1;var b=32-Xn(a)+v;if(30<b){var E=v-v%5;b=(m&(1<<E)-1).toString(32),m>>=E,v-=E,Er=1<<32-Xn(a)+v|d<<v|m,Pr=b+o}else Er=1<<b|d<<v|m,Pr=o}function uu(o){o.return!==null&&(wi(o,1),am(o,1,0))}function du(o){for(;o===Ds;)Ds=ho[--po],ho[po]=null,Os=ho[--po],ho[po]=null;for(;o===Ci;)Ci=On[--An],On[An]=null,Pr=On[--An],On[An]=null,Er=On[--An],On[An]=null}var Tn=null,zn=null,It=!1,va=!1,Qn=null;function sm(o,a){var d=Bn(5,null,null,0);d.elementType="DELETED",d.stateNode=a,d.return=o,a=o.deletions,a===null?(o.deletions=[d],o.flags|=16):a.push(d)}function lm(o,a){switch(o.tag){case 5:return a=jb(a,o.type,o.pendingProps),a!==null?(o.stateNode=a,Tn=o,zn=Tb(a),!0):!1;case 6:return a=Eb(a,o.pendingProps),a!==null?(o.stateNode=a,Tn=o,zn=null,!0):!1;case 13:if(a=Pb(a),a!==null){var d=Ci!==null?{id:Er,overflow:Pr}:null;return o.memoizedState={dehydrated:a,treeContext:d,retryLane:1073741824},d=Bn(18,null,null,0),d.stateNode=a,d.return=o,o.child=d,Tn=o,zn=null,!0}return!1;default:return!1}}function fu(o){return(o.mode&1)!==0&&(o.flags&128)===0}function hu(o){if(It){var a=zn;if(a){var d=a;if(!lm(o,a)){if(fu(o))throw Error(c(418));a=ks(d);var m=Tn;a&&lm(o,a)?sm(m,d):(o.flags=o.flags&-4097|2,It=!1,Tn=o)}}else{if(fu(o))throw Error(c(418));o.flags=o.flags&-4097|2,It=!1,Tn=o}}}function cm(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Tn=o}function As(o){if(!qe||o!==Tn)return!1;if(!It)return cm(o),It=!0,!1;if(o.tag!==3&&(o.tag!==5||Hb(o.type)&&!ue(o.type,o.memoizedProps))){var a=zn;if(a){if(fu(o))throw um(),Error(c(418));for(;a;)sm(o,a),a=ks(a)}}if(cm(o),o.tag===13){if(!qe)throw Error(c(316));if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(c(317));zn=Rb(o)}else zn=Tn?ks(o.stateNode):null;return!0}function um(){for(var o=zn;o;)o=ks(o)}function mo(){qe&&(zn=Tn=null,va=It=!1)}function pu(o){Qn===null?Qn=[o]:Qn.push(o)}var iS=u.ReactCurrentBatchConfig;function zs(o,a){if(Kn(o,a))return!0;if(typeof o!="object"||o===null||typeof a!="object"||a===null)return!1;var d=Object.keys(o),m=Object.keys(a);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var v=d[m];if(!Ub.call(a,v)||!Kn(o[v],a[v]))return!1}return!0}function oS(o){switch(o.tag){case 5:return ha(o.type);case 16:return ha("Lazy");case 13:return ha("Suspense");case 19:return ha("SuspenseList");case 0:case 2:case 15:return o=tu(o.type,!1),o;case 11:return o=tu(o.type.render,!1),o;case 1:return o=tu(o.type,!0),o;default:return""}}function Zn(o,a){if(o&&o.defaultProps){a=s({},a),o=o.defaultProps;for(var d in o)a[d]===void 0&&(a[d]=o[d]);return a}return a}var Rs=Gr(null),Ns=null,vo=null,mu=null;function vu(){mu=vo=Ns=null}function dm(o,a,d){Qe?(gt(Rs,a._currentValue),a._currentValue=d):(gt(Rs,a._currentValue2),a._currentValue2=d)}function gu(o){var a=Rs.current;bt(Rs),Qe?o._currentValue=a:o._currentValue2=a}function xu(o,a,d){for(;o!==null;){var m=o.alternate;if((o.childLanes&a)!==a?(o.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),o===d)break;o=o.return}}function go(o,a){Ns=o,mu=vo=null,o=o.dependencies,o!==null&&o.firstContext!==null&&(o.lanes&a&&(bn=!0),o.firstContext=null)}function Rn(o){var a=Qe?o._currentValue:o._currentValue2;if(mu!==o)if(o={context:o,memoizedValue:a,next:null},vo===null){if(Ns===null)throw Error(c(308));vo=o,Ns.dependencies={lanes:0,firstContext:o}}else vo=vo.next=o;return a}var ki=null;function yu(o){ki===null?ki=[o]:ki.push(o)}function fm(o,a,d,m){var v=a.interleaved;return v===null?(d.next=d,yu(a)):(d.next=v.next,v.next=d),a.interleaved=d,sr(o,m)}function sr(o,a){o.lanes|=a;var d=o.alternate;for(d!==null&&(d.lanes|=a),d=o,o=o.return;o!==null;)o.childLanes|=a,d=o.alternate,d!==null&&(d.childLanes|=a),d=o,o=o.return;return d.tag===3?d.stateNode:null}var Yr=!1;function bu(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hm(o,a){o=o.updateQueue,a.updateQueue===o&&(a.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Ir(o,a){return{eventTime:o,lane:a,tag:0,payload:null,callback:null,next:null}}function Xr(o,a,d){var m=o.updateQueue;if(m===null)return null;if(m=m.shared,Ke&2){var v=m.pending;return v===null?a.next=a:(a.next=v.next,v.next=a),m.pending=a,sr(o,d)}return v=m.interleaved,v===null?(a.next=a,yu(m)):(a.next=v.next,v.next=a),m.interleaved=a,sr(o,d)}function Fs(o,a,d){if(a=a.updateQueue,a!==null&&(a=a.shared,(d&4194240)!==0)){var m=a.lanes;m&=o.pendingLanes,d|=m,a.lanes=d,ou(o,d)}}function pm(o,a){var d=o.updateQueue,m=o.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},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=a:o.next=a,d.lastBaseUpdate=a}function Ls(o,a,d,m){var v=o.updateQueue;Yr=!1;var b=v.firstBaseUpdate,E=v.lastBaseUpdate,A=v.shared.pending;if(A!==null){v.shared.pending=null;var W=A,ae=W.next;W.next=null,E===null?b=ae:E.next=ae,E=W;var Ee=o.alternate;Ee!==null&&(Ee=Ee.updateQueue,A=Ee.lastBaseUpdate,A!==E&&(A===null?Ee.firstBaseUpdate=ae:A.next=ae,Ee.lastBaseUpdate=W))}if(b!==null){var Ue=v.baseState;E=0,Ee=ae=W=null,A=b;do{var ye=A.lane,St=A.eventTime;if((m&ye)===ye){Ee!==null&&(Ee=Ee.next={eventTime:St,lane:0,tag:A.tag,payload:A.payload,callback:A.callback,next:null});e:{var ft=o,wn=A;switch(ye=a,St=d,wn.tag){case 1:if(ft=wn.payload,typeof ft=="function"){Ue=ft.call(St,Ue,ye);break e}Ue=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=wn.payload,ye=typeof ft=="function"?ft.call(St,Ue,ye):ft,ye==null)break e;Ue=s({},Ue,ye);break e;case 2:Yr=!0}}A.callback!==null&&A.lane!==0&&(o.flags|=64,ye=v.effects,ye===null?v.effects=[A]:ye.push(A))}else St={eventTime:St,lane:ye,tag:A.tag,payload:A.payload,callback:A.callback,next:null},Ee===null?(ae=Ee=St,W=Ue):Ee=Ee.next=St,E|=ye;if(A=A.next,A===null){if(A=v.shared.pending,A===null)break;ye=A,A=ye.next,ye.next=null,v.lastBaseUpdate=ye,v.shared.pending=null}}while(1);if(Ee===null&&(W=Ue),v.baseState=W,v.firstBaseUpdate=ae,v.lastBaseUpdate=Ee,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);Ei|=E,o.lanes=E,o.memoizedState=Ue}}function mm(o,a,d){if(o=a.effects,a.effects=null,o!==null)for(a=0;a<o.length;a++){var m=o[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 vm=new r.Component().refs;function Su(o,a,d,m){a=o.memoizedState,d=d(m,a),d=d==null?a:s({},a,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var Bs={isMounted:function(o){return(o=o._reactInternals)?V(o)===o:!1},enqueueSetState:function(o,a,d){o=o._reactInternals;var m=un(),v=Zr(o),b=Ir(m,v);b.payload=a,d!=null&&(b.callback=d),a=Xr(o,b,v),a!==null&&(Ln(a,o,v,m),Fs(a,o,v))},enqueueReplaceState:function(o,a,d){o=o._reactInternals;var m=un(),v=Zr(o),b=Ir(m,v);b.tag=1,b.payload=a,d!=null&&(b.callback=d),a=Xr(o,b,v),a!==null&&(Ln(a,o,v,m),Fs(a,o,v))},enqueueForceUpdate:function(o,a){o=o._reactInternals;var d=un(),m=Zr(o),v=Ir(d,m);v.tag=2,a!=null&&(v.callback=a),a=Xr(o,v,m),a!==null&&(Ln(a,o,m,d),Fs(a,o,m))}};function gm(o,a,d,m,v,b,E){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(m,b,E):a.prototype&&a.prototype.isPureReactComponent?!zs(d,m)||!zs(v,b):!0}function xm(o,a,d){var m=!1,v=qr,b=a.contextType;return typeof b=="object"&&b!==null?b=Rn(b):(v=yn(a)?Si:an.current,m=a.contextTypes,b=(m=m!=null)?fo(o,v):qr),a=new a(d,b),o.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,o.stateNode=a,a._reactInternals=o,m&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=v,o.__reactInternalMemoizedMaskedChildContext=b),a}function ym(o,a,d,m){o=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(d,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(d,m),a.state!==o&&Bs.enqueueReplaceState(a,a.state,null)}function Cu(o,a,d,m){var v=o.stateNode;v.props=d,v.state=o.memoizedState,v.refs=vm,bu(o);var b=a.contextType;typeof b=="object"&&b!==null?v.context=Rn(b):(b=yn(a)?Si:an.current,v.context=fo(o,b)),v.state=o.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(Su(o,a,b,d),v.state=o.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&&Bs.enqueueReplaceState(v,v.state,null),Ls(o,d,v,m),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308)}function ga(o,a,d){if(o=d.ref,o!==null&&typeof o!="function"&&typeof o!="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,o));var v=m,b=""+o;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===b?a.ref:(a=function(E){var A=v.refs;A===vm&&(A=v.refs={}),E===null?delete A[b]:A[b]=E},a._stringRef=b,a)}if(typeof o!="string")throw Error(c(284));if(!d._owner)throw Error(c(290,o))}return o}function Hs(o,a){throw o=Object.prototype.toString.call(a),Error(c(31,o==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":o))}function bm(o){var a=o._init;return a(o._payload)}function Sm(o){function a(H,R){if(o){var G=H.deletions;G===null?(H.deletions=[R],H.flags|=16):G.push(R)}}function d(H,R){if(!o)return null;for(;R!==null;)a(H,R),R=R.sibling;return null}function m(H,R){for(H=new Map;R!==null;)R.key!==null?H.set(R.key,R):H.set(R.index,R),R=R.sibling;return H}function v(H,R){return H=ei(H,R),H.index=0,H.sibling=null,H}function b(H,R,G){return H.index=G,o?(G=H.alternate,G!==null?(G=G.index,G<R?(H.flags|=2,R):G):(H.flags|=2,R)):(H.flags|=1048576,R)}function E(H){return o&&H.alternate===null&&(H.flags|=2),H}function A(H,R,G,Se){return R===null||R.tag!==6?(R=cd(G,H.mode,Se),R.return=H,R):(R=v(R,G),R.return=H,R)}function W(H,R,G,Se){var Oe=G.type;return Oe===p?Ee(H,R,G.props.children,Se,G.key):R!==null&&(R.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===P&&bm(Oe)===R.type)?(Se=v(R,G.props),Se.ref=ga(H,R,G),Se.return=H,Se):(Se=hl(G.type,G.key,G.props,null,H.mode,Se),Se.ref=ga(H,R,G),Se.return=H,Se)}function ae(H,R,G,Se){return R===null||R.tag!==4||R.stateNode.containerInfo!==G.containerInfo||R.stateNode.implementation!==G.implementation?(R=ud(G,H.mode,Se),R.return=H,R):(R=v(R,G.children||[]),R.return=H,R)}function Ee(H,R,G,Se,Oe){return R===null||R.tag!==7?(R=Ti(G,H.mode,Se,Oe),R.return=H,R):(R=v(R,G),R.return=H,R)}function Ue(H,R,G){if(typeof R=="string"&&R!==""||typeof R=="number")return R=cd(""+R,H.mode,G),R.return=H,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case f:return G=hl(R.type,R.key,R.props,null,H.mode,G),G.ref=ga(H,null,R),G.return=H,G;case h:return R=ud(R,H.mode,G),R.return=H,R;case P:var Se=R._init;return Ue(H,Se(R._payload),G)}if(ie(R)||D(R))return R=Ti(R,H.mode,G,null),R.return=H,R;Hs(H,R)}return null}function ye(H,R,G,Se){var Oe=R!==null?R.key:null;if(typeof G=="string"&&G!==""||typeof G=="number")return Oe!==null?null:A(H,R,""+G,Se);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case f:return G.key===Oe?W(H,R,G,Se):null;case h:return G.key===Oe?ae(H,R,G,Se):null;case P:return Oe=G._init,ye(H,R,Oe(G._payload),Se)}if(ie(G)||D(G))return Oe!==null?null:Ee(H,R,G,Se,null);Hs(H,G)}return null}function St(H,R,G,Se,Oe){if(typeof Se=="string"&&Se!==""||typeof Se=="number")return H=H.get(G)||null,A(R,H,""+Se,Oe);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case f:return H=H.get(Se.key===null?G:Se.key)||null,W(R,H,Se,Oe);case h:return H=H.get(Se.key===null?G:Se.key)||null,ae(R,H,Se,Oe);case P:var Xe=Se._init;return St(H,R,G,Xe(Se._payload),Oe)}if(ie(Se)||D(Se))return H=H.get(G)||null,Ee(R,H,Se,Oe,null);Hs(R,Se)}return null}function ft(H,R,G,Se){for(var Oe=null,Xe=null,$e=R,ot=R=0,Zt=null;$e!==null&&ot<G.length;ot++){$e.index>ot?(Zt=$e,$e=null):Zt=$e.sibling;var at=ye(H,$e,G[ot],Se);if(at===null){$e===null&&($e=Zt);break}o&&$e&&at.alternate===null&&a(H,$e),R=b(at,R,ot),Xe===null?Oe=at:Xe.sibling=at,Xe=at,$e=Zt}if(ot===G.length)return d(H,$e),It&&wi(H,ot),Oe;if($e===null){for(;ot<G.length;ot++)$e=Ue(H,G[ot],Se),$e!==null&&(R=b($e,R,ot),Xe===null?Oe=$e:Xe.sibling=$e,Xe=$e);return It&&wi(H,ot),Oe}for($e=m(H,$e);ot<G.length;ot++)Zt=St($e,H,ot,G[ot],Se),Zt!==null&&(o&&Zt.alternate!==null&&$e.delete(Zt.key===null?ot:Zt.key),R=b(Zt,R,ot),Xe===null?Oe=Zt:Xe.sibling=Zt,Xe=Zt);return o&&$e.forEach(function(ti){return a(H,ti)}),It&&wi(H,ot),Oe}function wn(H,R,G,Se){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 Xe=Oe=null,$e=R,ot=R=0,Zt=null,at=G.next();$e!==null&&!at.done;ot++,at=G.next()){$e.index>ot?(Zt=$e,$e=null):Zt=$e.sibling;var ti=ye(H,$e,at.value,Se);if(ti===null){$e===null&&($e=Zt);break}o&&$e&&ti.alternate===null&&a(H,$e),R=b(ti,R,ot),Xe===null?Oe=ti:Xe.sibling=ti,Xe=ti,$e=Zt}if(at.done)return d(H,$e),It&&wi(H,ot),Oe;if($e===null){for(;!at.done;ot++,at=G.next())at=Ue(H,at.value,Se),at!==null&&(R=b(at,R,ot),Xe===null?Oe=at:Xe.sibling=at,Xe=at);return It&&wi(H,ot),Oe}for($e=m(H,$e);!at.done;ot++,at=G.next())at=St($e,H,ot,at.value,Se),at!==null&&(o&&at.alternate!==null&&$e.delete(at.key===null?ot:at.key),R=b(at,R,ot),Xe===null?Oe=at:Xe.sibling=at,Xe=at);return o&&$e.forEach(function(zS){return a(H,zS)}),It&&wi(H,ot),Oe}function _r(H,R,G,Se){if(typeof G=="object"&&G!==null&&G.type===p&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case f:e:{for(var Oe=G.key,Xe=R;Xe!==null;){if(Xe.key===Oe){if(Oe=G.type,Oe===p){if(Xe.tag===7){d(H,Xe.sibling),R=v(Xe,G.props.children),R.return=H,H=R;break e}}else if(Xe.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===P&&bm(Oe)===Xe.type){d(H,Xe.sibling),R=v(Xe,G.props),R.ref=ga(H,Xe,G),R.return=H,H=R;break e}d(H,Xe);break}else a(H,Xe);Xe=Xe.sibling}G.type===p?(R=Ti(G.props.children,H.mode,Se,G.key),R.return=H,H=R):(Se=hl(G.type,G.key,G.props,null,H.mode,Se),Se.ref=ga(H,R,G),Se.return=H,H=Se)}return E(H);case h:e:{for(Xe=G.key;R!==null;){if(R.key===Xe)if(R.tag===4&&R.stateNode.containerInfo===G.containerInfo&&R.stateNode.implementation===G.implementation){d(H,R.sibling),R=v(R,G.children||[]),R.return=H,H=R;break e}else{d(H,R);break}else a(H,R);R=R.sibling}R=ud(G,H.mode,Se),R.return=H,H=R}return E(H);case P:return Xe=G._init,_r(H,R,Xe(G._payload),Se)}if(ie(G))return ft(H,R,G,Se);if(D(G))return wn(H,R,G,Se);Hs(H,G)}return typeof G=="string"&&G!==""||typeof G=="number"?(G=""+G,R!==null&&R.tag===6?(d(H,R.sibling),R=v(R,G),R.return=H,H=R):(d(H,R),R=cd(G,H.mode,Se),R.return=H,H=R),E(H)):d(H,R)}return _r}var xo=Sm(!0),Cm=Sm(!1),xa={},Nn=Gr(xa),ya=Gr(xa),yo=Gr(xa);function lr(o){if(o===xa)throw Error(c(174));return o}function wu(o,a){gt(yo,a),gt(ya,o),gt(Nn,xa),o=U(a),bt(Nn),gt(Nn,o)}function bo(){bt(Nn),bt(ya),bt(yo)}function wm(o){var a=lr(yo.current),d=lr(Nn.current);a=K(d,o.type,a),d!==a&&(gt(ya,o),gt(Nn,a))}function ku(o){ya.current===o&&(bt(Nn),bt(ya))}var _t=Gr(0);function Ws(o){for(var a=o;a!==null;){if(a.tag===13){var d=a.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||Zp(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===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var ju=[];function Eu(){for(var o=0;o<ju.length;o++){var a=ju[o];Qe?a._workInProgressVersionPrimary=null:a._workInProgressVersionSecondary=null}ju.length=0}var Vs=u.ReactCurrentDispatcher,Pu=u.ReactCurrentBatchConfig,ji=0,Dt=null,Gt=null,Kt=null,Us=!1,ba=!1,Sa=0,aS=0;function sn(){throw Error(c(321))}function Iu(o,a){if(a===null)return!1;for(var d=0;d<a.length&&d<o.length;d++)if(!Kn(o[d],a[d]))return!1;return!0}function Mu(o,a,d,m,v,b){if(ji=b,Dt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Vs.current=o===null||o.memoizedState===null?uS:dS,o=d(m,v),ba){b=0;do{if(ba=!1,Sa=0,25<=b)throw Error(c(301));b+=1,Kt=Gt=null,a.updateQueue=null,Vs.current=fS,o=d(m,v)}while(ba)}if(Vs.current=qs,a=Gt!==null&&Gt.next!==null,ji=0,Kt=Gt=Dt=null,Us=!1,a)throw Error(c(300));return o}function Tu(){var o=Sa!==0;return Sa=0,o}function cr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?Dt.memoizedState=Kt=o:Kt=Kt.next=o,Kt}function Fn(){if(Gt===null){var o=Dt.alternate;o=o!==null?o.memoizedState:null}else o=Gt.next;var a=Kt===null?Dt.memoizedState:Kt.next;if(a!==null)Kt=a,Gt=o;else{if(o===null)throw Error(c(310));Gt=o,o={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},Kt===null?Dt.memoizedState=Kt=o:Kt=Kt.next=o}return Kt}function Ca(o,a){return typeof a=="function"?a(o):a}function _u(o){var a=Fn(),d=a.queue;if(d===null)throw Error(c(311));d.lastRenderedReducer=o;var m=Gt,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 A=E=null,W=null,ae=b;do{var Ee=ae.lane;if((ji&Ee)===Ee)W!==null&&(W=W.next={lane:0,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),m=ae.hasEagerState?ae.eagerState:o(m,ae.action);else{var Ue={lane:Ee,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null};W===null?(A=W=Ue,E=m):W=W.next=Ue,Dt.lanes|=Ee,Ei|=Ee}ae=ae.next}while(ae!==null&&ae!==b);W===null?E=m:W.next=A,Kn(m,a.memoizedState)||(bn=!0),a.memoizedState=m,a.baseState=E,a.baseQueue=W,d.lastRenderedState=m}if(o=d.interleaved,o!==null){v=o;do b=v.lane,Dt.lanes|=b,Ei|=b,v=v.next;while(v!==o)}else v===null&&(d.lanes=0);return[a.memoizedState,d.dispatch]}function Du(o){var a=Fn(),d=a.queue;if(d===null)throw Error(c(311));d.lastRenderedReducer=o;var m=d.dispatch,v=d.pending,b=a.memoizedState;if(v!==null){d.pending=null;var E=v=v.next;do b=o(b,E.action),E=E.next;while(E!==v);Kn(b,a.memoizedState)||(bn=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),d.lastRenderedState=b}return[b,m]}function km(){}function jm(o,a){var d=Dt,m=Fn(),v=a(),b=!Kn(m.memoizedState,v);if(b&&(m.memoizedState=v,bn=!0),m=m.queue,Ou(Im.bind(null,d,m,o),[o]),m.getSnapshot!==a||b||Kt!==null&&Kt.memoizedState.tag&1){if(d.flags|=2048,wa(9,Pm.bind(null,d,m,v,a),void 0,null),Qt===null)throw Error(c(349));ji&30||Em(d,a,v)}return v}function Em(o,a,d){o.flags|=16384,o={getSnapshot:a,value:d},a=Dt.updateQueue,a===null?(a={lastEffect:null,stores:null},Dt.updateQueue=a,a.stores=[o]):(d=a.stores,d===null?a.stores=[o]:d.push(o))}function Pm(o,a,d,m){a.value=d,a.getSnapshot=m,Mm(a)&&Tm(o)}function Im(o,a,d){return d(function(){Mm(a)&&Tm(o)})}function Mm(o){var a=o.getSnapshot;o=o.value;try{var d=a();return!Kn(o,d)}catch{return!0}}function Tm(o){var a=sr(o,1);a!==null&&Ln(a,o,1,-1)}function _m(o){var a=cr();return typeof o=="function"&&(o=o()),a.memoizedState=a.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:o},a.queue=o,o=o.dispatch=cS.bind(null,Dt,o),[a.memoizedState,o]}function wa(o,a,d,m){return o={tag:o,create:a,destroy:d,deps:m,next:null},a=Dt.updateQueue,a===null?(a={lastEffect:null,stores:null},Dt.updateQueue=a,a.lastEffect=o.next=o):(d=a.lastEffect,d===null?a.lastEffect=o.next=o:(m=d.next,d.next=o,o.next=m,a.lastEffect=o)),o}function Dm(){return Fn().memoizedState}function $s(o,a,d,m){var v=cr();Dt.flags|=o,v.memoizedState=wa(1|a,d,void 0,m===void 0?null:m)}function Gs(o,a,d,m){var v=Fn();m=m===void 0?null:m;var b=void 0;if(Gt!==null){var E=Gt.memoizedState;if(b=E.destroy,m!==null&&Iu(m,E.deps)){v.memoizedState=wa(a,d,b,m);return}}Dt.flags|=o,v.memoizedState=wa(1|a,d,b,m)}function Om(o,a){return $s(8390656,8,o,a)}function Ou(o,a){return Gs(2048,8,o,a)}function Am(o,a){return Gs(4,2,o,a)}function zm(o,a){return Gs(4,4,o,a)}function Rm(o,a){if(typeof a=="function")return o=o(),a(o),function(){a(null)};if(a!=null)return o=o(),a.current=o,function(){a.current=null}}function Nm(o,a,d){return d=d!=null?d.concat([o]):null,Gs(4,4,Rm.bind(null,a,o),d)}function Au(){}function Fm(o,a){var d=Fn();a=a===void 0?null:a;var m=d.memoizedState;return m!==null&&a!==null&&Iu(a,m[1])?m[0]:(d.memoizedState=[o,a],o)}function Lm(o,a){var d=Fn();a=a===void 0?null:a;var m=d.memoizedState;return m!==null&&a!==null&&Iu(a,m[1])?m[0]:(o=o(),d.memoizedState=[o,a],o)}function Bm(o,a,d){return ji&21?(Kn(d,a)||(d=nm(),Dt.lanes|=d,Ei|=d,o.baseState=!0),a):(o.baseState&&(o.baseState=!1,bn=!0),o.memoizedState=d)}function sS(o,a){var d=it;it=d!==0&&4>d?d:4,o(!0);var m=Pu.transition;Pu.transition={};try{o(!1),a()}finally{it=d,Pu.transition=m}}function Hm(){return Fn().memoizedState}function lS(o,a,d){var m=Zr(o);if(d={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null},Wm(o))Vm(a,d);else if(d=fm(o,a,d,m),d!==null){var v=un();Ln(d,o,m,v),Um(d,a,m)}}function cS(o,a,d){var m=Zr(o),v={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null};if(Wm(o))Vm(a,v);else{var b=o.alternate;if(o.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var E=a.lastRenderedState,A=b(E,d);if(v.hasEagerState=!0,v.eagerState=A,Kn(A,E)){var W=a.interleaved;W===null?(v.next=v,yu(a)):(v.next=W.next,W.next=v),a.interleaved=v;return}}catch{}finally{}d=fm(o,a,v,m),d!==null&&(v=un(),Ln(d,o,m,v),Um(d,a,m))}}function Wm(o){var a=o.alternate;return o===Dt||a!==null&&a===Dt}function Vm(o,a){ba=Us=!0;var d=o.pending;d===null?a.next=a:(a.next=d.next,d.next=a),o.pending=a}function Um(o,a,d){if(d&4194240){var m=a.lanes;m&=o.pendingLanes,d|=m,a.lanes=d,ou(o,d)}}var qs={readContext:Rn,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useInsertionEffect:sn,useLayoutEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useMutableSource:sn,useSyncExternalStore:sn,useId:sn,unstable_isNewReconciler:!1},uS={readContext:Rn,useCallback:function(o,a){return cr().memoizedState=[o,a===void 0?null:a],o},useContext:Rn,useEffect:Om,useImperativeHandle:function(o,a,d){return d=d!=null?d.concat([o]):null,$s(4194308,4,Rm.bind(null,a,o),d)},useLayoutEffect:function(o,a){return $s(4194308,4,o,a)},useInsertionEffect:function(o,a){return $s(4,2,o,a)},useMemo:function(o,a){var d=cr();return a=a===void 0?null:a,o=o(),d.memoizedState=[o,a],o},useReducer:function(o,a,d){var m=cr();return a=d!==void 0?d(a):a,m.memoizedState=m.baseState=a,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:a},m.queue=o,o=o.dispatch=lS.bind(null,Dt,o),[m.memoizedState,o]},useRef:function(o){var a=cr();return o={current:o},a.memoizedState=o},useState:_m,useDebugValue:Au,useDeferredValue:function(o){return cr().memoizedState=o},useTransition:function(){var o=_m(!1),a=o[0];return o=sS.bind(null,o[1]),cr().memoizedState=o,[a,o]},useMutableSource:function(){},useSyncExternalStore:function(o,a,d){var m=Dt,v=cr();if(It){if(d===void 0)throw Error(c(407));d=d()}else{if(d=a(),Qt===null)throw Error(c(349));ji&30||Em(m,a,d)}v.memoizedState=d;var b={value:d,getSnapshot:a};return v.queue=b,Om(Im.bind(null,m,b,o),[o]),m.flags|=2048,wa(9,Pm.bind(null,m,b,d,a),void 0,null),d},useId:function(){var o=cr(),a=Qt.identifierPrefix;if(It){var d=Pr,m=Er;d=(m&~(1<<32-Xn(m)-1)).toString(32)+d,a=":"+a+"R"+d,d=Sa++,0<d&&(a+="H"+d.toString(32)),a+=":"}else d=aS++,a=":"+a+"r"+d.toString(32)+":";return o.memoizedState=a},unstable_isNewReconciler:!1},dS={readContext:Rn,useCallback:Fm,useContext:Rn,useEffect:Ou,useImperativeHandle:Nm,useInsertionEffect:Am,useLayoutEffect:zm,useMemo:Lm,useReducer:_u,useRef:Dm,useState:function(){return _u(Ca)},useDebugValue:Au,useDeferredValue:function(o){var a=Fn();return Bm(a,Gt.memoizedState,o)},useTransition:function(){var o=_u(Ca)[0],a=Fn().memoizedState;return[o,a]},useMutableSource:km,useSyncExternalStore:jm,useId:Hm,unstable_isNewReconciler:!1},fS={readContext:Rn,useCallback:Fm,useContext:Rn,useEffect:Ou,useImperativeHandle:Nm,useInsertionEffect:Am,useLayoutEffect:zm,useMemo:Lm,useReducer:Du,useRef:Dm,useState:function(){return Du(Ca)},useDebugValue:Au,useDeferredValue:function(o){var a=Fn();return Gt===null?a.memoizedState=o:Bm(a,Gt.memoizedState,o)},useTransition:function(){var o=Du(Ca)[0],a=Fn().memoizedState;return[o,a]},useMutableSource:km,useSyncExternalStore:jm,useId:Hm,unstable_isNewReconciler:!1};function So(o,a){try{var d="",m=a;do d+=oS(m),m=m.return;while(m);var v=d}catch(b){v=`
|
||
Error generating stack: `+b.message+`
|
||
`+b.stack}return{value:o,source:a,stack:v,digest:null}}function zu(o,a,d){return{value:o,source:null,stack:d??null,digest:a??null}}function Ru(o,a){try{console.error(a.value)}catch(d){setTimeout(function(){throw d})}}var hS=typeof WeakMap=="function"?WeakMap:Map;function $m(o,a,d){d=Ir(-1,d),d.tag=3,d.payload={element:null};var m=a.value;return d.callback=function(){sl||(sl=!0,nd=m),Ru(o,a)},d}function Gm(o,a,d){d=Ir(-1,d),d.tag=3;var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var v=a.value;d.payload=function(){return m(v)},d.callback=function(){Ru(o,a)}}var b=o.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(d.callback=function(){Ru(o,a),typeof m!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var E=a.stack;this.componentDidCatch(a.value,{componentStack:E!==null?E:""})}),d}function qm(o,a,d){var m=o.pingCache;if(m===null){m=o.pingCache=new hS;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),o=PS.bind(null,o,a,d),a.then(o,o))}function Ym(o){do{var a;if((a=o.tag===13)&&(a=o.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return o;o=o.return}while(o!==null);return null}function Xm(o,a,d,m,v){return o.mode&1?(o.flags|=65536,o.lanes=v,o):(o===a?o.flags|=65536:(o.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(a=Ir(-1,1),a.tag=2,Xr(d,a,1))),d.lanes|=1),o)}var pS=u.ReactCurrentOwner,bn=!1;function mn(o,a,d,m){a.child=o===null?Cm(a,null,d,m):xo(a,o.child,d,m)}function Km(o,a,d,m,v){d=d.render;var b=a.ref;return go(a,v),m=Mu(o,a,d,m,b,v),d=Tu(),o!==null&&!bn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~v,Mr(o,a,v)):(It&&d&&uu(a),a.flags|=1,mn(o,a,m,v),a.child)}function Qm(o,a,d,m,v){if(o===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,Zm(o,a,b,m,v)):(o=hl(d.type,null,m,a,a.mode,v),o.ref=a.ref,o.return=a,a.child=o)}if(b=o.child,!(o.lanes&v)){var E=b.memoizedProps;if(d=d.compare,d=d!==null?d:zs,d(E,m)&&o.ref===a.ref)return Mr(o,a,v)}return a.flags|=1,o=ei(b,m),o.ref=a.ref,o.return=a,a.child=o}function Zm(o,a,d,m,v){if(o!==null){var b=o.memoizedProps;if(zs(b,m)&&o.ref===a.ref)if(bn=!1,a.pendingProps=m=b,(o.lanes&v)!==0)o.flags&131072&&(bn=!0);else return a.lanes=o.lanes,Mr(o,a,v)}return Nu(o,a,d,m,v)}function Jm(o,a,d){var m=a.pendingProps,v=m.children,b=o!==null?o.memoizedState:null;if(m.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(wo,_n),_n|=d;else{if(!(d&1073741824))return o=b!==null?b.baseLanes|d:d,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:o,cachePool:null,transitions:null},a.updateQueue=null,gt(wo,_n),_n|=o,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=b!==null?b.baseLanes:d,gt(wo,_n),_n|=m}else b!==null?(m=b.baseLanes|d,a.memoizedState=null):m=d,gt(wo,_n),_n|=m;return mn(o,a,v,d),a.child}function ev(o,a){var d=a.ref;(o===null&&d!==null||o!==null&&o.ref!==d)&&(a.flags|=512,a.flags|=2097152)}function Nu(o,a,d,m,v){var b=yn(d)?Si:an.current;return b=fo(a,b),go(a,v),d=Mu(o,a,d,m,b,v),m=Tu(),o!==null&&!bn?(a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~v,Mr(o,a,v)):(It&&m&&uu(a),a.flags|=1,mn(o,a,d,v),a.child)}function tv(o,a,d,m,v){if(yn(d)){var b=!0;Es(a)}else b=!1;if(go(a,v),a.stateNode===null)Xs(o,a),xm(a,d,m),Cu(a,d,m,v),m=!0;else if(o===null){var E=a.stateNode,A=a.memoizedProps;E.props=A;var W=E.context,ae=d.contextType;typeof ae=="object"&&ae!==null?ae=Rn(ae):(ae=yn(d)?Si:an.current,ae=fo(a,ae));var Ee=d.getDerivedStateFromProps,Ue=typeof Ee=="function"||typeof E.getSnapshotBeforeUpdate=="function";Ue||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(A!==m||W!==ae)&&ym(a,E,m,ae),Yr=!1;var ye=a.memoizedState;E.state=ye,Ls(a,m,E,v),W=a.memoizedState,A!==m||ye!==W||xn.current||Yr?(typeof Ee=="function"&&(Su(a,d,Ee,m),W=a.memoizedState),(A=Yr||gm(a,d,A,m,ye,W,ae))?(Ue||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=ae,m=A):(typeof E.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{E=a.stateNode,hm(o,a),A=a.memoizedProps,ae=a.type===a.elementType?A:Zn(a.type,A),E.props=ae,Ue=a.pendingProps,ye=E.context,W=d.contextType,typeof W=="object"&&W!==null?W=Rn(W):(W=yn(d)?Si:an.current,W=fo(a,W));var St=d.getDerivedStateFromProps;(Ee=typeof St=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(A!==Ue||ye!==W)&&ym(a,E,m,W),Yr=!1,ye=a.memoizedState,E.state=ye,Ls(a,m,E,v);var ft=a.memoizedState;A!==Ue||ye!==ft||xn.current||Yr?(typeof St=="function"&&(Su(a,d,St,m),ft=a.memoizedState),(ae=Yr||gm(a,d,ae,m,ye,ft,W)||!1)?(Ee||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(m,ft,W),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(m,ft,W)),typeof E.componentDidUpdate=="function"&&(a.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof E.componentDidUpdate!="function"||A===o.memoizedProps&&ye===o.memoizedState||(a.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||A===o.memoizedProps&&ye===o.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=ft),E.props=m,E.state=ft,E.context=W,m=ae):(typeof E.componentDidUpdate!="function"||A===o.memoizedProps&&ye===o.memoizedState||(a.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||A===o.memoizedProps&&ye===o.memoizedState||(a.flags|=1024),m=!1)}return Fu(o,a,d,m,b,v)}function Fu(o,a,d,m,v,b){ev(o,a);var E=(a.flags&128)!==0;if(!m&&!E)return v&&tm(a,d,!1),Mr(o,a,b);m=a.stateNode,pS.current=a;var A=E&&typeof d.getDerivedStateFromError!="function"?null:m.render();return a.flags|=1,o!==null&&E?(a.child=xo(a,o.child,null,b),a.child=xo(a,null,A,b)):mn(o,a,A,b),a.memoizedState=m.state,v&&tm(a,d,!0),a.child}function nv(o){var a=o.stateNode;a.pendingContext?Jp(o,a.pendingContext,a.pendingContext!==a.context):a.context&&Jp(o,a.context,!1),wu(o,a.containerInfo)}function rv(o,a,d,m,v){return mo(),pu(v),a.flags|=256,mn(o,a,d,m),a.child}var Lu={dehydrated:null,treeContext:null,retryLane:0};function Bu(o){return{baseLanes:o,cachePool:null,transitions:null}}function iv(o,a,d){var m=a.pendingProps,v=_t.current,b=!1,E=(a.flags&128)!==0,A;if((A=E)||(A=o!==null&&o.memoizedState===null?!1:(v&2)!==0),A?(b=!0,a.flags&=-129):(o===null||o.memoizedState!==null)&&(v|=1),gt(_t,v&1),o===null)return hu(a),o=a.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?(a.mode&1?Zc(o)?a.lanes=8:a.lanes=1073741824:a.lanes=1,null):(E=m.children,o=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=pl(E,m,0,null),o=Ti(o,m,d,null),b.return=a,o.return=a,b.sibling=o,a.child=b,a.child.memoizedState=Bu(d),a.memoizedState=Lu,o):Hu(a,E));if(v=o.memoizedState,v!==null&&(A=v.dehydrated,A!==null))return mS(o,a,E,m,A,v,d);if(b){b=m.fallback,E=a.mode,v=o.child,A=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=ei(v,W),m.subtreeFlags=v.subtreeFlags&14680064),A!==null?b=ei(A,b):(b=Ti(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=o.child.memoizedState,E=E===null?Bu(d):{baseLanes:E.baseLanes|d,cachePool:null,transitions:E.transitions},b.memoizedState=E,b.childLanes=o.childLanes&~d,a.memoizedState=Lu,m}return b=o.child,o=b.sibling,m=ei(b,{mode:"visible",children:m.children}),!(a.mode&1)&&(m.lanes=d),m.return=a,m.sibling=null,o!==null&&(d=a.deletions,d===null?(a.deletions=[o],a.flags|=16):d.push(o)),a.child=m,a.memoizedState=null,m}function Hu(o,a){return a=pl({mode:"visible",children:a},o.mode,0,null),a.return=o,o.child=a}function Ys(o,a,d,m){return m!==null&&pu(m),xo(a,o.child,null,d),o=Hu(a,a.pendingProps.children),o.flags|=2,a.memoizedState=null,o}function mS(o,a,d,m,v,b,E){if(d)return a.flags&256?(a.flags&=-257,m=zu(Error(c(422))),Ys(o,a,E,m)):a.memoizedState!==null?(a.child=o.child,a.flags|=128,null):(b=m.fallback,v=a.mode,m=pl({mode:"visible",children:m.children},v,0,null),b=Ti(b,v,E,null),b.flags|=2,m.return=a,b.return=a,m.sibling=b,a.child=m,a.mode&1&&xo(a,o.child,null,E),a.child.memoizedState=Bu(E),a.memoizedState=Lu,b);if(!(a.mode&1))return Ys(o,a,E,null);if(Zc(v))return m=Ib(v).digest,b=Error(c(419)),m=zu(b,m,void 0),Ys(o,a,E,m);if(d=(E&o.childLanes)!==0,bn||d){if(m=Qt,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,sr(o,v),Ln(m,o,v,-1))}return sd(),m=zu(Error(c(421))),Ys(o,a,E,m)}return Zp(v)?(a.flags|=128,a.child=o.child,a=IS.bind(null,o),Mb(v,a),null):(o=b.treeContext,qe&&(zn=Db(v),Tn=a,It=!0,Qn=null,va=!1,o!==null&&(On[An++]=Er,On[An++]=Pr,On[An++]=Ci,Er=o.id,Pr=o.overflow,Ci=a)),a=Hu(a,m.children),a.flags|=4096,a)}function ov(o,a,d){o.lanes|=a;var m=o.alternate;m!==null&&(m.lanes|=a),xu(o.return,a,d)}function Wu(o,a,d,m,v){var b=o.memoizedState;b===null?o.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 av(o,a,d){var m=a.pendingProps,v=m.revealOrder,b=m.tail;if(mn(o,a,m.children,d),m=_t.current,m&2)m=m&1|2,a.flags|=128;else{if(o!==null&&o.flags&128)e:for(o=a.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&ov(o,d,a);else if(o.tag===19)ov(o,d,a);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}m&=1}if(gt(_t,m),!(a.mode&1))a.memoizedState=null;else switch(v){case"forwards":for(d=a.child,v=null;d!==null;)o=d.alternate,o!==null&&Ws(o)===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(o=v.alternate,o!==null&&Ws(o)===null){a.child=v;break}o=v.sibling,v.sibling=d,d=v,v=o}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 Xs(o,a){!(a.mode&1)&&o!==null&&(o.alternate=null,a.alternate=null,a.flags|=2)}function Mr(o,a,d){if(o!==null&&(a.dependencies=o.dependencies),Ei|=a.lanes,!(d&a.childLanes))return null;if(o!==null&&a.child!==o.child)throw Error(c(153));if(a.child!==null){for(o=a.child,d=ei(o,o.pendingProps),a.child=d,d.return=a;o.sibling!==null;)o=o.sibling,d=d.sibling=ei(o,o.pendingProps),d.return=a;d.sibling=null}return a.child}function vS(o,a,d){switch(a.tag){case 3:nv(a),mo();break;case 5:wm(a);break;case 1:yn(a.type)&&Es(a);break;case 4:wu(a,a.stateNode.containerInfo);break;case 10:dm(a,a.type._context,a.memoizedProps.value);break;case 13:var m=a.memoizedState;if(m!==null)return m.dehydrated!==null?(gt(_t,_t.current&1),a.flags|=128,null):d&a.child.childLanes?iv(o,a,d):(gt(_t,_t.current&1),o=Mr(o,a,d),o!==null?o.sibling:null);gt(_t,_t.current&1);break;case 19:if(m=(d&a.childLanes)!==0,o.flags&128){if(m)return av(o,a,d);a.flags|=128}var v=a.memoizedState;if(v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),gt(_t,_t.current),m)break;return null;case 22:case 23:return a.lanes=0,Jm(o,a,d)}return Mr(o,a,d)}function ur(o){o.flags|=4}function sv(o,a){if(o!==null&&o.child===a.child)return!0;if(a.flags&16)return!1;for(o=a.child;o!==null;){if(o.flags&12854||o.subtreeFlags&12854)return!1;o=o.sibling}return!0}var ka,ja,Ks,Qs;if(ve)ka=function(o,a){for(var d=a.child;d!==null;){if(d.tag===5||d.tag===6)ze(o,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}},ja=function(){},Ks=function(o,a,d,m,v){if(o=o.memoizedProps,o!==m){var b=a.stateNode,E=lr(Nn.current);d=J(b,d,o,m,v,E),(a.updateQueue=d)&&ur(a)}},Qs=function(o,a,d,m){d!==m&&ur(a)};else if(_e){ka=function(o,a,d,m){for(var v=a.child;v!==null;){if(v.tag===5){var b=v.stateNode;d&&m&&(b=Kp(b,v.type,v.memoizedProps,v)),ze(o,b)}else if(v.tag===6)b=v.stateNode,d&&m&&(b=Qp(b,v.memoizedProps,v)),ze(o,b);else if(v.tag!==4){if(v.tag===22&&v.memoizedState!==null)b=v.child,b!==null&&(b.return=v),ka(o,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 lv=function(o,a,d,m){for(var v=a.child;v!==null;){if(v.tag===5){var b=v.stateNode;d&&m&&(b=Kp(b,v.type,v.memoizedProps,v)),Xp(o,b)}else if(v.tag===6)b=v.stateNode,d&&m&&(b=Qp(b,v.memoizedProps,v)),Xp(o,b);else if(v.tag!==4){if(v.tag===22&&v.memoizedState!==null)b=v.child,b!==null&&(b.return=v),lv(o,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}};ja=function(o,a){var d=a.stateNode;if(!sv(o,a)){o=d.containerInfo;var m=Yp(o);lv(m,a,!1,!1),d.pendingChildren=m,ur(a),kb(o,m)}},Ks=function(o,a,d,m,v){var b=o.stateNode,E=o.memoizedProps;if((o=sv(o,a))&&E===m)a.stateNode=b;else{var A=a.stateNode,W=lr(Nn.current),ae=null;E!==m&&(ae=J(A,d,E,m,v,W)),o&&ae===null?a.stateNode=b:(b=wb(b,ae,d,E,m,a,o,A),Me(b,d,m,v,W)&&ur(a),a.stateNode=b,o?ur(a):ka(b,a,!1,!1))}},Qs=function(o,a,d,m){d!==m?(o=lr(yo.current),d=lr(Nn.current),a.stateNode=Ie(m,o,d,a),ur(a)):a.stateNode=o.stateNode}}else ja=function(){},Ks=function(){},Qs=function(){};function Ea(o,a){if(!It)switch(o.tailMode){case"hidden":a=o.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?a||o.tail===null?o.tail=null:o.tail.sibling=null:m.sibling=null}}function ln(o){var a=o.alternate!==null&&o.alternate.child===o.child,d=0,m=0;if(a)for(var v=o.child;v!==null;)d|=v.lanes|v.childLanes,m|=v.subtreeFlags&14680064,m|=v.flags&14680064,v.return=o,v=v.sibling;else for(v=o.child;v!==null;)d|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=o,v=v.sibling;return o.subtreeFlags|=m,o.childLanes=d,a}function gS(o,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 ln(a),null;case 1:return yn(a.type)&&js(),ln(a),null;case 3:return d=a.stateNode,bo(),bt(xn),bt(an),Eu(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(As(a)?ur(a):o===null||o.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,Qn!==null&&(od(Qn),Qn=null))),ja(o,a),ln(a),null;case 5:ku(a),d=lr(yo.current);var v=a.type;if(o!==null&&a.stateNode!=null)Ks(o,a,v,m,d),o.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!m){if(a.stateNode===null)throw Error(c(166));return ln(a),null}if(o=lr(Nn.current),As(a)){if(!qe)throw Error(c(175));o=Ob(a.stateNode,a.type,a.memoizedProps,d,o,a,!va),a.updateQueue=o,o!==null&&ur(a)}else{var b=Re(v,m,d,o,a);ka(b,a,!1,!1),a.stateNode=b,Me(b,v,m,d,o)&&ur(a)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return ln(a),null;case 6:if(o&&a.stateNode!=null)Qs(o,a,o.memoizedProps,m);else{if(typeof m!="string"&&a.stateNode===null)throw Error(c(166));if(o=lr(yo.current),d=lr(Nn.current),As(a)){if(!qe)throw Error(c(176));if(o=a.stateNode,d=a.memoizedProps,(m=Ab(o,d,a,!va))&&(v=Tn,v!==null))switch(v.tag){case 3:Wb(v.stateNode.containerInfo,o,d,(v.mode&1)!==0);break;case 5:Vb(v.type,v.memoizedProps,v.stateNode,o,d,(v.mode&1)!==0)}m&&ur(a)}else a.stateNode=Ie(m,o,d,a)}return ln(a),null;case 13:if(bt(_t),m=a.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(It&&zn!==null&&a.mode&1&&!(a.flags&128))um(),mo(),a.flags|=98560,v=!1;else if(v=As(a),m!==null&&m.dehydrated!==null){if(o===null){if(!v)throw Error(c(318));if(!qe)throw Error(c(344));if(v=a.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(c(317));zb(v,a)}else mo(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;ln(a),v=!1}else Qn!==null&&(od(Qn),Qn=null),v=!0;if(!v)return a.flags&65536?a:null}return a.flags&128?(a.lanes=d,a):(d=m!==null,d!==(o!==null&&o.memoizedState!==null)&&d&&(a.child.flags|=8192,a.mode&1&&(o===null||_t.current&1?qt===0&&(qt=3):sd())),a.updateQueue!==null&&(a.flags|=4),ln(a),null);case 4:return bo(),ja(o,a),o===null&&Te(a.stateNode.containerInfo),ln(a),null;case 10:return gu(a.type._context),ln(a),null;case 17:return yn(a.type)&&js(),ln(a),null;case 19:if(bt(_t),v=a.memoizedState,v===null)return ln(a),null;if(m=(a.flags&128)!==0,b=v.rendering,b===null)if(m)Ea(v,!1);else{if(qt!==0||o!==null&&o.flags&128)for(o=a.child;o!==null;){if(b=Ws(o),b!==null){for(a.flags|=128,Ea(v,!1),o=b.updateQueue,o!==null&&(a.updateQueue=o,a.flags|=4),a.subtreeFlags=0,o=d,d=a.child;d!==null;)m=d,v=o,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(_t,_t.current&1|2),a.child}o=o.sibling}v.tail!==null&&Xt()>td&&(a.flags|=128,m=!0,Ea(v,!1),a.lanes=4194304)}else{if(!m)if(o=Ws(b),o!==null){if(a.flags|=128,m=!0,o=o.updateQueue,o!==null&&(a.updateQueue=o,a.flags|=4),Ea(v,!0),v.tail===null&&v.tailMode==="hidden"&&!b.alternate&&!It)return ln(a),null}else 2*Xt()-v.renderingStartTime>td&&d!==1073741824&&(a.flags|=128,m=!0,Ea(v,!1),a.lanes=4194304);v.isBackwards?(b.sibling=a.child,a.child=b):(o=v.last,o!==null?o.sibling=b:a.child=b,v.last=b)}return v.tail!==null?(a=v.tail,v.rendering=a,v.tail=a.sibling,v.renderingStartTime=Xt(),a.sibling=null,o=_t.current,gt(_t,m?o&1|2:o&1),a):(ln(a),null);case 22:case 23:return ad(),d=a.memoizedState!==null,o!==null&&o.memoizedState!==null!==d&&(a.flags|=8192),d&&a.mode&1?_n&1073741824&&(ln(a),ve&&a.subtreeFlags&6&&(a.flags|=8192)):ln(a),null;case 24:return null;case 25:return null}throw Error(c(156,a.tag))}function xS(o,a){switch(du(a),a.tag){case 1:return yn(a.type)&&js(),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return bo(),bt(xn),bt(an),Eu(),o=a.flags,o&65536&&!(o&128)?(a.flags=o&-65537|128,a):null;case 5:return ku(a),null;case 13:if(bt(_t),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(c(340));mo()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return bt(_t),null;case 4:return bo(),null;case 10:return gu(a.type._context),null;case 22:case 23:return ad(),null;case 24:return null;default:return null}}var Zs=!1,cn=!1,yS=typeof WeakSet=="function"?WeakSet:Set,we=null;function Co(o,a){var d=o.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(m){Mt(o,a,m)}else d.current=null}function Vu(o,a,d){try{d()}catch(m){Mt(o,a,m)}}var cv=!1;function bS(o,a){for(ne(o.containerInfo),we=a;we!==null;)if(o=we,a=o.child,(o.subtreeFlags&1028)!==0&&a!==null)a.return=o,we=a;else for(;we!==null;){o=we;try{var d=o.alternate;if(o.flags&1024)switch(o.tag){case 0:case 11:case 15:break;case 1:if(d!==null){var m=d.memoizedProps,v=d.memoizedState,b=o.stateNode,E=b.getSnapshotBeforeUpdate(o.elementType===o.type?m:Zn(o.type,m),v);b.__reactInternalSnapshotBeforeUpdate=E}break;case 3:ve&&bi(o.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(c(163))}}catch(A){Mt(o,o.return,A)}if(a=o.sibling,a!==null){a.return=o.return,we=a;break}we=o.return}return d=cv,cv=!1,d}function Pa(o,a,d){var m=a.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var v=m=m.next;do{if((v.tag&o)===o){var b=v.destroy;v.destroy=void 0,b!==void 0&&Vu(a,d,b)}v=v.next}while(v!==m)}}function Js(o,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var d=a=a.next;do{if((d.tag&o)===o){var m=d.create;d.destroy=m()}d=d.next}while(d!==a)}}function Uu(o){var a=o.ref;if(a!==null){var d=o.stateNode;switch(o.tag){case 5:o=oe(d);break;default:o=d}typeof a=="function"?a(o):a.current=o}}function uv(o){var a=o.alternate;a!==null&&(o.alternate=null,uv(a)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(a=o.stateNode,a!==null&&Ve(a)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function dv(o){return o.tag===5||o.tag===3||o.tag===4}function fv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||dv(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function $u(o,a,d){var m=o.tag;if(m===5||m===6)o=o.stateNode,a?hn(d,o,a):He(d,o);else if(m!==4&&(o=o.child,o!==null))for($u(o,a,d),o=o.sibling;o!==null;)$u(o,a,d),o=o.sibling}function Gu(o,a,d){var m=o.tag;if(m===5||m===6)o=o.stateNode,a?De(d,o,a):ee(d,o);else if(m!==4&&(o=o.child,o!==null))for(Gu(o,a,d),o=o.sibling;o!==null;)Gu(o,a,d),o=o.sibling}var tn=null,Jn=!1;function dr(o,a,d){for(d=d.child;d!==null;)qu(o,a,d),d=d.sibling}function qu(o,a,d){if(or&&typeof or.onCommitFiberUnmount=="function")try{or.onCommitFiberUnmount(Ts,d)}catch{}switch(d.tag){case 5:cn||Co(d,a);case 6:if(ve){var m=tn,v=Jn;tn=null,dr(o,a,d),tn=m,Jn=v,tn!==null&&(Jn?pn(tn,d.stateNode):$t(tn,d.stateNode))}else dr(o,a,d);break;case 18:ve&&tn!==null&&(Jn?Bb(tn,d.stateNode):Lb(tn,d.stateNode));break;case 4:ve?(m=tn,v=Jn,tn=d.stateNode.containerInfo,Jn=!0,dr(o,a,d),tn=m,Jn=v):(_e&&(m=d.stateNode.containerInfo,v=Yp(m),Qc(m,v)),dr(o,a,d));break;case 0:case 11:case 14:case 15:if(!cn&&(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)}dr(o,a,d);break;case 1:if(!cn&&(Co(d,a),m=d.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=d.memoizedProps,m.state=d.memoizedState,m.componentWillUnmount()}catch(A){Mt(d,a,A)}dr(o,a,d);break;case 21:dr(o,a,d);break;case 22:d.mode&1?(cn=(m=cn)||d.memoizedState!==null,dr(o,a,d),cn=m):dr(o,a,d);break;default:dr(o,a,d)}}function hv(o){var a=o.updateQueue;if(a!==null){o.updateQueue=null;var d=o.stateNode;d===null&&(d=o.stateNode=new yS),a.forEach(function(m){var v=MS.bind(null,o,m);d.has(m)||(d.add(m),m.then(v,v))})}}function er(o,a){var d=a.deletions;if(d!==null)for(var m=0;m<d.length;m++){var v=d[m];try{var b=o,E=a;if(ve){var A=E;e:for(;A!==null;){switch(A.tag){case 5:tn=A.stateNode,Jn=!1;break e;case 3:tn=A.stateNode.containerInfo,Jn=!0;break e;case 4:tn=A.stateNode.containerInfo,Jn=!0;break e}A=A.return}if(tn===null)throw Error(c(160));qu(b,E,v),tn=null,Jn=!1}else qu(b,E,v);var W=v.alternate;W!==null&&(W.return=null),v.return=null}catch(ae){Mt(v,a,ae)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)pv(a,o),a=a.sibling}function pv(o,a){var d=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(er(a,o),fr(o),m&4){try{Pa(3,o,o.return),Js(3,o)}catch(ye){Mt(o,o.return,ye)}try{Pa(5,o,o.return)}catch(ye){Mt(o,o.return,ye)}}break;case 1:er(a,o),fr(o),m&512&&d!==null&&Co(d,d.return);break;case 5:if(er(a,o),fr(o),m&512&&d!==null&&Co(d,d.return),ve){if(o.flags&32){var v=o.stateNode;try{ir(v)}catch(ye){Mt(o,o.return,ye)}}if(m&4&&(v=o.stateNode,v!=null)){var b=o.memoizedProps;if(d=d!==null?d.memoizedProps:b,m=o.type,a=o.updateQueue,o.updateQueue=null,a!==null)try{pe(v,a,m,d,b,o)}catch(ye){Mt(o,o.return,ye)}}}break;case 6:if(er(a,o),fr(o),m&4&&ve){if(o.stateNode===null)throw Error(c(162));v=o.stateNode,b=o.memoizedProps,d=d!==null?d.memoizedProps:b;try{nt(v,d,b)}catch(ye){Mt(o,o.return,ye)}}break;case 3:if(er(a,o),fr(o),m&4){if(ve&&qe&&d!==null&&d.memoizedState.isDehydrated)try{Nb(a.containerInfo)}catch(ye){Mt(o,o.return,ye)}if(_e){v=a.containerInfo,b=a.pendingChildren;try{Qc(v,b)}catch(ye){Mt(o,o.return,ye)}}}break;case 4:if(er(a,o),fr(o),m&4&&_e){b=o.stateNode,v=b.containerInfo,b=b.pendingChildren;try{Qc(v,b)}catch(ye){Mt(o,o.return,ye)}}break;case 13:er(a,o),fr(o),v=o.child,v.flags&8192&&(b=v.memoizedState!==null,v.stateNode.isHidden=b,!b||v.alternate!==null&&v.alternate.memoizedState!==null||(ed=Xt())),m&4&&hv(o);break;case 22:var E=d!==null&&d.memoizedState!==null;if(o.mode&1?(cn=(d=cn)||E,er(a,o),cn=d):er(a,o),fr(o),m&8192){if(d=o.memoizedState!==null,(o.stateNode.isHidden=d)&&!E&&o.mode&1)for(we=o,m=o.child;m!==null;){for(a=we=m;we!==null;){E=we;var A=E.child;switch(E.tag){case 0:case 11:case 14:case 15:Pa(4,E,E.return);break;case 1:Co(E,E.return);var W=E.stateNode;if(typeof W.componentWillUnmount=="function"){var ae=E,Ee=E.return;try{var Ue=ae;W.props=Ue.memoizedProps,W.state=Ue.memoizedState,W.componentWillUnmount()}catch(ye){Mt(ae,Ee,ye)}}break;case 5:Co(E,E.return);break;case 22:if(E.memoizedState!==null){gv(a);continue}}A!==null?(A.return=E,we=A):gv(a)}m=m.sibling}if(ve){e:if(m=null,ve)for(a=o;;){if(a.tag===5){if(m===null){m=a;try{v=a.stateNode,d?yi(v):Kc(a.stateNode,a.memoizedProps)}catch(ye){Mt(o,o.return,ye)}}}else if(a.tag===6){if(m===null)try{b=a.stateNode,d?da(b):fa(b,a.memoizedProps)}catch(ye){Mt(o,o.return,ye)}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===o)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;m===a&&(m=null),a=a.return}m===a&&(m=null),a.sibling.return=a.return,a=a.sibling}}}break;case 19:er(a,o),fr(o),m&4&&hv(o);break;case 21:break;default:er(a,o),fr(o)}}function fr(o){var a=o.flags;if(a&2){try{if(ve){e:{for(var d=o.return;d!==null;){if(dv(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&&(ir(v),m.flags&=-33);var b=fv(o);Gu(o,b,v);break;case 3:case 4:var E=m.stateNode.containerInfo,A=fv(o);$u(o,A,E);break;default:throw Error(c(161))}}}catch(W){Mt(o,o.return,W)}o.flags&=-3}a&4096&&(o.flags&=-4097)}function SS(o,a,d){we=o,mv(o)}function mv(o,a,d){for(var m=(o.mode&1)!==0;we!==null;){var v=we,b=v.child;if(v.tag===22&&m){var E=v.memoizedState!==null||Zs;if(!E){var A=v.alternate,W=A!==null&&A.memoizedState!==null||cn;A=Zs;var ae=cn;if(Zs=E,(cn=W)&&!ae)for(we=v;we!==null;)E=we,W=E.child,E.tag===22&&E.memoizedState!==null?xv(v):W!==null?(W.return=E,we=W):xv(v);for(;b!==null;)we=b,mv(b),b=b.sibling;we=v,Zs=A,cn=ae}vv(o)}else v.subtreeFlags&8772&&b!==null?(b.return=v,we=b):vv(o)}}function vv(o){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:cn||Js(5,a);break;case 1:var m=a.stateNode;if(a.flags&4&&!cn)if(d===null)m.componentDidMount();else{var v=a.elementType===a.type?d.memoizedProps:Zn(a.type,d.memoizedProps);m.componentDidUpdate(v,d.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var b=a.updateQueue;b!==null&&mm(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=oe(a.child.stateNode);break;case 1:d=a.child.stateNode}mm(a,E,d)}break;case 5:var A=a.stateNode;d===null&&a.flags&4&&Ft(A,a.type,a.memoizedProps,a);break;case 6:break;case 4:break;case 12:break;case 13:if(qe&&a.memoizedState===null){var W=a.alternate;if(W!==null){var ae=W.memoizedState;if(ae!==null){var Ee=ae.dehydrated;Ee!==null&&Fb(Ee)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(c(163))}cn||a.flags&512&&Uu(a)}catch(Ue){Mt(a,a.return,Ue)}}if(a===o){we=null;break}if(d=a.sibling,d!==null){d.return=a.return,we=d;break}we=a.return}}function gv(o){for(;we!==null;){var a=we;if(a===o){we=null;break}var d=a.sibling;if(d!==null){d.return=a.return,we=d;break}we=a.return}}function xv(o){for(;we!==null;){var a=we;try{switch(a.tag){case 0:case 11:case 15:var d=a.return;try{Js(4,a)}catch(W){Mt(a,d,W)}break;case 1:var m=a.stateNode;if(typeof m.componentDidMount=="function"){var v=a.return;try{m.componentDidMount()}catch(W){Mt(a,v,W)}}var b=a.return;try{Uu(a)}catch(W){Mt(a,b,W)}break;case 5:var E=a.return;try{Uu(a)}catch(W){Mt(a,E,W)}}}catch(W){Mt(a,a.return,W)}if(a===o){we=null;break}var A=a.sibling;if(A!==null){A.return=a.return,we=A;break}we=a.return}}var el=0,tl=1,nl=2,rl=3,il=4;if(typeof Symbol=="function"&&Symbol.for){var Ia=Symbol.for;el=Ia("selector.component"),tl=Ia("selector.has_pseudo_class"),nl=Ia("selector.role"),rl=Ia("selector.test_id"),il=Ia("selector.text")}function Yu(o){var a=ge(o);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error(c(364));return a}if(o=de(o),o===null)throw Error(c(362));return o.stateNode.current}function Xu(o,a){switch(a.$$typeof){case el:if(o.type===a.value)return!0;break;case tl:e:{a=a.value,o=[o,0];for(var d=0;d<o.length;){var m=o[d++],v=o[d++],b=a[v];if(m.tag!==5||!q(m)){for(;b!=null&&Xu(m,b);)v++,b=a[v];if(v===a.length){a=!0;break e}else for(m=m.child;m!==null;)o.push(m,v),m=m.sibling}}a=!1}return a;case nl:if(o.tag===5&&se(o.stateNode,a.value))return!0;break;case il:if((o.tag===5||o.tag===6)&&(o=je(o),o!==null&&0<=o.indexOf(a.value)))return!0;break;case rl:if(o.tag===5&&(o=o.memoizedProps["data-testname"],typeof o=="string"&&o.toLowerCase()===a.value.toLowerCase()))return!0;break;default:throw Error(c(365))}return!1}function Ku(o){switch(o.$$typeof){case el:return"<"+(_(o.value)||"Unknown")+">";case tl:return":has("+(Ku(o)||"")+")";case nl:return'[role="'+o.value+'"]';case il:return'"'+o.value+'"';case rl:return'[data-testname="'+o.value+'"]';default:throw Error(c(365))}}function yv(o,a){var d=[];o=[o,0];for(var m=0;m<o.length;){var v=o[m++],b=o[m++],E=a[b];if(v.tag!==5||!q(v)){for(;E!=null&&Xu(v,E);)b++,E=a[b];if(b===a.length)d.push(v);else for(v=v.child;v!==null;)o.push(v,b),v=v.sibling}}return d}function Qu(o,a){if(!N)throw Error(c(363));o=Yu(o),o=yv(o,a),a=[],o=Array.from(o);for(var d=0;d<o.length;){var m=o[d++];if(m.tag===5)q(m)||a.push(m.stateNode);else for(m=m.child;m!==null;)o.push(m),m=m.sibling}return a}var CS=Math.ceil,ol=u.ReactCurrentDispatcher,Zu=u.ReactCurrentOwner,Lt=u.ReactCurrentBatchConfig,Ke=0,Qt=null,Ht=null,nn=0,_n=0,wo=Gr(0),qt=0,Ma=null,Ei=0,al=0,Ju=0,Ta=null,Sn=null,ed=0,td=1/0,Tr=null;function ko(){td=Xt()+500}var sl=!1,nd=null,Kr=null,ll=!1,Qr=null,cl=0,_a=0,rd=null,ul=-1,dl=0;function un(){return Ke&6?Xt():ul!==-1?ul:ul=Xt()}function Zr(o){return o.mode&1?Ke&2&&nn!==0?nn&-nn:iS.transition!==null?(dl===0&&(dl=nm()),dl):(o=it,o!==0?o:et()):1}function Ln(o,a,d,m){if(50<_a)throw _a=0,rd=null,Error(c(185));ma(o,d,m),(!(Ke&2)||o!==Qt)&&(o===Qt&&(!(Ke&2)&&(al|=d),qt===4&&Jr(o,nn)),Cn(o,m),d===1&&Ke===0&&!(a.mode&1)&&(ko(),_s&&ar()))}function Cn(o,a){var d=o.callbackNode;Xb(o,a);var m=Ms(o,o===Qt?nn:0);if(m===0)d!==null&&im(d),o.callbackNode=null,o.callbackPriority=0;else if(a=m&-m,o.callbackPriority!==a){if(d!=null&&im(d),a===1)o.tag===0?rS(Sv.bind(null,o)):om(Sv.bind(null,o)),vt?Nt(function(){!(Ke&6)&&ar()}):au(su,ar),d=null;else{switch(rm(m)){case 1:d=su;break;case 4:d=Jb;break;case 16:d=lu;break;case 536870912:d=eS;break;default:d=lu}d=Tv(d,bv.bind(null,o))}o.callbackPriority=a,o.callbackNode=d}}function bv(o,a){if(ul=-1,dl=0,Ke&6)throw Error(c(327));var d=o.callbackNode;if(Mi()&&o.callbackNode!==d)return null;var m=Ms(o,o===Qt?nn:0);if(m===0)return null;if(m&30||m&o.expiredLanes||a)a=fl(o,m);else{a=m;var v=Ke;Ke|=2;var b=kv();(Qt!==o||nn!==a)&&(Tr=null,ko(),Pi(o,a));do try{jS();break}catch(A){wv(o,A)}while(1);vu(),ol.current=b,Ke=v,Ht!==null?a=0:(Qt=null,nn=0,a=qt)}if(a!==0){if(a===2&&(v=ru(o),v!==0&&(m=v,a=id(o,v))),a===1)throw d=Ma,Pi(o,0),Jr(o,m),Cn(o,Xt()),d;if(a===6)Jr(o,m);else{if(v=o.current.alternate,!(m&30)&&!wS(v)&&(a=fl(o,m),a===2&&(b=ru(o),b!==0&&(m=b,a=id(o,b))),a===1))throw d=Ma,Pi(o,0),Jr(o,m),Cn(o,Xt()),d;switch(o.finishedWork=v,o.finishedLanes=m,a){case 0:case 1:throw Error(c(345));case 2:Ii(o,Sn,Tr);break;case 3:if(Jr(o,m),(m&130023424)===m&&(a=ed+500-Xt(),10<a)){if(Ms(o,0)!==0)break;if(v=o.suspendedLanes,(v&m)!==m){un(),o.pingedLanes|=o.suspendedLanes&v;break}o.timeoutHandle=Be(Ii.bind(null,o,Sn,Tr),a);break}Ii(o,Sn,Tr);break;case 4:if(Jr(o,m),(m&4194240)===m)break;for(a=o.eventTimes,v=-1;0<m;){var E=31-Xn(m);b=1<<E,E=a[E],E>v&&(v=E),m&=~b}if(m=v,m=Xt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*CS(m/1960))-m,10<m){o.timeoutHandle=Be(Ii.bind(null,o,Sn,Tr),m);break}Ii(o,Sn,Tr);break;case 5:Ii(o,Sn,Tr);break;default:throw Error(c(329))}}}return Cn(o,Xt()),o.callbackNode===d?bv.bind(null,o):null}function id(o,a){var d=Ta;return o.current.memoizedState.isDehydrated&&(Pi(o,a).flags|=256),o=fl(o,a),o!==2&&(a=Sn,Sn=d,a!==null&&od(a)),o}function od(o){Sn===null?Sn=o:Sn.push.apply(Sn,o)}function wS(o){for(var a=o;;){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(!Kn(b(),v))return!1}catch{return!1}}}if(d=a.child,a.subtreeFlags&16384&&d!==null)d.return=a,a=d;else{if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Jr(o,a){for(a&=~Ju,a&=~al,o.suspendedLanes|=a,o.pingedLanes&=~a,o=o.expirationTimes;0<a;){var d=31-Xn(a),m=1<<d;o[d]=-1,a&=~m}}function Sv(o){if(Ke&6)throw Error(c(327));Mi();var a=Ms(o,0);if(!(a&1))return Cn(o,Xt()),null;var d=fl(o,a);if(o.tag!==0&&d===2){var m=ru(o);m!==0&&(a=m,d=id(o,m))}if(d===1)throw d=Ma,Pi(o,0),Jr(o,a),Cn(o,Xt()),d;if(d===6)throw Error(c(345));return o.finishedWork=o.current.alternate,o.finishedLanes=a,Ii(o,Sn,Tr),Cn(o,Xt()),null}function Cv(o){Qr!==null&&Qr.tag===0&&!(Ke&6)&&Mi();var a=Ke;Ke|=1;var d=Lt.transition,m=it;try{if(Lt.transition=null,it=1,o)return o()}finally{it=m,Lt.transition=d,Ke=a,!(Ke&6)&&ar()}}function ad(){_n=wo.current,bt(wo)}function Pi(o,a){o.finishedWork=null,o.finishedLanes=0;var d=o.timeoutHandle;if(d!==Ge&&(o.timeoutHandle=Ge,Ne(d)),Ht!==null)for(d=Ht.return;d!==null;){var m=d;switch(du(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&js();break;case 3:bo(),bt(xn),bt(an),Eu();break;case 5:ku(m);break;case 4:bo();break;case 13:bt(_t);break;case 19:bt(_t);break;case 10:gu(m.type._context);break;case 22:case 23:ad()}d=d.return}if(Qt=o,Ht=o=ei(o.current,null),nn=_n=a,qt=0,Ma=null,Ju=al=Ei=0,Sn=Ta=null,ki!==null){for(a=0;a<ki.length;a++)if(d=ki[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}ki=null}return o}function wv(o,a){do{var d=Ht;try{if(vu(),Vs.current=qs,Us){for(var m=Dt.memoizedState;m!==null;){var v=m.queue;v!==null&&(v.pending=null),m=m.next}Us=!1}if(ji=0,Kt=Gt=Dt=null,ba=!1,Sa=0,Zu.current=null,d===null||d.return===null){qt=1,Ma=a,Ht=null;break}e:{var b=o,E=d.return,A=d,W=a;if(a=nn,A.flags|=32768,W!==null&&typeof W=="object"&&typeof W.then=="function"){var ae=W,Ee=A,Ue=Ee.tag;if(!(Ee.mode&1)&&(Ue===0||Ue===11||Ue===15)){var ye=Ee.alternate;ye?(Ee.updateQueue=ye.updateQueue,Ee.memoizedState=ye.memoizedState,Ee.lanes=ye.lanes):(Ee.updateQueue=null,Ee.memoizedState=null)}var St=Ym(E);if(St!==null){St.flags&=-257,Xm(St,E,A,b,a),St.mode&1&&qm(b,ae,a),a=St,W=ae;var ft=a.updateQueue;if(ft===null){var wn=new Set;wn.add(W),a.updateQueue=wn}else ft.add(W);break e}else{if(!(a&1)){qm(b,ae,a),sd();break e}W=Error(c(426))}}else if(It&&A.mode&1){var _r=Ym(E);if(_r!==null){!(_r.flags&65536)&&(_r.flags|=256),Xm(_r,E,A,b,a),pu(So(W,A));break e}}b=W=So(W,A),qt!==4&&(qt=2),Ta===null?Ta=[b]:Ta.push(b),b=E;do{switch(b.tag){case 3:b.flags|=65536,a&=-a,b.lanes|=a;var H=$m(b,W,a);pm(b,H);break e;case 1:A=W;var R=b.type,G=b.stateNode;if(!(b.flags&128)&&(typeof R.getDerivedStateFromError=="function"||G!==null&&typeof G.componentDidCatch=="function"&&(Kr===null||!Kr.has(G)))){b.flags|=65536,a&=-a,b.lanes|=a;var Se=Gm(b,A,a);pm(b,Se);break e}}b=b.return}while(b!==null)}Ev(d)}catch(Oe){a=Oe,Ht===d&&d!==null&&(Ht=d=d.return);continue}break}while(1)}function kv(){var o=ol.current;return ol.current=qs,o===null?qs:o}function sd(){(qt===0||qt===3||qt===2)&&(qt=4),Qt===null||!(Ei&268435455)&&!(al&268435455)||Jr(Qt,nn)}function fl(o,a){var d=Ke;Ke|=2;var m=kv();(Qt!==o||nn!==a)&&(Tr=null,Pi(o,a));do try{kS();break}catch(v){wv(o,v)}while(1);if(vu(),Ke=d,ol.current=m,Ht!==null)throw Error(c(261));return Qt=null,nn=0,qt}function kS(){for(;Ht!==null;)jv(Ht)}function jS(){for(;Ht!==null&&!Qb();)jv(Ht)}function jv(o){var a=Mv(o.alternate,o,_n);o.memoizedProps=o.pendingProps,a===null?Ev(o):Ht=a,Zu.current=null}function Ev(o){var a=o;do{var d=a.alternate;if(o=a.return,a.flags&32768){if(d=xS(d,a),d!==null){d.flags&=32767,Ht=d;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{qt=6,Ht=null;return}}else if(d=gS(d,a,_n),d!==null){Ht=d;return}if(a=a.sibling,a!==null){Ht=a;return}Ht=a=o}while(a!==null);qt===0&&(qt=5)}function Ii(o,a,d){var m=it,v=Lt.transition;try{Lt.transition=null,it=1,ES(o,a,d,m)}finally{Lt.transition=v,it=m}return null}function ES(o,a,d,m){do Mi();while(Qr!==null);if(Ke&6)throw Error(c(327));d=o.finishedWork;var v=o.finishedLanes;if(d===null)return null;if(o.finishedWork=null,o.finishedLanes=0,d===o.current)throw Error(c(177));o.callbackNode=null,o.callbackPriority=0;var b=d.lanes|d.childLanes;if(Kb(o,b),o===Qt&&(Ht=Qt=null,nn=0),!(d.subtreeFlags&2064)&&!(d.flags&2064)||ll||(ll=!0,Tv(lu,function(){return Mi(),null})),b=(d.flags&15990)!==0,d.subtreeFlags&15990||b){b=Lt.transition,Lt.transition=null;var E=it;it=1;var A=Ke;Ke|=4,Zu.current=null,bS(o,d),pv(d,o),ce(o.containerInfo),o.current=d,SS(d),Zb(),Ke=A,it=E,Lt.transition=b}else o.current=d;if(ll&&(ll=!1,Qr=o,cl=v),b=o.pendingLanes,b===0&&(Kr=null),tS(d.stateNode),Cn(o,Xt()),a!==null)for(m=o.onRecoverableError,d=0;d<a.length;d++)v=a[d],m(v.value,{componentStack:v.stack,digest:v.digest});if(sl)throw sl=!1,o=nd,nd=null,o;return cl&1&&o.tag!==0&&Mi(),b=o.pendingLanes,b&1?o===rd?_a++:(_a=0,rd=o):_a=0,ar(),null}function Mi(){if(Qr!==null){var o=rm(cl),a=Lt.transition,d=it;try{if(Lt.transition=null,it=16>o?16:o,Qr===null)var m=!1;else{if(o=Qr,Qr=null,cl=0,Ke&6)throw Error(c(331));var v=Ke;for(Ke|=4,we=o.current;we!==null;){var b=we,E=b.child;if(we.flags&16){var A=b.deletions;if(A!==null){for(var W=0;W<A.length;W++){var ae=A[W];for(we=ae;we!==null;){var Ee=we;switch(Ee.tag){case 0:case 11:case 15:Pa(8,Ee,b)}var Ue=Ee.child;if(Ue!==null)Ue.return=Ee,we=Ue;else for(;we!==null;){Ee=we;var ye=Ee.sibling,St=Ee.return;if(uv(Ee),Ee===ae){we=null;break}if(ye!==null){ye.return=St,we=ye;break}we=St}}}var ft=b.alternate;if(ft!==null){var wn=ft.child;if(wn!==null){ft.child=null;do{var _r=wn.sibling;wn.sibling=null,wn=_r}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:Pa(9,b,b.return)}var H=b.sibling;if(H!==null){H.return=b.return,we=H;break e}we=b.return}}var R=o.current;for(we=R;we!==null;){E=we;var G=E.child;if(E.subtreeFlags&2064&&G!==null)G.return=E,we=G;else e:for(E=R;we!==null;){if(A=we,A.flags&2048)try{switch(A.tag){case 0:case 11:case 15:Js(9,A)}}catch(Oe){Mt(A,A.return,Oe)}if(A===E){we=null;break e}var Se=A.sibling;if(Se!==null){Se.return=A.return,we=Se;break e}we=A.return}}if(Ke=v,ar(),or&&typeof or.onPostCommitFiberRoot=="function")try{or.onPostCommitFiberRoot(Ts,o)}catch{}m=!0}return m}finally{it=d,Lt.transition=a}}return!1}function Pv(o,a,d){a=So(d,a),a=$m(o,a,1),o=Xr(o,a,1),a=un(),o!==null&&(ma(o,1,a),Cn(o,a))}function Mt(o,a,d){if(o.tag===3)Pv(o,o,d);else for(;a!==null;){if(a.tag===3){Pv(a,o,d);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Kr===null||!Kr.has(m))){o=So(d,o),o=Gm(a,o,1),a=Xr(a,o,1),o=un(),a!==null&&(ma(a,1,o),Cn(a,o));break}}a=a.return}}function PS(o,a,d){var m=o.pingCache;m!==null&&m.delete(a),a=un(),o.pingedLanes|=o.suspendedLanes&d,Qt===o&&(nn&d)===d&&(qt===4||qt===3&&(nn&130023424)===nn&&500>Xt()-ed?Pi(o,0):Ju|=d),Cn(o,a)}function Iv(o,a){a===0&&(o.mode&1?(a=Is,Is<<=1,!(Is&130023424)&&(Is=4194304)):a=1);var d=un();o=sr(o,a),o!==null&&(ma(o,a,d),Cn(o,d))}function IS(o){var a=o.memoizedState,d=0;a!==null&&(d=a.retryLane),Iv(o,d)}function MS(o,a){var d=0;switch(o.tag){case 13:var m=o.stateNode,v=o.memoizedState;v!==null&&(d=v.retryLane);break;case 19:m=o.stateNode;break;default:throw Error(c(314))}m!==null&&m.delete(a),Iv(o,d)}var Mv;Mv=function(o,a,d){if(o!==null)if(o.memoizedProps!==a.pendingProps||xn.current)bn=!0;else{if(!(o.lanes&d)&&!(a.flags&128))return bn=!1,vS(o,a,d);bn=!!(o.flags&131072)}else bn=!1,It&&a.flags&1048576&&am(a,Os,a.index);switch(a.lanes=0,a.tag){case 2:var m=a.type;Xs(o,a),o=a.pendingProps;var v=fo(a,an.current);go(a,d),v=Mu(null,a,m,o,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,yn(m)?(b=!0,Es(a)):b=!1,a.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,bu(a),v.updater=Bs,a.stateNode=v,v._reactInternals=a,Cu(a,m,o,d),a=Fu(null,a,m,!0,b,d)):(a.tag=0,It&&b&&uu(a),mn(null,a,v,d),a=a.child),a;case 16:m=a.elementType;e:{switch(Xs(o,a),o=a.pendingProps,v=m._init,m=v(m._payload),a.type=m,v=a.tag=_S(m),o=Zn(m,o),v){case 0:a=Nu(null,a,m,o,d);break e;case 1:a=tv(null,a,m,o,d);break e;case 11:a=Km(null,a,m,o,d);break e;case 14:a=Qm(null,a,m,Zn(m.type,o),d);break e}throw Error(c(306,m,""))}return a;case 0:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Zn(m,v),Nu(o,a,m,v,d);case 1:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Zn(m,v),tv(o,a,m,v,d);case 3:e:{if(nv(a),o===null)throw Error(c(387));m=a.pendingProps,b=a.memoizedState,v=b.element,hm(o,a),Ls(a,m,null,d);var E=a.memoizedState;if(m=E.element,qe&&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=So(Error(c(423)),a),a=rv(o,a,m,d,v);break e}else if(m!==v){v=So(Error(c(424)),a),a=rv(o,a,m,d,v);break e}else for(qe&&(zn=_b(a.stateNode.containerInfo),Tn=a,It=!0,Qn=null,va=!1),d=Cm(a,null,m,d),a.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(mo(),m===v){a=Mr(o,a,d);break e}mn(o,a,m,d)}a=a.child}return a;case 5:return wm(a),o===null&&hu(a),m=a.type,v=a.pendingProps,b=o!==null?o.memoizedProps:null,E=v.children,ue(m,v)?E=null:b!==null&&ue(m,b)&&(a.flags|=32),ev(o,a),mn(o,a,E,d),a.child;case 6:return o===null&&hu(a),null;case 13:return iv(o,a,d);case 4:return wu(a,a.stateNode.containerInfo),m=a.pendingProps,o===null?a.child=xo(a,null,m,d):mn(o,a,m,d),a.child;case 11:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Zn(m,v),Km(o,a,m,v,d);case 7:return mn(o,a,a.pendingProps,d),a.child;case 8:return mn(o,a,a.pendingProps.children,d),a.child;case 12:return mn(o,a,a.pendingProps.children,d),a.child;case 10:e:{if(m=a.type._context,v=a.pendingProps,b=a.memoizedProps,E=v.value,dm(a,m,E),b!==null)if(Kn(b.value,E)){if(b.children===v.children&&!xn.current){a=Mr(o,a,d);break e}}else for(b=a.child,b!==null&&(b.return=a);b!==null;){var A=b.dependencies;if(A!==null){E=b.child;for(var W=A.firstContext;W!==null;){if(W.context===m){if(b.tag===1){W=Ir(-1,d&-d),W.tag=2;var ae=b.updateQueue;if(ae!==null){ae=ae.shared;var Ee=ae.pending;Ee===null?W.next=W:(W.next=Ee.next,Ee.next=W),ae.pending=W}}b.lanes|=d,W=b.alternate,W!==null&&(W.lanes|=d),xu(b.return,d,a),A.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,A=E.alternate,A!==null&&(A.lanes|=d),xu(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}mn(o,a,v.children,d),a=a.child}return a;case 9:return v=a.type,m=a.pendingProps.children,go(a,d),v=Rn(v),m=m(v),a.flags|=1,mn(o,a,m,d),a.child;case 14:return m=a.type,v=Zn(m,a.pendingProps),v=Zn(m.type,v),Qm(o,a,m,v,d);case 15:return Zm(o,a,a.type,a.pendingProps,d);case 17:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Zn(m,v),Xs(o,a),a.tag=1,yn(m)?(o=!0,Es(a)):o=!1,go(a,d),xm(a,m,v),Cu(a,m,v,d),Fu(null,a,m,!0,o,d);case 19:return av(o,a,d);case 22:return Jm(o,a,d)}throw Error(c(156,a.tag))};function Tv(o,a){return au(o,a)}function TS(o,a,d,m){this.tag=o,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 Bn(o,a,d,m){return new TS(o,a,d,m)}function ld(o){return o=o.prototype,!(!o||!o.isReactComponent)}function _S(o){if(typeof o=="function")return ld(o)?1:0;if(o!=null){if(o=o.$$typeof,o===w)return 11;if(o===M)return 14}return 2}function ei(o,a){var d=o.alternate;return d===null?(d=Bn(o.tag,a,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=a,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&14680064,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,a=o.dependencies,d.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d}function hl(o,a,d,m,v,b){var E=2;if(m=o,typeof o=="function")ld(o)&&(E=1);else if(typeof o=="string")E=5;else e:switch(o){case p:return Ti(d.children,v,b,a);case g:E=8,v|=8;break;case y:return o=Bn(12,d,a,v|2),o.elementType=y,o.lanes=b,o;case k:return o=Bn(13,d,a,v),o.elementType=k,o.lanes=b,o;case j:return o=Bn(19,d,a,v),o.elementType=j,o.lanes=b,o;case I:return pl(d,v,b,a);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case S:E=10;break e;case C:E=9;break e;case w:E=11;break e;case M:E=14;break e;case P:E=16,m=null;break e}throw Error(c(130,o==null?o:typeof o,""))}return a=Bn(E,d,a,v),a.elementType=o,a.type=m,a.lanes=b,a}function Ti(o,a,d,m){return o=Bn(7,o,m,a),o.lanes=d,o}function pl(o,a,d,m){return o=Bn(22,o,m,a),o.elementType=I,o.lanes=d,o.stateNode={isHidden:!1},o}function cd(o,a,d){return o=Bn(6,o,null,a),o.lanes=d,o}function ud(o,a,d){return a=Bn(4,o.children!==null?o.children:[],o.key,a),a.lanes=d,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}function DS(o,a,d,m,v){this.tag=a,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Ge,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=iu(0),this.expirationTimes=iu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=iu(0),this.identifierPrefix=m,this.onRecoverableError=v,qe&&(this.mutableSourceEagerHydrationData=null)}function _v(o,a,d,m,v,b,E,A,W){return o=new DS(o,a,d,A,W),a===1?(a=1,b===!0&&(a|=8)):a=0,b=Bn(3,null,null,a),o.current=b,b.stateNode=o,b.memoizedState={element:m,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},bu(b),o}function Dv(o){if(!o)return qr;o=o._reactInternals;e:{if(V(o)!==o||o.tag!==1)throw Error(c(170));var a=o;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(yn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(c(171))}if(o.tag===1){var d=o.type;if(yn(d))return em(o,d,a)}return a}function Ov(o){var a=o._reactInternals;if(a===void 0)throw typeof o.render=="function"?Error(c(188)):(o=Object.keys(o).join(","),Error(c(268,o)));return o=X(a),o===null?null:o.stateNode}function Av(o,a){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<a?d:a}}function ml(o,a){Av(o,a),(o=o.alternate)&&Av(o,a)}function OS(o){return o=X(o),o===null?null:o.stateNode}function AS(){return null}return n.attemptContinuousHydration=function(o){if(o.tag===13){var a=sr(o,134217728);if(a!==null){var d=un();Ln(a,o,134217728,d)}ml(o,134217728)}},n.attemptDiscreteHydration=function(o){if(o.tag===13){var a=sr(o,1);if(a!==null){var d=un();Ln(a,o,1,d)}ml(o,1)}},n.attemptHydrationAtCurrentPriority=function(o){if(o.tag===13){var a=Zr(o),d=sr(o,a);if(d!==null){var m=un();Ln(d,o,a,m)}ml(o,a)}},n.attemptSynchronousHydration=function(o){switch(o.tag){case 3:var a=o.stateNode;if(a.current.memoizedState.isDehydrated){var d=pa(a.pendingLanes);d!==0&&(ou(a,d|1),Cn(a,Xt()),!(Ke&6)&&(ko(),ar()))}break;case 13:Cv(function(){var m=sr(o,1);if(m!==null){var v=un();Ln(m,o,1,v)}}),ml(o,1)}},n.batchedUpdates=function(o,a){var d=Ke;Ke|=1;try{return o(a)}finally{Ke=d,Ke===0&&(ko(),_s&&ar())}},n.createComponentSelector=function(o){return{$$typeof:el,value:o}},n.createContainer=function(o,a,d,m,v,b,E){return _v(o,a,!1,null,d,m,v,b,E)},n.createHasPseudoClassSelector=function(o){return{$$typeof:tl,value:o}},n.createHydrationContainer=function(o,a,d,m,v,b,E,A,W){return o=_v(d,m,!0,o,v,b,E,A,W),o.context=Dv(null),d=o.current,m=un(),v=Zr(d),b=Ir(m,v),b.callback=a??null,Xr(d,b,v),o.current.lanes=v,ma(o,v,m),Cn(o,m),o},n.createPortal=function(o,a,d){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:m==null?null:""+m,children:o,containerInfo:a,implementation:d}},n.createRoleSelector=function(o){return{$$typeof:nl,value:o}},n.createTestNameSelector=function(o){return{$$typeof:rl,value:o}},n.createTextSelector=function(o){return{$$typeof:il,value:o}},n.deferredUpdates=function(o){var a=it,d=Lt.transition;try{return Lt.transition=null,it=16,o()}finally{it=a,Lt.transition=d}},n.discreteUpdates=function(o,a,d,m,v){var b=it,E=Lt.transition;try{return Lt.transition=null,it=1,o(a,d,m,v)}finally{it=b,Lt.transition=E,Ke===0&&ko()}},n.findAllNodes=Qu,n.findBoundingRects=function(o,a){if(!N)throw Error(c(363));a=Qu(o,a),o=[];for(var d=0;d<a.length;d++)o.push(xe(a[d]));for(a=o.length-1;0<a;a--){d=o[a];for(var m=d.x,v=m+d.width,b=d.y,E=b+d.height,A=a-1;0<=A;A--)if(a!==A){var W=o[A],ae=W.x,Ee=ae+W.width,Ue=W.y,ye=Ue+W.height;if(m>=ae&&b>=Ue&&v<=Ee&&E<=ye){o.splice(a,1);break}else if(m!==ae||d.width!==W.width||ye<b||Ue>E){if(!(b!==Ue||d.height!==W.height||Ee<m||ae>v)){ae>m&&(W.width+=ae-m,W.x=m),Ee<v&&(W.width=v-ae),o.splice(a,1);break}}else{Ue>b&&(W.height+=Ue-b,W.y=b),ye<E&&(W.height=E-Ue),o.splice(a,1);break}}}return o},n.findHostInstance=Ov,n.findHostInstanceWithNoPortals=function(o){return o=L(o),o=o!==null?Q(o):null,o===null?null:o.stateNode},n.findHostInstanceWithWarning=function(o){return Ov(o)},n.flushControlled=function(o){var a=Ke;Ke|=1;var d=Lt.transition,m=it;try{Lt.transition=null,it=1,o()}finally{it=m,Lt.transition=d,Ke=a,Ke===0&&(ko(),ar())}},n.flushPassiveEffects=Mi,n.flushSync=Cv,n.focusWithin=function(o,a){if(!N)throw Error(c(363));for(o=Yu(o),a=yv(o,a),a=Array.from(a),o=0;o<a.length;){var d=a[o++];if(!q(d)){if(d.tag===5&&Fe(d.stateNode))return!0;for(d=d.child;d!==null;)a.push(d),d=d.sibling}}return!1},n.getCurrentUpdatePriority=function(){return it},n.getFindAllNodesFailureDescription=function(o,a){if(!N)throw Error(c(363));var d=0,m=[];o=[Yu(o),0];for(var v=0;v<o.length;){var b=o[v++],E=o[v++],A=a[E];if((b.tag!==5||!q(b))&&(Xu(b,A)&&(m.push(Ku(A)),E++,E>d&&(d=E)),E<a.length))for(b=b.child;b!==null;)o.push(b,E),b=b.sibling}if(d<a.length){for(o=[];d<a.length;d++)o.push(Ku(a[d]));return`findAllNodes was able to match part of the selector:
|
||
`+(m.join(" > ")+`
|
||
|
||
No matching component was found for:
|
||
`)+o.join(" > ")}return null},n.getPublicRootInstance=function(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return oe(o.child.stateNode);default:return o.child.stateNode}},n.injectIntoDevTools=function(o){if(o={bundleType:o.bundleType,version:o.version,rendererPackageName:o.rendererPackageName,rendererConfig:o.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:OS,findFiberByHostInstance:o.findFiberByHostInstance||AS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")o=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)o=!0;else{try{Ts=a.inject(o),or=a}catch{}o=!!a.checkDCE}}return o},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(o,a,d,m){if(!N)throw Error(c(363));o=Qu(o,a);var v=Ze(o,d,m).disconnect;return{disconnect:function(){v()}}},n.registerMutableSourceForHydration=function(o,a){var d=a._getVersion;d=d(a._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[a,d]:o.mutableSourceEagerHydrationData.push(a,d)},n.runWithPriority=function(o,a){var d=it;try{return it=o,a()}finally{it=d}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(o,a,d,m){var v=a.current,b=un(),E=Zr(v);return d=Dv(d),a.context===null?a.context=d:a.pendingContext=d,a=Ir(b,E),a.payload={element:o},m=m===void 0?null:m,m!==null&&(a.callback=m),o=Xr(v,a,E),o!==null&&(Ln(o,v,E,b),Fs(o,v,E)),E},n};(function(e){e.exports=ZI})(QI);const JI=SC(Af);var fc={},eM={get exports(){return fc},set exports(e){fc=e}},oo={};/**
|
||
* @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.
|
||
*/oo.ConcurrentRoot=1;oo.ContinuousEventPriority=4;oo.DefaultEventPriority=16;oo.DiscreteEventPriority=1;oo.IdleEventPriority=536870912;oo.LegacyRoot=0;(function(e){e.exports=oo})(eM);const w0={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let k0=!1,j0=!1;const Dp=".react-konva-event",tM=`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
|
||
`,nM=`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
|
||
`,rM={};function Hc(e,t,n=rM){if(!k0&&"zIndex"in t&&(console.warn(nM),k0=!0),!j0&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(tM),j0=!0)}for(var s in n)if(!w0[s]){var c=s.slice(0,2)==="on",u=n[s]!==t[s];if(c&&u){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e.off(f,n[s])}var h=!t.hasOwnProperty(s);h&&e.setAttr(s,void 0)}var p=t._useStrictMode,g={},y=!1;const S={};for(var s in t)if(!w0[s]){var c=s.slice(0,2)==="on",C=n[s]!==t[s];if(c&&C){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[s]&&(S[f]=t[s])}!c&&(t[s]!==n[s]||p&&t[s]!==e.getAttr(s))&&(y=!0,g[s]=t[s])}y&&(e.setAttrs(g),gi(e));for(var f in S)e.on(f+Dp,S[f])}function gi(e){if(!CC.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const v4={},iM={};qa.Node.prototype._applyProps=Hc;function oM(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),gi(e)}function aM(e,t,n){let r=qa[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=qa.Group);const i={},s={};for(var c in t){var u=c.slice(0,2)==="on";u?s[c]=t[c]:i[c]=t[c]}const f=new r(i);return Hc(f,s),f}function sM(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function lM(e,t,n){return!1}function cM(e){return e}function uM(){return null}function dM(){return null}function fM(e,t,n,r){return iM}function hM(){}function pM(e){}function mM(e,t){return!1}function vM(){return v4}function gM(){return v4}const xM=setTimeout,yM=clearTimeout,bM=-1;function SM(e,t){return!1}const CM=!1,wM=!0,kM=!0;function jM(e,t){t.parent===e?t.moveToTop():e.add(t),gi(e)}function EM(e,t){t.parent===e?t.moveToTop():e.add(t),gi(e)}function g4(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),gi(e)}function PM(e,t,n){g4(e,t,n)}function IM(e,t){t.destroy(),t.off(Dp),gi(e)}function MM(e,t){t.destroy(),t.off(Dp),gi(e)}function TM(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function _M(e,t,n){}function DM(e,t,n,r,i){Hc(e,i,r)}function OM(e){e.hide(),gi(e)}function AM(e){}function zM(e,t){(t.visible==null||t.visible)&&e.show()}function RM(e,t){}function NM(e){}function FM(){}const LM=()=>fc.DefaultEventPriority,BM=Object.freeze(Object.defineProperty({__proto__:null,appendChild:jM,appendChildToContainer:EM,appendInitialChild:oM,cancelTimeout:yM,clearContainer:NM,commitMount:_M,commitTextUpdate:TM,commitUpdate:DM,createInstance:aM,createTextInstance:sM,detachDeletedInstance:FM,finalizeInitialChildren:lM,getChildHostContext:gM,getCurrentEventPriority:LM,getPublicInstance:cM,getRootHostContext:vM,hideInstance:OM,hideTextInstance:AM,idlePriority:Ul.unstable_IdlePriority,insertBefore:g4,insertInContainerBefore:PM,isPrimaryRenderer:CM,noTimeout:bM,now:Ul.unstable_now,prepareForCommit:uM,preparePortalMount:dM,prepareUpdate:fM,removeChild:IM,removeChildFromContainer:MM,resetAfterCommit:hM,resetTextContent:pM,run:Ul.unstable_runWithPriority,scheduleTimeout:xM,shouldDeprioritizeSubtree:mM,shouldSetTextContent:SM,supportsMutation:kM,unhideInstance:zM,unhideTextInstance:RM,warnsIfNotActing:wM},Symbol.toStringTag,{value:"Module"}));var HM=Object.defineProperty,WM=Object.defineProperties,VM=Object.getOwnPropertyDescriptors,E0=Object.getOwnPropertySymbols,UM=Object.prototype.hasOwnProperty,$M=Object.prototype.propertyIsEnumerable,P0=(e,t,n)=>t in e?HM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I0=(e,t)=>{for(var n in t||(t={}))UM.call(t,n)&&P0(e,n,t[n]);if(E0)for(var n of E0(t))$M.call(t,n)&&P0(e,n,t[n]);return e},GM=(e,t)=>WM(e,VM(t));function x4(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=x4(r,t,n);if(i)return i;r=t?null:r.sibling}}function y4(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const Op=y4(x.createContext(null));class b4 extends x.Component{render(){return x.createElement(Op.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:qM,ReactCurrentDispatcher:YM}=x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function XM(){const e=x.useContext(Op);if(!e)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=x.useId();return x.useMemo(()=>{var r;return(r=qM.current)!=null?r:x4(e,!1,i=>{let s=i.memoizedState;for(;s;){if(s.memoizedState===t)return!0;s=s.next}})},[e,t])}function KM(){var e,t;const n=XM(),[r]=x.useState(()=>new Map);r.clear();let i=n;for(;i;){const s=(e=i.type)==null?void 0:e._context;s&&s!==Op&&!r.has(s)&&r.set(s,(t=YM.current)==null?void 0:t.readContext(y4(s))),i=i.return}return x.useMemo(()=>Array.from(r.keys()).reduce((s,c)=>u=>x.createElement(s,null,x.createElement(c.Provider,GM(I0({},u),{value:r.get(c)}))),s=>x.createElement(b4,I0({},s))),[r])}function QM(e){const t=ke.useRef();return ke.useLayoutEffect(()=>{t.current=e}),t.current}const ZM=e=>{const t=ke.useRef(),n=ke.useRef(),r=ke.useRef(),i=QM(e),s=KM(),c=u=>{const{forwardedRef:f}=e;f&&(typeof f=="function"?f(u):f.current=u)};return ke.useLayoutEffect(()=>(n.current=new qa.Stage({width:e.width,height:e.height,container:t.current}),c(n.current),r.current=Ba.createContainer(n.current,fc.LegacyRoot,!1,null),Ba.updateContainer(ke.createElement(s,{},e.children),r.current),()=>{qa.isBrowser&&(c(null),Ba.updateContainer(null,r.current,null),n.current.destroy())}),[]),ke.useLayoutEffect(()=>{c(n.current),Hc(n.current,e,i),Ba.updateContainer(ke.createElement(s,{},e.children),r.current,null)}),ke.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},za="Layer",Br="Group",Hr="Rect",_i="Circle",hc="Line",S4="Image",JM="Transformer",Ba=JI(BM);Ba.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:ke.version,rendererPackageName:"react-konva"});const eT=ke.forwardRef((e,t)=>ke.createElement(b4,{},ke.createElement(ZM,{...e,forwardedRef:t}))),tT=be([tt,zt],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),nT=()=>{const e=Y(),{tool:t,isStaging:n,isMovingBoundingBox:r}=O(tT);return{handleDragStart:x.useCallback(()=>{(t==="move"||n)&&!r&&e(Jl(!0))},[e,r,n,t]),handleDragMove:x.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const s={x:i.target.x(),y:i.target.y()};e(Y1(s))},[e,r,n,t]),handleDragEnd:x.useCallback(()=>{(t==="move"||n)&&!r&&e(Jl(!1))},[e,r,n,t])}},rT=be([tt,Bt,zt],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:s,tool:c,isMaskEnabled:u,shouldSnapToGrid:f}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:s,tool:c,isStaging:n,isMaskEnabled:u,shouldSnapToGrid:f}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),iT=()=>{const e=Y(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:s,shouldSnapToGrid:c}=O(rT),u=x.useRef(null),f=X1(),h=()=>e(Zf());fe(["shift+c"],()=>{h()},{enabled:()=>!i,preventDefault:!0},[]);const p=()=>e(ss(!s));fe(["h"],()=>{p()},{enabled:()=>!i,preventDefault:!0},[s]),fe(["n"],()=>{e(ec(!c))},{enabled:!0,preventDefault:!0},[c]),fe("esc",()=>{e(wC())},{enabled:()=>!0,preventDefault:!0}),fe("shift+h",()=>{e(kC(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),fe(["space"],g=>{g.repeat||(f==null||f.container().focus(),r!=="move"&&(u.current=r,e(xr("move"))),r==="move"&&u.current&&u.current!=="move"&&(e(xr(u.current)),u.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,u])},Ap=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}},C4=()=>{const e=Y(),t=Sr(),n=X1();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=jC.pixelRatio,[s,c,u,f]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(EC({r:s,g:c,b:u,a:f}))},commitColorUnderCursor:()=>{e(PC())}}},oT=be([Bt,tt,zt],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),aT=e=>{const t=Y(),{tool:n,isStaging:r}=O(oT),{commitColorUnderCursor:i}=C4();return x.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(Jl(!0));return}if(n==="colorPicker"){i();return}const c=Ap(e.current);c&&(s.evt.preventDefault(),t(K1(!0)),t(IC([c.x,c.y])))},[e,n,r,t,i])},sT=be([Bt,tt,zt],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),lT=(e,t,n)=>{const r=Y(),{isDrawing:i,tool:s,isStaging:c}=O(sT),{updateColorUnderCursor:u}=C4();return x.useCallback(()=>{if(!e.current)return;const f=Ap(e.current);if(f){if(r(MC(f)),n.current=f,s==="colorPicker"){u();return}!i||s==="move"||c||(t.current=!0,r(Q1([f.x,f.y])))}},[t,r,i,c,n,e,s,u])},cT=()=>{const e=Y();return x.useCallback(()=>{e(TC())},[e])},uT=be([Bt,tt,zt],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),dT=(e,t)=>{const n=Y(),{tool:r,isDrawing:i,isStaging:s}=O(uT);return x.useCallback(()=>{if(r==="move"||s){n(Jl(!1));return}if(!t.current&&i&&e.current){const c=Ap(e.current);if(!c)return;n(Q1([c.x,c.y]))}else t.current=!1;n(K1(!1))},[t,n,i,s,e,r])},fT=be([tt],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),hT=e=>{const t=Y(),{isMoveStageKeyHeld:n,stageScale:r}=O(fT);return x.useCallback(i=>{if(!e.current||n)return;i.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=i.evt.deltaY;i.evt.ctrlKey&&(u=-u);const f=te.clamp(r*_C**u,DC,OC),h={x:s.x-c.x*f,y:s.y-c.y*f};t(AC(f)),t(Y1(h))},[e,n,r,t])},pT=be(tt,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:s,stageCoordinates:c}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:c,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),mT=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:s}=O(pT);return l.jsxs(Br,{children:[l.jsx(Hr,{offsetX:r.x/s,offsetY:r.y/s,height:i.height/s,width:i.width/s,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),l.jsx(Hr,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},vT=be([tt],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),gT={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)",ocean:"rgba(136, 148, 184, 0.2)"},xT=()=>{const e=O(u=>u.ui.currentTheme),{stageScale:t,stageCoordinates:n,stageDimensions:r}=O(vT),[i,s]=x.useState([]),c=x.useCallback(u=>u/t,[t]);return x.useLayoutEffect(()=>{const u=gT[e],{width:f,height:h}=r,{x:p,y:g}=n,y={x1:0,y1:0,x2:f,y2:h,offset:{x:c(p),y:c(g)}},S={x:Math.ceil(c(p)/64)*64,y:Math.ceil(c(g)/64)*64},C={x1:-S.x,y1:-S.y,x2:c(f)-S.x+64,y2:c(h)-S.y+64},k={x1:Math.min(y.x1,C.x1),y1:Math.min(y.y1,C.y1),x2:Math.max(y.x2,C.x2),y2:Math.max(y.y2,C.y2)},j=k.x2-k.x1,M=k.y2-k.y1,P=Math.round(j/64)+1,I=Math.round(M/64)+1,T=te.range(0,P).map(_=>l.jsx(hc,{x:k.x1+_*64,y:k.y1,points:[0,0,0,M],stroke:u,strokeWidth:1},`x_${_}`)),D=te.range(0,I).map(_=>l.jsx(hc,{x:k.x1,y:k.y1+_*64,points:[0,0,j,0],stroke:u,strokeWidth:1},`y_${_}`));s(T.concat(D))},[t,n,r,e,c]),l.jsx(Br,{children:i})},yT=be([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:te.isEqual}}),bT=e=>{const{...t}=e,n=O(yT),[r,i]=x.useState(null);if(x.useEffect(()=>{if(!n)return;const h=new Image;h.onload=()=>{i(h)},h.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:s,y:c,width:u,height:f}}=n;return r?l.jsx(S4,{x:s,y:c,width:u,height:f,image:r,listening:!1,...t}):null},qi=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},ST=be(tt,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:qi(t)}}),M0=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),CT=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:s}=O(ST),[c,u]=x.useState(null),[f,h]=x.useState(0),p=x.useRef(null),g=x.useCallback(()=>{h(f+1),setTimeout(g,500)},[f]);return x.useEffect(()=>{if(c)return;const y=new Image;y.onload=()=>{u(y)},y.src=M0(n)},[c,n]),x.useEffect(()=>{c&&(c.src=M0(n))},[c,n]),x.useEffect(()=>{const y=setInterval(()=>h(S=>(S+1)%5),50);return()=>clearInterval(y)},[]),!c||!te.isNumber(r.x)||!te.isNumber(r.y)||!te.isNumber(s)||!te.isNumber(i.width)||!te.isNumber(i.height)?null:l.jsx(Hr,{ref:p,offsetX:r.x/s,offsetY:r.y/s,height:i.height/s,width:i.width/s,fillPatternImage:c,fillPatternOffsetY:te.isNumber(f)?f:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},wT=be([tt],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),kT=e=>{const{...t}=e,{objects:n}=O(wT);return l.jsx(Br,{listening:!1,...t,children:n.filter(zC).map((r,i)=>l.jsx(hc,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},i))})};var Di=x,jT=function(t,n,r){const i=Di.useRef("loading"),s=Di.useRef(),[c,u]=Di.useState(0),f=Di.useRef(),h=Di.useRef(),p=Di.useRef();return(f.current!==t||h.current!==n||p.current!==r)&&(i.current="loading",s.current=void 0,f.current=t,h.current=n,p.current=r),Di.useLayoutEffect(function(){if(!t)return;var g=document.createElement("img");function y(){i.current="loaded",s.current=g,u(Math.random())}function S(){i.current="failed",s.current=void 0,u(Math.random())}return g.addEventListener("load",y),g.addEventListener("error",S),n&&(g.crossOrigin=n),r&&(g.referrerpolicy=r),g.src=t,function(){g.removeEventListener("load",y),g.removeEventListener("error",S)}},[t,n,r]),[s.current,i.current]};const w4=e=>{const{url:t,x:n,y:r}=e,[i]=jT(t);return l.jsx(S4,{x:n,y:r,image:i,listening:!1})},ET=be([tt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),PT=()=>{const{objects:e}=O(ET);return e?l.jsx(Br,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(T1(t))return l.jsx(w4,{x:t.x,y:t.y,url:t.image.url},n);if(RC(t)){const r=l.jsx(hc,{points:t.points,stroke:t.color?qi(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(Br,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(NC(t))return l.jsx(Hr,{x:t.x,y:t.y,width:t.width,height:t.height,fill:qi(t.color)},n);if(FC(t))return l.jsx(Hr,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},IT=be([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,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:i,x:s,y:c,width:u,height:f}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),MT=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:s,y:c,width:u,height:f}=O(IT);return l.jsxs(Br,{...t,children:[r&&n&&l.jsx(w4,{url:n.image.url,x:s,y:c}),i&&l.jsxs(Br,{children:[l.jsx(Hr,{x:s,y:c,width:u,height:f,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),l.jsx(Hr,{x:s,y:c,width:u,height:f,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},TT=be([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),_T=()=>{const e=Y(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=O(TT),{t:s}=Z(),c=x.useCallback(()=>{e(Uv(!0))},[e]),u=x.useCallback(()=>{e(Uv(!1))},[e]);fe(["left"],()=>{f()},{enabled:()=>!0,preventDefault:!0}),fe(["right"],()=>{h()},{enabled:()=>!0,preventDefault:!0}),fe(["enter"],()=>{p()},{enabled:()=>!0,preventDefault:!0});const f=()=>e(LC()),h=()=>e(BC()),p=()=>e(HC());return r?l.jsx(B,{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(en,{isAttached:!0,children:[l.jsx(le,{tooltip:`${s("unifiedCanvas.previous")} (Left)`,"aria-label":`${s("unifiedCanvas.previous")} (Left)`,icon:l.jsx(M8,{}),onClick:f,colorScheme:"accent",isDisabled:t}),l.jsx(le,{tooltip:`${s("unifiedCanvas.next")} (Right)`,"aria-label":`${s("unifiedCanvas.next")} (Right)`,icon:l.jsx(T8,{}),onClick:h,colorScheme:"accent",isDisabled:n}),l.jsx(le,{tooltip:`${s("unifiedCanvas.accept")} (Enter)`,"aria-label":`${s("unifiedCanvas.accept")} (Enter)`,icon:l.jsx(zc,{}),onClick:p,colorScheme:"accent"}),l.jsx(le,{tooltip:s("unifiedCanvas.showHide"),"aria-label":s("unifiedCanvas.showHide"),"data-alert":!i,icon:i?l.jsx(N8,{}):l.jsx(R8,{}),onClick:()=>e(WC(!i)),colorScheme:"accent"}),l.jsx(le,{tooltip:s("unifiedCanvas.saveToGallery"),"aria-label":s("unifiedCanvas.saveToGallery"),icon:l.jsx(op,{}),onClick:()=>e(VC(r.image.url)),colorScheme:"accent"}),l.jsx(le,{tooltip:s("unifiedCanvas.discardAll"),"aria-label":s("unifiedCanvas.discardAll"),icon:l.jsx(xs,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(UC()),colorScheme:"error",fontSize:20})]})}):null},Ho=e=>Math.round(e*100)/100,DT=be([tt],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Ho(n)}, ${Ho(r)})`}},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function OT(){const{cursorCoordinatesString:e}=O(DT),{t}=Z();return l.jsx(We,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const zf="var(--invokeai-colors-warning-500)",AT=be([tt],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:s,height:c},scaledBoundingBoxDimensions:{width:u,height:f},boundingBoxCoordinates:{x:h,y:p},stageScale:g,shouldShowCanvasDebugInfo:y,layer:S,boundingBoxScaleMethod:C,shouldPreserveMaskedArea:w}=e;let k="inherit";return(C==="none"&&(s<512||c<512)||C==="manual"&&u*f<512*512)&&(k=zf),{activeLayerColor:S==="mask"?zf:"inherit",activeLayerString:S.charAt(0).toUpperCase()+S.slice(1),boundingBoxColor:k,boundingBoxCoordinatesString:`(${Ho(h)}, ${Ho(p)})`,boundingBoxDimensionsString:`${s}×${c}`,scaledBoundingBoxDimensionsString:`${u}×${f}`,canvasCoordinatesString:`${Ho(r)}×${Ho(i)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(g*100),shouldShowCanvasDebugInfo:y,shouldShowBoundingBox:C!=="auto",shouldShowScaledBoundingBox:C!=="none",shouldPreserveMaskedArea:w}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),zT=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:c,canvasCoordinatesString:u,canvasDimensionsString:f,canvasScaleString:h,shouldShowCanvasDebugInfo:p,shouldShowBoundingBox:g,shouldPreserveMaskedArea:y}=O(AT),{t:S}=Z();return l.jsxs(B,{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:"blackAlpha.500"},children:[l.jsx(We,{style:{color:e},children:`${S("unifiedCanvas.activeLayer")}: ${t}`}),l.jsx(We,{children:`${S("unifiedCanvas.canvasScale")}: ${h}%`}),y&&l.jsx(We,{style:{color:zf},children:"Preserve Masked Area: On"}),g&&l.jsx(We,{style:{color:n},children:`${S("unifiedCanvas.boundingBox")}: ${i}`}),c&&l.jsx(We,{style:{color:n},children:`${S("unifiedCanvas.scaledBoundingBox")}: ${s}`}),p&&l.jsxs(l.Fragment,{children:[l.jsx(We,{children:`${S("unifiedCanvas.boundingBoxPosition")}: ${r}`}),l.jsx(We,{children:`${S("unifiedCanvas.canvasDimensions")}: ${f}`}),l.jsx(We,{children:`${S("unifiedCanvas.canvasPosition")}: ${u}`}),l.jsx(OT,{})]})]})},RT=be(tt,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:s,isMovingBoundingBox:c,tool:u,shouldSnapToGrid:f}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:c,isTransformingBoundingBox:s,stageScale:r,shouldSnapToGrid:f,tool:u,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),NT=e=>{const{...t}=e,n=Y(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:s,isMovingBoundingBox:c,isTransformingBoundingBox:u,stageScale:f,shouldSnapToGrid:h,tool:p,hitStrokeWidth:g}=O(RT),y=x.useRef(null),S=x.useRef(null),[C,w]=x.useState(!1);x.useEffect(()=>{var X;!y.current||!S.current||(y.current.nodes([S.current]),(X=y.current.getLayer())==null||X.batchDraw())},[]);const k=64*f,j=x.useCallback(X=>{if(!h){n(fd({x:Math.floor(X.target.x()),y:Math.floor(X.target.y())}));return}const $=X.target.x(),Q=X.target.y(),ie=$v($,64),oe=$v(Q,64);X.target.x(ie),X.target.y(oe),n(fd({x:ie,y:oe}))},[n,h]),M=x.useCallback(()=>{if(!S.current)return;const X=S.current,$=X.scaleX(),Q=X.scaleY(),ie=Math.round(X.width()*$),oe=Math.round(X.height()*Q),U=Math.round(X.x()),K=Math.round(X.y());n(Na({width:ie,height:oe})),n(fd({x:h?xl(U,64):U,y:h?xl(K,64):K})),X.scaleX(1),X.scaleY(1)},[n,h]),P=x.useCallback((X,$,Q)=>{const ie=X.x%k,oe=X.y%k;return{x:xl($.x,k)+ie,y:xl($.y,k)+oe}},[k]),I=()=>{n(hd(!0))},T=()=>{n(hd(!1)),n(pd(!1)),n(yl(!1)),w(!1)},D=()=>{n(pd(!0))},_=()=>{n(hd(!1)),n(pd(!1)),n(yl(!1)),w(!1)},z=()=>{w(!0)},V=()=>{!u&&!c&&w(!1)},F=()=>{n(yl(!0))},L=()=>{n(yl(!1))};return l.jsxs(Br,{...t,children:[l.jsx(Hr,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:F,onMouseOver:F,onMouseLeave:L,onMouseOut:L}),l.jsx(Hr,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:g,listening:!s&&p==="move",onDragStart:D,onDragEnd:_,onDragMove:j,onMouseDown:D,onMouseOut:V,onMouseOver:z,onMouseEnter:z,onMouseUp:_,onTransform:M,onTransformEnd:T,ref:S,stroke:C?"rgba(255,255,255,0.7)":"white",strokeWidth:(C?8:1)/f,width:i.width,x:r.x,y:r.y}),l.jsx(JM,{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:p==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&p==="move",onDragStart:D,onDragEnd:_,onMouseDown:I,onMouseUp:T,onTransformEnd:T,ref:y,rotateEnabled:!1})]})},FT=be(tt,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:s,tool:c,layer:u,shouldShowBrush:f,isMovingBoundingBox:h,isTransformingBoundingBox:p,stageScale:g,stageDimensions:y,boundingBoxCoordinates:S,boundingBoxDimensions:C,shouldRestrictStrokesToBox:w}=e,k=w?{clipX:S.x,clipY:S.y,clipWidth:C.width,clipHeight:C.height}:{};return{cursorPosition:t,brushX:t?t.x:y.width/2,brushY:t?t.y:y.height/2,radius:n/2,colorPickerOuterRadius:Gv/g,colorPickerInnerRadius:(Gv-sf+1)/g,maskColorString:qi({...i,a:.5}),brushColorString:qi(s),colorPickerColorString:qi(r),tool:c,layer:u,shouldShowBrush:f,shouldDrawBrushPreview:!(h||p||!t)&&f,strokeWidth:1.5/g,dotRadius:1.5/g,clip:k}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),LT=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:s,tool:c,layer:u,shouldDrawBrushPreview:f,dotRadius:h,strokeWidth:p,brushColorString:g,colorPickerColorString:y,colorPickerInnerRadius:S,colorPickerOuterRadius:C,clip:w}=O(FT);return f?l.jsxs(Br,{listening:!1,...w,...t,children:[c==="colorPicker"?l.jsxs(l.Fragment,{children:[l.jsx(_i,{x:n,y:r,radius:C,stroke:g,strokeWidth:sf,strokeScaleEnabled:!1}),l.jsx(_i,{x:n,y:r,radius:S,stroke:y,strokeWidth:sf,strokeScaleEnabled:!1})]}):l.jsxs(l.Fragment,{children:[l.jsx(_i,{x:n,y:r,radius:i,fill:u==="mask"?s:g,globalCompositeOperation:c==="eraser"?"destination-out":"source-out"}),l.jsx(_i,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:p*2,strokeEnabled:!0,listening:!1}),l.jsx(_i,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:p,strokeEnabled:!0,listening:!1})]}),l.jsx(_i,{x:n,y:r,radius:h*2,fill:"rgba(255,255,255,0.4)",listening:!1}),l.jsx(_i,{x:n,y:r,radius:h,fill:"rgba(0,0,0,1)",listening:!1})]}):null},BT=be([tt,zt],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:s,isMouseOverBoundingBox:c,isMovingBoundingBox:u,stageDimensions:f,stageCoordinates:h,tool:p,isMovingStage:g,shouldShowIntermediates:y,shouldShowGrid:S,shouldRestrictStrokesToBox:C}=e;let w="none";return p==="move"||t?g?w="grabbing":w="grab":s?w=void 0:C&&!c&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||u,shouldShowBoundingBox:i,shouldShowGrid:S,stageCoordinates:h,stageCursor:w,stageDimensions:f,stageScale:r,tool:p,isStaging:t,shouldShowIntermediates:y}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),HT=re(eT,{shouldForwardProp:e=>!["sx"].includes(e)}),k4=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:s,stageDimensions:c,stageScale:u,tool:f,isStaging:h,shouldShowIntermediates:p}=O(BT);iT();const g=x.useRef(null),y=x.useRef(null),S=x.useCallback(V=>{GC(V),g.current=V},[]),C=x.useCallback(V=>{$C(V),y.current=V},[]),w=x.useRef({x:0,y:0}),k=x.useRef(!1),j=hT(g),M=aT(g),P=dT(g,k),I=lT(g,k,w),T=cT(),{handleDragStart:D,handleDragMove:_,handleDragEnd:z}=nT();return l.jsx(B,{sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:l.jsxs(We,{sx:{position:"relative"},children:[l.jsxs(HT,{tabIndex:-1,ref:S,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:i.x,y:i.y,width:c.width,height:c.height,scale:{x:u,y:u},onTouchStart:M,onTouchMove:I,onTouchEnd:P,onMouseDown:M,onMouseLeave:T,onMouseMove:I,onMouseUp:P,onDragStart:D,onDragMove:_,onDragEnd:z,onContextMenu:V=>V.evt.preventDefault(),onWheel:j,draggable:(f==="move"||h)&&!t,children:[l.jsx(za,{id:"grid",visible:r,children:l.jsx(xT,{})}),l.jsx(za,{id:"base",ref:C,listening:!1,imageSmoothingEnabled:!1,children:l.jsx(PT,{})}),l.jsxs(za,{id:"mask",visible:e,listening:!1,children:[l.jsx(kT,{visible:!0,listening:!1}),l.jsx(CT,{listening:!1})]}),l.jsx(za,{children:l.jsx(mT,{})}),l.jsxs(za,{id:"preview",imageSmoothingEnabled:!1,children:[!h&&l.jsx(LT,{visible:f!=="move",listening:!1}),l.jsx(MT,{visible:h}),p&&l.jsx(bT,{}),l.jsx(NT,{visible:n&&!h})]})]}),l.jsx(zT,{}),l.jsx(_T,{})]})})},WT=be(tt,Ny,Bt,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),j4=()=>{const e=Y(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=O(WT),s=x.useRef(null);return x.useLayoutEffect(()=>{window.setTimeout(()=>{if(!s.current)return;const{clientWidth:c,clientHeight:u}=s.current;e(qC({width:c,height:u})),e(i?YC():Sc()),e(on(!1))},0)},[e,r,t,n,i]),l.jsx(B,{ref:s,sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,width:"100%",height:"100%"},children:l.jsx(Qf,{thickness:"2px",speed:"1s",size:"xl"})})},VT=be([tt,Bt,Pt],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function E4(){const e=Y(),{canRedo:t,activeTabName:n}=O(VT),{t:r}=Z(),i=()=>{e(XC())};return fe(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),l.jsx(le,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:l.jsx(Y8,{}),onClick:i,isDisabled:!t})}const UT=be([tt,Bt,Pt],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function P4(){const e=Y(),{t}=Z(),{canUndo:n,activeTabName:r}=O(UT),i=()=>{e(KC())};return fe(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),l.jsx(le,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:l.jsx(J8,{}),onClick:i,isDisabled:!n})}const $T=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const s=i.getContext("2d");s&&(s.drawImage(r,0,0),i.toBlob(c=>{c&&navigator.clipboard.write([new ClipboardItem({[c.type]:c})])}),i.remove(),r.remove())}),r.src=e},GT=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},qT=(e,t,n,r)=>{const i=e.scale(),s=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:c,y:u,width:f,height:h}=e.getClientRect(),p=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:c,y:u,width:f,height:h},g=e.toDataURL(p);return e.scale(i),{dataURL:g,boundingBox:{x:s.x,y:s.y,width:f,height:h}}},YT={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},ai=(e=YT)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:s,shouldDownload:c,shouldCopy:u,shouldSetAsInitialImage:f}=e;t(QC("Exporting Image")),t(bl(!1));const h=n(),{stageScale:p,boundingBoxCoordinates:g,boundingBoxDimensions:y,stageCoordinates:S}=h.canvas,C=Sr();if(!C){t(md(!1)),t(bl(!0));return}const{dataURL:w,boundingBox:k}=qT(C,p,S,i?{...g,...y}:void 0);if(!w){t(md(!1)),t(bl(!0));return}const j=new FormData;j.append("data",JSON.stringify({dataURL:w,filename:"merged_canvas.png",kind:s?"result":"temp",cropVisible:r}));const P=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:j})).json(),{url:I,width:T,height:D}=P,_={uuid:P1(),category:s?"result":"user",...P};c&&(GT(I),t(Sl({title:nr.t("toast.downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),u&&($T(I,T,D),t(Sl({title:nr.t("toast.imageCopied"),status:"success",duration:2500,isClosable:!0}))),s&&(t(I1({image:_,category:"result"})),t(Sl({title:nr.t("toast.imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),f&&(t(ZC({kind:"image",layer:"base",...k,image:_})),t(Sl({title:nr.t("toast.canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(md(!1)),t(JC(nr.t("common.statusConnected"))),t(bl(!0))};function XT(){const e=O(zt),t=Sr(),n=O(u=>u.system.isProcessing),r=O(u=>u.canvas.shouldCropToBoundingBoxOnSave),i=Y(),{t:s}=Z();fe(["meta+c","ctrl+c"],()=>{c()},{enabled:()=>!e,preventDefault:!0},[t,n]);const c=()=>{i(ai({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return l.jsx(le,{"aria-label":`${s("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${s("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:l.jsx(Jo,{}),onClick:c,isDisabled:e})}function KT(){const e=Y(),{t}=Z(),n=Sr(),r=O(zt),i=O(u=>u.system.isProcessing),s=O(u=>u.canvas.shouldCropToBoundingBoxOnSave);fe(["shift+d"],()=>{c()},{enabled:()=>!r,preventDefault:!0},[n,i]);const c=()=>{e(ai({cropVisible:!s,cropToBoundingBox:s,shouldDownload:!0}))};return l.jsx(le,{"aria-label":`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:l.jsx(ip,{}),onClick:c,isDisabled:r})}function QT(){const e=O(zt),{openUploader:t}=Zh(),{t:n}=Z();return l.jsx(le,{"aria-label":n("common.upload"),tooltip:n("common.upload"),icon:l.jsx(Rc,{}),onClick:t,isDisabled:e})}const ZT=be([tt,zt],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function JT(){const e=Y(),{t}=Z(),{layer:n,isMaskEnabled:r,isStaging:i}=O(ZT),s=()=>{e(tc(n==="mask"?"base":"mask"))};fe(["q"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[n]);const c=u=>{const f=u.target.value;e(tc(f)),f==="mask"&&!r&&e(ss(!0))};return l.jsx(Mn,{tooltip:`${t("unifiedCanvas.layer")} (Q)`,"aria-label":`${t("unifiedCanvas.layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:Z1,onChange:c,isDisabled:i})}function e_(){const e=Y(),{t}=Z(),n=Sr(),r=O(zt),i=O(c=>c.system.isProcessing);fe(["shift+m"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n,i]);const s=()=>{e(ai({cropVisible:!1,shouldSetAsInitialImage:!0}))};return l.jsx(le,{"aria-label":`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:l.jsx(zy,{}),onClick:s,isDisabled:r})}function t_(){const e=O(s=>s.canvas.tool),t=O(zt),n=Y(),{t:r}=Z();fe(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(xr("move"));return l.jsx(le,{"aria-label":`${r("unifiedCanvas.move")} (V)`,tooltip:`${r("unifiedCanvas.move")} (V)`,icon:l.jsx(My,{}),isChecked:e==="move"||t,onClick:i})}function n_(){const e=O(i=>i.ui.shouldPinParametersPanel),t=Y(),{t:n}=Z(),r=()=>{t(Hi(!0)),e&&setTimeout(()=>t(on(!0)),400)};return l.jsxs(B,{flexDirection:"column",gap:2,children:[l.jsx(le,{tooltip:`${n("parameters.showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("parameters.showOptionsPanel"),onClick:r,children:l.jsx(ap,{})}),l.jsx(B,{children:l.jsx(xp,{iconButton:!0})}),l.jsx(B,{children:l.jsx(vp,{width:"100%",height:"40px",btnGroupWidth:"100%"})})]})}function r_(){const e=Y(),{t}=Z(),n=O(zt),r=()=>{e(Jf()),e(Sc())};return l.jsx(le,{"aria-label":t("unifiedCanvas.clearCanvas"),tooltip:t("unifiedCanvas.clearCanvas"),icon:l.jsx(io,{}),onClick:r,isDisabled:n,colorScheme:"error"})}function I4(e,t,n=250){const[r,i]=x.useState(0);return x.useEffect(()=>{const s=setTimeout(()=>{r===1&&e(),i(0)},n);return r===2&&t(),()=>clearTimeout(s)},[r,e,t,n]),()=>i(s=>s+1)}function i_(){const e=Sr(),t=Y(),{t:n}=Z();fe(["r"],()=>{i()},{enabled:()=>!0,preventDefault:!0},[e]);const r=I4(()=>i(!1),()=>i(!0)),i=(s=!1)=>{const c=Sr();if(!c)return;const u=c.getClientRect({skipTransform:!0});t(J1({contentRect:u,shouldScaleTo1:s}))};return l.jsx(le,{"aria-label":`${n("unifiedCanvas.resetView")} (R)`,tooltip:`${n("unifiedCanvas.resetView")} (R)`,icon:l.jsx(_y,{}),onClick:r})}function o_(){const e=O(zt),t=Sr(),n=O(u=>u.system.isProcessing),r=O(u=>u.canvas.shouldCropToBoundingBoxOnSave),i=Y(),{t:s}=Z();fe(["shift+s"],()=>{c()},{enabled:()=>!e,preventDefault:!0},[t,n]);const c=()=>{i(ai({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return l.jsx(le,{"aria-label":`${s("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${s("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:l.jsx(op,{}),onClick:c,isDisabled:e})}const a_=be([tt,zt,Pt],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),s_=()=>{const e=Y(),{t}=Z(),{tool:n,isStaging:r}=O(a_);fe(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),fe(["e"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n]),fe(["c"],()=>{c()},{enabled:()=>!r,preventDefault:!0},[n]),fe(["shift+f"],()=>{u()},{enabled:()=>!r,preventDefault:!0}),fe(["delete","backspace"],()=>{f()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(xr("brush")),s=()=>e(xr("eraser")),c=()=>e(xr("colorPicker")),u=()=>e(e2()),f=()=>e(t2());return l.jsxs(B,{flexDirection:"column",gap:2,children:[l.jsxs(en,{children:[l.jsx(le,{"aria-label":`${t("unifiedCanvas.brush")} (B)`,tooltip:`${t("unifiedCanvas.brush")} (B)`,icon:l.jsx(Ry,{}),isChecked:n==="brush"&&!r,onClick:i,isDisabled:r}),l.jsx(le,{"aria-label":`${t("unifiedCanvas.eraser")} (E)`,tooltip:`${t("unifiedCanvas.eraser")} (B)`,icon:l.jsx(Dy,{}),isChecked:n==="eraser"&&!r,isDisabled:r,onClick:s})]}),l.jsxs(en,{children:[l.jsx(le,{"aria-label":`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:l.jsx(Ay,{}),isDisabled:r,onClick:u}),l.jsx(le,{"aria-label":`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:l.jsx(xs,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:f})]}),l.jsx(le,{"aria-label":`${t("unifiedCanvas.colorPicker")} (C)`,tooltip:`${t("unifiedCanvas.colorPicker")} (C)`,icon:l.jsx(Oy,{}),isChecked:n==="colorPicker"&&!r,isDisabled:r,onClick:c,width:"max-content"})]})},Wc=he((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:s,children:c,title:u,triggerComponent:f}=e,{isOpen:h,onOpen:p,onClose:g}=ui(),y=x.useRef(null),S=()=>{r(),g()},C=()=>{s&&s(),g()};return l.jsxs(l.Fragment,{children:[x.cloneElement(f,{onClick:p,ref:t}),l.jsx(Xx,{isOpen:h,leastDestructiveRef:y,onClose:g,children:l.jsx(Nr,{children:l.jsxs(Kx,{children:[l.jsx(Rr,{fontSize:"lg",fontWeight:"bold",children:u}),l.jsx(Fr,{children:c}),l.jsxs(zr,{children:[l.jsx(Je,{ref:y,onClick:C,children:i}),l.jsx(Je,{colorScheme:"error",onClick:S,ml:3,children:n})]})]})})})]})}),M4=()=>{const e=O(zt),t=Y(),{t:n}=Z(),r=()=>{t(e3()),t(Jf()),t(n2())};return l.jsxs(Wc,{title:n("unifiedCanvas.emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedCanvas.emptyFolder"),triggerComponent:l.jsx(Je,{leftIcon:l.jsx(io,{}),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")})]})},T4=()=>{const e=O(zt),t=Y(),{t:n}=Z();return l.jsxs(Wc,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(n2()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:l.jsx(Je,{size:"sm",leftIcon:l.jsx(io,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[l.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),l.jsx("br",{}),l.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},l_=be([tt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),c_=()=>{const e=Y(),{t}=Z(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:s}=O(l_);return l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(le,{tooltip:t("unifiedCanvas.canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedCanvas.canvasSettings"),icon:l.jsx(sp,{})}),children:l.jsxs(B,{direction:"column",gap:2,children:[l.jsx(pt,{label:t("unifiedCanvas.showIntermediates"),isChecked:s,onChange:c=>e(r2(c.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:c=>e(i2(c.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:c=>e(o2(c.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:i,onChange:c=>e(a2(c.target.checked))}),l.jsx(T4,{}),l.jsx(M4,{})]})})},u_=()=>{const e=O(t=>t.ui.shouldShowParametersPanel);return l.jsxs(B,{flexDirection:"column",rowGap:2,children:[l.jsx(JT,{}),l.jsx(s_,{}),l.jsxs(B,{gap:2,children:[l.jsx(t_,{}),l.jsx(i_,{})]}),l.jsxs(B,{columnGap:2,children:[l.jsx(e_,{}),l.jsx(o_,{})]}),l.jsxs(B,{columnGap:2,children:[l.jsx(XT,{}),l.jsx(KT,{})]}),l.jsxs(B,{gap:2,children:[l.jsx(P4,{}),l.jsx(E4,{})]}),l.jsxs(B,{gap:2,children:[l.jsx(QT,{}),l.jsx(r_,{})]}),l.jsx(c_,{}),!e&&l.jsx(n_,{})]})};function d_(){const e=Y(),t=O(i=>i.canvas.brushSize),{t:n}=Z(),r=O(zt);return fe(["BracketLeft"],()=>{e(Wo(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),fe(["BracketRight"],()=>{e(Wo(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),l.jsx(ut,{label:n("unifiedCanvas.brushSize"),value:t,withInput:!0,onChange:i=>e(Wo(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,isCompact:!0})}function Vc(){return(Vc=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 _4(e,t){if(e==null)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)t.indexOf(n=s[r])>=0||(i[n]=e[n]);return i}function Rf(e){var t=x.useRef(e),n=x.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var ta=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Ua=function(e){return"touches"in e},Nf=function(e){return e&&e.ownerDocument.defaultView||self},T0=function(e,t,n){var r=e.getBoundingClientRect(),i=Ua(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:ta((i.pageX-(r.left+Nf(e).pageXOffset))/r.width),top:ta((i.pageY-(r.top+Nf(e).pageYOffset))/r.height)}},_0=function(e){!Ua(e)&&e.preventDefault()},zp=ke.memo(function(e){var t=e.onMove,n=e.onKey,r=_4(e,["onMove","onKey"]),i=x.useRef(null),s=Rf(t),c=Rf(n),u=x.useRef(null),f=x.useRef(!1),h=x.useMemo(function(){var S=function(k){_0(k),(Ua(k)?k.touches.length>0:k.buttons>0)&&i.current?s(T0(i.current,k,u.current)):w(!1)},C=function(){return w(!1)};function w(k){var j=f.current,M=Nf(i.current),P=k?M.addEventListener:M.removeEventListener;P(j?"touchmove":"mousemove",S),P(j?"touchend":"mouseup",C)}return[function(k){var j=k.nativeEvent,M=i.current;if(M&&(_0(j),!function(I,T){return T&&!Ua(I)}(j,f.current)&&M)){if(Ua(j)){f.current=!0;var P=j.changedTouches||[];P.length&&(u.current=P[0].identifier)}M.focus(),s(T0(M,j,u.current)),w(!0)}},function(k){var j=k.which||k.keyCode;j<37||j>40||(k.preventDefault(),c({left:j===39?.05:j===37?-.05:0,top:j===40?.05:j===38?-.05:0}))},w]},[c,s]),p=h[0],g=h[1],y=h[2];return x.useEffect(function(){return y},[y]),ke.createElement("div",Vc({},r,{onTouchStart:p,onMouseDown:p,className:"react-colorful__interactive",ref:i,onKeyDown:g,tabIndex:0,role:"slider"}))}),Uc=function(e){return e.filter(Boolean).join(" ")},Rp=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,s=Uc(["react-colorful__pointer",e.className]);return ke.createElement("div",{className:s,style:{top:100*i+"%",left:100*n+"%"}},ke.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},D4=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:gn(e.h),s:gn(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:gn(i/2),a:gn(r,2)}},Ff=function(e){var t=D4(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Bd=function(e){var t=D4(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},f_=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var s=Math.floor(t),c=r*(1-n),u=r*(1-(t-s)*n),f=r*(1-(1-t+s)*n),h=s%6;return{r:gn(255*[r,u,c,c,f,r][h]),g:gn(255*[f,r,r,u,c,c][h]),b:gn(255*[c,c,f,r,r,u][h]),a:gn(i,2)}},h_=function(e){var t=e.r,n=e.g,r=e.b,i=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:i}},p_=ke.memo(function(e){var t=e.hue,n=e.onChange,r=Uc(["react-colorful__hue",e.className]);return ke.createElement("div",{className:r},ke.createElement(zp,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:ta(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":gn(t),"aria-valuemax":"360","aria-valuemin":"0"},ke.createElement(Rp,{className:"react-colorful__hue-pointer",left:t/360,color:Ff({h:t,s:100,v:100,a:1})})))}),m_=ke.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Ff({h:t.h,s:100,v:100,a:1})};return ke.createElement("div",{className:"react-colorful__saturation",style:r},ke.createElement(zp,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:ta(t.s+100*i.left,0,100),v:ta(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+gn(t.s)+"%, Brightness "+gn(t.v)+"%"},ke.createElement(Rp,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Ff(t)})))}),O4=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function v_(e,t,n){var r=Rf(n),i=x.useState(function(){return e.toHsva(t)}),s=i[0],c=i[1],u=x.useRef({color:t,hsva:s});x.useEffect(function(){if(!e.equal(t,u.current.color)){var h=e.toHsva(t);u.current={hsva:h,color:t},c(h)}},[t,e]),x.useEffect(function(){var h;O4(s,u.current.hsva)||e.equal(h=e.fromHsva(s),u.current.color)||(u.current={hsva:s,color:h},r(h))},[s,e,r]);var f=x.useCallback(function(h){c(function(p){return Object.assign({},p,h)})},[]);return[s,f]}var g_=typeof window<"u"?x.useLayoutEffect:x.useEffect,x_=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},D0=new Map,y_=function(e){g_(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!D0.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}`,D0.set(t,n);var r=x_();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},b_=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+Bd(Object.assign({},n,{a:0}))+", "+Bd(Object.assign({},n,{a:1}))+")"},s=Uc(["react-colorful__alpha",t]),c=gn(100*n.a);return ke.createElement("div",{className:s},ke.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),ke.createElement(zp,{onMove:function(u){r({a:u.left})},onKey:function(u){r({a:ta(n.a+u.left)})},"aria-label":"Alpha","aria-valuetext":c+"%","aria-valuenow":c,"aria-valuemin":"0","aria-valuemax":"100"},ke.createElement(Rp,{className:"react-colorful__alpha-pointer",left:n.a,color:Bd(n)})))},S_=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,s=e.onChange,c=_4(e,["className","colorModel","color","onChange"]),u=x.useRef(null);y_(u);var f=v_(n,i,s),h=f[0],p=f[1],g=Uc(["react-colorful",t]);return ke.createElement("div",Vc({},c,{ref:u,className:g}),ke.createElement(m_,{hsva:h,onChange:p}),ke.createElement(p_,{hue:h.h,onChange:p}),ke.createElement(b_,{hsva:h,onChange:p,className:"react-colorful__last-control"}))},C_={defaultColor:{r:0,g:0,b:0,a:1},toHsva:h_,fromHsva:f_,equal:O4},w_=function(e){return ke.createElement(S_,Vc({},e,{colorModel:C_}))};const k_=re(w_,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),Hd={width:6,height:6,borderColor:"base.100"},pc=e=>{const{styleClass:t="",...n}=e;return l.jsx(k_,{sx:{".react-colorful__hue-pointer":Hd,".react-colorful__saturation-pointer":Hd,".react-colorful__alpha-pointer":Hd},className:t,...n})},j_=be([tt,zt],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function E_(){const e=Y(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=O(j_),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 fe(["shift+BracketLeft"],()=>{e(Vo({...t,a:te.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),fe(["shift+BracketRight"],()=>{e(Vo({...t,a:te.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(We,{sx:{width:7,height:7,minWidth:7,minHeight:7,borderRadius:"full",bg:s(),cursor:"pointer"}}),children:l.jsxs(B,{minWidth:60,direction:"column",gap:4,width:"100%",children:[r==="base"&&l.jsx(pc,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:t,onChange:c=>e(Vo(c))}),r==="mask"&&l.jsx(pc,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:c=>e(s2(c))})]})})}function A4(){return l.jsxs(B,{columnGap:4,alignItems:"center",children:[l.jsx(d_,{}),l.jsx(E_,{})]})}function P_(){const e=Y(),t=O(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Z();return l.jsx(pt,{label:n("unifiedCanvas.betaLimitToBox"),isChecked:t,onChange:r=>e(l2(r.target.checked))})}function I_(){return l.jsxs(B,{gap:4,alignItems:"center",children:[l.jsx(A4,{}),l.jsx(P_,{})]})}function M_(){const e=Y(),{t}=Z(),n=()=>e(Zf());return l.jsx(Je,{size:"sm",leftIcon:l.jsx(io,{}),onClick:n,tooltip:`${t("unifiedCanvas.clearMask")} (Shift+C)`,children:t("unifiedCanvas.betaClear")})}function T_(){const e=O(i=>i.canvas.isMaskEnabled),t=Y(),{t:n}=Z(),r=()=>t(ss(!e));return l.jsx(pt,{label:`${n("unifiedCanvas.enableMask")} (H)`,isChecked:e,onChange:r})}function __(){const e=Y(),{t}=Z(),n=O(r=>r.canvas.shouldPreserveMaskedArea);return l.jsx(pt,{label:t("unifiedCanvas.betaPreserveMasked"),isChecked:n,onChange:r=>e(c2(r.target.checked))})}function D_(){return l.jsxs(B,{gap:4,alignItems:"center",children:[l.jsx(A4,{}),l.jsx(T_,{}),l.jsx(__,{}),l.jsx(M_,{})]})}function O_(){const e=O(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Y(),{t:n}=Z();return l.jsx(pt,{label:n("unifiedCanvas.betaDarkenOutside"),isChecked:e,onChange:r=>t(u2(r.target.checked))})}function A_(){const e=O(r=>r.canvas.shouldShowGrid),t=Y(),{t:n}=Z();return l.jsx(pt,{label:n("unifiedCanvas.showGrid"),isChecked:e,onChange:r=>t(d2(r.target.checked))})}function z_(){const e=O(i=>i.canvas.shouldSnapToGrid),t=Y(),{t:n}=Z(),r=i=>t(ec(i.target.checked));return l.jsx(pt,{label:`${n("unifiedCanvas.snapToGrid")} (N)`,isChecked:e,onChange:r})}function R_(){return l.jsxs(B,{alignItems:"center",gap:4,children:[l.jsx(A_,{}),l.jsx(z_,{}),l.jsx(O_,{})]})}const N_=be([tt],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function F_(){const{tool:e,layer:t}=O(N_);return l.jsxs(B,{height:8,minHeight:8,maxHeight:8,alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&l.jsx(I_,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&l.jsx(D_,{}),e=="move"&&l.jsx(R_,{})]})}const L_=be([tt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),B_=()=>{const e=Y(),{doesCanvasNeedScaling:t}=O(L_);return x.useLayoutEffect(()=>{e(on(!0));const n=te.debounce(()=>{e(on(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),l.jsx(We,{sx:{width:"100%",height:"100%",borderRadius:"base",bg:"base.850"},children:l.jsxs(B,{flexDirection:"row",width:"100%",height:"100%",columnGap:4,padding:4,children:[l.jsx(u_,{}),l.jsxs(B,{width:"100%",height:"100%",flexDirection:"column",rowGap:4,children:[l.jsx(F_,{}),t?l.jsx(j4,{}):l.jsx(k4,{})]})]})})},H_=be([tt,zt],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:qi(n),isMaskEnabled:i,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),W_=()=>{const e=Y(),{t}=Z(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:s,isStaging:c}=O(H_);fe(["q"],()=>{u()},{enabled:()=>!c,preventDefault:!0},[n]),fe(["shift+c"],()=>{f()},{enabled:()=>!c,preventDefault:!0},[]),fe(["h"],()=>{h()},{enabled:()=>!c,preventDefault:!0},[i]);const u=()=>{e(tc(n==="mask"?"base":"mask"))},f=()=>e(Zf()),h=()=>e(ss(!i));return l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(en,{children:l.jsx(le,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:l.jsx(W8,{}),isChecked:n==="mask",isDisabled:c})}),children:l.jsxs(B,{direction:"column",gap:2,children:[l.jsx(pt,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:i,onChange:h}),l.jsx(pt,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:p=>e(c2(p.target.checked))}),l.jsx(pc,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:p=>e(s2(p))}),l.jsxs(Je,{size:"sm",leftIcon:l.jsx(io,{}),onClick:f,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},V_=be([tt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:s,shouldShowIntermediates:c,shouldSnapToGrid:u,shouldRestrictStrokesToBox:f}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:s,shouldShowIntermediates:c,shouldSnapToGrid:u,shouldRestrictStrokesToBox:f}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),U_=()=>{const e=Y(),{t}=Z(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:s,shouldShowGrid:c,shouldShowIntermediates:u,shouldSnapToGrid:f,shouldRestrictStrokesToBox:h}=O(V_);fe(["n"],()=>{e(ec(!f))},{enabled:!0,preventDefault:!0},[f]);const p=g=>e(ec(g.target.checked));return l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(le,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:l.jsx(sp,{})}),children:l.jsxs(B,{direction:"column",gap:2,children:[l.jsx(pt,{label:t("unifiedCanvas.showIntermediates"),isChecked:u,onChange:g=>e(r2(g.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.showGrid"),isChecked:c,onChange:g=>e(d2(g.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.snapToGrid"),isChecked:f,onChange:p}),l.jsx(pt,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:i,onChange:g=>e(u2(g.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:g=>e(i2(g.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:g=>e(o2(g.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:h,onChange:g=>e(l2(g.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:g=>e(a2(g.target.checked))}),l.jsx(T4,{}),l.jsx(M4,{})]})})},$_=be([tt,zt,Pt],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:s,brushSize:c}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:s,brushSize:c}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),G_=()=>{const e=Y(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=O($_),{t:s}=Z();fe(["b"],()=>{c()},{enabled:()=>!i,preventDefault:!0},[]),fe(["e"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[t]),fe(["c"],()=>{f()},{enabled:()=>!i,preventDefault:!0},[t]),fe(["shift+f"],()=>{h()},{enabled:()=>!i,preventDefault:!0}),fe(["delete","backspace"],()=>{p()},{enabled:()=>!i,preventDefault:!0}),fe(["BracketLeft"],()=>{e(Wo(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),fe(["BracketRight"],()=>{e(Wo(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),fe(["shift+BracketLeft"],()=>{e(Vo({...n,a:te.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),fe(["shift+BracketRight"],()=>{e(Vo({...n,a:te.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const c=()=>e(xr("brush")),u=()=>e(xr("eraser")),f=()=>e(xr("colorPicker")),h=()=>e(e2()),p=()=>e(t2());return l.jsxs(en,{isAttached:!0,children:[l.jsx(le,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:l.jsx(Ry,{}),isChecked:t==="brush"&&!i,onClick:c,isDisabled:i}),l.jsx(le,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:l.jsx(Dy,{}),isChecked:t==="eraser"&&!i,isDisabled:i,onClick:u}),l.jsx(le,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:l.jsx(Ay,{}),isDisabled:i,onClick:h}),l.jsx(le,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:l.jsx(xs,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:p}),l.jsx(le,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:l.jsx(Oy,{}),isChecked:t==="colorPicker"&&!i,isDisabled:i,onClick:f}),l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(le,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:l.jsx(ap,{})}),children:l.jsxs(B,{minWidth:60,direction:"column",gap:4,width:"100%",children:[l.jsx(B,{gap:4,justifyContent:"space-between",children:l.jsx(ut,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:g=>e(Wo(g)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),l.jsx(pc,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:g=>e(Vo(g))})]})})]})},q_=be([Pt,tt,zt],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:s,layer:c,isMaskEnabled:u}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:u,tool:i,layer:c,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),Y_=()=>{const e=Y(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:s,shouldCropToBoundingBoxOnSave:c}=O(q_),u=Sr(),{t:f}=Z(),{openUploader:h}=Zh();fe(["v"],()=>{p()},{enabled:()=>!n,preventDefault:!0},[]),fe(["r"],()=>{y()},{enabled:()=>!0,preventDefault:!0},[u]),fe(["shift+m"],()=>{C()},{enabled:()=>!n,preventDefault:!0},[u,t]),fe(["shift+s"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[u,t]),fe(["meta+c","ctrl+c"],()=>{k()},{enabled:()=>!n,preventDefault:!0},[u,t]),fe(["shift+d"],()=>{j()},{enabled:()=>!n,preventDefault:!0},[u,t]);const p=()=>e(xr("move")),g=I4(()=>y(!1),()=>y(!0)),y=(P=!1)=>{const I=Sr();if(!I)return;const T=I.getClientRect({skipTransform:!0});e(J1({contentRect:T,shouldScaleTo1:P}))},S=()=>{e(Jf()),e(Sc())},C=()=>{e(ai({cropVisible:!1,shouldSetAsInitialImage:!0}))},w=()=>{e(ai({cropVisible:!c,cropToBoundingBox:c,shouldSaveToGallery:!0}))},k=()=>{e(ai({cropVisible:!c,cropToBoundingBox:c,shouldCopy:!0}))},j=()=>{e(ai({cropVisible:!c,cropToBoundingBox:c,shouldDownload:!0}))},M=P=>{const I=P.target.value;e(tc(I)),I==="mask"&&!r&&e(ss(!0))};return l.jsxs(B,{sx:{alignItems:"center",gap:2},children:[l.jsx(Mn,{tooltip:`${f("unifiedCanvas.layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:Z1,onChange:M,isDisabled:n}),l.jsx(W_,{}),l.jsx(G_,{}),l.jsxs(en,{isAttached:!0,children:[l.jsx(le,{"aria-label":`${f("unifiedCanvas.move")} (V)`,tooltip:`${f("unifiedCanvas.move")} (V)`,icon:l.jsx(My,{}),isChecked:s==="move"||n,onClick:p}),l.jsx(le,{"aria-label":`${f("unifiedCanvas.resetView")} (R)`,tooltip:`${f("unifiedCanvas.resetView")} (R)`,icon:l.jsx(_y,{}),onClick:g})]}),l.jsxs(en,{isAttached:!0,children:[l.jsx(le,{"aria-label":`${f("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${f("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:l.jsx(zy,{}),onClick:C,isDisabled:n}),l.jsx(le,{"aria-label":`${f("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${f("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:l.jsx(op,{}),onClick:w,isDisabled:n}),l.jsx(le,{"aria-label":`${f("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${f("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:l.jsx(Jo,{}),onClick:k,isDisabled:n}),l.jsx(le,{"aria-label":`${f("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${f("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:l.jsx(ip,{}),onClick:j,isDisabled:n})]}),l.jsxs(en,{isAttached:!0,children:[l.jsx(P4,{}),l.jsx(E4,{})]}),l.jsxs(en,{isAttached:!0,children:[l.jsx(le,{"aria-label":`${f("common.upload")}`,tooltip:`${f("common.upload")}`,icon:l.jsx(Rc,{}),onClick:h,isDisabled:n}),l.jsx(le,{"aria-label":`${f("unifiedCanvas.clearCanvas")}`,tooltip:`${f("unifiedCanvas.clearCanvas")}`,icon:l.jsx(io,{}),onClick:S,colorScheme:"error",isDisabled:n})]}),l.jsx(en,{isAttached:!0,children:l.jsx(U_,{})})]})},X_=be([tt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),K_=()=>{const e=Y(),{doesCanvasNeedScaling:t}=O(X_);return x.useLayoutEffect(()=>{e(on(!0));const n=te.debounce(()=>{e(on(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),l.jsx(We,{sx:{width:"100%",height:"100%",padding:4,borderRadius:"base",bg:"base.850"},children:l.jsxs(B,{sx:{flexDirection:"column",alignItems:"center",gap:4,width:"100%",height:"100%"},children:[l.jsx(Y_,{}),l.jsx(B,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,width:"100%",height:"100%"},children:t?l.jsx(j4,{}):l.jsx(k4,{})})]})})},Q_=be(tt,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),Z_=()=>{const e=Y(),{boundingBoxDimensions:t}=O(Q_),{t:n}=Z(),r=u=>{e(Na({...t,width:Math.floor(u)}))},i=u=>{e(Na({...t,height:Math.floor(u)}))},s=()=>{e(Na({...t,width:Math.floor(512)}))},c=()=>{e(Na({...t,height:Math.floor(512)}))};return l.jsxs(Le,{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:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:c})]})},J_=be([gp,Pt,tt],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:s}=t,{boundingBoxScaleMethod:c,scaledBoundingBoxDimensions:u}=n;return{boundingBoxScale:c,scaledBoundingBoxDimensions:u,tileSize:r,infillMethod:i,availableInfillMethods:s,isManual:c==="manual"}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),eD=()=>{const e=Y(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:s,scaledBoundingBoxDimensions:c}=O(J_),{t:u}=Z(),f=S=>{e(Cl({...c,width:Math.floor(S)}))},h=S=>{e(Cl({...c,height:Math.floor(S)}))},p=()=>{e(Cl({...c,width:Math.floor(512)}))},g=()=>{e(Cl({...c,height:Math.floor(512)}))},y=S=>{e(r3(S.target.value))};return l.jsxs(Le,{gap:2,alignItems:"stretch",children:[l.jsx(Mn,{label:u("parameters.scaleBeforeProcessing"),validValues:t3,value:i,onChange:y}),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:p}),l.jsx(ut,{isInputDisabled:!s,isResetDisabled:!s,isSliderDisabled:!s,label:u("parameters.scaledHeight"),min:64,max:1024,step:64,value:c.height,onChange:h,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:g}),l.jsx(Mn,{label:u("parameters.infillMethod"),value:n,validValues:r,onChange:S=>e(n3(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(qv(S))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(qv(32))}})]})};function tD(){const e=Y(),t=O(r=>r.generation.seamBlur),{t:n}=Z();return l.jsx(ut,{label:n("parameters.seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(Yv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Yv(16))}})}function nD(){const e=Y(),{t}=Z(),n=O(r=>r.generation.seamSize);return l.jsx(ut,{label:t("parameters.seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(Xv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(Xv(96))})}function rD(){const{t:e}=Z(),t=O(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(Kv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(Kv(30))}})}function iD(){const e=Y(),{t}=Z(),n=O(r=>r.generation.seamStrength);return l.jsx(ut,{label:t("parameters.seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(Qv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Qv(.7))}})}const oD=()=>l.jsxs(Le,{gap:2,alignItems:"stretch",children:[l.jsx(nD,{}),l.jsx(tD,{}),l.jsx(iD,{}),l.jsx(rD,{})]});function aD(){const{t:e}=Z(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(Ep,{})},unifiedCanvasImg2Img:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:l.jsx(m4,{label:e("parameters.img2imgStrength")})},seed:{header:`${e("parameters.seed")}`,feature:dn.SEED,content:l.jsx(wp,{})},boundingBox:{header:`${e("parameters.boundingBoxHeader")}`,feature:dn.BOUNDING_BOX,content:l.jsx(Z_,{})},seamCorrection:{header:`${e("parameters.seamCorrectionHeader")}`,feature:dn.SEAM_CORRECTION,content:l.jsx(oD,{})},infillAndScaling:{header:`${e("parameters.infillScalingHeader")}`,feature:dn.INFILL_AND_SCALING,content:l.jsx(eD,{})},variations:{header:`${e("parameters.variations")}`,feature:dn.VARIATIONS,content:l.jsx(jp,{}),additionalHeaderComponents:l.jsx(kp,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(Sp,{}),additionalHeaderComponents:l.jsx(Cp,{})}};return l.jsxs(_p,{children:[l.jsxs(B,{flexDir:"column",rowGap:2,children:[l.jsx(Tp,{}),l.jsx(Mp,{})]}),l.jsx(Ip,{}),l.jsx(Pp,{accordionInfo:t})]})}function sD(){const e=O(t=>t.ui.shouldUseCanvasBetaLayout);return l.jsx(bp,{optionsPanel:l.jsx(aD,{}),children:e?l.jsx(B_,{}):l.jsx(K_,{})})}const Dn={txt2img:{title:l.jsx(Jt,{as:v9,boxSize:6}),workarea:l.jsx(KI,{}),tooltip:"Text To Image"},img2img:{title:l.jsx(Jt,{as:cp,boxSize:6}),workarea:l.jsx(VI,{}),tooltip:"Image To Image"},unifiedCanvas:{title:l.jsx(Jt,{as:y9,boxSize:6}),workarea:l.jsx(sD,{}),tooltip:"Unified Canvas"},nodes:{title:l.jsx(Jt,{as:g9,boxSize:6}),workarea:l.jsx($7,{}),tooltip:"Nodes"},postprocess:{title:l.jsx(Jt,{as:b9,boxSize:6}),workarea:l.jsx(G7,{}),tooltip:"Post Processing"},training:{title:l.jsx(Jt,{as:x9,boxSize:6}),workarea:l.jsx(q7,{}),tooltip:"Training"}};function lD(){Dn.txt2img.tooltip=nr.t("common.text2img"),Dn.img2img.tooltip=nr.t("common.img2img"),Dn.unifiedCanvas.tooltip=nr.t("common.unifiedCanvas"),Dn.nodes.tooltip=nr.t("common.nodes"),Dn.postprocess.tooltip=nr.t("common.postProcessing"),Dn.training.tooltip=nr.t("common.training")}function cD(){const e=O(U7),t=O(h=>h.lightbox.isLightboxOpen),{shouldShowGallery:n,shouldShowParametersPanel:r,shouldPinGallery:i,shouldPinParametersPanel:s}=O(yp);Y7(lD);const c=Y();fe("1",()=>{c(jn(0))}),fe("2",()=>{c(jn(1))}),fe("3",()=>{c(jn(2))}),fe("4",()=>{c(jn(3))}),fe("5",()=>{c(jn(4))}),fe("6",()=>{c(jn(5))}),fe("z",()=>{c(Bi(!t))},[t]),fe("f",()=>{n||r?(c(Hi(!1)),c(Fi(!1))):(c(Hi(!0)),c(Fi(!0))),(i||s)&&setTimeout(()=>c(on(!0)),400)},[n,r]);const u=()=>{const h=[];return Object.keys(Dn).forEach(p=>{h.push(l.jsx(Yt,{hasArrow:!0,label:Dn[p].tooltip,placement:"end",children:l.jsxs(yy,{children:[l.jsx(k2,{children:Dn[p].tooltip}),Dn[p].title]})},p))}),h},f=()=>{const h=[];return Object.keys(Dn).forEach(p=>{h.push(l.jsx(gy,{children:Dn[p].workarea},p))}),h};return l.jsxs(my,{isLazy:!0,defaultIndex:e,index:e,onChange:h=>{c(jn(h))},children:[l.jsx(vy,{children:u()}),l.jsx(xy,{children:t?l.jsx(sI,{}):f()})]})}var uD=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 bs(e,t){var n=dD(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 dD(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=uD.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var fD=[".DS_Store","Thumbs.db"];function hD(e){return oa(this,void 0,void 0,function(){return aa(this,function(t){return mc(e)&&pD(e.dataTransfer)?[2,xD(e.dataTransfer,e.type)]:mD(e)?[2,vD(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,gD(e)]:[2,[]]})})}function pD(e){return mc(e)}function mD(e){return mc(e)&&mc(e.target)}function mc(e){return typeof e=="object"&&e!==null}function vD(e){return Lf(e.target.files).map(function(t){return bs(t)})}function gD(e){return oa(this,void 0,void 0,function(){var t;return aa(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 bs(r)})]}})})}function xD(e,t){return oa(this,void 0,void 0,function(){var n,r;return aa(this,function(i){switch(i.label){case 0:return e.items?(n=Lf(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(yD))]):[3,2];case 1:return r=i.sent(),[2,O0(z4(r))];case 2:return[2,O0(Lf(e.files).map(function(s){return bs(s)}))]}})})}function O0(e){return e.filter(function(t){return fD.indexOf(t.name)===-1})}function Lf(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function yD(e){if(typeof e.webkitGetAsEntry!="function")return A0(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?R4(t):A0(e)}function z4(e){return e.reduce(function(t,n){return xf(xf([],fg(t),!1),fg(Array.isArray(n)?z4(n):[n]),!1)},[])}function A0(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=bs(t);return Promise.resolve(n)}function bD(e){return oa(this,void 0,void 0,function(){return aa(this,function(t){return[2,e.isDirectory?R4(e):SD(e)]})})}function R4(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function s(){var c=this;t.readEntries(function(u){return oa(c,void 0,void 0,function(){var f,h,p;return aa(this,function(g){switch(g.label){case 0:if(u.length)return[3,5];g.label=1;case 1:return g.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return f=g.sent(),n(f),[3,4];case 3:return h=g.sent(),r(h),[3,4];case 4:return[3,6];case 5:p=Promise.all(u.map(bD)),i.push(p),s(),g.label=6;case 6:return[2]}})})},function(u){r(u)})}s()})}function SD(e){return oa(this,void 0,void 0,function(){return aa(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var s=bs(i,e.fullPath);n(s)},function(i){r(i)})})]})})}var CD=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(function(c){var u=c.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):i===u})}return!0};function z0(e){return jD(e)||kD(e)||F4(e)||wD()}function wD(){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 kD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jD(e){if(Array.isArray(e))return Bf(e)}function R0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function N0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R0(Object(n),!0).forEach(function(r){N4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function N4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function es(e,t){return ID(e)||PD(e,t)||F4(e,t)||ED()}function ED(){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 F4(e,t){if(e){if(typeof e=="string")return Bf(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 Bf(e,t)}}function Bf(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 PD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,c,u;try{for(n=n.call(e);!(i=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));i=!0);}catch(f){s=!0,u=f}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function ID(e){if(Array.isArray(e))return e}var MD="file-invalid-type",TD="file-too-large",_D="file-too-small",DD="too-many-files",OD=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:MD,message:"File type must be ".concat(n)}},F0=function(t){return{code:TD,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},L0=function(t){return{code:_D,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},AD={code:DD,message:"Too many files"};function L4(e,t){var n=e.type==="application/x-moz-file"||CD(e,t);return[n,n?null:OD(t)]}function B4(e,t,n){if(Ni(e.size))if(Ni(t)&&Ni(n)){if(e.size>n)return[!1,F0(n)];if(e.size<t)return[!1,L0(t)]}else{if(Ni(t)&&e.size<t)return[!1,L0(t)];if(Ni(n)&&e.size>n)return[!1,F0(n)]}return[!0,null]}function Ni(e){return e!=null}function zD(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var h=L4(f,n),p=es(h,1),g=p[0],y=B4(f,r,i),S=es(y,1),C=S[0],w=u?u(f):null;return g&&C&&!w})}function vc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Nl(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 B0(e){e.preventDefault()}function RD(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function ND(e){return e.indexOf("Edge/")!==-1}function FD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return RD(e)||ND(e)}function hr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),c=1;c<i;c++)s[c-1]=arguments[c];return t.some(function(u){return!vc(r)&&u&&u.apply(void 0,[r].concat(s)),vc(r)})}}function LD(){return"showOpenFilePicker"in window}function BD(e){if(Ni(e)){var t=Object.entries(e).filter(function(n){var r=es(n,2),i=r[0],s=r[1],c=!0;return H4(i)||(console.warn('Skipped "'.concat(i,'" 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(W4))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var i=es(r,2),s=i[0],c=i[1];return N0(N0({},n),{},N4({},s,c))},{});return[{description:"Files",accept:t}]}return e}function HD(e){if(Ni(e))return Object.entries(e).reduce(function(t,n){var r=es(n,2),i=r[0],s=r[1];return[].concat(z0(t),[i],z0(s))},[]).filter(function(t){return H4(t)||W4(t)}).join(",")}function WD(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function VD(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function H4(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function W4(e){return/^.*\.[\w]+$/.test(e)}var UD=["children"],$D=["open"],GD=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],qD=["refKey","onChange","onClick"];function YD(e){return QD(e)||KD(e)||V4(e)||XD()}function XD(){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 KD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function QD(e){if(Array.isArray(e))return Hf(e)}function Wd(e,t){return eO(e)||JD(e,t)||V4(e,t)||ZD()}function ZD(){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 V4(e,t){if(e){if(typeof e=="string")return Hf(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 Hf(e,t)}}function Hf(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 JD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,c,u;try{for(n=n.call(e);!(i=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));i=!0);}catch(f){s=!0,u=f}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function eO(e){if(Array.isArray(e))return e}function H0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ot(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H0(Object(n),!0).forEach(function(r){Wf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gc(e,t){if(e==null)return{};var n=tO(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tO(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Np=x.forwardRef(function(e,t){var n=e.children,r=gc(e,UD),i=$4(r),s=i.open,c=gc(i,$D);return x.useImperativeHandle(t,function(){return{open:s}},[s]),ke.createElement(x.Fragment,null,n(Ot(Ot({},c),{},{open:s})))});Np.displayName="Dropzone";var U4={disabled:!1,getFilesFromEvent:hD,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};Np.defaultProps=U4;Np.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 Vf={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function $4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Ot(Ot({},U4),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,h=t.onDragEnter,p=t.onDragLeave,g=t.onDragOver,y=t.onDrop,S=t.onDropAccepted,C=t.onDropRejected,w=t.onFileDialogCancel,k=t.onFileDialogOpen,j=t.useFsAccessApi,M=t.autoFocus,P=t.preventDropOnDocument,I=t.noClick,T=t.noKeyboard,D=t.noDrag,_=t.noDragEventsBubbling,z=t.onError,V=t.validator,F=x.useMemo(function(){return HD(n)},[n]),L=x.useMemo(function(){return BD(n)},[n]),X=x.useMemo(function(){return typeof k=="function"?k:W0},[k]),$=x.useMemo(function(){return typeof w=="function"?w:W0},[w]),Q=x.useRef(null),ie=x.useRef(null),oe=x.useReducer(nO,Vf),U=Wd(oe,2),K=U[0],ne=U[1],ce=K.isFocused,Re=K.isFileDialogActive,ze=x.useRef(typeof window<"u"&&window.isSecureContext&&j&&LD()),Me=function(){!ze.current&&Re&&setTimeout(function(){if(ie.current){var se=ie.current.files;se.length||(ne({type:"closeDialog"}),$())}},300)};x.useEffect(function(){return window.addEventListener("focus",Me,!1),function(){window.removeEventListener("focus",Me,!1)}},[ie,Re,$,ze]);var J=x.useRef([]),ue=function(se){Q.current&&Q.current.contains(se.target)||(se.preventDefault(),J.current=[])};x.useEffect(function(){return P&&(document.addEventListener("dragover",B0,!1),document.addEventListener("drop",ue,!1)),function(){P&&(document.removeEventListener("dragover",B0),document.removeEventListener("drop",ue))}},[Q,P]),x.useEffect(function(){return!r&&M&&Q.current&&Q.current.focus(),function(){}},[Q,M,r]);var Ie=x.useCallback(function(q){z?z(q):console.error(q)},[z]),Be=x.useCallback(function(q){q.preventDefault(),q.persist(),N(q),J.current=[].concat(YD(J.current),[q.target]),Nl(q)&&Promise.resolve(i(q)).then(function(se){if(!(vc(q)&&!_)){var Fe=se.length,Ze=Fe>0&&zD({files:se,accept:F,minSize:c,maxSize:s,multiple:u,maxFiles:f,validator:V}),ee=Fe>0&&!Ze;ne({isDragAccept:Ze,isDragReject:ee,isDragActive:!0,type:"setDraggedFiles"}),h&&h(q)}}).catch(function(se){return Ie(se)})},[i,h,Ie,_,F,c,s,u,f,V]),Ne=x.useCallback(function(q){q.preventDefault(),q.persist(),N(q);var se=Nl(q);if(se&&q.dataTransfer)try{q.dataTransfer.dropEffect="copy"}catch{}return se&&g&&g(q),!1},[g,_]),Ge=x.useCallback(function(q){q.preventDefault(),q.persist(),N(q);var se=J.current.filter(function(Ze){return Q.current&&Q.current.contains(Ze)}),Fe=se.indexOf(q.target);Fe!==-1&&se.splice(Fe,1),J.current=se,!(se.length>0)&&(ne({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Nl(q)&&p&&p(q))},[Q,p,_]),Qe=x.useCallback(function(q,se){var Fe=[],Ze=[];q.forEach(function(ee){var He=L4(ee,F),nt=Wd(He,2),Ft=nt[0],pe=nt[1],De=B4(ee,c,s),hn=Wd(De,2),$t=hn[0],pn=hn[1],ir=V?V(ee):null;if(Ft&&$t&&!ir)Fe.push(ee);else{var yi=[pe,pn];ir&&(yi=yi.concat(ir)),Ze.push({file:ee,errors:yi.filter(function(da){return da})})}}),(!u&&Fe.length>1||u&&f>=1&&Fe.length>f)&&(Fe.forEach(function(ee){Ze.push({file:ee,errors:[AD]})}),Fe.splice(0)),ne({acceptedFiles:Fe,fileRejections:Ze,type:"setFiles"}),y&&y(Fe,Ze,se),Ze.length>0&&C&&C(Ze,se),Fe.length>0&&S&&S(Fe,se)},[ne,u,F,c,s,f,y,S,C,V]),ve=x.useCallback(function(q){q.preventDefault(),q.persist(),N(q),J.current=[],Nl(q)&&Promise.resolve(i(q)).then(function(se){vc(q)&&!_||Qe(se,q)}).catch(function(se){return Ie(se)}),ne({type:"reset"})},[i,Qe,Ie,_]),_e=x.useCallback(function(){if(ze.current){ne({type:"openDialog"}),X();var q={multiple:u,types:L};window.showOpenFilePicker(q).then(function(se){return i(se)}).then(function(se){Qe(se,null),ne({type:"closeDialog"})}).catch(function(se){WD(se)?($(se),ne({type:"closeDialog"})):VD(se)?(ze.current=!1,ie.current?(ie.current.value=null,ie.current.click()):Ie(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."))):Ie(se)});return}ie.current&&(ne({type:"openDialog"}),X(),ie.current.value=null,ie.current.click())},[ne,X,$,j,Qe,Ie,L,u]),qe=x.useCallback(function(q){!Q.current||!Q.current.isEqualNode(q.target)||(q.key===" "||q.key==="Enter"||q.keyCode===32||q.keyCode===13)&&(q.preventDefault(),_e())},[Q,_e]),ge=x.useCallback(function(){ne({type:"focus"})},[]),Te=x.useCallback(function(){ne({type:"blur"})},[]),et=x.useCallback(function(){I||(FD()?setTimeout(_e,0):_e())},[I,_e]),Ve=function(se){return r?null:se},vt=function(se){return T?null:Ve(se)},Nt=function(se){return D?null:Ve(se)},N=function(se){_&&se.stopPropagation()},de=x.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=q.refKey,Fe=se===void 0?"ref":se,Ze=q.role,ee=q.onKeyDown,He=q.onFocus,nt=q.onBlur,Ft=q.onClick,pe=q.onDragEnter,De=q.onDragOver,hn=q.onDragLeave,$t=q.onDrop,pn=gc(q,GD);return Ot(Ot(Wf({onKeyDown:vt(hr(ee,qe)),onFocus:vt(hr(He,ge)),onBlur:vt(hr(nt,Te)),onClick:Ve(hr(Ft,et)),onDragEnter:Nt(hr(pe,Be)),onDragOver:Nt(hr(De,Ne)),onDragLeave:Nt(hr(hn,Ge)),onDrop:Nt(hr($t,ve)),role:typeof Ze=="string"&&Ze!==""?Ze:"presentation"},Fe,Q),!r&&!T?{tabIndex:0}:{}),pn)}},[Q,qe,ge,Te,et,Be,Ne,Ge,ve,T,D,r]),xe=x.useCallback(function(q){q.stopPropagation()},[]),je=x.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},se=q.refKey,Fe=se===void 0?"ref":se,Ze=q.onChange,ee=q.onClick,He=gc(q,qD),nt=Wf({accept:F,multiple:u,type:"file",style:{display:"none"},onChange:Ve(hr(Ze,ve)),onClick:Ve(hr(ee,xe)),tabIndex:-1},Fe,ie);return Ot(Ot({},nt),He)}},[ie,n,u,ve,r]);return Ot(Ot({},K),{},{isFocused:ce&&!r,getRootProps:de,getInputProps:je,rootRef:Q,inputRef:ie,open:Ve(_e)})}function nO(e,t){switch(t.type){case"focus":return Ot(Ot({},e),{},{isFocused:!0});case"blur":return Ot(Ot({},e),{},{isFocused:!1});case"openDialog":return Ot(Ot({},Vf),{},{isFileDialogActive:!0});case"closeDialog":return Ot(Ot({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Ot(Ot({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Ot(Ot({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Ot({},Vf);default:return e}}function W0(){}const rO=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return fe("esc",()=>{i(!1)}),l.jsx(We,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:l.jsx(B,{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(Vn,{size:"lg",children:["Upload Image",r]}):l.jsxs(l.Fragment,{children:[l.jsx(Vn,{size:"lg",children:"Invalid Upload"}),l.jsx(Vn,{size:"md",children:"Must be single JPEG or PNG image"})]})})})},iO=e=>{const{children:t}=e,n=Y(),r=O(Bt),i=us({}),{t:s}=Z(),[c,u]=x.useState(!1),{setOpenUploader:f}=Zh(),h=x.useCallback(P=>{u(!0);const I=P.errors.reduce((T,D)=>`${T}
|
||
${D.message}`,"");i({title:s("toast.uploadFailed"),description:I,status:"error",isClosable:!0})},[s,i]),p=x.useCallback(async P=>{n(Ug({imageFile:P}))},[n]),g=x.useCallback((P,I)=>{I.forEach(T=>{h(T)}),P.forEach(T=>{p(T)})},[p,h]),{getRootProps:y,getInputProps:S,isDragAccept:C,isDragReject:w,isDragActive:k,open:j}=$4({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:g,onDragOver:()=>u(!0),maxFiles:1});f(j),x.useEffect(()=>{const P=I=>{var z;const T=(z=I.clipboardData)==null?void 0:z.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(I.stopImmediatePropagation(),D.length>1){i({description:s("toast.uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const _=D[0].getAsFile();if(!_){i({description:s("toast.uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(Ug({imageFile:_}))};return document.addEventListener("paste",P),()=>{document.removeEventListener("paste",P)}},[s,n,i,r]);const M=["img2img","unifiedCanvas"].includes(r)?` to ${Dn[r].tooltip}`:"";return l.jsx(Qh.Provider,{value:j,children:l.jsxs(We,{...y({style:{}}),onKeyDown:P=>{P.key},children:[l.jsx("input",{...S()}),t,k&&c&&l.jsx(rO,{isDragAccept:C,isDragReject:w,overlaySecondaryText:M,setIsHandlingUpload:u})]})})},oO=be(Pt,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),aO=be(Pt,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),sO=()=>{const e=Y(),t=O(oO),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=O(aO),[s,c]=x.useState(!0),u=x.useRef(null);x.useLayoutEffect(()=>{u.current!==null&&s&&(u.current.scrollTop=u.current.scrollHeight)},[s,t,n]);const f=()=>{e(f2()),e(vd(!n))};fe("`",()=>{e(vd(!n))},[n]),fe("esc",()=>{e(vd(!1))});const h=()=>{u.current&&s&&u.current.scrollTop<u.current.scrollHeight-u.current.clientHeight&&c(!1)};return l.jsxs(l.Fragment,{children:[n&&l.jsx(Ly,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",insetInlineStart:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:l.jsx(B,{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:u,onScroll:h,children:t.map((p,g)=>{const{timestamp:y,message:S,level:C}=p,w=C==="info"?"base":C;return l.jsxs(B,{sx:{gap:2,color:`${w}.300`},children:[l.jsxs(Ce,{fontWeight:"600",children:[y,":"]}),l.jsx(Ce,{wordBreak:"break-all",children:S})]},g)})})}),n&&l.jsx(Yt,{hasArrow:!0,label:s?"Autoscroll On":"Autoscroll Off",children:l.jsx(le,{size:"sm","aria-label":"Toggle autoscroll",icon:l.jsx(E8,{}),onClick:()=>c(!s),isChecked:s,sx:{position:"fixed",insetInlineStart:2,bottom:12,zIndex:"10000"}})}),l.jsx(Yt,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:l.jsx(le,{size:"sm","aria-label":"Toggle Log Viewer",icon:n?l.jsx(V8,{}):l.jsx(Ty,{}),onClick:f,sx:{position:"fixed",insetInlineStart:2,bottom:2,zIndex:"10000"},colorScheme:r||!i?"error":"base"})})]})},lO=be(Pt,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),cO=()=>{const{t:e}=Z(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:i}=O(lO),s=n?Math.round(n*100/r):0;return l.jsx(ey,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!i,height:fp,zIndex:99})};function uO(e){const{title:t,hotkey:n,description:r}=e;return l.jsxs($n,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs($n,{children:[l.jsx(Ce,{fontWeight:600,children:t}),r&&l.jsx(Ce,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),l.jsx(We,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function dO({children:e}){const{isOpen:t,onOpen:n,onClose:r}=ui(),{t:i}=Z(),s=[{title:i("hotkeys.invoke.title"),desc:i("hotkeys.invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys.cancel.title"),desc:i("hotkeys.cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys.focusPrompt.title"),desc:i("hotkeys.focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys.toggleOptions.title"),desc:i("hotkeys.toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys.pinOptions.title"),desc:i("hotkeys.pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys.toggleViewer.title"),desc:i("hotkeys.toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys.toggleGallery.title"),desc:i("hotkeys.toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys.maximizeWorkSpace.title"),desc:i("hotkeys.maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys.changeTabs.title"),desc:i("hotkeys.changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys.consoleToggle.title"),desc:i("hotkeys.consoleToggle.desc"),hotkey:"`"}],c=[{title:i("hotkeys.setPrompt.title"),desc:i("hotkeys.setPrompt.desc"),hotkey:"P"},{title:i("hotkeys.setSeed.title"),desc:i("hotkeys.setSeed.desc"),hotkey:"S"},{title:i("hotkeys.setParameters.title"),desc:i("hotkeys.setParameters.desc"),hotkey:"A"},{title:i("hotkeys.restoreFaces.title"),desc:i("hotkeys.restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys.upscale.title"),desc:i("hotkeys.upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys.showInfo.title"),desc:i("hotkeys.showInfo.desc"),hotkey:"I"},{title:i("hotkeys.sendToImageToImage.title"),desc:i("hotkeys.sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys.deleteImage.title"),desc:i("hotkeys.deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys.closePanels.title"),desc:i("hotkeys.closePanels.desc"),hotkey:"Esc"}],u=[{title:i("hotkeys.previousImage.title"),desc:i("hotkeys.previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys.nextImage.title"),desc:i("hotkeys.nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys.toggleGalleryPin.title"),desc:i("hotkeys.toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys.increaseGalleryThumbSize.title"),desc:i("hotkeys.increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys.decreaseGalleryThumbSize.title"),desc:i("hotkeys.decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],f=[{title:i("hotkeys.selectBrush.title"),desc:i("hotkeys.selectBrush.desc"),hotkey:"B"},{title:i("hotkeys.selectEraser.title"),desc:i("hotkeys.selectEraser.desc"),hotkey:"E"},{title:i("hotkeys.decreaseBrushSize.title"),desc:i("hotkeys.decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys.increaseBrushSize.title"),desc:i("hotkeys.increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys.decreaseBrushOpacity.title"),desc:i("hotkeys.decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys.increaseBrushOpacity.title"),desc:i("hotkeys.increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys.moveTool.title"),desc:i("hotkeys.moveTool.desc"),hotkey:"V"},{title:i("hotkeys.fillBoundingBox.title"),desc:i("hotkeys.fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys.eraseBoundingBox.title"),desc:i("hotkeys.eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys.colorPicker.title"),desc:i("hotkeys.colorPicker.desc"),hotkey:"C"},{title:i("hotkeys.toggleSnap.title"),desc:i("hotkeys.toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys.quickToggleMove.title"),desc:i("hotkeys.quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys.toggleLayer.title"),desc:i("hotkeys.toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys.clearMask.title"),desc:i("hotkeys.clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys.hideMask.title"),desc:i("hotkeys.hideMask.desc"),hotkey:"H"},{title:i("hotkeys.showHideBoundingBox.title"),desc:i("hotkeys.showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys.mergeVisible.title"),desc:i("hotkeys.mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys.saveToGallery.title"),desc:i("hotkeys.saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys.copyToClipboard.title"),desc:i("hotkeys.copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys.downloadImage.title"),desc:i("hotkeys.downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys.undoStroke.title"),desc:i("hotkeys.undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys.redoStroke.title"),desc:i("hotkeys.redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys.resetView.title"),desc:i("hotkeys.resetView.desc"),hotkey:"R"},{title:i("hotkeys.previousStagingImage.title"),desc:i("hotkeys.previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys.nextStagingImage.title"),desc:i("hotkeys.nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys.acceptStagingImage.title"),desc:i("hotkeys.acceptStagingImage.desc"),hotkey:"Enter"}],h=p=>l.jsx(B,{flexDir:"column",gap:4,children:p.map((g,y)=>l.jsxs(B,{flexDir:"column",px:2,gap:4,children:[l.jsx(uO,{title:g.title,description:g.desc,hotkey:g.hotkey}),y<p.length-1&&l.jsx(wx,{})]},y))});return l.jsxs(l.Fragment,{children:[x.cloneElement(e,{onClick:n}),l.jsxs(di,{isOpen:t,onClose:r,children:[l.jsx(Nr,{}),l.jsxs(fi,{children:[l.jsx(Rr,{children:i("hotkeys.keyboardShortcuts")}),l.jsx(ca,{}),l.jsx(Fr,{children:l.jsxs(sh,{allowMultiple:!0,children:[l.jsxs(No,{children:[l.jsx(zo,{children:l.jsxs(B,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:i("hotkeys.appHotkeys")}),l.jsx(Ro,{})]})}),l.jsx(Lo,{children:h(s)})]}),l.jsxs(No,{children:[l.jsx(zo,{children:l.jsxs(B,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:i("hotkeys.generalHotkeys")}),l.jsx(Ro,{})]})}),l.jsx(Lo,{children:h(c)})]}),l.jsxs(No,{children:[l.jsx(zo,{children:l.jsxs(B,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:i("hotkeys.galleryHotkeys")}),l.jsx(Ro,{})]})}),l.jsx(Lo,{children:h(u)})]}),l.jsxs(No,{children:[l.jsx(zo,{children:l.jsxs(B,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:i("hotkeys.unifiedCanvasHotkeys")}),l.jsx(Ro,{})]})}),l.jsx(Lo,{children:h(f)})]})]})}),l.jsx(zr,{})]})]})]})}var V0=Array.isArray,U0=Object.keys,fO=Object.prototype.hasOwnProperty,hO=typeof Element<"u";function Uf(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=V0(e),r=V0(t),i,s,c;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!Uf(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var u=e instanceof Date,f=t instanceof Date;if(u!=f)return!1;if(u&&f)return e.getTime()==t.getTime();var h=e instanceof RegExp,p=t instanceof RegExp;if(h!=p)return!1;if(h&&p)return e.toString()==t.toString();var g=U0(e);if(s=g.length,s!==U0(t).length)return!1;for(i=s;i--!==0;)if(!fO.call(t,g[i]))return!1;if(hO&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(c=g[i],!(c==="_owner"&&e.$$typeof)&&!Uf(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}var ri=function(t,n){try{return Uf(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}},pO=function(t){return mO(t)&&!vO(t)};function mO(e){return!!e&&typeof e=="object"}function vO(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||yO(e)}var gO=typeof Symbol=="function"&&Symbol.for,xO=gO?Symbol.for("react.element"):60103;function yO(e){return e.$$typeof===xO}function bO(e){return Array.isArray(e)?[]:{}}function xc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?ts(bO(e),e,t):e}function SO(e,t,n){return e.concat(t).map(function(r){return xc(r,n)})}function CO(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=xc(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=xc(t[i],n):r[i]=ts(e[i],t[i],n)}),r}function ts(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||SO,n.isMergeableObject=n.isMergeableObject||pO;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):CO(e,t,n):xc(t,n)}ts.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return ts(r,i,n)},{})};var $f=ts,wO=typeof global=="object"&&global&&global.Object===Object&&global;const G4=wO;var kO=typeof self=="object"&&self&&self.Object===Object&&self,jO=G4||kO||Function("return this")();const kr=jO;var EO=kr.Symbol;const hi=EO;var q4=Object.prototype,PO=q4.hasOwnProperty,IO=q4.toString,Ra=hi?hi.toStringTag:void 0;function MO(e){var t=PO.call(e,Ra),n=e[Ra];try{e[Ra]=void 0;var r=!0}catch{}var i=IO.call(e);return r&&(t?e[Ra]=n:delete e[Ra]),i}var TO=Object.prototype,_O=TO.toString;function DO(e){return _O.call(e)}var OO="[object Null]",AO="[object Undefined]",$0=hi?hi.toStringTag:void 0;function ao(e){return e==null?e===void 0?AO:OO:$0&&$0 in Object(e)?MO(e):DO(e)}function Y4(e,t){return function(n){return e(t(n))}}var zO=Y4(Object.getPrototypeOf,Object);const Fp=zO;function so(e){return e!=null&&typeof e=="object"}var RO="[object Object]",NO=Function.prototype,FO=Object.prototype,X4=NO.toString,LO=FO.hasOwnProperty,BO=X4.call(Object);function G0(e){if(!so(e)||ao(e)!=RO)return!1;var t=Fp(e);if(t===null)return!0;var n=LO.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&X4.call(n)==BO}function HO(){this.__data__=[],this.size=0}function K4(e,t){return e===t||e!==e&&t!==t}function $c(e,t){for(var n=e.length;n--;)if(K4(e[n][0],t))return n;return-1}var WO=Array.prototype,VO=WO.splice;function UO(e){var t=this.__data__,n=$c(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():VO.call(t,n,1),--this.size,!0}function $O(e){var t=this.__data__,n=$c(t,e);return n<0?void 0:t[n][1]}function GO(e){return $c(this.__data__,e)>-1}function qO(e,t){var n=this.__data__,r=$c(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function $r(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])}}$r.prototype.clear=HO;$r.prototype.delete=UO;$r.prototype.get=$O;$r.prototype.has=GO;$r.prototype.set=qO;function YO(){this.__data__=new $r,this.size=0}function XO(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function KO(e){return this.__data__.get(e)}function QO(e){return this.__data__.has(e)}function Ss(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ZO="[object AsyncFunction]",JO="[object Function]",eA="[object GeneratorFunction]",tA="[object Proxy]";function Q4(e){if(!Ss(e))return!1;var t=ao(e);return t==JO||t==eA||t==ZO||t==tA}var nA=kr["__core-js_shared__"];const Vd=nA;var q0=function(){var e=/[^.]+$/.exec(Vd&&Vd.keys&&Vd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function rA(e){return!!q0&&q0 in e}var iA=Function.prototype,oA=iA.toString;function lo(e){if(e!=null){try{return oA.call(e)}catch{}try{return e+""}catch{}}return""}var aA=/[\\^$.*+?()[\]{}|]/g,sA=/^\[object .+?Constructor\]$/,lA=Function.prototype,cA=Object.prototype,uA=lA.toString,dA=cA.hasOwnProperty,fA=RegExp("^"+uA.call(dA).replace(aA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hA(e){if(!Ss(e)||rA(e))return!1;var t=Q4(e)?fA:sA;return t.test(lo(e))}function pA(e,t){return e==null?void 0:e[t]}function co(e,t){var n=pA(e,t);return hA(n)?n:void 0}var mA=co(kr,"Map");const ns=mA;var vA=co(Object,"create");const rs=vA;function gA(){this.__data__=rs?rs(null):{},this.size=0}function xA(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var yA="__lodash_hash_undefined__",bA=Object.prototype,SA=bA.hasOwnProperty;function CA(e){var t=this.__data__;if(rs){var n=t[e];return n===yA?void 0:n}return SA.call(t,e)?t[e]:void 0}var wA=Object.prototype,kA=wA.hasOwnProperty;function jA(e){var t=this.__data__;return rs?t[e]!==void 0:kA.call(t,e)}var EA="__lodash_hash_undefined__";function PA(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=rs&&t===void 0?EA:t,this}function Qi(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])}}Qi.prototype.clear=gA;Qi.prototype.delete=xA;Qi.prototype.get=CA;Qi.prototype.has=jA;Qi.prototype.set=PA;function IA(){this.size=0,this.__data__={hash:new Qi,map:new(ns||$r),string:new Qi}}function MA(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Gc(e,t){var n=e.__data__;return MA(t)?n[typeof t=="string"?"string":"hash"]:n.map}function TA(e){var t=Gc(this,e).delete(e);return this.size-=t?1:0,t}function _A(e){return Gc(this,e).get(e)}function DA(e){return Gc(this,e).has(e)}function OA(e,t){var n=Gc(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function xi(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])}}xi.prototype.clear=IA;xi.prototype.delete=TA;xi.prototype.get=_A;xi.prototype.has=DA;xi.prototype.set=OA;var AA=200;function zA(e,t){var n=this.__data__;if(n instanceof $r){var r=n.__data__;if(!ns||r.length<AA-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new xi(r)}return n.set(e,t),this.size=n.size,this}function ua(e){var t=this.__data__=new $r(e);this.size=t.size}ua.prototype.clear=YO;ua.prototype.delete=XO;ua.prototype.get=KO;ua.prototype.has=QO;ua.prototype.set=zA;function RA(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var NA=function(){try{var e=co(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Y0=NA;function Z4(e,t,n){t=="__proto__"&&Y0?Y0(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var FA=Object.prototype,LA=FA.hasOwnProperty;function J4(e,t,n){var r=e[t];(!(LA.call(e,t)&&K4(r,n))||n===void 0&&!(t in e))&&Z4(e,t,n)}function qc(e,t,n,r){var i=!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]),i?Z4(n,u,f):J4(n,u,f)}return n}function BA(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var HA="[object Arguments]";function X0(e){return so(e)&&ao(e)==HA}var eb=Object.prototype,WA=eb.hasOwnProperty,VA=eb.propertyIsEnumerable,UA=X0(function(){return arguments}())?X0:function(e){return so(e)&&WA.call(e,"callee")&&!VA.call(e,"callee")};const $A=UA;var GA=Array.isArray;const Cs=GA;function qA(){return!1}var tb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,K0=tb&&typeof module=="object"&&module&&!module.nodeType&&module,YA=K0&&K0.exports===tb,Q0=YA?kr.Buffer:void 0,XA=Q0?Q0.isBuffer:void 0,KA=XA||qA;const nb=KA;var QA=9007199254740991,ZA=/^(?:0|[1-9]\d*)$/;function JA(e,t){var n=typeof e;return t=t??QA,!!t&&(n=="number"||n!="symbol"&&ZA.test(e))&&e>-1&&e%1==0&&e<t}var ez=9007199254740991;function rb(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ez}var tz="[object Arguments]",nz="[object Array]",rz="[object Boolean]",iz="[object Date]",oz="[object Error]",az="[object Function]",sz="[object Map]",lz="[object Number]",cz="[object Object]",uz="[object RegExp]",dz="[object Set]",fz="[object String]",hz="[object WeakMap]",pz="[object ArrayBuffer]",mz="[object DataView]",vz="[object Float32Array]",gz="[object Float64Array]",xz="[object Int8Array]",yz="[object Int16Array]",bz="[object Int32Array]",Sz="[object Uint8Array]",Cz="[object Uint8ClampedArray]",wz="[object Uint16Array]",kz="[object Uint32Array]",Ct={};Ct[vz]=Ct[gz]=Ct[xz]=Ct[yz]=Ct[bz]=Ct[Sz]=Ct[Cz]=Ct[wz]=Ct[kz]=!0;Ct[tz]=Ct[nz]=Ct[pz]=Ct[rz]=Ct[mz]=Ct[iz]=Ct[oz]=Ct[az]=Ct[sz]=Ct[lz]=Ct[cz]=Ct[uz]=Ct[dz]=Ct[fz]=Ct[hz]=!1;function jz(e){return so(e)&&rb(e.length)&&!!Ct[ao(e)]}function Lp(e){return function(t){return e(t)}}var ib=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$a=ib&&typeof module=="object"&&module&&!module.nodeType&&module,Ez=$a&&$a.exports===ib,Ud=Ez&&G4.process,Pz=function(){try{var e=$a&&$a.require&&$a.require("util").types;return e||Ud&&Ud.binding&&Ud.binding("util")}catch{}}();const na=Pz;var Z0=na&&na.isTypedArray,Iz=Z0?Lp(Z0):jz;const Mz=Iz;var Tz=Object.prototype,_z=Tz.hasOwnProperty;function ob(e,t){var n=Cs(e),r=!n&&$A(e),i=!n&&!r&&nb(e),s=!n&&!r&&!i&&Mz(e),c=n||r||i||s,u=c?BA(e.length,String):[],f=u.length;for(var h in e)(t||_z.call(e,h))&&!(c&&(h=="length"||i&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||JA(h,f)))&&u.push(h);return u}var Dz=Object.prototype;function Bp(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Dz;return e===n}var Oz=Y4(Object.keys,Object);const Az=Oz;var zz=Object.prototype,Rz=zz.hasOwnProperty;function Nz(e){if(!Bp(e))return Az(e);var t=[];for(var n in Object(e))Rz.call(e,n)&&n!="constructor"&&t.push(n);return t}function ab(e){return e!=null&&rb(e.length)&&!Q4(e)}function Hp(e){return ab(e)?ob(e):Nz(e)}function Fz(e,t){return e&&qc(t,Hp(t),e)}function Lz(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Bz=Object.prototype,Hz=Bz.hasOwnProperty;function Wz(e){if(!Ss(e))return Lz(e);var t=Bp(e),n=[];for(var r in e)r=="constructor"&&(t||!Hz.call(e,r))||n.push(r);return n}function Wp(e){return ab(e)?ob(e,!0):Wz(e)}function Vz(e,t){return e&&qc(t,Wp(t),e)}var sb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,J0=sb&&typeof module=="object"&&module&&!module.nodeType&&module,Uz=J0&&J0.exports===sb,e1=Uz?kr.Buffer:void 0,t1=e1?e1.allocUnsafe:void 0;function $z(e,t){if(t)return e.slice();var n=e.length,r=t1?t1(n):new e.constructor(n);return e.copy(r),r}function lb(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function Gz(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var c=e[n];t(c,n,e)&&(s[i++]=c)}return s}function cb(){return[]}var qz=Object.prototype,Yz=qz.propertyIsEnumerable,n1=Object.getOwnPropertySymbols,Xz=n1?function(e){return e==null?[]:(e=Object(e),Gz(n1(e),function(t){return Yz.call(e,t)}))}:cb;const Vp=Xz;function Kz(e,t){return qc(e,Vp(e),t)}function ub(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Qz=Object.getOwnPropertySymbols,Zz=Qz?function(e){for(var t=[];e;)ub(t,Vp(e)),e=Fp(e);return t}:cb;const db=Zz;function Jz(e,t){return qc(e,db(e),t)}function fb(e,t,n){var r=t(e);return Cs(e)?r:ub(r,n(e))}function eR(e){return fb(e,Hp,Vp)}function tR(e){return fb(e,Wp,db)}var nR=co(kr,"DataView");const Gf=nR;var rR=co(kr,"Promise");const qf=rR;var iR=co(kr,"Set");const Yf=iR;var oR=co(kr,"WeakMap");const Xf=oR;var r1="[object Map]",aR="[object Object]",i1="[object Promise]",o1="[object Set]",a1="[object WeakMap]",s1="[object DataView]",sR=lo(Gf),lR=lo(ns),cR=lo(qf),uR=lo(Yf),dR=lo(Xf),Ri=ao;(Gf&&Ri(new Gf(new ArrayBuffer(1)))!=s1||ns&&Ri(new ns)!=r1||qf&&Ri(qf.resolve())!=i1||Yf&&Ri(new Yf)!=o1||Xf&&Ri(new Xf)!=a1)&&(Ri=function(e){var t=ao(e),n=t==aR?e.constructor:void 0,r=n?lo(n):"";if(r)switch(r){case sR:return s1;case lR:return r1;case cR:return i1;case uR:return o1;case dR:return a1}return t});const Up=Ri;var fR=Object.prototype,hR=fR.hasOwnProperty;function pR(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&hR.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var mR=kr.Uint8Array;const l1=mR;function $p(e){var t=new e.constructor(e.byteLength);return new l1(t).set(new l1(e)),t}function vR(e,t){var n=t?$p(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var gR=/\w*$/;function xR(e){var t=new e.constructor(e.source,gR.exec(e));return t.lastIndex=e.lastIndex,t}var c1=hi?hi.prototype:void 0,u1=c1?c1.valueOf:void 0;function yR(e){return u1?Object(u1.call(e)):{}}function bR(e,t){var n=t?$p(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var SR="[object Boolean]",CR="[object Date]",wR="[object Map]",kR="[object Number]",jR="[object RegExp]",ER="[object Set]",PR="[object String]",IR="[object Symbol]",MR="[object ArrayBuffer]",TR="[object DataView]",_R="[object Float32Array]",DR="[object Float64Array]",OR="[object Int8Array]",AR="[object Int16Array]",zR="[object Int32Array]",RR="[object Uint8Array]",NR="[object Uint8ClampedArray]",FR="[object Uint16Array]",LR="[object Uint32Array]";function BR(e,t,n){var r=e.constructor;switch(t){case MR:return $p(e);case SR:case CR:return new r(+e);case TR:return vR(e,n);case _R:case DR:case OR:case AR:case zR:case RR:case NR:case FR:case LR:return bR(e,n);case wR:return new r;case kR:case PR:return new r(e);case jR:return xR(e);case ER:return new r;case IR:return yR(e)}}var d1=Object.create,HR=function(){function e(){}return function(t){if(!Ss(t))return{};if(d1)return d1(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const WR=HR;function VR(e){return typeof e.constructor=="function"&&!Bp(e)?WR(Fp(e)):{}}var UR="[object Map]";function $R(e){return so(e)&&Up(e)==UR}var f1=na&&na.isMap,GR=f1?Lp(f1):$R;const qR=GR;var YR="[object Set]";function XR(e){return so(e)&&Up(e)==YR}var h1=na&&na.isSet,KR=h1?Lp(h1):XR;const QR=KR;var ZR=1,JR=2,eN=4,hb="[object Arguments]",tN="[object Array]",nN="[object Boolean]",rN="[object Date]",iN="[object Error]",pb="[object Function]",oN="[object GeneratorFunction]",aN="[object Map]",sN="[object Number]",mb="[object Object]",lN="[object RegExp]",cN="[object Set]",uN="[object String]",dN="[object Symbol]",fN="[object WeakMap]",hN="[object ArrayBuffer]",pN="[object DataView]",mN="[object Float32Array]",vN="[object Float64Array]",gN="[object Int8Array]",xN="[object Int16Array]",yN="[object Int32Array]",bN="[object Uint8Array]",SN="[object Uint8ClampedArray]",CN="[object Uint16Array]",wN="[object Uint32Array]",yt={};yt[hb]=yt[tN]=yt[hN]=yt[pN]=yt[nN]=yt[rN]=yt[mN]=yt[vN]=yt[gN]=yt[xN]=yt[yN]=yt[aN]=yt[sN]=yt[mb]=yt[lN]=yt[cN]=yt[uN]=yt[dN]=yt[bN]=yt[SN]=yt[CN]=yt[wN]=!0;yt[iN]=yt[pb]=yt[fN]=!1;function Ga(e,t,n,r,i,s){var c,u=t&ZR,f=t&JR,h=t&eN;if(n&&(c=i?n(e,r,i,s):n(e)),c!==void 0)return c;if(!Ss(e))return e;var p=Cs(e);if(p){if(c=pR(e),!u)return lb(e,c)}else{var g=Up(e),y=g==pb||g==oN;if(nb(e))return $z(e,u);if(g==mb||g==hb||y&&!i){if(c=f||y?{}:VR(e),!u)return f?Jz(e,Vz(c,e)):Kz(e,Fz(c,e))}else{if(!yt[g])return i?e:{};c=BR(e,g,u)}}s||(s=new ua);var S=s.get(e);if(S)return S;s.set(e,c),QR(e)?e.forEach(function(k){c.add(Ga(k,t,n,k,e,s))}):qR(e)&&e.forEach(function(k,j){c.set(j,Ga(k,t,n,j,e,s))});var C=h?f?tR:eR:f?Wp:Hp,w=p?void 0:C(e);return RA(w||e,function(k,j){w&&(j=k,k=e[j]),J4(c,j,Ga(k,t,n,j,e,s))}),c}var kN=4;function p1(e){return Ga(e,kN)}function vb(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var jN="[object Symbol]";function Gp(e){return typeof e=="symbol"||so(e)&&ao(e)==jN}var EN="Expected a function";function qp(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(EN);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var c=e.apply(this,r);return n.cache=s.set(i,c)||s,c};return n.cache=new(qp.Cache||xi),n}qp.Cache=xi;var PN=500;function IN(e){var t=qp(e,function(r){return n.size===PN&&n.clear(),r}),n=t.cache;return t}var MN=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,TN=/\\(\\)?/g,_N=IN(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(MN,function(n,r,i,s){t.push(i?s.replace(TN,"$1"):r||n)}),t});const DN=_N;var ON=1/0;function AN(e){if(typeof e=="string"||Gp(e))return e;var t=e+"";return t=="0"&&1/e==-ON?"-0":t}var zN=1/0,m1=hi?hi.prototype:void 0,v1=m1?m1.toString:void 0;function gb(e){if(typeof e=="string")return e;if(Cs(e))return vb(e,gb)+"";if(Gp(e))return v1?v1.call(e):"";var t=e+"";return t=="0"&&1/e==-zN?"-0":t}function RN(e){return e==null?"":gb(e)}function xb(e){return Cs(e)?vb(e,AN):Gp(e)?[e]:lb(DN(RN(e)))}var NN=!0;function FN(e,t){if(!NN){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}var LN=1,BN=4;function HN(e){return Ga(e,LN|BN)}function ht(){return ht=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},ht.apply(this,arguments)}function WN(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Li(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function g1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var x1=function(t){return Array.isArray(t)&&t.length===0},kn=function(t){return typeof t=="function"},Yc=function(t){return t!==null&&typeof t=="object"},VN=function(t){return String(Math.floor(Number(t)))===t},$d=function(t){return Object.prototype.toString.call(t)==="[object String]"},yb=function(t){return x.Children.count(t)===0},Gd=function(t){return Yc(t)&&kn(t.then)};function rn(e,t,n,r){r===void 0&&(r=0);for(var i=xb(t);e&&r<i.length;)e=e[i[r++]];return e===void 0?n:e}function br(e,t,n){for(var r=p1(e),i=r,s=0,c=xb(t);s<c.length-1;s++){var u=c[s],f=rn(e,c.slice(0,s+1));if(f&&(Yc(f)||Array.isArray(f)))i=i[u]=p1(f);else{var h=c[s+1];i=i[u]=VN(h)&&Number(h)>=0?[]:{}}}return(s===0?e:i)[c[s]]===n?e:(n===void 0?delete i[c[s]]:i[c[s]]=n,s===0&&n===void 0&&delete r[c[s]],r)}function bb(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,s=Object.keys(e);i<s.length;i++){var c=s[i],u=e[c];Yc(u)?n.get(u)||(n.set(u,!0),r[c]=Array.isArray(u)?[]:{},bb(u,t,n,r[c])):r[c]=t}return r}var Xc=x.createContext(void 0);Xc.displayName="FormikContext";var UN=Xc.Provider;Xc.Consumer;function Sb(){var e=x.useContext(Xc);return e||FN(!1),e}function $N(e,t){switch(t.type){case"SET_VALUES":return ht({},e,{values:t.payload});case"SET_TOUCHED":return ht({},e,{touched:t.payload});case"SET_ERRORS":return ri(e.errors,t.payload)?e:ht({},e,{errors:t.payload});case"SET_STATUS":return ht({},e,{status:t.payload});case"SET_ISSUBMITTING":return ht({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return ht({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return ht({},e,{values:br(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return ht({},e,{touched:br(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return ht({},e,{errors:br(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return ht({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return ht({},e,{touched:bb(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return ht({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return ht({},e,{isSubmitting:!1});default:return e}}var Oi={},Fl={};function GN(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,i=r===void 0?!0:r,s=e.validateOnMount,c=s===void 0?!1:s,u=e.isInitialValid,f=e.enableReinitialize,h=f===void 0?!1:f,p=e.onSubmit,g=Li(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),y=ht({validateOnChange:n,validateOnBlur:i,validateOnMount:c,onSubmit:p},g),S=x.useRef(y.initialValues),C=x.useRef(y.initialErrors||Oi),w=x.useRef(y.initialTouched||Fl),k=x.useRef(y.initialStatus),j=x.useRef(!1),M=x.useRef({});x.useEffect(function(){return j.current=!0,function(){j.current=!1}},[]);var P=x.useReducer($N,{values:y.initialValues,errors:y.initialErrors||Oi,touched:y.initialTouched||Fl,status:y.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),I=P[0],T=P[1],D=x.useCallback(function(N,de){return new Promise(function(xe,je){var q=y.validate(N,de);q==null?xe(Oi):Gd(q)?q.then(function(se){xe(se||Oi)},function(se){je(se)}):xe(q)})},[y.validate]),_=x.useCallback(function(N,de){var xe=y.validationSchema,je=kn(xe)?xe(de):xe,q=de&&je.validateAt?je.validateAt(de,N):YN(N,je);return new Promise(function(se,Fe){q.then(function(){se(Oi)},function(Ze){Ze.name==="ValidationError"?se(qN(Ze)):Fe(Ze)})})},[y.validationSchema]),z=x.useCallback(function(N,de){return new Promise(function(xe){return xe(M.current[N].validate(de))})},[]),V=x.useCallback(function(N){var de=Object.keys(M.current).filter(function(je){return kn(M.current[je].validate)}),xe=de.length>0?de.map(function(je){return z(je,rn(N,je))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(xe).then(function(je){return je.reduce(function(q,se,Fe){return se==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||se&&(q=br(q,de[Fe],se)),q},{})})},[z]),F=x.useCallback(function(N){return Promise.all([V(N),y.validationSchema?_(N):{},y.validate?D(N):{}]).then(function(de){var xe=de[0],je=de[1],q=de[2],se=$f.all([xe,je,q],{arrayMerge:XN});return se})},[y.validate,y.validationSchema,V,D,_]),L=Hn(function(N){return N===void 0&&(N=I.values),T({type:"SET_ISVALIDATING",payload:!0}),F(N).then(function(de){return j.current&&(T({type:"SET_ISVALIDATING",payload:!1}),T({type:"SET_ERRORS",payload:de})),de})});x.useEffect(function(){c&&j.current===!0&&ri(S.current,y.initialValues)&&L(S.current)},[c,L]);var X=x.useCallback(function(N){var de=N&&N.values?N.values:S.current,xe=N&&N.errors?N.errors:C.current?C.current:y.initialErrors||{},je=N&&N.touched?N.touched:w.current?w.current:y.initialTouched||{},q=N&&N.status?N.status:k.current?k.current:y.initialStatus;S.current=de,C.current=xe,w.current=je,k.current=q;var se=function(){T({type:"RESET_FORM",payload:{isSubmitting:!!N&&!!N.isSubmitting,errors:xe,touched:je,status:q,values:de,isValidating:!!N&&!!N.isValidating,submitCount:N&&N.submitCount&&typeof N.submitCount=="number"?N.submitCount:0}})};if(y.onReset){var Fe=y.onReset(I.values,ve);Gd(Fe)?Fe.then(se):se()}else se()},[y.initialErrors,y.initialStatus,y.initialTouched]);x.useEffect(function(){j.current===!0&&!ri(S.current,y.initialValues)&&(h&&(S.current=y.initialValues,X()),c&&L(S.current))},[h,y.initialValues,X,c,L]),x.useEffect(function(){h&&j.current===!0&&!ri(C.current,y.initialErrors)&&(C.current=y.initialErrors||Oi,T({type:"SET_ERRORS",payload:y.initialErrors||Oi}))},[h,y.initialErrors]),x.useEffect(function(){h&&j.current===!0&&!ri(w.current,y.initialTouched)&&(w.current=y.initialTouched||Fl,T({type:"SET_TOUCHED",payload:y.initialTouched||Fl}))},[h,y.initialTouched]),x.useEffect(function(){h&&j.current===!0&&!ri(k.current,y.initialStatus)&&(k.current=y.initialStatus,T({type:"SET_STATUS",payload:y.initialStatus}))},[h,y.initialStatus,y.initialTouched]);var $=Hn(function(N){if(M.current[N]&&kn(M.current[N].validate)){var de=rn(I.values,N),xe=M.current[N].validate(de);return Gd(xe)?(T({type:"SET_ISVALIDATING",payload:!0}),xe.then(function(je){return je}).then(function(je){T({type:"SET_FIELD_ERROR",payload:{field:N,value:je}}),T({type:"SET_ISVALIDATING",payload:!1})})):(T({type:"SET_FIELD_ERROR",payload:{field:N,value:xe}}),Promise.resolve(xe))}else if(y.validationSchema)return T({type:"SET_ISVALIDATING",payload:!0}),_(I.values,N).then(function(je){return je}).then(function(je){T({type:"SET_FIELD_ERROR",payload:{field:N,value:je[N]}}),T({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),Q=x.useCallback(function(N,de){var xe=de.validate;M.current[N]={validate:xe}},[]),ie=x.useCallback(function(N){delete M.current[N]},[]),oe=Hn(function(N,de){T({type:"SET_TOUCHED",payload:N});var xe=de===void 0?i:de;return xe?L(I.values):Promise.resolve()}),U=x.useCallback(function(N){T({type:"SET_ERRORS",payload:N})},[]),K=Hn(function(N,de){var xe=kn(N)?N(I.values):N;T({type:"SET_VALUES",payload:xe});var je=de===void 0?n:de;return je?L(xe):Promise.resolve()}),ne=x.useCallback(function(N,de){T({type:"SET_FIELD_ERROR",payload:{field:N,value:de}})},[]),ce=Hn(function(N,de,xe){T({type:"SET_FIELD_VALUE",payload:{field:N,value:de}});var je=xe===void 0?n:xe;return je?L(br(I.values,N,de)):Promise.resolve()}),Re=x.useCallback(function(N,de){var xe=de,je=N,q;if(!$d(N)){N.persist&&N.persist();var se=N.target?N.target:N.currentTarget,Fe=se.type,Ze=se.name,ee=se.id,He=se.value,nt=se.checked,Ft=se.outerHTML,pe=se.options,De=se.multiple;xe=de||Ze||ee,je=/number|range/.test(Fe)?(q=parseFloat(He),isNaN(q)?"":q):/checkbox/.test(Fe)?QN(rn(I.values,xe),nt,He):pe&&De?KN(pe):He}xe&&ce(xe,je)},[ce,I.values]),ze=Hn(function(N){if($d(N))return function(de){return Re(de,N)};Re(N)}),Me=Hn(function(N,de,xe){de===void 0&&(de=!0),T({type:"SET_FIELD_TOUCHED",payload:{field:N,value:de}});var je=xe===void 0?i:xe;return je?L(I.values):Promise.resolve()}),J=x.useCallback(function(N,de){N.persist&&N.persist();var xe=N.target,je=xe.name,q=xe.id,se=xe.outerHTML,Fe=de||je||q;Me(Fe,!0)},[Me]),ue=Hn(function(N){if($d(N))return function(de){return J(de,N)};J(N)}),Ie=x.useCallback(function(N){kn(N)?T({type:"SET_FORMIK_STATE",payload:N}):T({type:"SET_FORMIK_STATE",payload:function(){return N}})},[]),Be=x.useCallback(function(N){T({type:"SET_STATUS",payload:N})},[]),Ne=x.useCallback(function(N){T({type:"SET_ISSUBMITTING",payload:N})},[]),Ge=Hn(function(){return T({type:"SUBMIT_ATTEMPT"}),L().then(function(N){var de=N instanceof Error,xe=!de&&Object.keys(N).length===0;if(xe){var je;try{if(je=_e(),je===void 0)return}catch(q){throw q}return Promise.resolve(je).then(function(q){return j.current&&T({type:"SUBMIT_SUCCESS"}),q}).catch(function(q){if(j.current)throw T({type:"SUBMIT_FAILURE"}),q})}else if(j.current&&(T({type:"SUBMIT_FAILURE"}),de))throw N})}),Qe=Hn(function(N){N&&N.preventDefault&&kn(N.preventDefault)&&N.preventDefault(),N&&N.stopPropagation&&kn(N.stopPropagation)&&N.stopPropagation(),Ge().catch(function(de){console.warn("Warning: An unhandled error was caught from submitForm()",de)})}),ve={resetForm:X,validateForm:L,validateField:$,setErrors:U,setFieldError:ne,setFieldTouched:Me,setFieldValue:ce,setStatus:Be,setSubmitting:Ne,setTouched:oe,setValues:K,setFormikState:Ie,submitForm:Ge},_e=Hn(function(){return p(I.values,ve)}),qe=Hn(function(N){N&&N.preventDefault&&kn(N.preventDefault)&&N.preventDefault(),N&&N.stopPropagation&&kn(N.stopPropagation)&&N.stopPropagation(),X()}),ge=x.useCallback(function(N){return{value:rn(I.values,N),error:rn(I.errors,N),touched:!!rn(I.touched,N),initialValue:rn(S.current,N),initialTouched:!!rn(w.current,N),initialError:rn(C.current,N)}},[I.errors,I.touched,I.values]),Te=x.useCallback(function(N){return{setValue:function(xe,je){return ce(N,xe,je)},setTouched:function(xe,je){return Me(N,xe,je)},setError:function(xe){return ne(N,xe)}}},[ce,Me,ne]),et=x.useCallback(function(N){var de=Yc(N),xe=de?N.name:N,je=rn(I.values,xe),q={name:xe,value:je,onChange:ze,onBlur:ue};if(de){var se=N.type,Fe=N.value,Ze=N.as,ee=N.multiple;se==="checkbox"?Fe===void 0?q.checked=!!je:(q.checked=!!(Array.isArray(je)&&~je.indexOf(Fe)),q.value=Fe):se==="radio"?(q.checked=je===Fe,q.value=Fe):Ze==="select"&&ee&&(q.value=q.value||[],q.multiple=!0)}return q},[ue,ze,I.values]),Ve=x.useMemo(function(){return!ri(S.current,I.values)},[S.current,I.values]),vt=x.useMemo(function(){return typeof u<"u"?Ve?I.errors&&Object.keys(I.errors).length===0:u!==!1&&kn(u)?u(y):u:I.errors&&Object.keys(I.errors).length===0},[u,Ve,I.errors,y]),Nt=ht({},I,{initialValues:S.current,initialErrors:C.current,initialTouched:w.current,initialStatus:k.current,handleBlur:ue,handleChange:ze,handleReset:qe,handleSubmit:Qe,resetForm:X,setErrors:U,setFormikState:Ie,setFieldTouched:Me,setFieldValue:ce,setFieldError:ne,setStatus:Be,setSubmitting:Ne,setTouched:oe,setValues:K,submitForm:Ge,validateForm:L,validateField:$,isValid:vt,dirty:Ve,unregisterField:ie,registerField:Q,getFieldProps:et,getFieldMeta:ge,getFieldHelpers:Te,validateOnBlur:i,validateOnChange:n,validateOnMount:c});return Nt}function ws(e){var t=GN(e),n=e.component,r=e.children,i=e.render,s=e.innerRef;return x.useImperativeHandle(s,function(){return t}),x.createElement(UN,{value:t},n?x.createElement(n,t):i?i(t):r?kn(r)?r(t):yb(r)?null:x.Children.only(r):null)}function qN(e){var t={};if(e.inner){if(e.inner.length===0)return br(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var s;if(n){if(r>=i.length)break;s=i[r++]}else{if(r=i.next(),r.done)break;s=r.value}var c=s;rn(t,c.path)||(t=br(t,c.path,c.message))}}return t}function YN(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=Kf(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function Kf(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(i){return Array.isArray(i)===!0||G0(i)?Kf(i):i!==""?i:void 0}):G0(e[r])?t[r]=Kf(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function XN(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?$f(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[c]=$f(e[c],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function KN(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function QN(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,s=-1;if(Array.isArray(e))r=e,s=e.indexOf(n),i=s>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,s).concat(r.slice(s+1)):r}var ZN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?x.useLayoutEffect:x.useEffect;function Hn(e){var t=x.useRef(e);return ZN(function(){t.current=e}),x.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current.apply(void 0,r)},[])}function jt(e){var t=e.validate,n=e.name,r=e.render,i=e.children,s=e.as,c=e.component,u=Li(e,["validate","name","render","children","as","component"]),f=Sb(),h=Li(f,["validate","validationSchema"]),p=h.registerField,g=h.unregisterField;x.useEffect(function(){return p(n,{validate:t}),function(){g(n)}},[p,g,n,t]);var y=h.getFieldProps(ht({name:n},u)),S=h.getFieldMeta(n),C={field:y,form:h};if(r)return r(ht({},C,{meta:S}));if(kn(i))return i(ht({},C,{meta:S}));if(c){if(typeof c=="string"){var w=u.innerRef,k=Li(u,["innerRef"]);return x.createElement(c,ht({ref:w},y,k),i)}return x.createElement(c,ht({field:y,form:h},u),i)}var j=s||"input";if(typeof j=="string"){var M=u.innerRef,P=Li(u,["innerRef"]);return x.createElement(j,ht({ref:M},y,P),i)}return x.createElement(j,ht({},y,u),i)}var JN=x.forwardRef(function(e,t){var n=e.action,r=Li(e,["action"]),i=n??"#",s=Sb(),c=s.handleReset,u=s.handleSubmit;return x.createElement("form",Object.assign({onSubmit:u,ref:t,onReset:c,action:i},r))});JN.displayName="Form";var eF=function(t,n,r){var i=ra(t),s=i[n];return i.splice(n,1),i.splice(r,0,s),i},tF=function(t,n,r){var i=ra(t),s=i[n];return i[n]=i[r],i[r]=s,i},qd=function(t,n,r){var i=ra(t);return i.splice(n,0,r),i},nF=function(t,n,r){var i=ra(t);return i[n]=r,i},ra=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,i){return i>r?i:r},0);return Array.from(ht({},t,{length:n+1}))}else return[]},rF=function(e){WN(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(s,c,u){var f=i.props,h=f.name,p=f.formik.setFormikState;p(function(g){var y=typeof u=="function"?u:s,S=typeof c=="function"?c:s,C=br(g.values,h,s(rn(g.values,h))),w=u?y(rn(g.errors,h)):void 0,k=c?S(rn(g.touched,h)):void 0;return x1(w)&&(w=void 0),x1(k)&&(k=void 0),ht({},g,{values:C,errors:u?br(g.errors,h,w):g.errors,touched:c?br(g.touched,h,k):g.touched})})},i.push=function(s){return i.updateArrayField(function(c){return[].concat(ra(c),[HN(s)])},!1,!1)},i.handlePush=function(s){return function(){return i.push(s)}},i.swap=function(s,c){return i.updateArrayField(function(u){return tF(u,s,c)},!0,!0)},i.handleSwap=function(s,c){return function(){return i.swap(s,c)}},i.move=function(s,c){return i.updateArrayField(function(u){return eF(u,s,c)},!0,!0)},i.handleMove=function(s,c){return function(){return i.move(s,c)}},i.insert=function(s,c){return i.updateArrayField(function(u){return qd(u,s,c)},function(u){return qd(u,s,null)},function(u){return qd(u,s,null)})},i.handleInsert=function(s,c){return function(){return i.insert(s,c)}},i.replace=function(s,c){return i.updateArrayField(function(u){return nF(u,s,c)},!1,!1)},i.handleReplace=function(s,c){return function(){return i.replace(s,c)}},i.unshift=function(s){var c=-1;return i.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},i.handleUnshift=function(s){return function(){return i.unshift(s)}},i.handleRemove=function(s){return function(){return i.remove(s)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(g1(i)),i.pop=i.pop.bind(g1(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!ri(rn(i.formik.values,i.name),rn(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var s;return this.updateArrayField(function(c){var u=c?ra(c):[];return s||(s=u[i]),kn(u.splice)&&u.splice(i,1),u},!0,!0),s},n.pop=function(){var i;return this.updateArrayField(function(s){var c=s;return i||(i=c&&c.pop&&c.pop()),c},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},s=this.props,c=s.component,u=s.render,f=s.children,h=s.name,p=s.formik,g=Li(p,["validate","validationSchema"]),y=ht({},i,{form:g,name:h});return c?x.createElement(c,y):u?u(y):f?typeof f=="function"?f(y):yb(f)?null:x.Children.only(f):null},t}(x.Component);rF.defaultProps={validateOnChange:!0};function iF(e){const{model:t}=e,r=O(C=>C.system.model_list)[t],i=Y(),{t:s}=Z(),c=O(C=>C.system.isProcessing),u=O(C=>C.system.isConnected),[f,h]=x.useState("same"),[p,g]=x.useState("");x.useEffect(()=>{h("same")},[t]);const y=()=>{h("same")},S=()=>{i(i3({model_name:t,save_location:f,custom_location:f==="custom"&&p!==""?p:null}))};return l.jsxs(Wc,{title:`${s("modelManager.convert")} ${t}`,acceptCallback:S,cancelCallback:y,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(B,{flexDirection:"column",rowGap:4,children:[l.jsx(Ce,{children:s("modelManager.convertToDiffusersHelpText1")}),l.jsxs(gx,{children:[l.jsx(Fa,{children:s("modelManager.convertToDiffusersHelpText2")}),l.jsx(Fa,{children:s("modelManager.convertToDiffusersHelpText3")}),l.jsx(Fa,{children:s("modelManager.convertToDiffusersHelpText4")}),l.jsx(Fa,{children:s("modelManager.convertToDiffusersHelpText5")})]}),l.jsx(Ce,{children:s("modelManager.convertToDiffusersHelpText6")})]}),l.jsxs(B,{flexDir:"column",gap:4,children:[l.jsxs(B,{marginTop:4,flexDir:"column",gap:2,children:[l.jsx(Ce,{fontWeight:"600",children:s("modelManager.convertToDiffusersSaveLocation")}),l.jsx(Ja,{value:f,onChange:C=>h(C),children:l.jsxs(B,{gap:4,children:[l.jsx(vn,{value:"same",children:l.jsx(Yt,{label:"Save converted model in the same folder",children:s("modelManager.sameFolder")})}),l.jsx(vn,{value:"root",children:l.jsx(Yt,{label:"Save converted model in the InvokeAI root folder",children:s("modelManager.invokeRoot")})}),l.jsx(vn,{value:"custom",children:l.jsx(Yt,{label:"Save converted model in a custom folder",children:s("modelManager.custom")})})]})})]}),f==="custom"&&l.jsxs(B,{flexDirection:"column",rowGap:2,children:[l.jsx(Ce,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:s("modelManager.customSaveLocation")}),l.jsx(mt,{value:p,onChange:C=>{C.target.value!==""&&g(C.target.value)},width:"full"})]})]})]})}const oF=be([Pt],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),y1=64,b1=2048;function aF(){const{openModel:e,model_list:t}=O(oF),n=O(f=>f.system.isProcessing),r=Y(),{t:i}=Z(),[s,c]=x.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});x.useEffect(()=>{var f,h,p,g,y,S,C;if(e){const w=te.pickBy(t,(k,j)=>te.isEqual(j,e));c({name:e,description:(f=w[e])==null?void 0:f.description,config:(h=w[e])==null?void 0:h.config,weights:(p=w[e])==null?void 0:p.weights,vae:(g=w[e])==null?void 0:g.vae,width:(y=w[e])==null?void 0:y.width,height:(S=w[e])==null?void 0:S.height,default:(C=w[e])==null?void 0:C.default,format:"ckpt"})}},[t,e]);const u=f=>{r(ls({...f,width:Number(f.width),height:Number(f.height)}))};return e?l.jsxs(B,{flexDirection:"column",rowGap:4,width:"100%",children:[l.jsxs(B,{alignItems:"center",gap:4,justifyContent:"space-between",children:[l.jsx(Ce,{fontSize:"lg",fontWeight:"bold",children:e}),l.jsx(iF,{model:e})]}),l.jsx(B,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingInlineEnd:8,children:l.jsx(ws,{enableReinitialize:!0,initialValues:s,onSubmit:u,children:({handleSubmit:f,errors:h,touched:p})=>l.jsx("form",{onSubmit:f,children:l.jsxs(Le,{rowGap:2,alignItems:"start",children:[l.jsxs(rt,{isInvalid:!!h.description&&p.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:i("modelManager.description")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"description",name:"description",type:"text",width:"full"}),h.description&&p.description?l.jsx(kt,{children:h.description}):l.jsx(wt,{margin:0,children:i("modelManager.descriptionValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.config&&p.config,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:i("modelManager.config")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"config",name:"config",type:"text",width:"full"}),h.config&&p.config?l.jsx(kt,{children:h.config}):l.jsx(wt,{margin:0,children:i("modelManager.configValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.weights&&p.weights,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:i("modelManager.modelLocation")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"weights",name:"weights",type:"text",width:"full"}),h.weights&&p.weights?l.jsx(kt,{children:h.weights}):l.jsx(wt,{margin:0,children:i("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.vae&&p.vae,children:[l.jsx(st,{htmlFor:"vae",fontSize:"sm",children:i("modelManager.vaeLocation")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae",name:"vae",type:"text",width:"full"}),h.vae&&p.vae?l.jsx(kt,{children:h.vae}):l.jsx(wt,{margin:0,children:i("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(sa,{width:"100%",children:[l.jsxs(rt,{isInvalid:!!h.width&&p.width,children:[l.jsx(st,{htmlFor:"width",fontSize:"sm",children:i("modelManager.width")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{id:"width",name:"width",children:({field:g,form:y})=>l.jsx(Lr,{id:"width",name:"width",min:y1,max:b1,step:64,value:y.values.width,onChange:S=>y.setFieldValue(g.name,Number(S))})}),h.width&&p.width?l.jsx(kt,{children:h.width}):l.jsx(wt,{margin:0,children:i("modelManager.widthValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.height&&p.height,children:[l.jsx(st,{htmlFor:"height",fontSize:"sm",children:i("modelManager.height")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{id:"height",name:"height",children:({field:g,form:y})=>l.jsx(Lr,{id:"height",name:"height",min:y1,max:b1,step:64,value:y.values.height,onChange:S=>y.setFieldValue(g.name,Number(S))})}),h.height&&p.height?l.jsx(kt,{children:h.height}):l.jsx(wt,{margin:0,children:i("modelManager.heightValidationMsg")})]})]})]}),l.jsx(Je,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelManager.updateModel")})]})})})})]}):l.jsx(B,{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 sF=be([Pt],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function lF(){const{openModel:e,model_list:t}=O(sF),n=O(f=>f.system.isProcessing),r=Y(),{t:i}=Z(),[s,c]=x.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});x.useEffect(()=>{var f,h,p,g,y,S,C,w,k,j,M,P,I,T,D,_;if(e){const z=te.pickBy(t,(V,F)=>te.isEqual(F,e));c({name:e,description:(f=z[e])==null?void 0:f.description,path:(h=z[e])!=null&&h.path&&((p=z[e])==null?void 0:p.path)!=="None"?(g=z[e])==null?void 0:g.path:"",repo_id:(y=z[e])!=null&&y.repo_id&&((S=z[e])==null?void 0:S.repo_id)!=="None"?(C=z[e])==null?void 0:C.repo_id:"",vae:{repo_id:(k=(w=z[e])==null?void 0:w.vae)!=null&&k.repo_id?(M=(j=z[e])==null?void 0:j.vae)==null?void 0:M.repo_id:"",path:(I=(P=z[e])==null?void 0:P.vae)!=null&&I.path?(D=(T=z[e])==null?void 0:T.vae)==null?void 0:D.path:""},default:(_=z[e])==null?void 0:_.default,format:"diffusers"})}},[t,e]);const u=f=>{const h=f;f.path===""&&delete h.path,f.repo_id===""&&delete h.repo_id,f.vae.path===""&&delete h.vae.path,f.vae.repo_id===""&&delete h.vae.repo_id,r(ls(f))};return e?l.jsxs(B,{flexDirection:"column",rowGap:4,width:"100%",children:[l.jsx(B,{alignItems:"center",children:l.jsx(Ce,{fontSize:"lg",fontWeight:"bold",children:e})}),l.jsx(B,{flexDirection:"column",overflowY:"scroll",paddingInlineEnd:8,children:l.jsx(ws,{enableReinitialize:!0,initialValues:s,onSubmit:u,children:({handleSubmit:f,errors:h,touched:p})=>{var g,y,S,C,w,k,j,M,P,I;return l.jsx("form",{onSubmit:f,children:l.jsxs(Le,{rowGap:2,alignItems:"start",children:[l.jsxs(rt,{isInvalid:!!h.description&&p.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:i("modelManager.description")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"description",name:"description",type:"text",width:"full"}),h.description&&p.description?l.jsx(kt,{children:h.description}):l.jsx(wt,{margin:0,children:i("modelManager.descriptionValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.path&&p.path,isRequired:!0,children:[l.jsx(st,{htmlFor:"path",fontSize:"sm",children:i("modelManager.modelLocation")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"path",name:"path",type:"text",width:"full"}),h.path&&p.path?l.jsx(kt,{children:h.path}):l.jsx(wt,{margin:0,children:i("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.repo_id&&p.repo_id,children:[l.jsx(st,{htmlFor:"repo_id",fontSize:"sm",children:i("modelManager.repo_id")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"repo_id",name:"repo_id",type:"text",width:"full"}),h.repo_id&&p.repo_id?l.jsx(kt,{children:h.repo_id}):l.jsx(wt,{margin:0,children:i("modelManager.repoIDValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((g=h.vae)!=null&&g.path)&&((y=p.vae)==null?void 0:y.path),children:[l.jsx(st,{htmlFor:"vae.path",fontSize:"sm",children:i("modelManager.vaeLocation")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae.path",name:"vae.path",type:"text",width:"full"}),(S=h.vae)!=null&&S.path&&((C=p.vae)!=null&&C.path)?l.jsx(kt,{children:(w=h.vae)==null?void 0:w.path}):l.jsx(wt,{margin:0,children:i("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((k=h.vae)!=null&&k.repo_id)&&((j=p.vae)==null?void 0:j.repo_id),children:[l.jsx(st,{htmlFor:"vae.repo_id",fontSize:"sm",children:i("modelManager.vaeRepoID")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"full"}),(M=h.vae)!=null&&M.repo_id&&((P=p.vae)!=null&&P.repo_id)?l.jsx(kt,{children:(I=h.vae)==null?void 0:I.repo_id}):l.jsx(wt,{margin:0,children:i("modelManager.vaeRepoIDValidationMsg")})]})]}),l.jsx(Je,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelManager.updateModel")})]})})}})})]}):l.jsx(B,{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 Cb=be([Pt],e=>{const{model_list:t}=e,n=[];return te.forEach(t,r=>{n.push(r.weights)}),n});function S1({model:e,modelsToAdd:t,setModelsToAdd:n}){const{t:r}=Z(),i=O(Cb),s=c=>{t.includes(c.target.value)?n(te.remove(t,u=>u!==c.target.value)):n([...t,c.target.value])};return l.jsx(Le,{children:l.jsxs(B,{flexDirection:"column",gap:2,backgroundColor:t.includes(e.name)?"accent.650":"base.800",paddingX:4,paddingY:2,borderRadius:4,children:[l.jsxs(B,{gap:4,children:[l.jsx(pt,{value:e.name,label:l.jsx(Ce,{fontWeight:500,children:e.name}),isChecked:t.includes(e.name),isDisabled:i.includes(e.location),onChange:s}),i.includes(e.location)&&l.jsx(Sx,{colorScheme:"accent",children:r("modelManager.modelExists")})]}),l.jsx(Ce,{fontStyle:"italic",variant:"subtext",children:e.location})]})})}function cF(){const e=Y(),{t}=Z(),n=O(P=>P.system.searchFolder),r=O(P=>P.system.foundModels),i=O(Cb),s=O(P=>P.ui.shouldShowExistingModelsInSearch),c=O(P=>P.system.isProcessing),[u,f]=ke.useState([]),[h,p]=ke.useState("v1"),[g,y]=ke.useState(""),S=()=>{e(a3(null)),e(s3(null)),f([])},C=P=>{e(Zv(P.checkpointFolder))},w=()=>{f([]),r&&r.forEach(P=>{i.includes(P.location)||f(I=>[...I,P.name])})},k=()=>{f([])},j=()=>{const P=r==null?void 0:r.filter(T=>u.includes(T.name)),I={v1:"configs/stable-diffusion/v1-inference.yaml",v2_base:"configs/stable-diffusion/v2-inference-v.yaml",v2_768:"configs/stable-diffusion/v2-inference-v.yaml",inpainting:"configs/stable-diffusion/v1-inpainting-inference.yaml",custom:g};P==null||P.forEach(T=>{const D={name:T.name,description:"",config:I[h],weights:T.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(ls(D))}),f([])},M=()=>{const P=[],I=[];return r&&r.forEach((T,D)=>{i.includes(T.location)?I.push(l.jsx(S1,{model:T,modelsToAdd:u,setModelsToAdd:f},D)):P.push(l.jsx(S1,{model:T,modelsToAdd:u,setModelsToAdd:f},D))}),l.jsxs(l.Fragment,{children:[P,s&&I]})};return l.jsxs(l.Fragment,{children:[n?l.jsxs(B,{sx:{padding:4,gap:2,position:"relative",borderRadius:"base",alignItems:"center",w:"full",bg:"base.900"},children:[l.jsxs(B,{sx:{flexDir:"column",gap:2},children:[l.jsx(Ce,{sx:{fontWeight:500,fontSize:"sm"},variant:"subtext",children:t("modelManager.checkpointFolder")}),l.jsx(Ce,{sx:{fontWeight:500,fontSize:"sm"},children:n})]}),l.jsx(jc,{}),l.jsx(le,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:l.jsx(ep,{}),fontSize:18,disabled:c,onClick:()=>e(Zv(n))}),l.jsx(le,{"aria-label":t("modelManager.clearCheckpointFolder"),icon:l.jsx(xs,{style:{transform:"rotate(45deg)"}}),onClick:S})]}):l.jsx(ws,{initialValues:{checkpointFolder:""},onSubmit:P=>{C(P)},children:({handleSubmit:P})=>l.jsx("form",{onSubmit:P,children:l.jsxs(sa,{columnGap:2,alignItems:"flex-end",width:"100%",children:[l.jsx(rt,{isRequired:!0,width:"lg",children:l.jsx(jt,{as:mt,id:"checkpointFolder",name:"checkpointFolder",type:"text",size:"md",label:t("modelManager.checkpointFolder")})}),l.jsx(Je,{leftIcon:l.jsx(X8,{}),"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),type:"submit",disabled:c,paddingX:10,children:t("modelManager.findModels")})]})})}),r&&l.jsxs(B,{flexDirection:"column",rowGap:4,width:"full",children:[l.jsxs(B,{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(B,{columnGap:2,justifyContent:"space-between",children:[l.jsxs(B,{columnGap:2,children:[l.jsx(Je,{isDisabled:u.length===r.length,onClick:w,children:t("modelManager.selectAll")}),l.jsx(Je,{isDisabled:u.length===0,onClick:k,children:t("modelManager.deselectAll")}),l.jsx(pt,{label:t("modelManager.showExisting"),isChecked:s,onChange:()=>e(o3(!s))})]}),l.jsx(Je,{isDisabled:u.length===0,onClick:j,colorScheme:"accent",children:t("modelManager.addSelected")})]}),l.jsxs(B,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:[l.jsxs(B,{gap:4,children:[l.jsx(Ce,{fontWeight:500,variant:"subtext",children:t("modelManager.pickModelType")}),l.jsx(Ja,{value:h,onChange:P=>p(P),defaultValue:"v1",name:"model_type",children:l.jsxs(B,{gap:4,children:[l.jsx(vn,{value:"v1",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.v1")})}),l.jsx(vn,{value:"v2_base",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.v2_base")})}),l.jsx(vn,{value:"v2_768",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.v2_768")})}),l.jsx(vn,{value:"inpainting",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.inpainting")})}),l.jsx(vn,{value:"custom",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.customConfig")})})]})})]}),h==="custom"&&l.jsxs(B,{flexDirection:"column",rowGap:2,children:[l.jsx(Ce,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:t("modelManager.pathToCustomConfig")}),l.jsx(mt,{value:g,onChange:P=>{P.target.value!==""&&y(P.target.value)},width:"full"})]})]}),l.jsx(B,{flexDirection:"column",maxHeight:72,overflowY:"scroll",borderRadius:"sm",paddingInlineEnd:4,gap:2,children:r.length>0?M():l.jsx(Ce,{fontWeight:"500",padding:2,borderRadius:"sm",textAlign:"center",variant:"subtext",children:t("modelManager.noModelsFound")})})]})]})}const C1=64,w1=2048;function uF(){const e=Y(),{t}=Z(),n=O(h=>h.system.isProcessing);function r(h){return/\s/.test(h)}function i(h){let p;return r(h)&&(p=t("modelManager.cannotUseSpaces")),p}const s={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},c=h=>{e(ls(h)),e(Wi(null))},[u,f]=ke.useState(!1);return l.jsxs(Le,{gap:2,alignItems:"flex-start",children:[l.jsx(le,{"aria-label":t("common.back"),tooltip:t("common.back"),onClick:()=>e(Wi(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",insetInlineEnd:12,top:3,icon:l.jsx(Cy,{})}),l.jsx(cF,{}),l.jsx(pt,{label:t("modelManager.addManually"),isChecked:u,onChange:()=>f(!u)}),u&&l.jsx(ws,{initialValues:s,onSubmit:c,children:({handleSubmit:h,errors:p,touched:g})=>l.jsx("form",{onSubmit:h,children:l.jsxs(Le,{rowGap:2,children:[l.jsx(Ce,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelManager.manual")}),l.jsxs(rt,{isInvalid:!!p.name&&g.name,isRequired:!0,children:[l.jsx(st,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"name",name:"name",type:"text",validate:i,width:"2xl"}),p.name&&g.name?l.jsx(kt,{children:p.name}):l.jsx(wt,{margin:0,children:t("modelManager.nameValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.description&&g.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"description",name:"description",type:"text",width:"2xl"}),p.description&&g.description?l.jsx(kt,{children:p.description}):l.jsx(wt,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.config&&g.config,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:t("modelManager.config")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"config",name:"config",type:"text",width:"2xl"}),p.config&&g.config?l.jsx(kt,{children:p.config}):l.jsx(wt,{margin:0,children:t("modelManager.configValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.weights&&g.weights,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:t("modelManager.modelLocation")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"weights",name:"weights",type:"text",width:"2xl"}),p.weights&&g.weights?l.jsx(kt,{children:p.weights}):l.jsx(wt,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.vae&&g.vae,children:[l.jsx(st,{htmlFor:"vae",fontSize:"sm",children:t("modelManager.vaeLocation")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae",name:"vae",type:"text",width:"2xl"}),p.vae&&g.vae?l.jsx(kt,{children:p.vae}):l.jsx(wt,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(sa,{width:"100%",children:[l.jsxs(rt,{isInvalid:!!p.width&&g.width,children:[l.jsx(st,{htmlFor:"width",fontSize:"sm",children:t("modelManager.width")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{id:"width",name:"width",children:({field:y,form:S})=>l.jsx(Lr,{id:"width",name:"width",min:C1,max:w1,step:64,width:"90%",value:S.values.width,onChange:C=>S.setFieldValue(y.name,Number(C))})}),p.width&&g.width?l.jsx(kt,{children:p.width}):l.jsx(wt,{margin:0,children:t("modelManager.widthValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.height&&g.height,children:[l.jsx(st,{htmlFor:"height",fontSize:"sm",children:t("modelManager.height")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{id:"height",name:"height",children:({field:y,form:S})=>l.jsx(Lr,{id:"height",name:"height",min:C1,max:w1,width:"90%",step:64,value:S.values.height,onChange:C=>S.setFieldValue(y.name,Number(C))})}),p.height&&g.height?l.jsx(kt,{children:p.height}):l.jsx(wt,{margin:0,children:t("modelManager.heightValidationMsg")})]})]})]}),l.jsx(Je,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelManager.addModel")})]})})})]})}function Ll({children:e}){return l.jsx(B,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:e})}function dF(){const e=Y(),{t}=Z(),n=O(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function i(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(ls(f)),e(Wi(null))};return l.jsxs(B,{children:[l.jsx(le,{"aria-label":t("common.back"),tooltip:t("common.back"),onClick:()=>e(Wi(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",insetInlineEnd:12,top:3,icon:l.jsx(Cy,{})}),l.jsx(ws,{initialValues:s,onSubmit:c,children:({handleSubmit:u,errors:f,touched:h})=>{var p,g,y,S,C,w,k,j,M,P;return l.jsx("form",{onSubmit:u,children:l.jsxs(Le,{rowGap:2,children:[l.jsx(Ll,{children:l.jsxs(rt,{isInvalid:!!f.name&&h.name,isRequired:!0,children:[l.jsx(st,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"name",name:"name",type:"text",validate:i,width:"2xl",isRequired:!0}),f.name&&h.name?l.jsx(kt,{children:f.name}):l.jsx(wt,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),l.jsx(Ll,{children:l.jsxs(rt,{isInvalid:!!f.description&&h.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),f.description&&h.description?l.jsx(kt,{children:f.description}):l.jsx(wt,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),l.jsxs(Ll,{children:[l.jsx(Ce,{fontWeight:"bold",fontSize:"sm",children:t("modelManager.formMessageDiffusersModelLocation")}),l.jsx(Ce,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersModelLocationDesc")}),l.jsxs(rt,{isInvalid:!!f.path&&h.path,children:[l.jsx(st,{htmlFor:"path",fontSize:"sm",children:t("modelManager.modelLocation")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"path",name:"path",type:"text",width:"2xl"}),f.path&&h.path?l.jsx(kt,{children:f.path}):l.jsx(wt,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!f.repo_id&&h.repo_id,children:[l.jsx(st,{htmlFor:"repo_id",fontSize:"sm",children:t("modelManager.repo_id")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),f.repo_id&&h.repo_id?l.jsx(kt,{children:f.repo_id}):l.jsx(wt,{margin:0,children:t("modelManager.repoIDValidationMsg")})]})]})]}),l.jsxs(Ll,{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:!!((p=f.vae)!=null&&p.path)&&((g=h.vae)==null?void 0:g.path),children:[l.jsx(st,{htmlFor:"vae.path",fontSize:"sm",children:t("modelManager.vaeLocation")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(y=f.vae)!=null&&y.path&&((S=h.vae)!=null&&S.path)?l.jsx(kt,{children:(C=f.vae)==null?void 0:C.path}):l.jsx(wt,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((w=f.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:t("modelManager.vaeRepoID")}),l.jsxs(Le,{alignItems:"start",children:[l.jsx(jt,{as:mt,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(j=f.vae)!=null&&j.repo_id&&((M=h.vae)!=null&&M.repo_id)?l.jsx(kt,{children:(P=f.vae)==null?void 0:P.repo_id}):l.jsx(wt,{margin:0,children:t("modelManager.vaeRepoIDValidationMsg")})]})]})]}),l.jsx(Je,{type:"submit",isLoading:n,children:t("modelManager.addModel")})]})})}})]})}function k1({text:e,onClick:t}){return l.jsx(B,{position:"relative",width:"50%",height:40,justifyContent:"center",alignItems:"center",onClick:t,as:to,children:l.jsx(Ce,{fontWeight:"bold",children:e})})}function fF(){const{isOpen:e,onOpen:t,onClose:n}=ui(),r=O(u=>u.ui.addNewModelUIOption),i=Y(),{t:s}=Z(),c=()=>{n(),i(Wi(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(B,{columnGap:2,alignItems:"center",children:[l.jsx(xs,{}),s("modelManager.addNew")]})}),l.jsxs(di,{isOpen:e,onClose:c,size:"3xl",closeOnOverlayClick:!1,children:[l.jsx(Nr,{}),l.jsxs(fi,{margin:"auto",paddingInlineEnd:4,children:[l.jsx(Rr,{children:s("modelManager.addNewModel")}),l.jsx(ca,{}),l.jsxs(Fr,{children:[r==null&&l.jsxs(B,{columnGap:4,children:[l.jsx(k1,{text:s("modelManager.addCheckpointModel"),onClick:()=>i(Wi("ckpt"))}),l.jsx(k1,{text:s("modelManager.addDiffuserModel"),onClick:()=>i(Wi("diffusers"))})]}),r=="ckpt"&&l.jsx(uF,{}),r=="diffusers"&&l.jsx(dF,{})]}),l.jsx(zr,{})]})]})]})}function Bl(e){const{isProcessing:t,isConnected:n}=O(S=>S.system),r=O(S=>S.system.openModel),{t:i}=Z(),s=Y(),{name:c,status:u,description:f}=e,h=()=>{s(h2(c))},p=()=>{s(Jv(c))},g=()=>{s(l3(c)),s(Jv(null))},y=()=>{switch(u){case"active":return"ok.500";case"cached":return"warning.500";case"not loaded":return"inherit"}};return l.jsxs(B,{alignItems:"center",p:2,borderRadius:"base",sx:c===r?{bg:"accent.750",_hover:{bg:"accent.750"}}:{_hover:{bg:"base.750"}},children:[l.jsx(We,{onClick:p,cursor:"pointer",children:l.jsx(Yt,{label:f,hasArrow:!0,placement:"bottom",children:l.jsx(Ce,{fontWeight:"600",children:c})})}),l.jsx(jc,{onClick:p,cursor:"pointer"}),l.jsxs(B,{gap:2,alignItems:"center",children:[l.jsx(Ce,{color:y(),children:u}),l.jsx(to,{size:"sm",onClick:h,isDisabled:u==="active"||t||!n,children:i("modelManager.load")}),l.jsx(le,{icon:l.jsx(B9,{}),size:"sm",onClick:p,"aria-label":"Modify Config",isDisabled:u==="active"||t||!n}),l.jsx(Wc,{title:i("modelManager.deleteModel"),acceptCallback:g,acceptButtonText:i("modelManager.delete"),triggerComponent:l.jsx(le,{icon:l.jsx(H9,{}),size:"sm","aria-label":i("modelManager.deleteConfig"),isDisabled:u==="active"||t||!n,colorScheme:"error"}),children:l.jsxs(B,{rowGap:4,flexDirection:"column",children:[l.jsx("p",{style:{fontWeight:"bold"},children:i("modelManager.deleteMsg1")}),l.jsx("p",{children:i("modelManager.deleteMsg2")})]})})]})]})}function hF(){const e=Y(),{isOpen:t,onOpen:n,onClose:r}=ui(),i=O(c8),{t:s}=Z(),[c,u]=x.useState(Object.keys(i)[0]),[f,h]=x.useState(Object.keys(i)[1]),[p,g]=x.useState("none"),[y,S]=x.useState(""),[C,w]=x.useState(.5),[k,j]=x.useState("weighted_sum"),[M,P]=x.useState("root"),[I,T]=x.useState(""),[D,_]=x.useState(!1),z=Object.keys(i).filter($=>$!==f&&$!==p),V=Object.keys(i).filter($=>$!==c&&$!==p),F=[{key:s("modelManager.none"),value:"none"},...Object.keys(i).filter($=>$!==c&&$!==f).map($=>({key:$,value:$}))],L=O($=>$.system.isProcessing),X=()=>{let $=[c,f,p];$=$.filter(ie=>ie!=="none");const Q={models_to_merge:$,merged_model_name:y!==""?y:$.join("-"),alpha:C,interp:k,model_merge_save_path:M==="root"?null:I,force:D};e(c3(Q))};return l.jsxs(l.Fragment,{children:[l.jsx(Je,{onClick:n,size:"sm",children:l.jsx(B,{columnGap:2,alignItems:"center",children:s("modelManager.mergeModels")})}),l.jsxs(di,{isOpen:t,onClose:r,size:"4xl",closeOnOverlayClick:!1,children:[l.jsx(Nr,{}),l.jsxs(fi,{fontFamily:"Inter",margin:"auto",paddingInlineEnd:4,children:[l.jsx(Rr,{children:s("modelManager.mergeModels")}),l.jsx(ca,{}),l.jsx(Fr,{children:l.jsxs(B,{flexDirection:"column",rowGap:4,children:[l.jsxs(B,{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(B,{columnGap:4,children:[l.jsx(Mn,{label:s("modelManager.modelOne"),validValues:z,onChange:$=>u($.target.value)}),l.jsx(Mn,{label:s("modelManager.modelTwo"),validValues:V,onChange:$=>h($.target.value)}),l.jsx(Mn,{label:s("modelManager.modelThree"),validValues:F,onChange:$=>{$.target.value!=="none"?(g($.target.value),j("add_difference")):(g("none"),j("weighted_sum"))}})]}),l.jsx(mt,{label:s("modelManager.mergedModelName"),value:y,onChange:$=>S($.target.value)}),l.jsxs(B,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[l.jsx(ut,{label:s("modelManager.alpha"),min:.01,max:.99,step:.01,value:C,onChange:$=>w($),withInput:!0,withReset:!0,handleReset:()=>w(.5),withSliderMarks:!0}),l.jsx(Ce,{variant:"subtext",fontSize:"sm",children:s("modelManager.modelMergeAlphaHelp")})]}),l.jsxs(B,{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(Ja,{value:k,onChange:$=>j($),children:l.jsx(B,{columnGap:4,children:p==="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(Yt,{label:s("modelManager.modelMergeInterpAddDifferenceHelp"),children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.addDifference")})})})})})]}),l.jsxs(B,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[l.jsxs(B,{columnGap:4,children:[l.jsx(Ce,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:s("modelManager.mergedModelSaveLocation")}),l.jsx(Ja,{value:M,onChange:$=>P($),children:l.jsxs(B,{columnGap:4,children:[l.jsx(vn,{value:"root",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.invokeAIFolder")})}),l.jsx(vn,{value:"custom",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.custom")})})]})})]}),M==="custom"&&l.jsx(mt,{label:s("modelManager.mergedModelCustomSaveLocation"),value:I,onChange:$=>T($.target.value)})]}),l.jsx(pt,{label:s("modelManager.ignoreMismatch"),isChecked:D,onChange:$=>_($.target.checked),fontWeight:"500"}),l.jsx(Je,{onClick:X,isLoading:L,isDisabled:M==="custom"&&I==="",children:s("modelManager.merge")})]})}),l.jsx(zr,{})]})]})]})}const pF=be(Pt,e=>te.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:te.isEqual}});function Yd({label:e,isActive:t,onClick:n}){return l.jsx(Je,{onClick:n,isActive:t,sx:{_active:{bg:"accent.750"}},size:"sm",children:e})}const mF=()=>{const e=O(pF),[t,n]=ke.useState(!1);ke.useEffect(()=>{const y=setTimeout(()=>{n(!0)},200);return()=>clearTimeout(y)},[]);const[r,i]=x.useState(""),[s,c]=x.useState("all"),[u,f]=x.useTransition(),{t:h}=Z(),p=y=>{f(()=>{i(y.target.value)})},g=x.useMemo(()=>{const y=[],S=[],C=[],w=[];return e.forEach((k,j)=>{k.name.toLowerCase().includes(r.toLowerCase())&&(C.push(l.jsx(Bl,{name:k.name,status:k.status,description:k.description},j)),k.format===s&&w.push(l.jsx(Bl,{name:k.name,status:k.status,description:k.description},j))),k.format!=="diffusers"?y.push(l.jsx(Bl,{name:k.name,status:k.status,description:k.description},j)):S.push(l.jsx(Bl,{name:k.name,status:k.status,description:k.description},j))}),r!==""?s==="all"?l.jsx(We,{marginTop:4,children:C}):l.jsx(We,{marginTop:4,children:w}):l.jsxs(B,{flexDirection:"column",rowGap:6,children:[s==="all"&&l.jsxs(l.Fragment,{children:[l.jsxs(We,{children:[l.jsx(Ce,{sx:{fontWeight:"500",py:2,px:4,my:4,mx:0,borderRadius:"base",width:"max-content",fontSize:"sm",bg:"base.750"},children:h("modelManager.checkpointModels")}),y]}),l.jsxs(We,{children:[l.jsx(Ce,{sx:{fontWeight:"500",py:2,px:4,mb:4,borderRadius:"base",width:"max-content",fontSize:"sm",bg:"base.750"},children:h("modelManager.diffusersModels")}),S]})]}),s==="ckpt"&&l.jsx(B,{flexDirection:"column",marginTop:4,children:y}),s==="diffusers"&&l.jsx(B,{flexDirection:"column",marginTop:4,children:S})]})},[e,r,h,s]);return l.jsxs(B,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:[l.jsxs(B,{justifyContent:"space-between",alignItems:"center",gap:2,children:[l.jsx(Vn,{size:"md",children:h("modelManager.availableModels")}),l.jsx(jc,{}),l.jsx(fF,{}),l.jsx(hF,{})]}),l.jsx(mt,{onChange:p,label:h("modelManager.search")}),l.jsxs(B,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-240,overflow:"scroll",paddingInlineEnd:4,children:[l.jsxs(B,{columnGap:2,children:[l.jsx(Yd,{label:h("modelManager.allModels"),onClick:()=>c("all"),isActive:s==="all"}),l.jsx(Yd,{label:h("modelManager.checkpointModels"),onClick:()=>c("ckpt"),isActive:s==="ckpt"}),l.jsx(Yd,{label:h("modelManager.diffusersModels"),onClick:()=>c("diffusers"),isActive:s==="diffusers"})]}),t?g:l.jsx(B,{width:"100%",minHeight:96,justifyContent:"center",alignItems:"center",children:l.jsx(Qf,{})})]})]})};function vF({children:e}){const{isOpen:t,onOpen:n,onClose:r}=ui(),i=O(u=>u.system.model_list),s=O(u=>u.system.openModel),{t:c}=Z();return l.jsxs(l.Fragment,{children:[x.cloneElement(e,{onClick:n}),l.jsxs(di,{isOpen:t,onClose:r,size:"full",children:[l.jsx(Nr,{}),l.jsxs(fi,{children:[l.jsx(ca,{}),l.jsx(Rr,{children:c("modelManager.modelManager")}),l.jsx(Fr,{children:l.jsxs(B,{width:"100%",columnGap:8,children:[l.jsx(mF,{}),s&&i[s].format==="diffusers"?l.jsx(lF,{}):l.jsx(aF,{})]})}),l.jsx(zr,{})]})]})]})}const gF=be([Pt],e=>{const{isProcessing:t,model_list:n}=e;return{models:te.map(n,(i,s)=>s),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),xF=()=>{const e=Y(),{t}=Z(),{models:n,isProcessing:r}=O(gF),i=O(wy),s=c=>{e(h2(c.target.value))};return l.jsx(B,{style:{paddingInlineStart:1.5},children:l.jsx(Mn,{style:{fontSize:"sm"},"aria-label":t("accessibility.modelSelect"),tooltip:i.description,isDisabled:r,value:i.name,validValues:n,onChange:s})})},yF=be([Pt,ro],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:s,saveIntermediatesInterval:c,enableImageDebugging:u}=e,{shouldUseCanvasBetaLayout:f,shouldUseSliders:h}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:te.map(s,(p,g)=>g),saveIntermediatesInterval:c,enableImageDebugging:u,shouldUseCanvasBetaLayout:f,shouldUseSliders:h}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),Xd={flexDirection:"column",gap:2,p:4,bg:"base.900"},bF=({children:e})=>{const t=Y(),{t:n}=Z(),r=O(P=>P.generation.steps),{isOpen:i,onOpen:s,onClose:c}=ui(),{isOpen:u,onOpen:f,onClose:h}=ui(),{shouldDisplayInProgressType:p,shouldConfirmOnDelete:g,shouldDisplayGuides:y,saveIntermediatesInterval:S,enableImageDebugging:C,shouldUseCanvasBetaLayout:w,shouldUseSliders:k}=O(yF),j=()=>{v3.purge().then(()=>{c(),f()})},M=P=>{P>r&&(P=r),P<1&&(P=1),t(g3(P))};return l.jsxs(l.Fragment,{children:[x.cloneElement(e,{onClick:s}),l.jsxs(di,{isOpen:i,onClose:c,size:"xl",children:[l.jsx(Nr,{}),l.jsxs(fi,{paddingInlineEnd:4,children:[l.jsx(Rr,{children:n("common.settingsLabel")}),l.jsx(ca,{}),l.jsx(Fr,{children:l.jsxs($n,{gap:4,children:[l.jsxs(B,{sx:Xd,children:[l.jsx(Mn,{label:n("settings.displayInProgress"),validValues:u3,value:p,onChange:P=>t(d3(P.target.value))}),p==="full-res"&&l.jsx(Lr,{label:n("settings.saveSteps"),min:1,max:r,step:1,onChange:M,value:S,width:"auto",textAlign:"center"}),l.jsx(En,{label:n("settings.confirmOnDelete"),isChecked:g,onChange:P=>t(_1(P.target.checked))}),l.jsx(En,{label:n("settings.displayHelpIcons"),isChecked:y,onChange:P=>t(f3(P.target.checked))}),l.jsx(En,{label:n("settings.useCanvasBeta"),isChecked:w,onChange:P=>t(h3(P.target.checked))}),l.jsx(En,{label:n("settings.useSlidersForAll"),isChecked:k,onChange:P=>t(p3(P.target.checked))})]}),l.jsxs(B,{sx:Xd,children:[l.jsx(Vn,{size:"sm",style:{fontWeight:"bold"},children:"Developer"}),l.jsx(En,{label:n("settings.enableImageDebugging"),isChecked:C,onChange:P=>t(m3(P.target.checked))})]}),l.jsxs(B,{sx:Xd,children:[l.jsx(Vn,{size:"sm",children:n("settings.resetWebUI")}),l.jsx(Je,{colorScheme:"error",onClick:j,children:n("settings.resetWebUI")}),l.jsx(Ce,{children:n("settings.resetWebUIDesc1")}),l.jsx(Ce,{children:n("settings.resetWebUIDesc2")})]})]})}),l.jsx(zr,{children:l.jsx(Je,{onClick:c,children:n("common.close")})})]})]}),l.jsxs(di,{closeOnOverlayClick:!1,isOpen:u,onClose:h,isCentered:!0,children:[l.jsx(Nr,{backdropFilter:"blur(40px)"}),l.jsxs(fi,{children:[l.jsx(Rr,{}),l.jsx(Fr,{children:l.jsx(B,{justifyContent:"center",children:l.jsx(Ce,{fontSize:"lg",children:l.jsx(Ce,{children:n("settings.resetComplete")})})})}),l.jsx(zr,{})]})]})]})},SF=be(Pt,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),CF=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:s,wasErrorSeen:c}=O(SF),u=Y(),{t:f}=Z();let h;e&&!s?h="ok":h="error";let p=i;t&&(h="working"),p&&t&&r>1&&(p=`${f(p)} (${n}/${r})`);const g=s&&!c?"Click to clear, check logs for details":void 0,y=s&&!c?"pointer":"initial",S=()=>{(s||!c)&&u(f2())};return l.jsx(Yt,{label:g,children:l.jsx(Ce,{cursor:y,onClick:S,sx:{fontSize:"xs",fontWeight:"600",color:`${h}.400`},children:f(p)})})};function wF(){const{t:e}=Z(),t=Y(),n=O(c=>c.ui.currentTheme),r={dark:e("common.darkTheme"),light:e("common.lightTheme"),green:e("common.greenTheme"),ocean:e("common.oceanTheme")},i=c=>{t(x3(c))},s=()=>{const c=[];return Object.keys(r).forEach(u=>{c.push(l.jsx(Je,{sx:{width:24},isChecked:n===u,leftIcon:n===u?l.jsx(zc,{}):void 0,size:"sm",onClick:()=>i(u),children:r[u]},u))}),c};return l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(le,{"aria-label":e("common.themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(U8,{})}),children:l.jsx(Le,{align:"stretch",children:s()})})}function kF(){const{t:e,i18n:t}=Z(),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 i=[];return Object.keys(n).forEach(s=>{i.push(l.jsx(Je,{isChecked:localStorage.getItem("i18nextLng")===s,leftIcon:localStorage.getItem("i18nextLng")===s?l.jsx(zc,{}):void 0,onClick:()=>t.changeLanguage(s),"aria-label":n[s],size:"sm",minWidth:"200px",children:n[s]},s))}),i};return l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(le,{"aria-label":e("common.languagePickerLabel"),tooltip:e("common.languagePickerLabel"),icon:l.jsx(H8,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:l.jsx(Le,{children:r()})})}const jF=()=>{const{t:e}=Z();return l.jsxs($n,{gridTemplateColumns:"auto max-content",children:[l.jsx(p4,{}),l.jsxs(B,{alignItems:"center",gap:2,children:[l.jsx(CF,{}),l.jsx(xF,{}),l.jsx(vF,{children:l.jsx(le,{"aria-label":e("modelManager.modelManager"),tooltip:e("modelManager.modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(O8,{})})}),l.jsx(dO,{children:l.jsx(le,{"aria-label":e("common.hotkeysLabel"),tooltip:e("common.hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(B8,{})})}),l.jsx(wF,{}),l.jsx(kF,{}),l.jsx(le,{"aria-label":e("common.reportBugLabel"),tooltip:e("common.reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx($i,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:l.jsx(D8,{})})}),l.jsx(le,{"aria-label":e("common.githubLabel"),tooltip:e("common.githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx($i,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:l.jsx(j8,{})})}),l.jsx(le,{"aria-label":e("common.discordLabel"),tooltip:e("common.discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx($i,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:l.jsx(k8,{})})}),l.jsx(bF,{children:l.jsx(le,{"aria-label":e("common.settingsLabel"),tooltip:e("common.settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:l.jsx(m9,{})})})]})]})};function EF(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const PF=()=>{const e=Y(),t=O(l8),n=us();x.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(y3())},[e,n,t])},IF=()=>{const e=Y(),{shouldShowGalleryButton:t,shouldPinGallery:n}=O(yp),r=()=>{e(Fi(!0)),n&&e(on(!0))};return t?l.jsx(le,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",onClick:r,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(cp,{})}):null};EF();const OF=()=>(PF(),l.jsxs($n,{w:"100vw",h:"100vh",children:[l.jsxs(iO,{children:[l.jsx(cO,{}),l.jsxs($n,{gap:4,p:O9,gridAutoRows:"min-content auto",w:A9,h:z9,children:[l.jsx(jF,{}),l.jsx(cD,{})]}),l.jsx(We,{children:l.jsx(sO,{})})]}),l.jsx(uI,{}),l.jsx(IF,{})]}));export{OF as default};
|