InvokeAI/invokeai/frontend/web/dist/assets/App-d1567775.js
2023-09-08 15:22:22 +10:00

170 lines
901 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var H0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Se=(e,t,n)=>(H0(e,t,"read from private field"),n?n.call(e):t.get(e)),Jt=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Jr=(e,t,n,r)=>(H0(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var vu=(e,t,n,r)=>({set _(o){Jr(e,t,o,n)},get _(){return Se(e,t,r)}}),os=(e,t,n)=>(H0(e,t,"access private method"),n);import{a as gd,b as bj,S as yj,c as Cj,d as wj,e as Jv,f as Sj,i as e1,g as l7,k as c7,h as DC,j as kj,t as u7,l as d7,m as f7,n as p7,o as h7,p as m7,q as g7,r as W0,s as v7,u as d,v as a,w as Dx,x as Bp,y as x7,z as b7,A as y7,B as C7,P as w7,C as Rx,D as S7,E as k7,F as _7,G as j7,H as _j,I as Pe,J as P7,K as _e,L as et,M as Fe,N as vd,O as nr,Q as gn,R as Hn,T as Xt,U as Ki,V as Qa,W as at,X as co,Y as Xl,Z as aa,_ as cm,$ as Ax,a0 as Oc,a1 as nn,a2 as I7,a3 as H,a4 as RC,a5 as E7,a6 as jj,a7 as t1,a8 as xd,a9 as M7,aa as Pj,ab as Ij,ac as ds,ad as O7,ae,af as Ce,ag as kt,ah as F,ai as D7,aj as AC,ak as R7,al as A7,am as N7,an as Dc,ao as te,ap as T7,aq as Nt,ar as zt,as as Ie,at as T,au as oo,av as xe,aw as wn,ax as Ej,ay as $7,az as L7,aA as z7,aB as F7,aC as so,aD as Nx,aE as ia,aF as Ir,aG as um,aH as B7,aI as H7,aJ as NC,aK as Tx,aL as be,aM as Ro,aN as W7,aO as Mj,aP as Oj,aQ as TC,aR as V7,aS as U7,aT as G7,aU as qi,aV as Dj,aW as bn,aX as K7,aY as q7,aZ as X7,a_ as Rj,a$ as rr,b0 as dm,b1 as Y7,b2 as $C,b3 as Aj,b4 as Q7,b5 as Z7,b6 as J7,b7 as eD,b8 as tD,b9 as nD,ba as rD,bb as oD,bc as Nj,bd as sD,be as aD,bf as iD,bg as lD,bh as cD,bi as zr,bj as uD,bk as dD,bl as fD,bm as LC,bn as pD,bo as hD,bp as Fa,bq as fm,br as Tj,bs as $j,bt as po,bu as Lj,bv as mD,bw as Ri,bx as Eu,by as zC,bz as gD,bA as vD,bB as xD,bC as Hf,bD as Wf,bE as xu,bF as V0,bG as $u,bH as Lu,bI as zu,bJ as Fu,bK as FC,bL as Hp,bM as U0,bN as Wp,bO as BC,bP as n1,bQ as G0,bR as r1,bS as K0,bT as Vp,bU as HC,bV as Ai,bW as WC,bX as Ni,bY as VC,bZ as Up,b_ as pm,b$ as bD,c0 as zj,c1 as o1,c2 as s1,c3 as Fj,c4 as yD,c5 as a1,c6 as CD,c7 as i1,c8 as wD,c9 as l1,ca as $x,cb as Lx,cc as zx,cd as Fx,ce as hm,cf as Bx,cg as Bj,ch as Ra,ci as Hj,cj as Hx,ck as Wj,cl as SD,cm as bu,cn as Ti,co as Vj,cp as Uj,cq as UC,cr as kD,cs as _D,ct as jD,cu as Cn,cv as PD,cw as Fn,cx as bd,cy as mm,cz as ID,cA as ED,cB as MD,cC as OD,cD as DD,cE as RD,cF as AD,cG as ND,cH as TD,cI as $D,cJ as GC,cK as Wx,cL as LD,cM as zD,cN as yd,cO as FD,cP as BD,cQ as gm,cR as HD,cS as WD,cT as VD,cU as Vx,cV as UD,cW as mn,cX as GD,cY as KD,cZ as qD,c_ as vm,c$ as XD,d0 as YD,d1 as QD,d2 as Xu,d3 as KC,d4 as Bo,d5 as Gj,d6 as ZD,d7 as Ux,d8 as JD,d9 as qC,da as eR,db as tR,dc as nR,dd as Kj,de as rR,df as qj,dg as oR,dh as sR,di as aR,dj as iR,dk as lR,dl as cR,dm as uR,dn as dR,dp as Xj,dq as Yj,dr as fR,ds as pR,dt as hR,du as mR,dv as gR,dw as Ao,dx as vR,dy as go,dz as xR,dA as bR,dB as yR,dC as CR,dD as wR,dE as SR,dF as kR,dG as _R,dH as jR,dI as PR,dJ as IR,dK as ER,dL as MR,dM as OR,dN as DR,dO as RR,dP as XC,dQ as AR,dR as YC,dS as NR,dT as TR,dU as $R,dV as LR,dW as zR,dX as FR,dY as QC,dZ as ZC,d_ as JC,d$ as Gx,e0 as BR,e1 as Mo,e2 as Yu,e3 as fr,e4 as HR,e5 as WR,e6 as Qj,e7 as Zj,e8 as VR,e9 as ew,ea as UR,eb as tw,ec as nw,ed as rw,ee as GR,ef as KR,eg as ow,eh as sw,ei as qR,ej as XR,ek as Gp,el as YR,em as aw,en as Vf,eo as iw,ep as lw,eq as QR,er as ZR,es as JR,et as Jj,eu as eA,ev as tA,ew as cw,ex as nA,ey as uw,ez as rA,eA as e3,eB as t3,eC as Cd,eD as n3,eE as Ci,eF as r3,eG as dw,eH as oA,eI as sA,eJ as o3,eK as aA,eL as iA,eM as lA,eN as cA,eO as uA,eP as Kx,eQ as c1,eR as fw,eS as Xi,eT as dA,eU as fA,eV as s3,eW as Us,eX as Gs,eY as a3,eZ as i3,e_ as qx,e$ as l3,f0 as pA,f1 as Ks,f2 as hA,f3 as c3,f4 as mA,f5 as gA,f6 as vA,f7 as xA,f8 as bA,f9 as yA,fa as CA,fb as Kp,fc as Mu,fd as Hl,fe as wA,ff as SA,fg as kA,fh as _A,fi as jA,fj as PA,fk as IA,fl as EA,fm as MA,fn as OA,fo as DA,fp as RA,fq as AA,fr as NA,fs as TA,ft as $A,fu as LA,fv as zA,fw as FA,fx as BA,fy as pw,fz as HA,fA as WA,fB as VA,fC as UA,fD as GA,fE as KA,fF as qA,fG as XA,fH as YA,fI as QA,fJ as ZA,fK as JA,fL as e9,fM as t9,fN as hw,fO as Ip,fP as n9,fQ as qp,fR as u3,fS as Xp,fT as r9,fU as o9,fV as Yl,fW as d3,fX as f3,fY as Xx,fZ as s9,f_ as a9,f$ as i9,g0 as u1,g1 as p3,g2 as l9,g3 as c9,g4 as h3,g5 as u9,g6 as d9,g7 as f9,g8 as p9,g9 as h9,ga as wl,gb as m9,gc as g9,gd as v9,ge as x9,gf as b9,gg as y9,gh as mw,gi as C9,gj as w9,gk as S9,gl as k9,gm as _9,gn as j9,go as P9,gp as I9,gq as q0,gr as X0,gs as Y0,gt as Uf,gu as gw,gv as d1,gw as E9,gx as M9,gy as O9,gz as D9,gA as R9,gB as m3,gC as A9,gD as N9,gE as T9,gF as $9,gG as L9,gH as z9,gI as F9,gJ as B9,gK as H9,gL as W9,gM as V9,gN as Gf,gO as Q0,gP as U9,gQ as G9,gR as K9,gS as q9,gT as X9,gU as Y9,gV as Q9,gW as Z9,gX as J9,gY as eN,gZ as tN,g_ as nN,g$ as rN,h0 as oN,h1 as vw,h2 as xw,h3 as sN,h4 as aN}from"./index-f83c2c5c.js";import{I as An,u as iN,c as lN,a as Tt,b as tn,d as la,P as wd,C as cN,e as we,f as g3,g as ca,h as uN,r as Oe,i as dN,j as bw,k as ut,l as Sn,m as mc}from"./menu-31376327.js";var fN=200;function pN(e,t,n,r){var o=-1,s=Cj,i=!0,l=e.length,f=[],p=t.length;if(!l)return f;n&&(t=gd(t,bj(n))),r?(s=wj,i=!1):t.length>=fN&&(s=Jv,i=!1,t=new yj(t));e:for(;++o<l;){var h=e[o],m=n==null?h:n(h);if(h=r||h!==0?h:0,i&&m===m){for(var v=p;v--;)if(t[v]===m)continue e;f.push(h)}else s(t,m,r)||f.push(h)}return f}var hN=Sj(function(e,t){return e1(e)?pN(e,l7(t,1,e1,!0)):[]});const mN=hN;function gN(e,t){return gd(t,function(n){return e[n]})}function vN(e){return e==null?[]:gN(e,c7(e))}var xN=Math.min;function bN(e,t,n){for(var r=n?wj:Cj,o=e[0].length,s=e.length,i=s,l=Array(s),f=1/0,p=[];i--;){var h=e[i];i&&t&&(h=gd(h,bj(t))),f=xN(h.length,f),l[i]=!n&&(t||o>=120&&h.length>=120)?new yj(i&&h):void 0}h=e[0];var m=-1,v=l[0];e:for(;++m<o&&p.length<f;){var x=h[m],C=t?t(x):x;if(x=n||x!==0?x:0,!(v?Jv(v,C):r(p,C,n))){for(i=s;--i;){var b=l[i];if(!(b?Jv(b,C):r(e[i],C,n)))continue e}v&&v.push(C),p.push(x)}}return p}function yN(e){return e1(e)?e:[]}var CN=Sj(function(e){var t=gd(e,yN);return t.length&&t[0]===e[0]?bN(t):[]});const wN=CN;function SN(e,t,n,r){if(!DC(e))return e;t=kj(t,e);for(var o=-1,s=t.length,i=s-1,l=e;l!=null&&++o<s;){var f=u7(t[o]),p=n;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(o!=i){var h=l[f];p=r?r(h,f,l):void 0,p===void 0&&(p=DC(h)?h:d7(t[o+1])?[]:{})}f7(l,f,p),l=l[f]}return e}function kN(e,t,n){for(var r=-1,o=t.length,s={};++r<o;){var i=t[r],l=p7(e,i);n(l,i)&&SN(s,kj(i,e),l)}return s}function yw(e,t){if(e==null)return{};var n=gd(h7(e),function(r){return[r]});return t=m7(t),kN(e,n,function(r,o){return t(r,o[0])})}var _N=Math.ceil,jN=Math.max;function PN(e,t,n,r){for(var o=-1,s=jN(_N((t-e)/(n||1)),0),i=Array(s);s--;)i[r?s:++o]=e,e+=n;return i}function IN(e){return function(t,n,r){return r&&typeof r!="number"&&g7(t,n,r)&&(n=r=void 0),t=W0(t),n===void 0?(n=t,t=0):n=W0(n),r=r===void 0?t<n?1:-1:W0(r),PN(t,n,r,e)}}var EN=IN();const Cw=EN;function ww(e){return e&&e.length?v7(e):[]}function MN(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}const v3=({id:e,x:t,y:n,width:r,height:o,style:s,color:i,strokeColor:l,strokeWidth:f,className:p,borderRadius:h,shapeRendering:m,onClick:v,selected:x})=>{const{background:C,backgroundColor:b}=s||{},w=i||C||b;return a.jsx("rect",{className:Dx(["react-flow__minimap-node",{selected:x},p]),x:t,y:n,rx:h,ry:h,width:r,height:o,fill:w,stroke:l,strokeWidth:f,shapeRendering:m,onClick:v?k=>v(k,e):void 0})};v3.displayName="MiniMapNode";var ON=d.memo(v3);const DN=e=>e.nodeOrigin,RN=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),Z0=e=>e instanceof Function?e:()=>e;function AN({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=ON,onClick:i}){const l=Bp(RN,Rx),f=Bp(DN),p=Z0(t),h=Z0(e),m=Z0(n),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(x=>{const{x:C,y:b}=x7(x,f).positionAbsolute;return a.jsx(s,{x:C,y:b,width:x.width,height:x.height,style:x.style,selected:x.selected,className:m(x),color:p(x),borderRadius:r,strokeColor:h(x),strokeWidth:o,shapeRendering:v,onClick:i,id:x.id},x.id)})})}var NN=d.memo(AN);const TN=200,$N=150,LN=e=>{const t=e.getNodes(),n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:t.length>0?_7(j7(t,e.nodeOrigin),n):n,rfId:e.rfId}},zN="react-flow__minimap-desc";function x3({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:i=2,nodeComponent:l,maskColor:f="rgb(240, 240, 240, 0.6)",maskStrokeColor:p="none",maskStrokeWidth:h=1,position:m="bottom-right",onClick:v,onNodeClick:x,pannable:C=!1,zoomable:b=!1,ariaLabel:w="React Flow mini map",inversePan:k=!1,zoomStep:_=10,offsetScale:j=5}){const I=b7(),M=d.useRef(null),{boundingRect:E,viewBB:O,rfId:D}=Bp(LN,Rx),A=(e==null?void 0:e.width)??TN,R=(e==null?void 0:e.height)??$N,$=E.width/A,K=E.height/R,B=Math.max($,K),U=B*A,Y=B*R,W=j*B,L=E.x-(U-E.width)/2-W,X=E.y-(Y-E.height)/2-W,z=U+W*2,q=Y+W*2,ne=`${zN}-${D}`,Q=d.useRef(0);Q.current=B,d.useEffect(()=>{if(M.current){const V=y7(M.current),G=re=>{const{transform:fe,d3Selection:de,d3Zoom:me}=I.getState();if(re.sourceEvent.type!=="wheel"||!de||!me)return;const ye=-re.sourceEvent.deltaY*(re.sourceEvent.deltaMode===1?.05:re.sourceEvent.deltaMode?1:.002)*_,he=fe[2]*Math.pow(2,ye);me.scaleTo(de,he)},J=re=>{const{transform:fe,d3Selection:de,d3Zoom:me,translateExtent:ye,width:he,height:ue}=I.getState();if(re.sourceEvent.type!=="mousemove"||!de||!me)return;const De=Q.current*Math.max(1,fe[2])*(k?-1:1),je={x:fe[0]-re.sourceEvent.movementX*De,y:fe[1]-re.sourceEvent.movementY*De},Be=[[0,0],[he,ue]],rt=S7.translate(je.x,je.y).scale(fe[2]),Ue=me.constrain()(rt,Be,ye);me.transform(de,Ue)},se=C7().on("zoom",C?J:null).on("zoom.wheel",b?G:null);return V.call(se),()=>{V.on("zoom",null)}}},[C,b,k,_]);const ie=v?V=>{const G=k7(V);v(V,{x:G[0],y:G[1]})}:void 0,oe=x?(V,G)=>{const J=I.getState().nodeInternals.get(G);x(V,J)}:void 0;return a.jsx(w7,{position:m,style:e,className:Dx(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:A,height:R,viewBox:`${L} ${X} ${z} ${q}`,role:"img","aria-labelledby":ne,ref:M,onClick:ie,children:[w&&a.jsx("title",{id:ne,children:w}),a.jsx(NN,{onClick:oe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${L-W},${X-W}h${z+W*2}v${q+W*2}h${-z-W*2}z
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fill:f,fillRule:"evenodd",stroke:p,strokeWidth:h,pointerEvents:"none"})]})})}x3.displayName="MiniMap";var FN=d.memo(x3),To;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(To||(To={}));function BN({color:e,dimensions:t,lineWidth:n}){return a.jsx("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function HN({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const WN={[To.Dots]:"#91919a",[To.Lines]:"#eee",[To.Cross]:"#e2e2e2"},VN={[To.Dots]:1,[To.Lines]:1,[To.Cross]:6},UN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function b3({id:e,variant:t=To.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:l,className:f}){const p=d.useRef(null),{transform:h,patternId:m}=Bp(UN,Rx),v=i||WN[t],x=r||VN[t],C=t===To.Dots,b=t===To.Cross,w=Array.isArray(n)?n:[n,n],k=[w[0]*h[2]||1,w[1]*h[2]||1],_=x*h[2],j=b?[_,_]:k,I=C?[_/s,_/s]:[j[0]/s,j[1]/s];return a.jsxs("svg",{className:Dx(["react-flow__background",f]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background",children:[a.jsx("pattern",{id:m+e,x:h[0]%k[0],y:h[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${I[0]},-${I[1]})`,children:C?a.jsx(HN,{color:v,radius:_/s}):a.jsx(BN,{dimensions:j,color:v,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`})]})}b3.displayName="Background";var GN=d.memo(b3);const Sw=(e,t,n)=>{KN(n);const r=_j(e,t);return y3[n].includes(r)},y3={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},kw=Object.keys(y3),KN=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(kw.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${kw.join("|")}`)};function qN(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var XN=qN();const C3=1/60*1e3,YN=typeof performance<"u"?()=>performance.now():()=>Date.now(),w3=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(YN()),C3);function QN(e){let t=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,l={schedule:(f,p=!1,h=!1)=>{const m=h&&o,v=m?t:n;return p&&i.add(f),v.indexOf(f)===-1&&(v.push(f),m&&o&&(r=t.length)),f},cancel:f=>{const p=n.indexOf(f);p!==-1&&n.splice(p,1),i.delete(f)},process:f=>{if(o){s=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let p=0;p<r;p++){const h=t[p];h(f),i.has(h)&&(l.schedule(h),e())}o=!1,s&&(s=!1,l.process(f))}};return l}const ZN=40;let f1=!0,Qu=!1,p1=!1;const Ql={delta:0,timestamp:0},Sd=["read","update","preRender","render","postRender"],xm=Sd.reduce((e,t)=>(e[t]=QN(()=>Qu=!0),e),{}),JN=Sd.reduce((e,t)=>{const n=xm[t];return e[t]=(r,o=!1,s=!1)=>(Qu||nT(),n.schedule(r,o,s)),e},{}),eT=Sd.reduce((e,t)=>(e[t]=xm[t].cancel,e),{});Sd.reduce((e,t)=>(e[t]=()=>xm[t].process(Ql),e),{});const tT=e=>xm[e].process(Ql),S3=e=>{Qu=!1,Ql.delta=f1?C3:Math.max(Math.min(e-Ql.timestamp,ZN),1),Ql.timestamp=e,p1=!0,Sd.forEach(tT),p1=!1,Qu&&(f1=!1,w3(S3))},nT=()=>{Qu=!0,f1=!0,p1||w3(S3)},_w=()=>Ql;function kd(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=d.Children.toArray(e.path),i=Pe((l,f)=>a.jsx(An,{ref:f,viewBox:t,...o,...l,children:s.length?s:a.jsx("path",{fill:"currentColor",d:n})}));return i.displayName=r,i}function k3(e){const{theme:t}=P7(),n=iN();return d.useMemo(()=>lN(t.direction,{...n,...e}),[e,t.direction,n])}var rT=Object.defineProperty,oT=(e,t,n)=>t in e?rT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fn=(e,t,n)=>(oT(e,typeof t!="symbol"?t+"":t,n),n);function jw(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 sT=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function Pw(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function Iw(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var h1=typeof window<"u"?d.useLayoutEffect:d.useEffect,Yp=e=>e,aT=class{constructor(){fn(this,"descendants",new Map),fn(this,"register",e=>{if(e!=null)return sT(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),fn(this,"unregister",e=>{this.descendants.delete(e);const t=jw(Array.from(this.descendants.keys()));this.assignIndex(t)}),fn(this,"destroy",()=>{this.descendants.clear()}),fn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),fn(this,"count",()=>this.descendants.size),fn(this,"enabledCount",()=>this.enabledValues().length),fn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),fn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),fn(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),fn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),fn(this,"first",()=>this.item(0)),fn(this,"firstEnabled",()=>this.enabledItem(0)),fn(this,"last",()=>this.item(this.descendants.size-1)),fn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),fn(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),fn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),fn(this,"next",(e,t=!0)=>{const n=Pw(e,this.count(),t);return this.item(n)}),fn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Pw(r,this.enabledCount(),t);return this.enabledItem(o)}),fn(this,"prev",(e,t=!0)=>{const n=Iw(e,this.count()-1,t);return this.item(n)}),fn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Iw(r,this.enabledCount()-1,t);return this.enabledItem(o)}),fn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=jw(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const o={node:e,index:-1,...t};this.descendants.set(e,o),this.assignIndex(r)})}};function iT(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 yt(...e){return t=>{e.forEach(n=>{iT(n,t)})}}function lT(...e){return d.useMemo(()=>yt(...e),e)}function cT(){const e=d.useRef(new aT);return h1(()=>()=>e.current.destroy()),e.current}var[uT,_3]=Tt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function dT(e){const t=_3(),[n,r]=d.useState(-1),o=d.useRef(null);h1(()=>()=>{o.current&&t.unregister(o.current)},[]),h1(()=>{if(!o.current)return;const i=Number(o.current.dataset.index);n!=i&&!Number.isNaN(i)&&r(i)});const s=Yp(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:yt(s,o)}}function Yx(){return[Yp(uT),()=>Yp(_3()),()=>cT(),o=>dT(o)]}var[fT,bm]=Tt({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[pT,Qx]=Tt({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[hT,Qge,mT,gT]=Yx(),Rl=Pe(function(t,n){const{getButtonProps:r}=Qx(),o=r(t,n),i={display:"flex",alignItems:"center",width:"100%",outline:0,...bm().button};return a.jsx(_e.button,{...o,className:et("chakra-accordion__button",t.className),__css:i})});Rl.displayName="AccordionButton";function Rc(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(v,x)=>v!==x}=e,s=tn(r),i=tn(o),[l,f]=d.useState(n),p=t!==void 0,h=p?t:l,m=tn(v=>{const C=typeof v=="function"?v(h):v;i(h,C)&&(p||f(C),s(C))},[p,s,h,i]);return[h,m]}function vT(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...i}=e;yT(e),CT(e);const l=mT(),[f,p]=d.useState(-1);d.useEffect(()=>()=>{p(-1)},[]);const[h,m]=Rc({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:h,setIndex:m,htmlProps:i,getAccordionItemProps:x=>{let C=!1;return x!==null&&(C=Array.isArray(h)?h.includes(x):h===x),{isOpen:C,onChange:w=>{if(x!==null)if(o&&Array.isArray(h)){const k=w?h.concat(x):h.filter(_=>_!==x);m(k)}else w?m(x):s&&m(-1)}}},focusedIndex:f,setFocusedIndex:p,descendants:l}}var[xT,Zx]=Tt({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function bT(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:i}=Zx(),l=d.useRef(null),f=d.useId(),p=r??f,h=`accordion-button-${p}`,m=`accordion-panel-${p}`;wT(e);const{register:v,index:x,descendants:C}=gT({disabled:t&&!n}),{isOpen:b,onChange:w}=s(x===-1?null:x);ST({isOpen:b,isDisabled:t});const k=()=>{w==null||w(!0)},_=()=>{w==null||w(!1)},j=d.useCallback(()=>{w==null||w(!b),i(x)},[x,i,b,w]),I=d.useCallback(D=>{const R={ArrowDown:()=>{const $=C.nextEnabled(x);$==null||$.node.focus()},ArrowUp:()=>{const $=C.prevEnabled(x);$==null||$.node.focus()},Home:()=>{const $=C.firstEnabled();$==null||$.node.focus()},End:()=>{const $=C.lastEnabled();$==null||$.node.focus()}}[D.key];R&&(D.preventDefault(),R(D))},[C,x]),M=d.useCallback(()=>{i(x)},[i,x]),E=d.useCallback(function(A={},R=null){return{...A,type:"button",ref:yt(v,l,R),id:h,disabled:!!t,"aria-expanded":!!b,"aria-controls":m,onClick:Fe(A.onClick,j),onFocus:Fe(A.onFocus,M),onKeyDown:Fe(A.onKeyDown,I)}},[h,t,b,j,M,I,m,v]),O=d.useCallback(function(A={},R=null){return{...A,ref:R,role:"region",id:m,"aria-labelledby":h,hidden:!b}},[h,b,m]);return{isOpen:b,isDisabled:t,isFocusable:n,onOpen:k,onClose:_,getButtonProps:E,getPanelProps:O,htmlProps:o}}function yT(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;vd({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function CT(e){vd({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 wT(e){vd({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 ST(e){vd({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Al(e){const{isOpen:t,isDisabled:n}=Qx(),{reduceMotion:r}=Zx(),o=et("chakra-accordion__icon",e.className),s=bm(),i={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return a.jsx(An,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:i,...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Al.displayName="AccordionIcon";var Nl=Pe(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...i}=bT(t),f={...bm().container,overflowAnchor:"none"},p=d.useMemo(()=>i,[i]);return a.jsx(pT,{value:p,children:a.jsx(_e.div,{ref:n,...s,className:et("chakra-accordion__item",o),__css:f,children:typeof r=="function"?r({isExpanded:!!i.isOpen,isDisabled:!!i.isDisabled}):r})})});Nl.displayName="AccordionItem";var Wl={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},ki={enter:{duration:.2,ease:Wl.easeOut},exit:{duration:.1,ease:Wl.easeIn}},Xs={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})},kT=e=>e!=null&&parseInt(e.toString(),10)>0,Ew={exit:{height:{duration:.2,ease:Wl.ease},opacity:{duration:.3,ease:Wl.ease}},enter:{height:{duration:.3,ease:Wl.ease},opacity:{duration:.4,ease:Wl.ease}}},_T={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:kT(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:Xs.exit(Ew.exit,o)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(s=n==null?void 0:n.enter)!=null?s:Xs.enter(Ew.enter,o)}}},ym=d.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:i="auto",style:l,className:f,transition:p,transitionEnd:h,...m}=e,[v,x]=d.useState(!1);d.useEffect(()=>{const _=setTimeout(()=>{x(!0)});return()=>clearTimeout(_)},[]),vd({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const C=parseFloat(s.toString())>0,b={startingHeight:s,endingHeight:i,animateOpacity:o,transition:v?p:{enter:{duration:0}},transitionEnd:{enter:h==null?void 0:h.enter,exit:r?h==null?void 0:h.exit:{...h==null?void 0:h.exit,display:C?"block":"none"}}},w=r?n:!0,k=n||r?"enter":"exit";return a.jsx(nr,{initial:!1,custom:b,children:w&&a.jsx(gn.div,{ref:t,...m,className:et("chakra-collapse",f),style:{overflow:"hidden",display:"block",...l},custom:b,variants:_T,initial:r?"exit":!1,animate:k,exit:"exit"})})});ym.displayName="Collapse";var jT={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Xs.enter(ki.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:Xs.exit(ki.exit,n),transitionEnd:t==null?void 0:t.exit}}},j3={initial:"exit",animate:"enter",exit:"exit",variants:jT},PT=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:i,transitionEnd:l,delay:f,...p}=t,h=o||r?"enter":"exit",m=r?o&&r:!0,v={transition:i,transitionEnd:l,delay:f};return a.jsx(nr,{custom:v,children:m&&a.jsx(gn.div,{ref:n,className:et("chakra-fade",s),custom:v,...j3,animate:h,...p})})});PT.displayName="Fade";var IT={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(s=n==null?void 0:n.exit)!=null?s:Xs.exit(ki.exit,o)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:Xs.enter(ki.enter,n),transitionEnd:e==null?void 0:e.enter}}},P3={initial:"exit",animate:"enter",exit:"exit",variants:IT},ET=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:i=.95,className:l,transition:f,transitionEnd:p,delay:h,...m}=t,v=r?o&&r:!0,x=o||r?"enter":"exit",C={initialScale:i,reverse:s,transition:f,transitionEnd:p,delay:h};return a.jsx(nr,{custom:C,children:v&&a.jsx(gn.div,{ref:n,className:et("chakra-offset-slide",l),...P3,animate:x,custom:C,...m})})});ET.displayName="ScaleFade";var MT={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{opacity:0,x:e,y:t,transition:(s=n==null?void 0:n.exit)!=null?s:Xs.exit(ki.exit,o),transitionEnd:r==null?void 0:r.exit}},enter:({transition:e,transitionEnd:t,delay:n})=>{var r;return{opacity:1,x:0,y:0,transition:(r=e==null?void 0:e.enter)!=null?r:Xs.enter(ki.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var i;const l={x:t,y:e};return{opacity:0,transition:(i=n==null?void 0:n.exit)!=null?i:Xs.exit(ki.exit,s),...o?{...l,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...l,...r==null?void 0:r.exit}}}}},m1={initial:"initial",animate:"enter",exit:"exit",variants:MT},OT=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:i,offsetX:l=0,offsetY:f=8,transition:p,transitionEnd:h,delay:m,...v}=t,x=r?o&&r:!0,C=o||r?"enter":"exit",b={offsetX:l,offsetY:f,reverse:s,transition:p,transitionEnd:h,delay:m};return a.jsx(nr,{custom:b,children:x&&a.jsx(gn.div,{ref:n,className:et("chakra-offset-slide",i),custom:b,...m1,animate:C,...v})})});OT.displayName="SlideFade";var Tl=Pe(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:i}=Zx(),{getPanelProps:l,isOpen:f}=Qx(),p=l(s,n),h=et("chakra-accordion__panel",r),m=bm();i||delete p.hidden;const v=a.jsx(_e.div,{...p,__css:m.panel,className:h});return i?v:a.jsx(ym,{in:f,...o,children:v})});Tl.displayName="AccordionPanel";var I3=Pe(function({children:t,reduceMotion:n,...r},o){const s=Hn("Accordion",r),i=Xt(r),{htmlProps:l,descendants:f,...p}=vT(i),h=d.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return a.jsx(hT,{value:f,children:a.jsx(xT,{value:h,children:a.jsx(fT,{value:s,children:a.jsx(_e.div,{ref:o,...l,className:et("chakra-accordion",r.className),__css:s.root,children:t})})})})});I3.displayName="Accordion";function _d(e){return d.Children.toArray(e).filter(t=>d.isValidElement(t))}var[DT,RT]=Tt({strict:!1,name:"ButtonGroupContext"}),AT={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}}},NT={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},pn=Pe(function(t,n){const{size:r,colorScheme:o,variant:s,className:i,spacing:l="0.5rem",isAttached:f,isDisabled:p,orientation:h="horizontal",...m}=t,v=et("chakra-button__group",i),x=d.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let C={display:"inline-flex",...f?AT[h]:NT[h](l)};const b=h==="vertical";return a.jsx(DT,{value:x,children:a.jsx(_e.div,{ref:n,role:"group",__css:C,className:v,"data-attached":f?"":void 0,"data-orientation":h,flexDir:b?"column":void 0,...m})})});pn.displayName="ButtonGroup";function TT(e){const[t,n]=d.useState(!e);return{ref:d.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function g1(e){const{children:t,className:n,...r}=e,o=d.isValidElement(t)?d.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=et("chakra-button__icon",n);return a.jsx(_e.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}g1.displayName="ButtonIcon";function Qp(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=a.jsx(Ki,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:i,...l}=e,f=et("chakra-button__spinner",s),p=n==="start"?"marginEnd":"marginStart",h=d.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[p]:t?r:0,fontSize:"1em",lineHeight:"normal",...i}),[i,t,p,r]);return a.jsx(_e.div,{className:f,...l,__css:h,children:o})}Qp.displayName="ButtonSpinner";var gc=Pe((e,t)=>{const n=RT(),r=Qa("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:i,children:l,leftIcon:f,rightIcon:p,loadingText:h,iconSpacing:m="0.5rem",type:v,spinner:x,spinnerPlacement:C="start",className:b,as:w,...k}=Xt(e),_=d.useMemo(()=>{const E={...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:E}}},[r,n]),{ref:j,type:I}=TT(w),M={rightIcon:p,leftIcon:f,iconSpacing:m,children:l};return a.jsxs(_e.button,{ref:lT(t,j),as:w,type:v??I,"data-active":at(i),"data-loading":at(s),__css:_,className:et("chakra-button",b),...k,disabled:o||s,children:[s&&C==="start"&&a.jsx(Qp,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:m,children:x}),s?h||a.jsx(_e.span,{opacity:0,children:a.jsx(Mw,{...M})}):a.jsx(Mw,{...M}),s&&C==="end"&&a.jsx(Qp,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:m,children:x})]})});gc.displayName="Button";function Mw(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return a.jsxs(a.Fragment,{children:[t&&a.jsx(g1,{marginEnd:o,children:t}),r,n&&a.jsx(g1,{marginStart:o,children:n})]})}var ps=Pe((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...i}=e,l=n||r,f=d.isValidElement(l)?d.cloneElement(l,{"aria-hidden":!0,focusable:!1}):null;return a.jsx(gc,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...i,children:f})});ps.displayName="IconButton";var[Zge,$T]=Tt({name:"CheckboxGroupContext",strict:!1});function LT(e){const[t,n]=d.useState(e),[r,o]=d.useState(!1);return e!==t&&(o(!0),n(e)),r}function zT(e){return a.jsx(_e.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:a.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function FT(e){return a.jsx(_e.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:a.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function BT(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?FT:zT;return n||t?a.jsx(_e.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(o,{...r})}):null}var[HT,E3]=Tt({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[WT,jd]=Tt({strict:!1,name:"FormControlContext"});function VT(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...i}=e,l=d.useId(),f=t||`field-${l}`,p=`${f}-label`,h=`${f}-feedback`,m=`${f}-helptext`,[v,x]=d.useState(!1),[C,b]=d.useState(!1),[w,k]=d.useState(!1),_=d.useCallback((O={},D=null)=>({id:m,...O,ref:yt(D,A=>{A&&b(!0)})}),[m]),j=d.useCallback((O={},D=null)=>({...O,ref:D,"data-focus":at(w),"data-disabled":at(o),"data-invalid":at(r),"data-readonly":at(s),id:O.id!==void 0?O.id:p,htmlFor:O.htmlFor!==void 0?O.htmlFor:f}),[f,o,w,r,s,p]),I=d.useCallback((O={},D=null)=>({id:h,...O,ref:yt(D,A=>{A&&x(!0)}),"aria-live":"polite"}),[h]),M=d.useCallback((O={},D=null)=>({...O,...i,ref:D,role:"group"}),[i]),E=d.useCallback((O={},D=null)=>({...O,ref:D,role:"presentation","aria-hidden":!0,children:O.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!w,onFocus:()=>k(!0),onBlur:()=>k(!1),hasFeedbackText:v,setHasFeedbackText:x,hasHelpText:C,setHasHelpText:b,id:f,labelId:p,feedbackId:h,helpTextId:m,htmlProps:i,getHelpTextProps:_,getErrorMessageProps:I,getRootProps:M,getLabelProps:j,getRequiredIndicatorProps:E}}var un=Pe(function(t,n){const r=Hn("Form",t),o=Xt(t),{getRootProps:s,htmlProps:i,...l}=VT(o),f=et("chakra-form-control",t.className);return a.jsx(WT,{value:l,children:a.jsx(HT,{value:r,children:a.jsx(_e.div,{...s({},n),className:f,__css:r.container})})})});un.displayName="FormControl";var M3=Pe(function(t,n){const r=jd(),o=E3(),s=et("chakra-form__helper-text",t.className);return a.jsx(_e.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});M3.displayName="FormHelperText";var Gn=Pe(function(t,n){var r;const o=Qa("FormLabel",t),s=Xt(t),{className:i,children:l,requiredIndicator:f=a.jsx(O3,{}),optionalIndicator:p=null,...h}=s,m=jd(),v=(r=m==null?void 0:m.getLabelProps(h,n))!=null?r:{ref:n,...h};return a.jsxs(_e.label,{...v,className:et("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[l,m!=null&&m.isRequired?f:p]})});Gn.displayName="FormLabel";var O3=Pe(function(t,n){const r=jd(),o=E3();if(!(r!=null&&r.isRequired))return null;const s=et("chakra-form__required-indicator",t.className);return a.jsx(_e.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});O3.displayName="RequiredIndicator";function Jx(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=eb(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":co(n),"aria-required":co(o),"aria-readonly":co(r)}}function eb(e){var t,n,r;const o=jd(),{id:s,disabled:i,readOnly:l,required:f,isRequired:p,isInvalid:h,isReadOnly:m,isDisabled:v,onFocus:x,onBlur:C,...b}=e,w=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&w.push(o.feedbackId),o!=null&&o.hasHelpText&&w.push(o.helpTextId),{...b,"aria-describedby":w.join(" ")||void 0,id:s??(o==null?void 0:o.id),isDisabled:(t=i??v)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=l??m)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=f??p)!=null?r:o==null?void 0:o.isRequired,isInvalid:h??(o==null?void 0:o.isInvalid),onFocus:Fe(o==null?void 0:o.onFocus,x),onBlur:Fe(o==null?void 0:o.onBlur,C)}}var tb={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},D3=_e("span",{baseStyle:tb});D3.displayName="VisuallyHidden";var UT=_e("input",{baseStyle:tb});UT.displayName="VisuallyHiddenInput";const GT=()=>typeof document<"u";let Ow=!1,Pd=null,$i=!1,v1=!1;const x1=new Set;function nb(e,t){x1.forEach(n=>n(e,t))}const KT=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function qT(e){return!(e.metaKey||!KT&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Dw(e){$i=!0,qT(e)&&(Pd="keyboard",nb("keyboard",e))}function Sl(e){if(Pd="pointer",e.type==="mousedown"||e.type==="pointerdown"){$i=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;nb("pointer",e)}}function XT(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function YT(e){XT(e)&&($i=!0,Pd="virtual")}function QT(e){e.target===window||e.target===document||(!$i&&!v1&&(Pd="virtual",nb("virtual",e)),$i=!1,v1=!1)}function ZT(){$i=!1,v1=!0}function Rw(){return Pd!=="pointer"}function JT(){if(!GT()||Ow)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){$i=!0,e.apply(this,n)},document.addEventListener("keydown",Dw,!0),document.addEventListener("keyup",Dw,!0),document.addEventListener("click",YT,!0),window.addEventListener("focus",QT,!0),window.addEventListener("blur",ZT,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Sl,!0),document.addEventListener("pointermove",Sl,!0),document.addEventListener("pointerup",Sl,!0)):(document.addEventListener("mousedown",Sl,!0),document.addEventListener("mousemove",Sl,!0),document.addEventListener("mouseup",Sl,!0)),Ow=!0}function R3(e){JT(),e(Rw());const t=()=>e(Rw());return x1.add(t),()=>{x1.delete(t)}}function e$(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function A3(e={}){const t=eb(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:i,onBlur:l,onFocus:f,"aria-describedby":p}=t,{defaultChecked:h,isChecked:m,isFocusable:v,onChange:x,isIndeterminate:C,name:b,value:w,tabIndex:k=void 0,"aria-label":_,"aria-labelledby":j,"aria-invalid":I,...M}=e,E=e$(M,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),O=tn(x),D=tn(l),A=tn(f),[R,$]=d.useState(!1),[K,B]=d.useState(!1),[U,Y]=d.useState(!1),[W,L]=d.useState(!1);d.useEffect(()=>R3($),[]);const X=d.useRef(null),[z,q]=d.useState(!0),[ne,Q]=d.useState(!!h),ie=m!==void 0,oe=ie?m:ne,V=d.useCallback(ue=>{if(r||n){ue.preventDefault();return}ie||Q(oe?ue.target.checked:C?!0:ue.target.checked),O==null||O(ue)},[r,n,oe,ie,C,O]);Xl(()=>{X.current&&(X.current.indeterminate=!!C)},[C]),la(()=>{n&&B(!1)},[n,B]),Xl(()=>{const ue=X.current;if(!(ue!=null&&ue.form))return;const De=()=>{Q(!!h)};return ue.form.addEventListener("reset",De),()=>{var je;return(je=ue.form)==null?void 0:je.removeEventListener("reset",De)}},[]);const G=n&&!v,J=d.useCallback(ue=>{ue.key===" "&&L(!0)},[L]),se=d.useCallback(ue=>{ue.key===" "&&L(!1)},[L]);Xl(()=>{if(!X.current)return;X.current.checked!==oe&&Q(X.current.checked)},[X.current]);const re=d.useCallback((ue={},De=null)=>{const je=Be=>{K&&Be.preventDefault(),L(!0)};return{...ue,ref:De,"data-active":at(W),"data-hover":at(U),"data-checked":at(oe),"data-focus":at(K),"data-focus-visible":at(K&&R),"data-indeterminate":at(C),"data-disabled":at(n),"data-invalid":at(s),"data-readonly":at(r),"aria-hidden":!0,onMouseDown:Fe(ue.onMouseDown,je),onMouseUp:Fe(ue.onMouseUp,()=>L(!1)),onMouseEnter:Fe(ue.onMouseEnter,()=>Y(!0)),onMouseLeave:Fe(ue.onMouseLeave,()=>Y(!1))}},[W,oe,n,K,R,U,C,s,r]),fe=d.useCallback((ue={},De=null)=>({...ue,ref:De,"data-active":at(W),"data-hover":at(U),"data-checked":at(oe),"data-focus":at(K),"data-focus-visible":at(K&&R),"data-indeterminate":at(C),"data-disabled":at(n),"data-invalid":at(s),"data-readonly":at(r)}),[W,oe,n,K,R,U,C,s,r]),de=d.useCallback((ue={},De=null)=>({...E,...ue,ref:yt(De,je=>{je&&q(je.tagName==="LABEL")}),onClick:Fe(ue.onClick,()=>{var je;z||((je=X.current)==null||je.click(),requestAnimationFrame(()=>{var Be;(Be=X.current)==null||Be.focus({preventScroll:!0})}))}),"data-disabled":at(n),"data-checked":at(oe),"data-invalid":at(s)}),[E,n,oe,s,z]),me=d.useCallback((ue={},De=null)=>({...ue,ref:yt(X,De),type:"checkbox",name:b,value:w,id:i,tabIndex:k,onChange:Fe(ue.onChange,V),onBlur:Fe(ue.onBlur,D,()=>B(!1)),onFocus:Fe(ue.onFocus,A,()=>B(!0)),onKeyDown:Fe(ue.onKeyDown,J),onKeyUp:Fe(ue.onKeyUp,se),required:o,checked:oe,disabled:G,readOnly:r,"aria-label":_,"aria-labelledby":j,"aria-invalid":I?!!I:s,"aria-describedby":p,"aria-disabled":n,style:tb}),[b,w,i,V,D,A,J,se,o,oe,G,r,_,j,I,s,p,n,k]),ye=d.useCallback((ue={},De=null)=>({...ue,ref:De,onMouseDown:Fe(ue.onMouseDown,t$),"data-disabled":at(n),"data-checked":at(oe),"data-invalid":at(s)}),[oe,n,s]);return{state:{isInvalid:s,isFocused:K,isChecked:oe,isActive:W,isHovered:U,isIndeterminate:C,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:de,getCheckboxProps:re,getIndicatorProps:fe,getInputProps:me,getLabelProps:ye,htmlProps:E}}function t$(e){e.preventDefault(),e.stopPropagation()}var n$={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},r$={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},o$=aa({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),s$=aa({from:{opacity:0},to:{opacity:1}}),a$=aa({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Cm=Pe(function(t,n){const r=$T(),o={...r,...t},s=Hn("Checkbox",o),i=Xt(t),{spacing:l="0.5rem",className:f,children:p,iconColor:h,iconSize:m,icon:v=a.jsx(BT,{}),isChecked:x,isDisabled:C=r==null?void 0:r.isDisabled,onChange:b,inputProps:w,...k}=i;let _=x;r!=null&&r.value&&i.value&&(_=r.value.includes(i.value));let j=b;r!=null&&r.onChange&&i.value&&(j=cm(r.onChange,b));const{state:I,getInputProps:M,getCheckboxProps:E,getLabelProps:O,getRootProps:D}=A3({...k,isDisabled:C,isChecked:_,onChange:j}),A=LT(I.isChecked),R=d.useMemo(()=>({animation:A?I.isIndeterminate?`${s$} 20ms linear, ${a$} 200ms linear`:`${o$} 200ms linear`:void 0,fontSize:m,color:h,...s.icon}),[h,m,A,I.isIndeterminate,s.icon]),$=d.cloneElement(v,{__css:R,isIndeterminate:I.isIndeterminate,isChecked:I.isChecked});return a.jsxs(_e.label,{__css:{...r$,...s.container},className:et("chakra-checkbox",f),...D(),children:[a.jsx("input",{className:"chakra-checkbox__input",...M(w,n)}),a.jsx(_e.span,{__css:{...n$,...s.control},className:"chakra-checkbox__control",...E(),children:$}),p&&a.jsx(_e.span,{className:"chakra-checkbox__label",...O(),__css:{marginStart:l,...s.label},children:p})]})});Cm.displayName="Checkbox";function i$(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function rb(e,t){let n=i$(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function b1(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 Zp(e,t,n){return(e-t)*100/(n-t)}function N3(e,t,n){return(n-t)*e+t}function y1(e,t,n){const r=Math.round((e-t)/n)*n+t,o=b1(n);return rb(r,o)}function Zl(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 l$(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:i=Number.MIN_SAFE_INTEGER,max:l=Number.MAX_SAFE_INTEGER,keepWithinRange:f=!0}=e,p=tn(t),[h,m]=d.useState(()=>{var R;return r==null?"":(R=J0(r,s,n))!=null?R:""}),v=typeof o<"u",x=v?o:h,C=T3(Ea(x),s),b=n??C,w=d.useCallback(R=>{R!==x&&(v||m(R.toString()),p==null||p(R.toString(),Ea(R)))},[p,v,x]),k=d.useCallback(R=>{let $=R;return f&&($=Zl($,i,l)),rb($,b)},[b,f,l,i]),_=d.useCallback((R=s)=>{let $;x===""?$=Ea(R):$=Ea(x)+R,$=k($),w($)},[k,s,w,x]),j=d.useCallback((R=s)=>{let $;x===""?$=Ea(-R):$=Ea(x)-R,$=k($),w($)},[k,s,w,x]),I=d.useCallback(()=>{var R;let $;r==null?$="":$=(R=J0(r,s,n))!=null?R:i,w($)},[r,n,s,w,i]),M=d.useCallback(R=>{var $;const K=($=J0(R,s,b))!=null?$:i;w(K)},[b,s,w,i]),E=Ea(x);return{isOutOfRange:E>l||E<i,isAtMax:E===l,isAtMin:E===i,precision:b,value:x,valueAsNumber:E,update:w,reset:I,increment:_,decrement:j,clamp:k,cast:M,setValue:m}}function Ea(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function T3(e,t){return Math.max(b1(t),b1(e))}function J0(e,t,n){const r=Ea(e);if(Number.isNaN(r))return;const o=T3(r,t);return rb(r,n??o)}var[c$,$3]=Tt({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[u$,ob]=Tt({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),L3={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},wm=Pe(function(t,n){const{getInputProps:r}=ob(),o=$3(),s=r(t,n),i=et("chakra-editable__input",t.className);return a.jsx(_e.input,{...s,__css:{outline:0,...L3,...o.input},className:i})});wm.displayName="EditableInput";var Sm=Pe(function(t,n){const{getPreviewProps:r}=ob(),o=$3(),s=r(t,n),i=et("chakra-editable__preview",t.className);return a.jsx(_e.span,{...s,__css:{cursor:"text",display:"inline-block",...L3,...o.preview},className:i})});Sm.displayName="EditablePreview";function _i(e,t,n,r){const o=tn(n);return d.useEffect(()=>{const s=typeof e=="function"?e():e??document;if(!(!n||!s))return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const s=typeof e=="function"?e():e??document;s==null||s.removeEventListener(t,o,r)}}function d$(e){return"current"in e}var z3=()=>typeof window<"u";function f$(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var p$=e=>z3()&&e.test(navigator.vendor),h$=e=>z3()&&e.test(f$()),m$=()=>h$(/mac|iphone|ipad|ipod/i),g$=()=>m$()&&p$(/apple/i);function F3(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,i;return(i=(s=t.current)==null?void 0:s.ownerDocument)!=null?i:document};_i(o,"pointerdown",s=>{if(!g$()||!r)return;const i=s.target,f=(n??[t]).some(p=>{const h=d$(p)?p.current:p;return(h==null?void 0:h.contains(i))||h===i});o().activeElement!==i&&f&&(s.preventDefault(),i.focus())})}function Aw(e,t){return e?e===t||e.contains(t):!1}function v$(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:i,defaultValue:l,startWithEditView:f,isPreviewFocusable:p=!0,submitOnBlur:h=!0,selectAllOnFocus:m=!0,placeholder:v,onEdit:x,finalFocusRef:C,...b}=e,w=tn(x),k=!!(f&&!i),[_,j]=d.useState(k),[I,M]=Rc({defaultValue:l||"",value:s,onChange:t}),[E,O]=d.useState(I),D=d.useRef(null),A=d.useRef(null),R=d.useRef(null),$=d.useRef(null),K=d.useRef(null);F3({ref:D,enabled:_,elements:[$,K]});const B=!_&&!i;Xl(()=>{var re,fe;_&&((re=D.current)==null||re.focus(),m&&((fe=D.current)==null||fe.select()))},[]),la(()=>{var re,fe,de,me;if(!_){C?(re=C.current)==null||re.focus():(fe=R.current)==null||fe.focus();return}(de=D.current)==null||de.focus(),m&&((me=D.current)==null||me.select()),w==null||w()},[_,w,m]);const U=d.useCallback(()=>{B&&j(!0)},[B]),Y=d.useCallback(()=>{O(I)},[I]),W=d.useCallback(()=>{j(!1),M(E),n==null||n(E),o==null||o(E)},[n,o,M,E]),L=d.useCallback(()=>{j(!1),O(I),r==null||r(I),o==null||o(E)},[I,r,o,E]);d.useEffect(()=>{if(_)return;const re=D.current;(re==null?void 0:re.ownerDocument.activeElement)===re&&(re==null||re.blur())},[_]);const X=d.useCallback(re=>{M(re.currentTarget.value)},[M]),z=d.useCallback(re=>{const fe=re.key,me={Escape:W,Enter:ye=>{!ye.shiftKey&&!ye.metaKey&&L()}}[fe];me&&(re.preventDefault(),me(re))},[W,L]),q=d.useCallback(re=>{const fe=re.key,me={Escape:W}[fe];me&&(re.preventDefault(),me(re))},[W]),ne=I.length===0,Q=d.useCallback(re=>{var fe;if(!_)return;const de=re.currentTarget.ownerDocument,me=(fe=re.relatedTarget)!=null?fe:de.activeElement,ye=Aw($.current,me),he=Aw(K.current,me);!ye&&!he&&(h?L():W())},[h,L,W,_]),ie=d.useCallback((re={},fe=null)=>{const de=B&&p?0:void 0;return{...re,ref:yt(fe,A),children:ne?v:I,hidden:_,"aria-disabled":co(i),tabIndex:de,onFocus:Fe(re.onFocus,U,Y)}},[i,_,B,p,ne,U,Y,v,I]),oe=d.useCallback((re={},fe=null)=>({...re,hidden:!_,placeholder:v,ref:yt(fe,D),disabled:i,"aria-disabled":co(i),value:I,onBlur:Fe(re.onBlur,Q),onChange:Fe(re.onChange,X),onKeyDown:Fe(re.onKeyDown,z),onFocus:Fe(re.onFocus,Y)}),[i,_,Q,X,z,Y,v,I]),V=d.useCallback((re={},fe=null)=>({...re,hidden:!_,placeholder:v,ref:yt(fe,D),disabled:i,"aria-disabled":co(i),value:I,onBlur:Fe(re.onBlur,Q),onChange:Fe(re.onChange,X),onKeyDown:Fe(re.onKeyDown,q),onFocus:Fe(re.onFocus,Y)}),[i,_,Q,X,q,Y,v,I]),G=d.useCallback((re={},fe=null)=>({"aria-label":"Edit",...re,type:"button",onClick:Fe(re.onClick,U),ref:yt(fe,R),disabled:i}),[U,i]),J=d.useCallback((re={},fe=null)=>({...re,"aria-label":"Submit",ref:yt(K,fe),type:"button",onClick:Fe(re.onClick,L),disabled:i}),[L,i]),se=d.useCallback((re={},fe=null)=>({"aria-label":"Cancel",id:"cancel",...re,ref:yt($,fe),type:"button",onClick:Fe(re.onClick,W),disabled:i}),[W,i]);return{isEditing:_,isDisabled:i,isValueEmpty:ne,value:I,onEdit:U,onCancel:W,onSubmit:L,getPreviewProps:ie,getInputProps:oe,getTextareaProps:V,getEditButtonProps:G,getSubmitButtonProps:J,getCancelButtonProps:se,htmlProps:b}}var km=Pe(function(t,n){const r=Hn("Editable",t),o=Xt(t),{htmlProps:s,...i}=v$(o),{isEditing:l,onSubmit:f,onCancel:p,onEdit:h}=i,m=et("chakra-editable",t.className),v=Ax(t.children,{isEditing:l,onSubmit:f,onCancel:p,onEdit:h});return a.jsx(u$,{value:i,children:a.jsx(c$,{value:r,children:a.jsx(_e.div,{ref:n,...s,className:m,children:v})})})});km.displayName="Editable";function B3(){const{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}=ob();return{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}}var H3={exports:{}},x$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",b$=x$,y$=b$;function W3(){}function V3(){}V3.resetWarningCache=W3;var C$=function(){function e(r,o,s,i,l,f){if(f!==y$){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:V3,resetWarningCache:W3};return n.PropTypes=n,n};H3.exports=C$();var w$=H3.exports;const Bt=Oc(w$);var C1="data-focus-lock",U3="data-focus-lock-disabled",S$="data-no-focus-lock",k$="data-autofocus-inside",_$="data-no-autofocus";function j$(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function P$(e,t){var n=d.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function G3(e,t){return P$(t||null,function(n){return e.forEach(function(r){return j$(r,n)})})}var ev={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},us=function(){return us=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},us.apply(this,arguments)};function K3(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Ac(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function l(h){try{p(r.next(h))}catch(m){i(m)}}function f(h){try{p(r.throw(h))}catch(m){i(m)}}function p(h){h.done?s(h.value):o(h.value).then(l,f)}p((r=r.apply(e,t||[])).next())})}function Nc(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(p){return function(h){return f([p,h])}}function f(p){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,p[0]&&(n=0)),n;)try{if(r=1,o&&(s=p[0]&2?o.return:p[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,p[1])).done)return s;switch(o=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){n.label=p[1];break}if(p[0]===6&&n.label<s[1]){n.label=s[1],s=p;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(p);break}s[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(h){p=[6,h],o=0}finally{r=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Nw(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(l){i={error:l}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function w1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function q3(e){return e}function X3(e,t){t===void 0&&(t=q3);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var f=function(){var h=i;i=[],h.forEach(s)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(h){i.push(h),p()},filter:function(h){return i=i.filter(h),n}}}};return o}function sb(e,t){return t===void 0&&(t=q3),X3(e,t)}function Y3(e){e===void 0&&(e={});var t=X3(null);return t.options=us({async:!0,ssr:!1},e),t}var Q3=function(e){var t=e.sideCar,n=K3(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 d.createElement(r,us({},n))};Q3.isSideCarExport=!0;function I$(e,t){return e.useMedium(t),Q3}var Z3=sb({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),J3=sb(),E$=sb(),M$=Y3({async:!0}),O$=[],ab=d.forwardRef(function(t,n){var r,o=d.useState(),s=o[0],i=o[1],l=d.useRef(),f=d.useRef(!1),p=d.useRef(null),h=t.children,m=t.disabled,v=t.noFocusGuards,x=t.persistentFocus,C=t.crossFrame,b=t.autoFocus;t.allowTextSelection;var w=t.group,k=t.className,_=t.whiteList,j=t.hasPositiveIndices,I=t.shards,M=I===void 0?O$:I,E=t.as,O=E===void 0?"div":E,D=t.lockProps,A=D===void 0?{}:D,R=t.sideCar,$=t.returnFocus,K=t.focusOptions,B=t.onActivation,U=t.onDeactivation,Y=d.useState({}),W=Y[0],L=d.useCallback(function(){p.current=p.current||document&&document.activeElement,l.current&&B&&B(l.current),f.current=!0},[B]),X=d.useCallback(function(){f.current=!1,U&&U(l.current)},[U]);d.useEffect(function(){m||(p.current=null)},[]);var z=d.useCallback(function(J){var se=p.current;if(se&&se.focus){var re=typeof $=="function"?$(se):$;if(re){var fe=typeof re=="object"?re:void 0;p.current=null,J?Promise.resolve().then(function(){return se.focus(fe)}):se.focus(fe)}}},[$]),q=d.useCallback(function(J){f.current&&Z3.useMedium(J)},[]),ne=J3.useMedium,Q=d.useCallback(function(J){l.current!==J&&(l.current=J,i(J))},[]),ie=nn((r={},r[U3]=m&&"disabled",r[C1]=w,r),A),oe=v!==!0,V=oe&&v!=="tail",G=G3([n,Q]);return d.createElement(d.Fragment,null,oe&&[d.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:m?-1:0,style:ev}),j?d.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:m?-1:1,style:ev}):null],!m&&d.createElement(R,{id:W,sideCar:M$,observed:s,disabled:m,persistentFocus:x,crossFrame:C,autoFocus:b,whiteList:_,shards:M,onActivation:L,onDeactivation:X,returnFocus:z,focusOptions:K}),d.createElement(O,nn({ref:G},ie,{className:k,onBlur:ne,onFocus:q}),h),V&&d.createElement("div",{"data-focus-guard":!0,tabIndex:m?-1:0,style:ev}))});ab.propTypes={};ab.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 e5=ab;function S1(e,t){return S1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},S1(e,t)}function D$(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,S1(e,t)}function R$(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],i;function l(){i=e(s.map(function(p){return p.props})),t(i)}var f=function(p){D$(h,p);function h(){return p.apply(this,arguments)||this}h.peek=function(){return i};var m=h.prototype;return m.componentDidMount=function(){s.push(this),l()},m.componentDidUpdate=function(){l()},m.componentWillUnmount=function(){var x=s.indexOf(this);s.splice(x,1),l()},m.render=function(){return H.createElement(o,this.props)},h}(d.PureComponent);return I7(f,"displayName","SideEffect("+n(o)+")"),f}}var _s=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},Jp=function(e){return Array.isArray(e)?e:[e]},t5=function(e){return Array.isArray(e)?e[0]:e},A$=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"},n5=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},r5=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},N$=function(e,t){return!e||r5(e)||!A$(e)&&t(n5(e))},o5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=N$(t,o5.bind(void 0,e));return e.set(t,r),r},T$=function(e,t){return e&&!r5(e)?z$(e)?t(n5(e)):!1:!0},s5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=T$(t,s5.bind(void 0,e));return e.set(t,r),r},a5=function(e){return e.dataset},$$=function(e){return e.tagName==="BUTTON"},i5=function(e){return e.tagName==="INPUT"},l5=function(e){return i5(e)&&e.type==="radio"},L$=function(e){return!((i5(e)||$$(e))&&(e.type==="hidden"||e.disabled))},z$=function(e){var t=e.getAttribute(_$);return![!0,"true",""].includes(t)},ib=function(e){var t;return!!(e&&(!((t=a5(e))===null||t===void 0)&&t.focusGuard))},eh=function(e){return!ib(e)},F$=function(e){return!!e},B$=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},c5=function(e,t,n){return _s(e).map(function(r,o){return{node:r,index:o,tabIndex:n&&r.tabIndex===-1?(r.dataset||{}).focusGuard?0:-1:r.tabIndex}}).filter(function(r){return!t||r.tabIndex>=0}).sort(B$)},H$=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],lb=H$.join(","),W$="".concat(lb,", [data-focus-guard]"),u5=function(e,t){return _s((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?W$:lb)?[r]:[],u5(r))},[])},V$=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?_m([e.contentDocument.body],t):[e]},_m=function(e,t){return e.reduce(function(n,r){var o,s=u5(r,t),i=(o=[]).concat.apply(o,s.map(function(l){return V$(l,t)}));return n.concat(i,r.parentNode?_s(r.parentNode.querySelectorAll(lb)).filter(function(l){return l===r}):[])},[])},U$=function(e){var t=e.querySelectorAll("[".concat(k$,"]"));return _s(t).map(function(n){return _m([n])}).reduce(function(n,r){return n.concat(r)},[])},cb=function(e,t){return _s(e).filter(function(n){return o5(t,n)}).filter(function(n){return L$(n)})},Tw=function(e,t){return t===void 0&&(t=new Map),_s(e).filter(function(n){return s5(t,n)})},k1=function(e,t,n){return c5(cb(_m(e,n),t),!0,n)},$w=function(e,t){return c5(cb(_m(e),t),!1)},G$=function(e,t){return cb(U$(e),t)},Jl=function(e,t){return e.shadowRoot?Jl(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:_s(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?Jl(o,t):!1}return Jl(n,t)})},K$=function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var o=r+1;o<n;o+=1){var s=e[r].compareDocumentPosition(e[o]);(s&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(s&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(i,l){return!t.has(l)})},d5=function(e){return e.parentNode?d5(e.parentNode):e},ub=function(e){var t=Jp(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(C1);return n.push.apply(n,o?K$(_s(d5(r).querySelectorAll("[".concat(C1,'="').concat(o,'"]:not([').concat(U3,'="disabled"])')))):[r]),n},[])},q$=function(e){try{return e()}catch{return}},Zu=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Zu(t.shadowRoot):t instanceof HTMLIFrameElement&&q$(function(){return t.contentWindow.document})?Zu(t.contentWindow.document):t}},X$=function(e,t){return e===t},Y$=function(e,t){return!!_s(e.querySelectorAll("iframe")).some(function(n){return X$(n,t)})},f5=function(e,t){return t===void 0&&(t=Zu(t5(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:ub(e).some(function(n){return Jl(n,t)||Y$(n,t)})},Q$=function(e){e===void 0&&(e=document);var t=Zu(e);return t?_s(e.querySelectorAll("[".concat(S$,"]"))).some(function(n){return Jl(n,t)}):!1},Z$=function(e,t){return t.filter(l5).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},db=function(e,t){return l5(e)&&e.name?Z$(e,t):e},J$=function(e){var t=new Set;return e.forEach(function(n){return t.add(db(n,e))}),e.filter(function(n){return t.has(n)})},Lw=function(e){return e[0]&&e.length>1?db(e[0],e):e[0]},zw=function(e,t){return e.length>1?e.indexOf(db(e[t],e)):t},p5="NEW_FOCUS",eL=function(e,t,n,r){var o=e.length,s=e[0],i=e[o-1],l=ib(n);if(!(n&&e.indexOf(n)>=0)){var f=n!==void 0?t.indexOf(n):-1,p=r?t.indexOf(r):f,h=r?e.indexOf(r):-1,m=f-p,v=t.indexOf(s),x=t.indexOf(i),C=J$(t),b=n!==void 0?C.indexOf(n):-1,w=b-(r?C.indexOf(r):f),k=zw(e,0),_=zw(e,o-1);if(f===-1||h===-1)return p5;if(!m&&h>=0)return h;if(f<=v&&l&&Math.abs(m)>1)return _;if(f>=x&&l&&Math.abs(m)>1)return k;if(m&&Math.abs(w)>1)return h;if(f<=v)return _;if(f>x)return k;if(m)return Math.abs(m)>1?h:(o+h+m)%o}},tL=function(e){return function(t){var n,r=(n=a5(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},nL=function(e,t,n){var r=e.map(function(s){var i=s.node;return i}),o=Tw(r.filter(tL(n)));return o&&o.length?Lw(o):Lw(Tw(t))},_1=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&_1(e.parentNode.host||e.parentNode,t),t},tv=function(e,t){for(var n=_1(e),r=_1(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},h5=function(e,t,n){var r=Jp(e),o=Jp(t),s=r[0],i=!1;return o.filter(Boolean).forEach(function(l){i=tv(i||l,l)||i,n.filter(Boolean).forEach(function(f){var p=tv(s,f);p&&(!i||Jl(p,i)?i=p:i=tv(p,i))})}),i},rL=function(e,t){return e.reduce(function(n,r){return n.concat(G$(r,t))},[])},oL=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(F$)},sL=function(e,t){var n=Zu(Jp(e).length>0?document:t5(e).ownerDocument),r=ub(e).filter(eh),o=h5(n||e,e,r),s=new Map,i=$w(r,s),l=k1(r,s).filter(function(x){var C=x.node;return eh(C)});if(!(!l[0]&&(l=i,!l[0]))){var f=$w([o],s).map(function(x){var C=x.node;return C}),p=oL(f,l),h=p.map(function(x){var C=x.node;return C}),m=eL(h,f,n,t);if(m===p5){var v=nL(i,h,rL(r,s));if(v)return{node:v};console.warn("focus-lock: cannot find any node to move focus into");return}return m===void 0?m:p[m]}},aL=function(e){var t=ub(e).filter(eh),n=h5(e,e,t),r=new Map,o=k1([n],r,!0),s=k1(t,r).filter(function(i){var l=i.node;return eh(l)}).map(function(i){var l=i.node;return l});return o.map(function(i){var l=i.node,f=i.index;return{node:l,index:f,lockItem:s.indexOf(l)>=0,guard:ib(l)}})},iL=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},nv=0,rv=!1,m5=function(e,t,n){n===void 0&&(n={});var r=sL(e,t);if(!rv&&r){if(nv>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),rv=!0,setTimeout(function(){rv=!1},1);return}nv++,iL(r.node,n.focusOptions),nv--}};function fb(e){setTimeout(e,1)}var lL=function(){return document&&document.activeElement===document.body},cL=function(){return lL()||Q$()},ec=null,Vl=null,tc=null,Ju=!1,uL=function(){return!0},dL=function(t){return(ec.whiteList||uL)(t)},fL=function(t,n){tc={observerNode:t,portaledElement:n}},pL=function(t){return tc&&tc.portaledElement===t};function Fw(e,t,n,r){var o=null,s=e;do{var i=r[s];if(i.guard)i.node.dataset.focusAutoGuard&&(o=i);else if(i.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var hL=function(t){return t&&"current"in t?t.current:t},mL=function(t){return t?!!Ju:Ju==="meanwhile"},gL=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},vL=function(t,n){return n.some(function(r){return gL(t,r,r)})},th=function(){var t=!1;if(ec){var n=ec,r=n.observed,o=n.persistentFocus,s=n.autoFocus,i=n.shards,l=n.crossFrame,f=n.focusOptions,p=r||tc&&tc.portaledElement,h=document&&document.activeElement;if(p){var m=[p].concat(i.map(hL).filter(Boolean));if((!h||dL(h))&&(o||mL(l)||!cL()||!Vl&&s)&&(p&&!(f5(m)||h&&vL(h,m)||pL(h))&&(document&&!Vl&&h&&!s?(h.blur&&h.blur(),document.body.focus()):(t=m5(m,Vl,{focusOptions:f}),tc={})),Ju=!1,Vl=document&&document.activeElement),document){var v=document&&document.activeElement,x=aL(m),C=x.map(function(b){var w=b.node;return w}).indexOf(v);C>-1&&(x.filter(function(b){var w=b.guard,k=b.node;return w&&k.dataset.focusAutoGuard}).forEach(function(b){var w=b.node;return w.removeAttribute("tabIndex")}),Fw(C,x.length,1,x),Fw(C,-1,-1,x))}}}return t},g5=function(t){th()&&t&&(t.stopPropagation(),t.preventDefault())},pb=function(){return fb(th)},xL=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||fL(r,n)},bL=function(){return null},v5=function(){Ju="just",fb(function(){Ju="meanwhile"})},yL=function(){document.addEventListener("focusin",g5),document.addEventListener("focusout",pb),window.addEventListener("blur",v5)},CL=function(){document.removeEventListener("focusin",g5),document.removeEventListener("focusout",pb),window.removeEventListener("blur",v5)};function wL(e){return e.filter(function(t){var n=t.disabled;return!n})}function SL(e){var t=e.slice(-1)[0];t&&!ec&&yL();var n=ec,r=n&&t&&t.id===n.id;ec=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Vl=null,(!r||n.observed!==t.observed)&&t.onActivation(),th(),fb(th)):(CL(),Vl=null)}Z3.assignSyncMedium(xL);J3.assignMedium(pb);E$.assignMedium(function(e){return e({moveFocusInside:m5,focusInside:f5})});const kL=R$(wL,SL)(bL);var x5=d.forwardRef(function(t,n){return d.createElement(e5,nn({sideCar:kL,ref:n},t))}),b5=e5.propTypes||{};b5.sideCar;MN(b5,["sideCar"]);x5.propTypes={};const Bw=x5;function y5(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function hb(e){var t;if(!y5(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function _L(e){var t,n;return(n=(t=C5(e))==null?void 0:t.defaultView)!=null?n:window}function C5(e){return y5(e)?e.ownerDocument:document}function jL(e){return C5(e).activeElement}function PL(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function IL(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function w5(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:hb(e)&&PL(e)?e:w5(IL(e))}var S5=e=>e.hasAttribute("tabindex"),EL=e=>S5(e)&&e.tabIndex===-1;function ML(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function k5(e){return e.parentElement&&k5(e.parentElement)?!0:e.hidden}function OL(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function _5(e){if(!hb(e)||k5(e)||ML(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]():OL(e)?!0:S5(e)}function DL(e){return e?hb(e)&&_5(e)&&!EL(e):!1}var RL=["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]"],AL=RL.join(),NL=e=>e.offsetWidth>0&&e.offsetHeight>0;function j5(e){const t=Array.from(e.querySelectorAll(AL));return t.unshift(e),t.filter(n=>_5(n)&&NL(n))}var Hw,TL=(Hw=Bw.default)!=null?Hw:Bw,P5=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:i,autoFocus:l,persistentFocus:f,lockFocusAcrossFrames:p}=e,h=d.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&j5(r.current).length===0&&requestAnimationFrame(()=>{var C;(C=r.current)==null||C.focus()})},[t,r]),m=d.useCallback(()=>{var x;(x=n==null?void 0:n.current)==null||x.focus()},[n]),v=o&&!n;return a.jsx(TL,{crossFrame:p,persistentFocus:f,autoFocus:l,disabled:i,onActivation:h,onDeactivation:m,returnFocus:v,children:s})};P5.displayName="FocusLock";var $L=XN?d.useLayoutEffect:d.useEffect;function j1(e,t=[]){const n=d.useRef(e);return $L(()=>{n.current=e}),d.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function LL(e,t,n,r){const o=j1(t);return d.useEffect(()=>{var s;const i=(s=RC(n))!=null?s:document;if(t)return i.addEventListener(e,o,r),()=>{i.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=RC(n))!=null?s:document).removeEventListener(e,o,r)}}function zL(e,t){const n=d.useId();return d.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function FL(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Er(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=j1(n),i=j1(t),[l,f]=d.useState(e.defaultIsOpen||!1),[p,h]=FL(r,l),m=zL(o,"disclosure"),v=d.useCallback(()=>{p||f(!1),i==null||i()},[p,i]),x=d.useCallback(()=>{p||f(!0),s==null||s()},[p,s]),C=d.useCallback(()=>{(h?v:x)()},[h,x,v]);return{isOpen:!!h,onOpen:x,onClose:v,onToggle:C,isControlled:p,getButtonProps:(b={})=>({...b,"aria-expanded":h,"aria-controls":m,onClick:E7(b.onClick,C)}),getDisclosureProps:(b={})=>({...b,hidden:!h,id:m})}}var[BL,HL]=Tt({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),I5=Pe(function(t,n){const r=Hn("Input",t),{children:o,className:s,...i}=Xt(t),l=et("chakra-input__group",s),f={},p=_d(o),h=r.field;p.forEach(v=>{var x,C;r&&(h&&v.type.id==="InputLeftElement"&&(f.paddingStart=(x=h.height)!=null?x:h.h),h&&v.type.id==="InputRightElement"&&(f.paddingEnd=(C=h.height)!=null?C:h.h),v.type.id==="InputRightAddon"&&(f.borderEndRadius=0),v.type.id==="InputLeftAddon"&&(f.borderStartRadius=0))});const m=p.map(v=>{var x,C;const b=jj({size:((x=v.props)==null?void 0:x.size)||t.size,variant:((C=v.props)==null?void 0:C.variant)||t.variant});return v.type.id!=="Input"?d.cloneElement(v,b):d.cloneElement(v,Object.assign(b,f,v.props))});return a.jsx(_e.div,{className:l,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...i,children:a.jsx(BL,{value:r,children:m})})});I5.displayName="InputGroup";var WL=_e("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),jm=Pe(function(t,n){var r,o;const{placement:s="left",...i}=t,l=HL(),f=l.field,h={[s==="left"?"insetStart":"insetEnd"]:"0",width:(r=f==null?void 0:f.height)!=null?r:f==null?void 0:f.h,height:(o=f==null?void 0:f.height)!=null?o:f==null?void 0:f.h,fontSize:f==null?void 0:f.fontSize,...l.element};return a.jsx(WL,{ref:n,__css:h,...i})});jm.id="InputElement";jm.displayName="InputElement";var E5=Pe(function(t,n){const{className:r,...o}=t,s=et("chakra-input__left-element",r);return a.jsx(jm,{ref:n,placement:"left",className:s,...o})});E5.id="InputLeftElement";E5.displayName="InputLeftElement";var mb=Pe(function(t,n){const{className:r,...o}=t,s=et("chakra-input__right-element",r);return a.jsx(jm,{ref:n,placement:"right",className:s,...o})});mb.id="InputRightElement";mb.displayName="InputRightElement";var Pm=Pe(function(t,n){const{htmlSize:r,...o}=t,s=Hn("Input",o),i=Xt(o),l=Jx(i),f=et("chakra-input",t.className);return a.jsx(_e.input,{size:r,...l,__css:s.field,ref:n,className:f})});Pm.displayName="Input";Pm.id="Input";var Im=Pe(function(t,n){const r=Qa("Link",t),{className:o,isExternal:s,...i}=Xt(t);return a.jsx(_e.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:et("chakra-link",o),...i,__css:r})});Im.displayName="Link";var[VL,M5]=Tt({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),gb=Pe(function(t,n){const r=Hn("List",t),{children:o,styleType:s="none",stylePosition:i,spacing:l,...f}=Xt(t),p=_d(o),m=l?{["& > *:not(style) ~ *:not(style)"]:{mt:l}}:{};return a.jsx(VL,{value:r,children:a.jsx(_e.ul,{ref:n,listStyleType:s,listStylePosition:i,role:"list",__css:{...r.container,...m},...f,children:p})})});gb.displayName="List";var UL=Pe((e,t)=>{const{as:n,...r}=e;return a.jsx(gb,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});UL.displayName="OrderedList";var Id=Pe(function(t,n){const{as:r,...o}=t;return a.jsx(gb,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});Id.displayName="UnorderedList";var No=Pe(function(t,n){const r=M5();return a.jsx(_e.li,{ref:n,...t,__css:r.item})});No.displayName="ListItem";var GL=Pe(function(t,n){const r=M5();return a.jsx(An,{ref:n,role:"presentation",...t,__css:r.icon})});GL.displayName="ListIcon";var Ua=Pe(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:i,column:l,row:f,autoFlow:p,autoRows:h,templateRows:m,autoColumns:v,templateColumns:x,...C}=t,b={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:i,gridAutoColumns:v,gridColumn:l,gridRow:f,gridAutoFlow:p,gridAutoRows:h,gridTemplateRows:m,gridTemplateColumns:x};return a.jsx(_e.div,{ref:n,__css:b,...C})});Ua.displayName="Grid";function O5(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):t1(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Za=_e("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});Za.displayName="Spacer";var D5=e=>a.jsx(_e.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});D5.displayName="StackItem";function KL(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{"&":O5(n,o=>r[o])}}var vb=Pe((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:i="0.5rem",wrap:l,children:f,divider:p,className:h,shouldWrapChildren:m,...v}=e,x=n?"row":r??"column",C=d.useMemo(()=>KL({spacing:i,direction:x}),[i,x]),b=!!p,w=!m&&!b,k=d.useMemo(()=>{const j=_d(f);return w?j:j.map((I,M)=>{const E=typeof I.key<"u"?I.key:M,O=M+1===j.length,A=m?a.jsx(D5,{children:I},E):I;if(!b)return A;const R=d.cloneElement(p,{__css:C}),$=O?null:R;return a.jsxs(d.Fragment,{children:[A,$]},E)})},[p,C,b,w,m,f]),_=et("chakra-stack",h);return a.jsx(_e.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:x,flexWrap:l,gap:b?void 0:i,className:_,...v,children:k})});vb.displayName="Stack";var R5=Pe((e,t)=>a.jsx(vb,{align:"center",...e,direction:"column",ref:t}));R5.displayName="VStack";var xb=Pe((e,t)=>a.jsx(vb,{align:"center",...e,direction:"row",ref:t}));xb.displayName="HStack";function Ww(e){return O5(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var ed=Pe(function(t,n){const{area:r,colSpan:o,colStart:s,colEnd:i,rowEnd:l,rowSpan:f,rowStart:p,...h}=t,m=jj({gridArea:r,gridColumn:Ww(o),gridRow:Ww(f),gridColumnStart:s,gridColumnEnd:i,gridRowStart:p,gridRowEnd:l});return a.jsx(_e.div,{ref:n,__css:m,...h})});ed.displayName="GridItem";var ua=Pe(function(t,n){const r=Qa("Badge",t),{className:o,...s}=Xt(t);return a.jsx(_e.span,{ref:n,className:et("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});ua.displayName="Badge";var Fr=Pe(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:i,borderWidth:l,borderStyle:f,borderColor:p,...h}=Qa("Divider",t),{className:m,orientation:v="horizontal",__css:x,...C}=Xt(t),b={vertical:{borderLeftWidth:r||i||l||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||l||"1px",width:"100%"}};return a.jsx(_e.hr,{ref:n,"aria-orientation":v,...C,__css:{...h,border:"0",borderColor:p,borderStyle:f,...b[v],...x},className:et("chakra-divider",m)})});Fr.displayName="Divider";function qL(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function XL(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=d.useState([]),s=d.useRef(),i=()=>{s.current&&(clearTimeout(s.current),s.current=null)},l=()=>{i(),s.current=setTimeout(()=>{o([]),s.current=null},t)};d.useEffect(()=>i,[]);function f(p){return h=>{if(h.key==="Backspace"){const m=[...r];m.pop(),o(m);return}if(qL(h)){const m=r.concat(h.key);n(h)&&(h.preventDefault(),h.stopPropagation()),o(m),p(m.join("")),l()}}}return f}function YL(e,t,n,r){if(t==null)return r;if(!r)return e.find(i=>n(i).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(s=>n(s).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let s;return o.includes(r)?(s=o.indexOf(r)+1,s===o.length&&(s=0),o[s]):(s=e.indexOf(o[0]),e[s])}return r}function QL(){const e=d.useRef(new Map),t=e.current,n=d.useCallback((o,s,i,l)=>{e.current.set(i,{type:s,el:o,options:l}),o.addEventListener(s,i,l)},[]),r=d.useCallback((o,s,i,l)=>{o.removeEventListener(s,i,l),e.current.delete(i)},[]);return d.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function ov(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function A5(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:i,onMouseUp:l,onClick:f,onKeyDown:p,onKeyUp:h,tabIndex:m,onMouseOver:v,onMouseLeave:x,...C}=e,[b,w]=d.useState(!0),[k,_]=d.useState(!1),j=QL(),I=L=>{L&&L.tagName!=="BUTTON"&&w(!1)},M=b?m:m||0,E=n&&!r,O=d.useCallback(L=>{if(n){L.stopPropagation(),L.preventDefault();return}L.currentTarget.focus(),f==null||f(L)},[n,f]),D=d.useCallback(L=>{k&&ov(L)&&(L.preventDefault(),L.stopPropagation(),_(!1),j.remove(document,"keyup",D,!1))},[k,j]),A=d.useCallback(L=>{if(p==null||p(L),n||L.defaultPrevented||L.metaKey||!ov(L.nativeEvent)||b)return;const X=o&&L.key==="Enter";s&&L.key===" "&&(L.preventDefault(),_(!0)),X&&(L.preventDefault(),L.currentTarget.click()),j.add(document,"keyup",D,!1)},[n,b,p,o,s,j,D]),R=d.useCallback(L=>{if(h==null||h(L),n||L.defaultPrevented||L.metaKey||!ov(L.nativeEvent)||b)return;s&&L.key===" "&&(L.preventDefault(),_(!1),L.currentTarget.click())},[s,b,n,h]),$=d.useCallback(L=>{L.button===0&&(_(!1),j.remove(document,"mouseup",$,!1))},[j]),K=d.useCallback(L=>{if(L.button!==0)return;if(n){L.stopPropagation(),L.preventDefault();return}b||_(!0),L.currentTarget.focus({preventScroll:!0}),j.add(document,"mouseup",$,!1),i==null||i(L)},[n,b,i,j,$]),B=d.useCallback(L=>{L.button===0&&(b||_(!1),l==null||l(L))},[l,b]),U=d.useCallback(L=>{if(n){L.preventDefault();return}v==null||v(L)},[n,v]),Y=d.useCallback(L=>{k&&(L.preventDefault(),_(!1)),x==null||x(L)},[k,x]),W=yt(t,I);return b?{...C,ref:W,type:"button","aria-disabled":E?void 0:n,disabled:E,onClick:O,onMouseDown:i,onMouseUp:l,onKeyUp:h,onKeyDown:p,onMouseOver:v,onMouseLeave:x}:{...C,ref:W,role:"button","data-active":at(k),"aria-disabled":n?"true":void 0,tabIndex:E?void 0:M,onClick:O,onMouseDown:K,onMouseUp:B,onKeyUp:R,onKeyDown:A,onMouseOver:U,onMouseLeave:Y}}function ZL(e){const t=e.current;if(!t)return!1;const n=jL(t);return!n||t.contains(n)?!1:!!DL(n)}function N5(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;la(()=>{if(!s||ZL(e))return;const i=(o==null?void 0:o.current)||e.current;let l;if(i)return l=requestAnimationFrame(()=>{i.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(l)}},[s,e,o])}var JL={preventScroll:!0,shouldFocus:!1};function ez(e,t=JL){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,i=tz(e)?e.current:e,l=o&&s,f=d.useRef(l),p=d.useRef(s);Xl(()=>{!p.current&&s&&(f.current=l),p.current=s},[s,l]);const h=d.useCallback(()=>{if(!(!s||!i||!f.current)&&(f.current=!1,!i.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var m;(m=n.current)==null||m.focus({preventScroll:r})});else{const m=j5(i);m.length>0&&requestAnimationFrame(()=>{m[0].focus({preventScroll:r})})}},[s,r,i,n]);la(()=>{h()},[h]),_i(i,"transitionend",h)}function tz(e){return"current"in e}var kl=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),jn={arrowShadowColor:kl("--popper-arrow-shadow-color"),arrowSize:kl("--popper-arrow-size","8px"),arrowSizeHalf:kl("--popper-arrow-size-half"),arrowBg:kl("--popper-arrow-bg"),transformOrigin:kl("--popper-transform-origin"),arrowOffset:kl("--popper-arrow-offset")};function nz(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var rz={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"},oz=e=>rz[e],Vw={scroll:!0,resize:!0};function sz(e){let t;return typeof e=="object"?t={enabled:!0,options:{...Vw,...e}}:t={enabled:e,options:Vw},t}var az={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`}},iz={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{Uw(e)},effect:({state:e})=>()=>{Uw(e)}},Uw=e=>{e.elements.popper.style.setProperty(jn.transformOrigin.var,oz(e.placement))},lz={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{cz(e)}},cz=e=>{var t;if(!e.placement)return;const n=uz(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:jn.arrowSize.varRef,height:jn.arrowSize.varRef,zIndex:-1});const r={[jn.arrowSizeHalf.var]:`calc(${jn.arrowSize.varRef} / 2 - 1px)`,[jn.arrowOffset.var]:`calc(${jn.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},uz=e=>{if(e.startsWith("top"))return{property:"bottom",value:jn.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:jn.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:jn.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:jn.arrowOffset.varRef}},dz={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{Gw(e)},effect:({state:e})=>()=>{Gw(e)}},Gw=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=nz(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:jn.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},fz={"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"}},pz={"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 hz(e,t="ltr"){var n,r;const o=((n=fz[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=pz[e])!=null?r:o}var _r="top",ho="bottom",mo="right",jr="left",bb="auto",Ed=[_r,ho,mo,jr],vc="start",td="end",mz="clippingParents",T5="viewport",yu="popper",gz="reference",Kw=Ed.reduce(function(e,t){return e.concat([t+"-"+vc,t+"-"+td])},[]),$5=[].concat(Ed,[bb]).reduce(function(e,t){return e.concat([t,t+"-"+vc,t+"-"+td])},[]),vz="beforeRead",xz="read",bz="afterRead",yz="beforeMain",Cz="main",wz="afterMain",Sz="beforeWrite",kz="write",_z="afterWrite",jz=[vz,xz,bz,yz,Cz,wz,Sz,kz,_z];function ms(e){return e?(e.nodeName||"").toLowerCase():null}function Br(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Li(e){var t=Br(e).Element;return e instanceof t||e instanceof Element}function uo(e){var t=Br(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function yb(e){if(typeof ShadowRoot>"u")return!1;var t=Br(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Pz(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!uo(s)||!ms(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var l=o[i];l===!1?s.removeAttribute(i):s.setAttribute(i,l===!0?"":l)}))})}function Iz(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},i=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=i.reduce(function(f,p){return f[p]="",f},{});!uo(o)||!ms(o)||(Object.assign(o.style,l),Object.keys(s).forEach(function(f){o.removeAttribute(f)}))})}}const Ez={name:"applyStyles",enabled:!0,phase:"write",fn:Pz,effect:Iz,requires:["computeStyles"]};function hs(e){return e.split("-")[0]}var ji=Math.max,nh=Math.min,xc=Math.round;function P1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function L5(){return!/^((?!chrome|android).)*safari/i.test(P1())}function bc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&uo(e)&&(o=e.offsetWidth>0&&xc(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&xc(r.height)/e.offsetHeight||1);var i=Li(e)?Br(e):window,l=i.visualViewport,f=!L5()&&n,p=(r.left+(f&&l?l.offsetLeft:0))/o,h=(r.top+(f&&l?l.offsetTop:0))/s,m=r.width/o,v=r.height/s;return{width:m,height:v,top:h,right:p+m,bottom:h+v,left:p,x:p,y:h}}function Cb(e){var t=bc(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 z5(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&yb(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ta(e){return Br(e).getComputedStyle(e)}function Mz(e){return["table","td","th"].indexOf(ms(e))>=0}function Ja(e){return((Li(e)?e.ownerDocument:e.document)||window.document).documentElement}function Em(e){return ms(e)==="html"?e:e.assignedSlot||e.parentNode||(yb(e)?e.host:null)||Ja(e)}function qw(e){return!uo(e)||ta(e).position==="fixed"?null:e.offsetParent}function Oz(e){var t=/firefox/i.test(P1()),n=/Trident/i.test(P1());if(n&&uo(e)){var r=ta(e);if(r.position==="fixed")return null}var o=Em(e);for(yb(o)&&(o=o.host);uo(o)&&["html","body"].indexOf(ms(o))<0;){var s=ta(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function Md(e){for(var t=Br(e),n=qw(e);n&&Mz(n)&&ta(n).position==="static";)n=qw(n);return n&&(ms(n)==="html"||ms(n)==="body"&&ta(n).position==="static")?t:n||Oz(e)||t}function wb(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Bu(e,t,n){return ji(e,nh(t,n))}function Dz(e,t,n){var r=Bu(e,t,n);return r>n?n:r}function F5(){return{top:0,right:0,bottom:0,left:0}}function B5(e){return Object.assign({},F5(),e)}function H5(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Rz=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,B5(typeof t!="number"?t:H5(t,Ed))};function Az(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,l=hs(n.placement),f=wb(l),p=[jr,mo].indexOf(l)>=0,h=p?"height":"width";if(!(!s||!i)){var m=Rz(o.padding,n),v=Cb(s),x=f==="y"?_r:jr,C=f==="y"?ho:mo,b=n.rects.reference[h]+n.rects.reference[f]-i[f]-n.rects.popper[h],w=i[f]-n.rects.reference[f],k=Md(s),_=k?f==="y"?k.clientHeight||0:k.clientWidth||0:0,j=b/2-w/2,I=m[x],M=_-v[h]-m[C],E=_/2-v[h]/2+j,O=Bu(I,E,M),D=f;n.modifiersData[r]=(t={},t[D]=O,t.centerOffset=O-E,t)}}function Nz(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||z5(t.elements.popper,o)&&(t.elements.arrow=o))}const Tz={name:"arrow",enabled:!0,phase:"main",fn:Az,effect:Nz,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function yc(e){return e.split("-")[1]}var $z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Lz(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:xc(n*o)/o||0,y:xc(r*o)/o||0}}function Xw(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,i=e.offsets,l=e.position,f=e.gpuAcceleration,p=e.adaptive,h=e.roundOffsets,m=e.isFixed,v=i.x,x=v===void 0?0:v,C=i.y,b=C===void 0?0:C,w=typeof h=="function"?h({x,y:b}):{x,y:b};x=w.x,b=w.y;var k=i.hasOwnProperty("x"),_=i.hasOwnProperty("y"),j=jr,I=_r,M=window;if(p){var E=Md(n),O="clientHeight",D="clientWidth";if(E===Br(n)&&(E=Ja(n),ta(E).position!=="static"&&l==="absolute"&&(O="scrollHeight",D="scrollWidth")),E=E,o===_r||(o===jr||o===mo)&&s===td){I=ho;var A=m&&E===M&&M.visualViewport?M.visualViewport.height:E[O];b-=A-r.height,b*=f?1:-1}if(o===jr||(o===_r||o===ho)&&s===td){j=mo;var R=m&&E===M&&M.visualViewport?M.visualViewport.width:E[D];x-=R-r.width,x*=f?1:-1}}var $=Object.assign({position:l},p&&$z),K=h===!0?Lz({x,y:b},Br(n)):{x,y:b};if(x=K.x,b=K.y,f){var B;return Object.assign({},$,(B={},B[I]=_?"0":"",B[j]=k?"0":"",B.transform=(M.devicePixelRatio||1)<=1?"translate("+x+"px, "+b+"px)":"translate3d("+x+"px, "+b+"px, 0)",B))}return Object.assign({},$,(t={},t[I]=_?b+"px":"",t[j]=k?x+"px":"",t.transform="",t))}function zz(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,i=s===void 0?!0:s,l=n.roundOffsets,f=l===void 0?!0:l,p={placement:hs(t.placement),variation:yc(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Xw(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:f})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Xw(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Fz={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:zz,data:{}};var Kf={passive:!0};function Bz(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,l=i===void 0?!0:i,f=Br(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&p.forEach(function(h){h.addEventListener("scroll",n.update,Kf)}),l&&f.addEventListener("resize",n.update,Kf),function(){s&&p.forEach(function(h){h.removeEventListener("scroll",n.update,Kf)}),l&&f.removeEventListener("resize",n.update,Kf)}}const Hz={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Bz,data:{}};var Wz={left:"right",right:"left",bottom:"top",top:"bottom"};function Ep(e){return e.replace(/left|right|bottom|top/g,function(t){return Wz[t]})}var Vz={start:"end",end:"start"};function Yw(e){return e.replace(/start|end/g,function(t){return Vz[t]})}function Sb(e){var t=Br(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function kb(e){return bc(Ja(e)).left+Sb(e).scrollLeft}function Uz(e,t){var n=Br(e),r=Ja(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,l=0,f=0;if(o){s=o.width,i=o.height;var p=L5();(p||!p&&t==="fixed")&&(l=o.offsetLeft,f=o.offsetTop)}return{width:s,height:i,x:l+kb(e),y:f}}function Gz(e){var t,n=Ja(e),r=Sb(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=ji(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=ji(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+kb(e),f=-r.scrollTop;return ta(o||n).direction==="rtl"&&(l+=ji(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:l,y:f}}function _b(e){var t=ta(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function W5(e){return["html","body","#document"].indexOf(ms(e))>=0?e.ownerDocument.body:uo(e)&&_b(e)?e:W5(Em(e))}function Hu(e,t){var n;t===void 0&&(t=[]);var r=W5(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Br(r),i=o?[s].concat(s.visualViewport||[],_b(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(Hu(Em(i)))}function I1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Kz(e,t){var n=bc(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 Qw(e,t,n){return t===T5?I1(Uz(e,n)):Li(t)?Kz(t,n):I1(Gz(Ja(e)))}function qz(e){var t=Hu(Em(e)),n=["absolute","fixed"].indexOf(ta(e).position)>=0,r=n&&uo(e)?Md(e):e;return Li(r)?t.filter(function(o){return Li(o)&&z5(o,r)&&ms(o)!=="body"}):[]}function Xz(e,t,n,r){var o=t==="clippingParents"?qz(e):[].concat(t),s=[].concat(o,[n]),i=s[0],l=s.reduce(function(f,p){var h=Qw(e,p,r);return f.top=ji(h.top,f.top),f.right=nh(h.right,f.right),f.bottom=nh(h.bottom,f.bottom),f.left=ji(h.left,f.left),f},Qw(e,i,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function V5(e){var t=e.reference,n=e.element,r=e.placement,o=r?hs(r):null,s=r?yc(r):null,i=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,f;switch(o){case _r:f={x:i,y:t.y-n.height};break;case ho:f={x:i,y:t.y+t.height};break;case mo:f={x:t.x+t.width,y:l};break;case jr:f={x:t.x-n.width,y:l};break;default:f={x:t.x,y:t.y}}var p=o?wb(o):null;if(p!=null){var h=p==="y"?"height":"width";switch(s){case vc:f[p]=f[p]-(t[h]/2-n[h]/2);break;case td:f[p]=f[p]+(t[h]/2-n[h]/2);break}}return f}function nd(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,i=s===void 0?e.strategy:s,l=n.boundary,f=l===void 0?mz:l,p=n.rootBoundary,h=p===void 0?T5:p,m=n.elementContext,v=m===void 0?yu:m,x=n.altBoundary,C=x===void 0?!1:x,b=n.padding,w=b===void 0?0:b,k=B5(typeof w!="number"?w:H5(w,Ed)),_=v===yu?gz:yu,j=e.rects.popper,I=e.elements[C?_:v],M=Xz(Li(I)?I:I.contextElement||Ja(e.elements.popper),f,h,i),E=bc(e.elements.reference),O=V5({reference:E,element:j,strategy:"absolute",placement:o}),D=I1(Object.assign({},j,O)),A=v===yu?D:E,R={top:M.top-A.top+k.top,bottom:A.bottom-M.bottom+k.bottom,left:M.left-A.left+k.left,right:A.right-M.right+k.right},$=e.modifiersData.offset;if(v===yu&&$){var K=$[o];Object.keys(R).forEach(function(B){var U=[mo,ho].indexOf(B)>=0?1:-1,Y=[_r,ho].indexOf(B)>=0?"y":"x";R[B]+=K[Y]*U})}return R}function Yz(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,l=n.flipVariations,f=n.allowedAutoPlacements,p=f===void 0?$5:f,h=yc(r),m=h?l?Kw:Kw.filter(function(C){return yc(C)===h}):Ed,v=m.filter(function(C){return p.indexOf(C)>=0});v.length===0&&(v=m);var x=v.reduce(function(C,b){return C[b]=nd(e,{placement:b,boundary:o,rootBoundary:s,padding:i})[hs(b)],C},{});return Object.keys(x).sort(function(C,b){return x[C]-x[b]})}function Qz(e){if(hs(e)===bb)return[];var t=Ep(e);return[Yw(e),t,Yw(t)]}function Zz(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!0:i,f=n.fallbackPlacements,p=n.padding,h=n.boundary,m=n.rootBoundary,v=n.altBoundary,x=n.flipVariations,C=x===void 0?!0:x,b=n.allowedAutoPlacements,w=t.options.placement,k=hs(w),_=k===w,j=f||(_||!C?[Ep(w)]:Qz(w)),I=[w].concat(j).reduce(function(oe,V){return oe.concat(hs(V)===bb?Yz(t,{placement:V,boundary:h,rootBoundary:m,padding:p,flipVariations:C,allowedAutoPlacements:b}):V)},[]),M=t.rects.reference,E=t.rects.popper,O=new Map,D=!0,A=I[0],R=0;R<I.length;R++){var $=I[R],K=hs($),B=yc($)===vc,U=[_r,ho].indexOf(K)>=0,Y=U?"width":"height",W=nd(t,{placement:$,boundary:h,rootBoundary:m,altBoundary:v,padding:p}),L=U?B?mo:jr:B?ho:_r;M[Y]>E[Y]&&(L=Ep(L));var X=Ep(L),z=[];if(s&&z.push(W[K]<=0),l&&z.push(W[L]<=0,W[X]<=0),z.every(function(oe){return oe})){A=$,D=!1;break}O.set($,z)}if(D)for(var q=C?3:1,ne=function(V){var G=I.find(function(J){var se=O.get(J);if(se)return se.slice(0,V).every(function(re){return re})});if(G)return A=G,"break"},Q=q;Q>0;Q--){var ie=ne(Q);if(ie==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const Jz={name:"flip",enabled:!0,phase:"main",fn:Zz,requiresIfExists:["offset"],data:{_skip:!1}};function Zw(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 Jw(e){return[_r,mo,ho,jr].some(function(t){return e[t]>=0})}function eF(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,i=nd(t,{elementContext:"reference"}),l=nd(t,{altBoundary:!0}),f=Zw(i,r),p=Zw(l,o,s),h=Jw(f),m=Jw(p);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:p,isReferenceHidden:h,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":m})}const tF={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:eF};function nF(e,t,n){var r=hs(e),o=[jr,_r].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=s[0],l=s[1];return i=i||0,l=(l||0)*o,[jr,mo].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function rF(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,i=$5.reduce(function(h,m){return h[m]=nF(m,t.rects,s),h},{}),l=i[t.placement],f=l.x,p=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=i}const oF={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:rF};function sF(e){var t=e.state,n=e.name;t.modifiersData[n]=V5({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const aF={name:"popperOffsets",enabled:!0,phase:"read",fn:sF,data:{}};function iF(e){return e==="x"?"y":"x"}function lF(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,l=i===void 0?!1:i,f=n.boundary,p=n.rootBoundary,h=n.altBoundary,m=n.padding,v=n.tether,x=v===void 0?!0:v,C=n.tetherOffset,b=C===void 0?0:C,w=nd(t,{boundary:f,rootBoundary:p,padding:m,altBoundary:h}),k=hs(t.placement),_=yc(t.placement),j=!_,I=wb(k),M=iF(I),E=t.modifiersData.popperOffsets,O=t.rects.reference,D=t.rects.popper,A=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,R=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),$=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,K={x:0,y:0};if(E){if(s){var B,U=I==="y"?_r:jr,Y=I==="y"?ho:mo,W=I==="y"?"height":"width",L=E[I],X=L+w[U],z=L-w[Y],q=x?-D[W]/2:0,ne=_===vc?O[W]:D[W],Q=_===vc?-D[W]:-O[W],ie=t.elements.arrow,oe=x&&ie?Cb(ie):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:F5(),G=V[U],J=V[Y],se=Bu(0,O[W],oe[W]),re=j?O[W]/2-q-se-G-R.mainAxis:ne-se-G-R.mainAxis,fe=j?-O[W]/2+q+se+J+R.mainAxis:Q+se+J+R.mainAxis,de=t.elements.arrow&&Md(t.elements.arrow),me=de?I==="y"?de.clientTop||0:de.clientLeft||0:0,ye=(B=$==null?void 0:$[I])!=null?B:0,he=L+re-ye-me,ue=L+fe-ye,De=Bu(x?nh(X,he):X,L,x?ji(z,ue):z);E[I]=De,K[I]=De-L}if(l){var je,Be=I==="x"?_r:jr,rt=I==="x"?ho:mo,Ue=E[M],Ct=M==="y"?"height":"width",Xe=Ue+w[Be],tt=Ue-w[rt],ve=[_r,jr].indexOf(k)!==-1,Re=(je=$==null?void 0:$[M])!=null?je:0,st=ve?Xe:Ue-O[Ct]-D[Ct]-Re+R.altAxis,mt=ve?Ue+O[Ct]+D[Ct]-Re-R.altAxis:tt,ge=x&&ve?Dz(st,Ue,mt):Bu(x?st:Xe,Ue,x?mt:tt);E[M]=ge,K[M]=ge-Ue}t.modifiersData[r]=K}}const cF={name:"preventOverflow",enabled:!0,phase:"main",fn:lF,requiresIfExists:["offset"]};function uF(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function dF(e){return e===Br(e)||!uo(e)?Sb(e):uF(e)}function fF(e){var t=e.getBoundingClientRect(),n=xc(t.width)/e.offsetWidth||1,r=xc(t.height)/e.offsetHeight||1;return n!==1||r!==1}function pF(e,t,n){n===void 0&&(n=!1);var r=uo(t),o=uo(t)&&fF(t),s=Ja(t),i=bc(e,o,n),l={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((ms(t)!=="body"||_b(s))&&(l=dF(t)),uo(t)?(f=bc(t,!0),f.x+=t.clientLeft,f.y+=t.clientTop):s&&(f.x=kb(s))),{x:i.left+l.scrollLeft-f.x,y:i.top+l.scrollTop-f.y,width:i.width,height:i.height}}function hF(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var i=[].concat(s.requires||[],s.requiresIfExists||[]);i.forEach(function(l){if(!n.has(l)){var f=t.get(l);f&&o(f)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function mF(e){var t=hF(e);return jz.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function gF(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function vF(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var eS={placement:"bottom",modifiers:[],strategy:"absolute"};function tS(){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 xF(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?eS:o;return function(l,f,p){p===void 0&&(p=s);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},eS,s),modifiersData:{},elements:{reference:l,popper:f},attributes:{},styles:{}},m=[],v=!1,x={state:h,setOptions:function(k){var _=typeof k=="function"?k(h.options):k;b(),h.options=Object.assign({},s,h.options,_),h.scrollParents={reference:Li(l)?Hu(l):l.contextElement?Hu(l.contextElement):[],popper:Hu(f)};var j=mF(vF([].concat(r,h.options.modifiers)));return h.orderedModifiers=j.filter(function(I){return I.enabled}),C(),x.update()},forceUpdate:function(){if(!v){var k=h.elements,_=k.reference,j=k.popper;if(tS(_,j)){h.rects={reference:pF(_,Md(j),h.options.strategy==="fixed"),popper:Cb(j)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(R){return h.modifiersData[R.name]=Object.assign({},R.data)});for(var I=0;I<h.orderedModifiers.length;I++){if(h.reset===!0){h.reset=!1,I=-1;continue}var M=h.orderedModifiers[I],E=M.fn,O=M.options,D=O===void 0?{}:O,A=M.name;typeof E=="function"&&(h=E({state:h,options:D,name:A,instance:x})||h)}}}},update:gF(function(){return new Promise(function(w){x.forceUpdate(),w(h)})}),destroy:function(){b(),v=!0}};if(!tS(l,f))return x;x.setOptions(p).then(function(w){!v&&p.onFirstUpdate&&p.onFirstUpdate(w)});function C(){h.orderedModifiers.forEach(function(w){var k=w.name,_=w.options,j=_===void 0?{}:_,I=w.effect;if(typeof I=="function"){var M=I({state:h,name:k,instance:x,options:j}),E=function(){};m.push(M||E)}})}function b(){m.forEach(function(w){return w()}),m=[]}return x}}var bF=[Hz,aF,Fz,Ez,oF,Jz,cF,Tz,tF],yF=xF({defaultModifiers:bF});function jb(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:i=!0,offset:l,gutter:f=8,flip:p=!0,boundary:h="clippingParents",preventOverflow:m=!0,matchWidth:v,direction:x="ltr"}=e,C=d.useRef(null),b=d.useRef(null),w=d.useRef(null),k=hz(r,x),_=d.useRef(()=>{}),j=d.useCallback(()=>{var R;!t||!C.current||!b.current||((R=_.current)==null||R.call(_),w.current=yF(C.current,b.current,{placement:k,modifiers:[dz,lz,iz,{...az,enabled:!!v},{name:"eventListeners",...sz(i)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:l??[0,f]}},{name:"flip",enabled:!!p,options:{padding:8}},{name:"preventOverflow",enabled:!!m,options:{boundary:h}},...n??[]],strategy:o}),w.current.forceUpdate(),_.current=w.current.destroy)},[k,t,n,v,i,s,l,f,p,m,h,o]);d.useEffect(()=>()=>{var R;!C.current&&!b.current&&((R=w.current)==null||R.destroy(),w.current=null)},[]);const I=d.useCallback(R=>{C.current=R,j()},[j]),M=d.useCallback((R={},$=null)=>({...R,ref:yt(I,$)}),[I]),E=d.useCallback(R=>{b.current=R,j()},[j]),O=d.useCallback((R={},$=null)=>({...R,ref:yt(E,$),style:{...R.style,position:o,minWidth:v?void 0:"max-content",inset:"0 auto auto 0"}}),[o,E,v]),D=d.useCallback((R={},$=null)=>{const{size:K,shadowColor:B,bg:U,style:Y,...W}=R;return{...W,ref:$,"data-popper-arrow":"",style:CF(R)}},[]),A=d.useCallback((R={},$=null)=>({...R,ref:$,"data-popper-arrow-inner":""}),[]);return{update(){var R;(R=w.current)==null||R.update()},forceUpdate(){var R;(R=w.current)==null||R.forceUpdate()},transformOrigin:jn.transformOrigin.varRef,referenceRef:I,popperRef:E,getPopperProps:O,getArrowProps:D,getArrowInnerProps:A,getReferenceProps:M}}function CF(e){const{size:t,shadowColor:n,bg:r,style:o}=e,s={...o,position:"absolute"};return t&&(s["--popper-arrow-size"]=t),n&&(s["--popper-arrow-shadow-color"]=n),r&&(s["--popper-arrow-bg"]=r),s}function Pb(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=tn(n),i=tn(t),[l,f]=d.useState(e.defaultIsOpen||!1),p=r!==void 0?r:l,h=r!==void 0,m=d.useId(),v=o??`disclosure-${m}`,x=d.useCallback(()=>{h||f(!1),i==null||i()},[h,i]),C=d.useCallback(()=>{h||f(!0),s==null||s()},[h,s]),b=d.useCallback(()=>{p?x():C()},[p,C,x]);function w(_={}){return{..._,"aria-expanded":p,"aria-controls":v,onClick(j){var I;(I=_.onClick)==null||I.call(_,j),b()}}}function k(_={}){return{..._,hidden:!p,id:v}}return{isOpen:p,onOpen:C,onClose:x,onToggle:b,isControlled:h,getButtonProps:w,getDisclosureProps:k}}function wF(e){const{ref:t,handler:n,enabled:r=!0}=e,o=tn(n),i=d.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;d.useEffect(()=>{if(!r)return;const l=m=>{sv(m,t)&&(i.isPointerDown=!0)},f=m=>{if(i.ignoreEmulatedMouseEvents){i.ignoreEmulatedMouseEvents=!1;return}i.isPointerDown&&n&&sv(m,t)&&(i.isPointerDown=!1,o(m))},p=m=>{i.ignoreEmulatedMouseEvents=!0,n&&i.isPointerDown&&sv(m,t)&&(i.isPointerDown=!1,o(m))},h=U5(t.current);return h.addEventListener("mousedown",l,!0),h.addEventListener("mouseup",f,!0),h.addEventListener("touchstart",l,!0),h.addEventListener("touchend",p,!0),()=>{h.removeEventListener("mousedown",l,!0),h.removeEventListener("mouseup",f,!0),h.removeEventListener("touchstart",l,!0),h.removeEventListener("touchend",p,!0)}},[n,t,o,i,r])}function sv(e,t){var n;const r=e.target;return r&&!U5(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function U5(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function G5(e){const{isOpen:t,ref:n}=e,[r,o]=d.useState(t),[s,i]=d.useState(!1);return d.useEffect(()=>{s||(o(t),i(!0))},[t,s,r]),_i(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var f;const p=_L(n.current),h=new p.CustomEvent("animationend",{bubbles:!0});(f=n.current)==null||f.dispatchEvent(h)}}}function Ib(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[SF,kF,_F,jF]=Yx(),[PF,Od]=Tt({strict:!1,name:"MenuContext"});function IF(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function K5(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function nS(e){return K5(e).activeElement===e}function EF(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:i,isOpen:l,defaultIsOpen:f,onClose:p,onOpen:h,placement:m="bottom-start",lazyBehavior:v="unmount",direction:x,computePositionOnMount:C=!1,...b}=e,w=d.useRef(null),k=d.useRef(null),_=_F(),j=d.useCallback(()=>{requestAnimationFrame(()=>{var ie;(ie=w.current)==null||ie.focus({preventScroll:!1})})},[]),I=d.useCallback(()=>{const ie=setTimeout(()=>{var oe;if(o)(oe=o.current)==null||oe.focus();else{const V=_.firstEnabled();V&&B(V.index)}});X.current.add(ie)},[_,o]),M=d.useCallback(()=>{const ie=setTimeout(()=>{const oe=_.lastEnabled();oe&&B(oe.index)});X.current.add(ie)},[_]),E=d.useCallback(()=>{h==null||h(),s?I():j()},[s,I,j,h]),{isOpen:O,onOpen:D,onClose:A,onToggle:R}=Pb({isOpen:l,defaultIsOpen:f,onClose:p,onOpen:E});wF({enabled:O&&r,ref:w,handler:ie=>{var oe;(oe=k.current)!=null&&oe.contains(ie.target)||A()}});const $=jb({...b,enabled:O||C,placement:m,direction:x}),[K,B]=d.useState(-1);la(()=>{O||B(-1)},[O]),N5(w,{focusRef:k,visible:O,shouldFocus:!0});const U=G5({isOpen:O,ref:w}),[Y,W]=IF(t,"menu-button","menu-list"),L=d.useCallback(()=>{D(),j()},[D,j]),X=d.useRef(new Set([]));$F(()=>{X.current.forEach(ie=>clearTimeout(ie)),X.current.clear()});const z=d.useCallback(()=>{D(),I()},[I,D]),q=d.useCallback(()=>{D(),M()},[D,M]),ne=d.useCallback(()=>{var ie,oe;const V=K5(w.current),G=(ie=w.current)==null?void 0:ie.contains(V.activeElement);if(!(O&&!G))return;const se=(oe=_.item(K))==null?void 0:oe.node;se==null||se.focus()},[O,K,_]),Q=d.useRef(null);return{openAndFocusMenu:L,openAndFocusFirstItem:z,openAndFocusLastItem:q,onTransitionEnd:ne,unstable__animationState:U,descendants:_,popper:$,buttonId:Y,menuId:W,forceUpdate:$.forceUpdate,orientation:"vertical",isOpen:O,onToggle:R,onOpen:D,onClose:A,menuRef:w,buttonRef:k,focusedIndex:K,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:B,isLazy:i,lazyBehavior:v,initialFocusRef:o,rafId:Q}}function MF(e={},t=null){const n=Od(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:i}=n,l=d.useCallback(f=>{const p=f.key,m={Enter:s,ArrowDown:s,ArrowUp:i}[p];m&&(f.preventDefault(),f.stopPropagation(),m(f))},[s,i]);return{...e,ref:yt(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":at(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:Fe(e.onClick,r),onKeyDown:Fe(e.onKeyDown,l)}}function E1(e){var t;return NF(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function OF(e={},t=null){const n=Od();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");const{focusedIndex:r,setFocusedIndex:o,menuRef:s,isOpen:i,onClose:l,menuId:f,isLazy:p,lazyBehavior:h,unstable__animationState:m}=n,v=kF(),x=XL({preventDefault:k=>k.key!==" "&&E1(k.target)}),C=d.useCallback(k=>{if(!k.currentTarget.contains(k.target))return;const _=k.key,I={Tab:E=>E.preventDefault(),Escape:l,ArrowDown:()=>{const E=v.nextEnabled(r);E&&o(E.index)},ArrowUp:()=>{const E=v.prevEnabled(r);E&&o(E.index)}}[_];if(I){k.preventDefault(),I(k);return}const M=x(E=>{const O=YL(v.values(),E,D=>{var A,R;return(R=(A=D==null?void 0:D.node)==null?void 0:A.textContent)!=null?R:""},v.item(r));if(O){const D=v.indexOf(O.node);o(D)}});E1(k.target)&&M(k)},[v,r,x,l,o]),b=d.useRef(!1);i&&(b.current=!0);const w=Ib({wasSelected:b.current,enabled:p,mode:h,isSelected:m.present});return{...e,ref:yt(s,t),children:w?e.children:null,tabIndex:-1,role:"menu",id:f,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:Fe(e.onKeyDown,C)}}function DF(e={}){const{popper:t,isOpen:n}=Od();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function q5(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:i,isDisabled:l,isFocusable:f,closeOnSelect:p,type:h,...m}=e,v=Od(),{setFocusedIndex:x,focusedIndex:C,closeOnSelect:b,onClose:w,menuRef:k,isOpen:_,menuId:j,rafId:I}=v,M=d.useRef(null),E=`${j}-menuitem-${d.useId()}`,{index:O,register:D}=jF({disabled:l&&!f}),A=d.useCallback(L=>{n==null||n(L),!l&&x(O)},[x,O,l,n]),R=d.useCallback(L=>{r==null||r(L),M.current&&!nS(M.current)&&A(L)},[A,r]),$=d.useCallback(L=>{o==null||o(L),!l&&x(-1)},[x,l,o]),K=d.useCallback(L=>{s==null||s(L),E1(L.currentTarget)&&(p??b)&&w()},[w,s,b,p]),B=d.useCallback(L=>{i==null||i(L),x(O)},[x,i,O]),U=O===C,Y=l&&!f;la(()=>{_&&(U&&!Y&&M.current?(I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{var L;(L=M.current)==null||L.focus(),I.current=null})):k.current&&!nS(k.current)&&k.current.focus({preventScroll:!0}))},[U,Y,k,_]);const W=A5({onClick:K,onFocus:B,onMouseEnter:A,onMouseMove:R,onMouseLeave:$,ref:yt(D,M,t),isDisabled:l,isFocusable:f});return{...m,...W,type:h??W.type,id:E,role:"menuitem",tabIndex:U?0:-1}}function RF(e={},t=null){const{type:n="radio",isChecked:r,...o}=e;return{...q5(o,t),role:`menuitem${n}`,"aria-checked":r}}function AF(e={}){const{children:t,type:n="radio",value:r,defaultValue:o,onChange:s,...i}=e,f=n==="radio"?"":[],[p,h]=Rc({defaultValue:o??f,value:r,onChange:s}),m=d.useCallback(C=>{if(n==="radio"&&typeof p=="string"&&h(C),n==="checkbox"&&Array.isArray(p)){const b=p.includes(C)?p.filter(w=>w!==C):p.concat(C);h(b)}},[p,h,n]),x=_d(t).map(C=>{if(C.type.id!=="MenuItemOption")return C;const b=k=>{var _,j;m(C.props.value),(j=(_=C.props).onClick)==null||j.call(_,k)},w=n==="radio"?C.props.value===p:p.includes(C.props.value);return d.cloneElement(C,{type:n,onClick:b,isChecked:w})});return{...i,children:x}}function NF(e){var t;if(!TF(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function TF(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function $F(e,t=[]){return d.useEffect(()=>()=>e(),t)}var[LF,Tc]=Tt({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),Dd=e=>{const{children:t}=e,n=Hn("Menu",e),r=Xt(e),{direction:o}=xd(),{descendants:s,...i}=EF({...r,direction:o}),l=d.useMemo(()=>i,[i]),{isOpen:f,onClose:p,forceUpdate:h}=l;return a.jsx(SF,{value:s,children:a.jsx(PF,{value:l,children:a.jsx(LF,{value:n,children:Ax(t,{isOpen:f,onClose:p,forceUpdate:h})})})})};Dd.displayName="Menu";var X5=Pe((e,t)=>{const n=Tc();return a.jsx(_e.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});X5.displayName="MenuCommand";var Y5=Pe((e,t)=>{const{type:n,...r}=e,o=Tc(),s=r.as||n?n??void 0:"button",i=d.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return a.jsx(_e.button,{ref:t,type:s,...r,__css:i})}),Eb=e=>{const{className:t,children:n,...r}=e,o=Tc(),s=d.Children.only(n),i=d.isValidElement(s)?d.cloneElement(s,{focusable:"false","aria-hidden":!0,className:et("chakra-menu__icon",s.props.className)}):null,l=et("chakra-menu__icon-wrapper",t);return a.jsx(_e.span,{className:l,...r,__css:o.icon,children:i})};Eb.displayName="MenuIcon";var Ht=Pe((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:i,...l}=e,f=q5(l,t),h=n||o?a.jsx("span",{style:{pointerEvents:"none",flex:1},children:i}):i;return a.jsxs(Y5,{...f,className:et("chakra-menu__menuitem",f.className),children:[n&&a.jsx(Eb,{fontSize:"0.8em",marginEnd:r,children:n}),h,o&&a.jsx(X5,{marginStart:s,children:o})]})});Ht.displayName="MenuItem";var zF={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"}}},FF=_e(gn.div),Ga=Pe(function(t,n){var r,o;const{rootProps:s,motionProps:i,...l}=t,{isOpen:f,onTransitionEnd:p,unstable__animationState:h}=Od(),m=OF(l,n),v=DF(s),x=Tc();return a.jsx(_e.div,{...v,__css:{zIndex:(o=t.zIndex)!=null?o:(r=x.list)==null?void 0:r.zIndex},children:a.jsx(FF,{variants:zF,initial:!1,animate:f?"enter":"exit",__css:{outline:0,...x.list},...i,className:et("chakra-menu__menu-list",m.className),...m,onUpdate:p,onAnimationComplete:cm(h.onComplete,m.onAnimationComplete)})})});Ga.displayName="MenuList";var Cc=Pe((e,t)=>{const{title:n,children:r,className:o,...s}=e,i=et("chakra-menu__group__title",o),l=Tc();return a.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&a.jsx(_e.p,{className:i,...s,__css:l.groupTitle,children:n}),r]})});Cc.displayName="MenuGroup";var Q5=e=>{const{className:t,title:n,...r}=e,o=AF(r);return a.jsx(Cc,{title:n,className:et("chakra-menu__option-group",t),...o})};Q5.displayName="MenuOptionGroup";var BF=Pe((e,t)=>{const n=Tc();return a.jsx(_e.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Rd=Pe((e,t)=>{const{children:n,as:r,...o}=e,s=MF(o,t),i=r||BF;return a.jsx(i,{...s,className:et("chakra-menu__menu-button",e.className),children:a.jsx(_e.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Rd.displayName="MenuButton";var HF=e=>a.jsx("svg",{viewBox:"0 0 14 14",width:"1em",height:"1em",...e,children:a.jsx("polygon",{fill:"currentColor",points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})}),rh=Pe((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",...o}=e,s=RF(o,t);return a.jsxs(Y5,{...s,className:et("chakra-menu__menuitem-option",o.className),children:[n!==null&&a.jsx(Eb,{fontSize:"0.8em",marginEnd:r,opacity:e.isChecked?1:0,children:n||a.jsx(HF,{})}),a.jsx("span",{style:{flex:1},children:s.children})]})});rh.id="MenuItemOption";rh.displayName="MenuItemOption";var WF={slideInBottom:{...m1,custom:{offsetY:16,reverse:!0}},slideInRight:{...m1,custom:{offsetX:16,reverse:!0}},scale:{...P3,custom:{initialScale:.95,reverse:!0}},none:{}},VF=_e(gn.section),UF=e=>WF[e||"none"],Z5=d.forwardRef((e,t)=>{const{preset:n,motionProps:r=UF(n),...o}=e;return a.jsx(VF,{ref:t,...r,...o})});Z5.displayName="ModalTransition";var GF=Object.defineProperty,KF=(e,t,n)=>t in e?GF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qF=(e,t,n)=>(KF(e,typeof t!="symbol"?t+"":t,n),n),XF=class{constructor(){qF(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}},M1=new XF;function J5(e,t){const[n,r]=d.useState(0);return d.useEffect(()=>{const o=e.current;if(o){if(t){const s=M1.add(o);r(s)}return()=>{M1.remove(o),r(0)}}},[t,e]),n}var YF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},_l=new WeakMap,qf=new WeakMap,Xf={},av=0,eP=function(e){return e&&(e.host||eP(e.parentNode))},QF=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=eP(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ZF=function(e,t,n,r){var o=QF(t,Array.isArray(e)?e:[e]);Xf[n]||(Xf[n]=new WeakMap);var s=Xf[n],i=[],l=new Set,f=new Set(o),p=function(m){!m||l.has(m)||(l.add(m),p(m.parentNode))};o.forEach(p);var h=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(v){if(l.has(v))h(v);else{var x=v.getAttribute(r),C=x!==null&&x!=="false",b=(_l.get(v)||0)+1,w=(s.get(v)||0)+1;_l.set(v,b),s.set(v,w),i.push(v),b===1&&C&&qf.set(v,!0),w===1&&v.setAttribute(n,"true"),C||v.setAttribute(r,"true")}})};return h(t),l.clear(),av++,function(){i.forEach(function(m){var v=_l.get(m)-1,x=s.get(m)-1;_l.set(m,v),s.set(m,x),v||(qf.has(m)||m.removeAttribute(r),qf.delete(m)),x||m.removeAttribute(n)}),av--,av||(_l=new WeakMap,_l=new WeakMap,qf=new WeakMap,Xf={})}},JF=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||YF(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),ZF(r,o,n,"aria-hidden")):function(){return null}};function eB(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:i=!0,onOverlayClick:l,onEsc:f}=e,p=d.useRef(null),h=d.useRef(null),[m,v,x]=nB(r,"chakra-modal","chakra-modal--header","chakra-modal--body");tB(p,t&&i);const C=J5(p,t),b=d.useRef(null),w=d.useCallback(A=>{b.current=A.target},[]),k=d.useCallback(A=>{A.key==="Escape"&&(A.stopPropagation(),s&&(n==null||n()),f==null||f())},[s,n,f]),[_,j]=d.useState(!1),[I,M]=d.useState(!1),E=d.useCallback((A={},R=null)=>({role:"dialog",...A,ref:yt(R,p),id:m,tabIndex:-1,"aria-modal":!0,"aria-labelledby":_?v:void 0,"aria-describedby":I?x:void 0,onClick:Fe(A.onClick,$=>$.stopPropagation())}),[x,I,m,v,_]),O=d.useCallback(A=>{A.stopPropagation(),b.current===A.target&&M1.isTopModal(p.current)&&(o&&(n==null||n()),l==null||l())},[n,o,l]),D=d.useCallback((A={},R=null)=>({...A,ref:yt(R,h),onClick:Fe(A.onClick,O),onKeyDown:Fe(A.onKeyDown,k),onMouseDown:Fe(A.onMouseDown,w)}),[k,w,O]);return{isOpen:t,onClose:n,headerId:v,bodyId:x,setBodyMounted:M,setHeaderMounted:j,dialogRef:p,overlayRef:h,getDialogProps:E,getDialogContainerProps:D,index:C}}function tB(e,t){const n=e.current;d.useEffect(()=>{if(!(!e.current||!t))return JF(e.current)},[t,e,n])}function nB(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[rB,$c]=Tt({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[oB,zi]=Tt({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),Fi=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:l,returnFocusOnClose:f,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:x,onCloseComplete:C}=t,b=Hn("Modal",t),k={...eB(t),autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:l,returnFocusOnClose:f,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:x};return a.jsx(oB,{value:k,children:a.jsx(rB,{value:b,children:a.jsx(nr,{onExitComplete:C,children:k.isOpen&&a.jsx(wd,{...n,children:r})})})})};Fi.displayName="Modal";var Mp="right-scroll-bar-position",Op="width-before-scroll-bar",sB="with-scroll-bars-hidden",aB="--removed-body-scroll-bar-size",tP=Y3(),iv=function(){},Mm=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:iv,onWheelCapture:iv,onTouchMoveCapture:iv}),o=r[0],s=r[1],i=e.forwardProps,l=e.children,f=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,v=e.sideCar,x=e.noIsolation,C=e.inert,b=e.allowPinchZoom,w=e.as,k=w===void 0?"div":w,_=e.gapMode,j=K3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=v,M=G3([n,t]),E=us(us({},j),o);return d.createElement(d.Fragment,null,h&&d.createElement(I,{sideCar:tP,removeScrollBar:p,shards:m,noIsolation:x,inert:C,setCallbacks:s,allowPinchZoom:!!b,lockRef:n,gapMode:_}),i?d.cloneElement(d.Children.only(l),us(us({},E),{ref:M})):d.createElement(k,us({},E,{className:f,ref:M}),l))});Mm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Mm.classNames={fullWidth:Op,zeroRight:Mp};var rS,iB=function(){if(rS)return rS;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function lB(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=iB();return t&&e.setAttribute("nonce",t),e}function cB(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function uB(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dB=function(){var e=0,t=null;return{add:function(n){e==0&&(t=lB())&&(cB(t,n),uB(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},fB=function(){var e=dB();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nP=function(){var e=fB(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},pB={left:0,top:0,right:0,gap:0},lv=function(e){return parseInt(e||"",10)||0},hB=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[lv(n),lv(r),lv(o)]},mB=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return pB;var t=hB(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])}},gB=nP(),vB=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),`
.`.concat(sB,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(l,"px ").concat(r,`;
}
body {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(s,`px;
padding-right: `).concat(i,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(l,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(Mp,` {
right: `).concat(l,"px ").concat(r,`;
}
.`).concat(Op,` {
margin-right: `).concat(l,"px ").concat(r,`;
}
.`).concat(Mp," .").concat(Mp,` {
right: 0 `).concat(r,`;
}
.`).concat(Op," .").concat(Op,` {
margin-right: 0 `).concat(r,`;
}
body {
`).concat(aB,": ").concat(l,`px;
}
`)},xB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=d.useMemo(function(){return mB(o)},[o]);return d.createElement(gB,{styles:vB(s,!t,o,n?"":"!important")})},O1=!1;if(typeof window<"u")try{var Yf=Object.defineProperty({},"passive",{get:function(){return O1=!0,!0}});window.addEventListener("test",Yf,Yf),window.removeEventListener("test",Yf,Yf)}catch{O1=!1}var jl=O1?{passive:!1}:!1,bB=function(e){return e.tagName==="TEXTAREA"},rP=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!bB(e)&&n[t]==="visible")},yB=function(e){return rP(e,"overflowY")},CB=function(e){return rP(e,"overflowX")},oS=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=oP(e,r);if(o){var s=sP(e,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wB=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},SB=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},oP=function(e,t){return e==="v"?yB(t):CB(t)},sP=function(e,t){return e==="v"?wB(t):SB(t)},kB=function(e,t){return e==="h"&&t==="rtl"?-1:1},_B=function(e,t,n,r,o){var s=kB(e,window.getComputedStyle(t).direction),i=s*r,l=n.target,f=t.contains(l),p=!1,h=i>0,m=0,v=0;do{var x=sP(e,l),C=x[0],b=x[1],w=x[2],k=b-w-s*C;(C||k)&&oP(e,l)&&(m+=k,v+=C),l=l.parentNode}while(!f&&l!==document.body||f&&(t.contains(l)||t===l));return(h&&(o&&m===0||!o&&i>m)||!h&&(o&&v===0||!o&&-i>v))&&(p=!0),p},Qf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sS=function(e){return[e.deltaX,e.deltaY]},aS=function(e){return e&&"current"in e?e.current:e},jB=function(e,t){return e[0]===t[0]&&e[1]===t[1]},PB=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},IB=0,Pl=[];function EB(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(IB++)[0],s=d.useState(nP)[0],i=d.useRef(e);d.useEffect(function(){i.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=w1([e.lockRef.current],(e.shards||[]).map(aS),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=d.useCallback(function(b,w){if("touches"in b&&b.touches.length===2)return!i.current.allowPinchZoom;var k=Qf(b),_=n.current,j="deltaX"in b?b.deltaX:_[0]-k[0],I="deltaY"in b?b.deltaY:_[1]-k[1],M,E=b.target,O=Math.abs(j)>Math.abs(I)?"h":"v";if("touches"in b&&O==="h"&&E.type==="range")return!1;var D=oS(O,E);if(!D)return!0;if(D?M=O:(M=O==="v"?"h":"v",D=oS(O,E)),!D)return!1;if(!r.current&&"changedTouches"in b&&(j||I)&&(r.current=M),!M)return!0;var A=r.current||M;return _B(A,w,b,A==="h"?j:I,!0)},[]),f=d.useCallback(function(b){var w=b;if(!(!Pl.length||Pl[Pl.length-1]!==s)){var k="deltaY"in w?sS(w):Qf(w),_=t.current.filter(function(M){return M.name===w.type&&M.target===w.target&&jB(M.delta,k)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var j=(i.current.shards||[]).map(aS).filter(Boolean).filter(function(M){return M.contains(w.target)}),I=j.length>0?l(w,j[0]):!i.current.noIsolation;I&&w.cancelable&&w.preventDefault()}}},[]),p=d.useCallback(function(b,w,k,_){var j={name:b,delta:w,target:k,should:_};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(I){return I!==j})},1)},[]),h=d.useCallback(function(b){n.current=Qf(b),r.current=void 0},[]),m=d.useCallback(function(b){p(b.type,sS(b),b.target,l(b,e.lockRef.current))},[]),v=d.useCallback(function(b){p(b.type,Qf(b),b.target,l(b,e.lockRef.current))},[]);d.useEffect(function(){return Pl.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",f,jl),document.addEventListener("touchmove",f,jl),document.addEventListener("touchstart",h,jl),function(){Pl=Pl.filter(function(b){return b!==s}),document.removeEventListener("wheel",f,jl),document.removeEventListener("touchmove",f,jl),document.removeEventListener("touchstart",h,jl)}},[]);var x=e.removeScrollBar,C=e.inert;return d.createElement(d.Fragment,null,C?d.createElement(s,{styles:PB(o)}):null,x?d.createElement(xB,{gapMode:e.gapMode}):null)}const MB=I$(tP,EB);var aP=d.forwardRef(function(e,t){return d.createElement(Mm,us({},e,{ref:t,sideCar:MB}))});aP.classNames=Mm.classNames;const OB=aP;function DB(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:i,finalFocusRef:l,returnFocusOnClose:f,preserveScrollBarGap:p,lockFocusAcrossFrames:h,isOpen:m}=zi(),[v,x]=M7();d.useEffect(()=>{!v&&x&&setTimeout(x)},[v,x]);const C=J5(r,m);return a.jsx(P5,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:l,restoreFocus:f,contentRef:r,lockFocusAcrossFrames:h,children:a.jsx(OB,{removeScrollBar:!p,allowPinchZoom:i,enabled:C===1&&s,forwardProps:!0,children:e.children})})}var Bi=Pe((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...i}=e,{getDialogProps:l,getDialogContainerProps:f}=zi(),p=l(i,t),h=f(o),m=et("chakra-modal__content",n),v=$c(),x={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},C={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{motionPreset:b}=zi();return a.jsx(DB,{children:a.jsx(_e.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:C,children:a.jsx(Z5,{preset:b,motionProps:s,className:m,...p,__css:x,children:r})})})});Bi.displayName="ModalContent";function Ad(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(Fi,{...n,initialFocusRef:t})}var Nd=Pe((e,t)=>a.jsx(Bi,{ref:t,role:"alertdialog",...e})),gs=Pe((e,t)=>{const{className:n,...r}=e,o=et("chakra-modal__footer",n),i={display:"flex",alignItems:"center",justifyContent:"flex-end",...$c().footer};return a.jsx(_e.footer,{ref:t,...r,__css:i,className:o})});gs.displayName="ModalFooter";var Ho=Pe((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=zi();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=et("chakra-modal__header",n),f={flex:0,...$c().header};return a.jsx(_e.header,{ref:t,className:i,id:o,...r,__css:f})});Ho.displayName="ModalHeader";var RB=_e(gn.div),Wo=Pe((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,i=et("chakra-modal__overlay",n),f={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...$c().overlay},{motionPreset:p}=zi(),m=o||(p==="none"?{}:j3);return a.jsx(RB,{...m,__css:f,ref:t,className:i,...s})});Wo.displayName="ModalOverlay";var Vo=Pe((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=zi();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=et("chakra-modal__body",n),l=$c();return a.jsx(_e.div,{ref:t,className:i,id:o,...r,__css:l.body})});Vo.displayName="ModalBody";var Td=Pe((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=zi(),i=et("chakra-modal__close-btn",r),l=$c();return a.jsx(cN,{ref:t,__css:l.closeButton,className:i,onClick:Fe(n,f=>{f.stopPropagation(),s()}),...o})});Td.displayName="ModalCloseButton";var AB=e=>a.jsx(An,{viewBox:"0 0 24 24",...e,children:a.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"})}),NB=e=>a.jsx(An,{viewBox:"0 0 24 24",...e,children:a.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 iS(e,t,n,r){d.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,i=Array.isArray(t)?t:[t],l=new s.MutationObserver(f=>{for(const p of f)p.type==="attributes"&&p.attributeName&&i.includes(p.attributeName)&&n(p)});return l.observe(e.current,{attributes:!0,attributeFilter:i}),()=>l.disconnect()})}function TB(e,t){const n=tn(e);d.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var $B=50,lS=300;function LB(e,t){const[n,r]=d.useState(!1),[o,s]=d.useState(null),[i,l]=d.useState(!0),f=d.useRef(null),p=()=>clearTimeout(f.current);TB(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?$B:null);const h=d.useCallback(()=>{i&&e(),f.current=setTimeout(()=>{l(!1),r(!0),s("increment")},lS)},[e,i]),m=d.useCallback(()=>{i&&t(),f.current=setTimeout(()=>{l(!1),r(!0),s("decrement")},lS)},[t,i]),v=d.useCallback(()=>{l(!0),r(!1),p()},[]);return d.useEffect(()=>()=>p(),[]),{up:h,down:m,stop:v,isSpinning:n}}var zB=/^[Ee0-9+\-.]$/;function FB(e){return zB.test(e)}function BB(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 HB(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:o=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:i=1,isReadOnly:l,isDisabled:f,isRequired:p,isInvalid:h,pattern:m="[0-9]*(.[0-9]+)?",inputMode:v="decimal",allowMouseWheel:x,id:C,onChange:b,precision:w,name:k,"aria-describedby":_,"aria-label":j,"aria-labelledby":I,onFocus:M,onBlur:E,onInvalid:O,getAriaValueText:D,isValidCharacter:A,format:R,parse:$,...K}=e,B=tn(M),U=tn(E),Y=tn(O),W=tn(A??FB),L=tn(D),X=l$(e),{update:z,increment:q,decrement:ne}=X,[Q,ie]=d.useState(!1),oe=!(l||f),V=d.useRef(null),G=d.useRef(null),J=d.useRef(null),se=d.useRef(null),re=d.useCallback(ge=>ge.split("").filter(W).join(""),[W]),fe=d.useCallback(ge=>{var Ye;return(Ye=$==null?void 0:$(ge))!=null?Ye:ge},[$]),de=d.useCallback(ge=>{var Ye;return((Ye=R==null?void 0:R(ge))!=null?Ye:ge).toString()},[R]);la(()=>{(X.valueAsNumber>s||X.valueAsNumber<o)&&(Y==null||Y("rangeOverflow",de(X.value),X.valueAsNumber))},[X.valueAsNumber,X.value,de,Y]),Xl(()=>{if(!V.current)return;if(V.current.value!=X.value){const Ye=fe(V.current.value);X.setValue(re(Ye))}},[fe,re]);const me=d.useCallback((ge=i)=>{oe&&q(ge)},[q,oe,i]),ye=d.useCallback((ge=i)=>{oe&&ne(ge)},[ne,oe,i]),he=LB(me,ye);iS(J,"disabled",he.stop,he.isSpinning),iS(se,"disabled",he.stop,he.isSpinning);const ue=d.useCallback(ge=>{if(ge.nativeEvent.isComposing)return;const ot=fe(ge.currentTarget.value);z(re(ot)),G.current={start:ge.currentTarget.selectionStart,end:ge.currentTarget.selectionEnd}},[z,re,fe]),De=d.useCallback(ge=>{var Ye,ot,lt;B==null||B(ge),G.current&&(ge.target.selectionStart=(ot=G.current.start)!=null?ot:(Ye=ge.currentTarget.value)==null?void 0:Ye.length,ge.currentTarget.selectionEnd=(lt=G.current.end)!=null?lt:ge.currentTarget.selectionStart)},[B]),je=d.useCallback(ge=>{if(ge.nativeEvent.isComposing)return;BB(ge,W)||ge.preventDefault();const Ye=Be(ge)*i,ot=ge.key,Me={ArrowUp:()=>me(Ye),ArrowDown:()=>ye(Ye),Home:()=>z(o),End:()=>z(s)}[ot];Me&&(ge.preventDefault(),Me(ge))},[W,i,me,ye,z,o,s]),Be=ge=>{let Ye=1;return(ge.metaKey||ge.ctrlKey)&&(Ye=.1),ge.shiftKey&&(Ye=10),Ye},rt=d.useMemo(()=>{const ge=L==null?void 0:L(X.value);if(ge!=null)return ge;const Ye=X.value.toString();return Ye||void 0},[X.value,L]),Ue=d.useCallback(()=>{let ge=X.value;if(X.value==="")return;/^[eE]/.test(X.value.toString())?X.setValue(""):(X.valueAsNumber<o&&(ge=o),X.valueAsNumber>s&&(ge=s),X.cast(ge))},[X,s,o]),Ct=d.useCallback(()=>{ie(!1),n&&Ue()},[n,ie,Ue]),Xe=d.useCallback(()=>{t&&requestAnimationFrame(()=>{var ge;(ge=V.current)==null||ge.focus()})},[t]),tt=d.useCallback(ge=>{ge.preventDefault(),he.up(),Xe()},[Xe,he]),ve=d.useCallback(ge=>{ge.preventDefault(),he.down(),Xe()},[Xe,he]);_i(()=>V.current,"wheel",ge=>{var Ye,ot;const Me=((ot=(Ye=V.current)==null?void 0:Ye.ownerDocument)!=null?ot:document).activeElement===V.current;if(!x||!Me)return;ge.preventDefault();const $e=Be(ge)*i,Rt=Math.sign(ge.deltaY);Rt===-1?me($e):Rt===1&&ye($e)},{passive:!1});const Re=d.useCallback((ge={},Ye=null)=>{const ot=f||r&&X.isAtMax;return{...ge,ref:yt(Ye,J),role:"button",tabIndex:-1,onPointerDown:Fe(ge.onPointerDown,lt=>{lt.button!==0||ot||tt(lt)}),onPointerLeave:Fe(ge.onPointerLeave,he.stop),onPointerUp:Fe(ge.onPointerUp,he.stop),disabled:ot,"aria-disabled":co(ot)}},[X.isAtMax,r,tt,he.stop,f]),st=d.useCallback((ge={},Ye=null)=>{const ot=f||r&&X.isAtMin;return{...ge,ref:yt(Ye,se),role:"button",tabIndex:-1,onPointerDown:Fe(ge.onPointerDown,lt=>{lt.button!==0||ot||ve(lt)}),onPointerLeave:Fe(ge.onPointerLeave,he.stop),onPointerUp:Fe(ge.onPointerUp,he.stop),disabled:ot,"aria-disabled":co(ot)}},[X.isAtMin,r,ve,he.stop,f]),mt=d.useCallback((ge={},Ye=null)=>{var ot,lt,Me,$e;return{name:k,inputMode:v,type:"text",pattern:m,"aria-labelledby":I,"aria-label":j,"aria-describedby":_,id:C,disabled:f,...ge,readOnly:(ot=ge.readOnly)!=null?ot:l,"aria-readonly":(lt=ge.readOnly)!=null?lt:l,"aria-required":(Me=ge.required)!=null?Me:p,required:($e=ge.required)!=null?$e:p,ref:yt(V,Ye),value:de(X.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(X.valueAsNumber)?void 0:X.valueAsNumber,"aria-invalid":co(h??X.isOutOfRange),"aria-valuetext":rt,autoComplete:"off",autoCorrect:"off",onChange:Fe(ge.onChange,ue),onKeyDown:Fe(ge.onKeyDown,je),onFocus:Fe(ge.onFocus,De,()=>ie(!0)),onBlur:Fe(ge.onBlur,U,Ct)}},[k,v,m,I,j,de,_,C,f,p,l,h,X.value,X.valueAsNumber,X.isOutOfRange,o,s,rt,ue,je,De,U,Ct]);return{value:de(X.value),valueAsNumber:X.valueAsNumber,isFocused:Q,isDisabled:f,isReadOnly:l,getIncrementButtonProps:Re,getDecrementButtonProps:st,getInputProps:mt,htmlProps:K}}var[WB,Om]=Tt({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[VB,Mb]=Tt({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Dm=Pe(function(t,n){const r=Hn("NumberInput",t),o=Xt(t),s=eb(o),{htmlProps:i,...l}=HB(s),f=d.useMemo(()=>l,[l]);return a.jsx(VB,{value:f,children:a.jsx(WB,{value:r,children:a.jsx(_e.div,{...i,ref:n,className:et("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Dm.displayName="NumberInput";var Rm=Pe(function(t,n){const r=Om();return a.jsx(_e.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}})});Rm.displayName="NumberInputStepper";var Am=Pe(function(t,n){const{getInputProps:r}=Mb(),o=r(t,n),s=Om();return a.jsx(_e.input,{...o,className:et("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Am.displayName="NumberInputField";var iP=_e("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Nm=Pe(function(t,n){var r;const o=Om(),{getDecrementButtonProps:s}=Mb(),i=s(t,n);return a.jsx(iP,{...i,__css:o.stepper,children:(r=t.children)!=null?r:a.jsx(AB,{})})});Nm.displayName="NumberDecrementStepper";var Tm=Pe(function(t,n){var r;const{getIncrementButtonProps:o}=Mb(),s=o(t,n),i=Om();return a.jsx(iP,{...s,__css:i.stepper,children:(r=t.children)!=null?r:a.jsx(NB,{})})});Tm.displayName="NumberIncrementStepper";var[UB,Lc]=Tt({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[GB,Ob]=Tt({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Db(e){const t=d.Children.only(e.children),{getTriggerProps:n}=Lc();return d.cloneElement(t,n(t.props,t.ref))}Db.displayName="PopoverTrigger";var Il={click:"click",hover:"hover"};function KB(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:i=!0,arrowSize:l,arrowShadowColor:f,trigger:p=Il.click,openDelay:h=200,closeDelay:m=200,isLazy:v,lazyBehavior:x="unmount",computePositionOnMount:C,...b}=e,{isOpen:w,onClose:k,onOpen:_,onToggle:j}=Pb(e),I=d.useRef(null),M=d.useRef(null),E=d.useRef(null),O=d.useRef(!1),D=d.useRef(!1);w&&(D.current=!0);const[A,R]=d.useState(!1),[$,K]=d.useState(!1),B=d.useId(),U=o??B,[Y,W,L,X]=["popover-trigger","popover-content","popover-header","popover-body"].map(ue=>`${ue}-${U}`),{referenceRef:z,getArrowProps:q,getPopperProps:ne,getArrowInnerProps:Q,forceUpdate:ie}=jb({...b,enabled:w||!!C}),oe=G5({isOpen:w,ref:E});F3({enabled:w,ref:M}),N5(E,{focusRef:M,visible:w,shouldFocus:s&&p===Il.click}),ez(E,{focusRef:r,visible:w,shouldFocus:i&&p===Il.click});const V=Ib({wasSelected:D.current,enabled:v,mode:x,isSelected:oe.present}),G=d.useCallback((ue={},De=null)=>{const je={...ue,style:{...ue.style,transformOrigin:jn.transformOrigin.varRef,[jn.arrowSize.var]:l?`${l}px`:void 0,[jn.arrowShadowColor.var]:f},ref:yt(E,De),children:V?ue.children:null,id:W,tabIndex:-1,role:"dialog",onKeyDown:Fe(ue.onKeyDown,Be=>{n&&Be.key==="Escape"&&k()}),onBlur:Fe(ue.onBlur,Be=>{const rt=cS(Be),Ue=cv(E.current,rt),Ct=cv(M.current,rt);w&&t&&(!Ue&&!Ct)&&k()}),"aria-labelledby":A?L:void 0,"aria-describedby":$?X:void 0};return p===Il.hover&&(je.role="tooltip",je.onMouseEnter=Fe(ue.onMouseEnter,()=>{O.current=!0}),je.onMouseLeave=Fe(ue.onMouseLeave,Be=>{Be.nativeEvent.relatedTarget!==null&&(O.current=!1,setTimeout(()=>k(),m))})),je},[V,W,A,L,$,X,p,n,k,w,t,m,f,l]),J=d.useCallback((ue={},De=null)=>ne({...ue,style:{visibility:w?"visible":"hidden",...ue.style}},De),[w,ne]),se=d.useCallback((ue,De=null)=>({...ue,ref:yt(De,I,z)}),[I,z]),re=d.useRef(),fe=d.useRef(),de=d.useCallback(ue=>{I.current==null&&z(ue)},[z]),me=d.useCallback((ue={},De=null)=>{const je={...ue,ref:yt(M,De,de),id:Y,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":W};return p===Il.click&&(je.onClick=Fe(ue.onClick,j)),p===Il.hover&&(je.onFocus=Fe(ue.onFocus,()=>{re.current===void 0&&_()}),je.onBlur=Fe(ue.onBlur,Be=>{const rt=cS(Be),Ue=!cv(E.current,rt);w&&t&&Ue&&k()}),je.onKeyDown=Fe(ue.onKeyDown,Be=>{Be.key==="Escape"&&k()}),je.onMouseEnter=Fe(ue.onMouseEnter,()=>{O.current=!0,re.current=window.setTimeout(()=>_(),h)}),je.onMouseLeave=Fe(ue.onMouseLeave,()=>{O.current=!1,re.current&&(clearTimeout(re.current),re.current=void 0),fe.current=window.setTimeout(()=>{O.current===!1&&k()},m)})),je},[Y,w,W,p,de,j,_,t,k,h,m]);d.useEffect(()=>()=>{re.current&&clearTimeout(re.current),fe.current&&clearTimeout(fe.current)},[]);const ye=d.useCallback((ue={},De=null)=>({...ue,id:L,ref:yt(De,je=>{R(!!je)})}),[L]),he=d.useCallback((ue={},De=null)=>({...ue,id:X,ref:yt(De,je=>{K(!!je)})}),[X]);return{forceUpdate:ie,isOpen:w,onAnimationComplete:oe.onComplete,onClose:k,getAnchorProps:se,getArrowProps:q,getArrowInnerProps:Q,getPopoverPositionerProps:J,getPopoverProps:G,getTriggerProps:me,getHeaderProps:ye,getBodyProps:he}}function cv(e,t){return e===t||(e==null?void 0:e.contains(t))}function cS(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function $m(e){const t=Hn("Popover",e),{children:n,...r}=Xt(e),o=xd(),s=KB({...r,direction:o.direction});return a.jsx(UB,{value:s,children:a.jsx(GB,{value:t,children:Ax(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}$m.displayName="Popover";function lP(e){const t=d.Children.only(e.children),{getAnchorProps:n}=Lc();return d.cloneElement(t,n(t.props,t.ref))}lP.displayName="PopoverAnchor";var uv=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function cP(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:i,shadowColor:l}=e,{getArrowProps:f,getArrowInnerProps:p}=Lc(),h=Ob(),m=(t=n??r)!=null?t:o,v=s??i;return a.jsx(_e.div,{...f(),className:"chakra-popover__arrow-positioner",children:a.jsx(_e.div,{className:et("chakra-popover__arrow",e.className),...p(e),__css:{"--popper-arrow-shadow-color":uv("colors",l),"--popper-arrow-bg":uv("colors",m),"--popper-arrow-shadow":uv("shadows",v),...h.arrow}})})}cP.displayName="PopoverArrow";var Rb=Pe(function(t,n){const{getBodyProps:r}=Lc(),o=Ob();return a.jsx(_e.div,{...r(t,n),className:et("chakra-popover__body",t.className),__css:o.body})});Rb.displayName="PopoverBody";function qB(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var XB={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]}}},YB=_e(gn.section),uP=Pe(function(t,n){const{variants:r=XB,...o}=t,{isOpen:s}=Lc();return a.jsx(YB,{ref:n,variants:qB(r),initial:!1,animate:s?"enter":"exit",...o})});uP.displayName="PopoverTransition";var Lm=Pe(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:i,getPopoverPositionerProps:l,onAnimationComplete:f}=Lc(),p=Ob(),h={position:"relative",display:"flex",flexDirection:"column",...p.content};return a.jsx(_e.div,{...l(r),__css:p.popper,className:"chakra-popover__popper",children:a.jsx(uP,{...o,...i(s,n),onAnimationComplete:cm(f,s.onAnimationComplete),className:et("chakra-popover__content",t.className),__css:h})})});Lm.displayName="PopoverContent";var D1=e=>a.jsx(_e.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});D1.displayName="Circle";function QB(e,t,n){return(e-t)*100/(n-t)}var ZB=aa({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),JB=aa({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),eH=aa({"0%":{left:"-40%"},"100%":{left:"100%"}}),tH=aa({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function dP(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:i,role:l="progressbar"}=e,f=QB(t,n,r);return{bind:{"data-indeterminate":i?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":i?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,f):o})(),role:l},percent:f,value:t}}var fP=e=>{const{size:t,isIndeterminate:n,...r}=e;return a.jsx(_e.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${JB} 2s linear infinite`:void 0},...r})};fP.displayName="Shape";var R1=Pe((e,t)=>{var n;const{size:r="48px",max:o=100,min:s=0,valueText:i,getValueText:l,value:f,capIsRound:p,children:h,thickness:m="10px",color:v="#0078d4",trackColor:x="#edebe9",isIndeterminate:C,...b}=e,w=dP({min:s,max:o,value:f,valueText:i,getValueText:l,isIndeterminate:C}),k=C?void 0:((n=w.percent)!=null?n:0)*2.64,_=k==null?void 0:`${k} ${264-k}`,j=C?{css:{animation:`${ZB} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:_,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},I={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:r};return a.jsxs(_e.div,{ref:t,className:"chakra-progress",...w.bind,...b,__css:I,children:[a.jsxs(fP,{size:r,isIndeterminate:C,children:[a.jsx(D1,{stroke:x,strokeWidth:m,className:"chakra-progress__track"}),a.jsx(D1,{stroke:v,strokeWidth:m,className:"chakra-progress__indicator",strokeLinecap:p?"round":void 0,opacity:w.value===0&&!C?0:void 0,...j})]}),h]})});R1.displayName="CircularProgress";var[nH,rH]=Tt({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),oH=Pe((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:i,...l}=e,f=dP({value:o,min:n,max:r,isIndeterminate:s,role:i}),h={height:"100%",...rH().filledTrack};return a.jsx(_e.div,{ref:t,style:{width:`${f.percent}%`,...l.style},...f.bind,...l,__css:h})}),pP=Pe((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:i,isAnimated:l,children:f,borderRadius:p,isIndeterminate:h,"aria-label":m,"aria-labelledby":v,"aria-valuetext":x,title:C,role:b,...w}=Xt(e),k=Hn("Progress",e),_=p??((n=k.track)==null?void 0:n.borderRadius),j={animation:`${tH} 1s linear infinite`},E={...!h&&i&&l&&j,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${eH} 1s ease infinite normal none running`}},O={overflow:"hidden",position:"relative",...k.track};return a.jsx(_e.div,{ref:t,borderRadius:_,__css:O,...w,children:a.jsxs(nH,{value:k,children:[a.jsx(oH,{"aria-label":m,"aria-labelledby":v,"aria-valuetext":x,min:o,max:s,value:r,isIndeterminate:h,css:E,borderRadius:_,title:C,role:b}),f]})})});pP.displayName="Progress";function sH(e){return e&&t1(e)&&t1(e.target)}function aH(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:i,isNative:l,...f}=e,[p,h]=d.useState(r||""),m=typeof n<"u",v=m?n:p,x=d.useRef(null),C=d.useCallback(()=>{const M=x.current;if(!M)return;let E="input:not(:disabled):checked";const O=M.querySelector(E);if(O){O.focus();return}E="input:not(:disabled)";const D=M.querySelector(E);D==null||D.focus()},[]),w=`radio-${d.useId()}`,k=o||w,_=d.useCallback(M=>{const E=sH(M)?M.target.value:M;m||h(E),t==null||t(String(E))},[t,m]),j=d.useCallback((M={},E=null)=>({...M,ref:yt(E,x),role:"radiogroup"}),[]),I=d.useCallback((M={},E=null)=>({...M,ref:E,name:k,[l?"checked":"isChecked"]:v!=null?M.value===v:void 0,onChange(D){_(D)},"data-radiogroup":!0}),[l,k,_,v]);return{getRootProps:j,getRadioProps:I,name:k,ref:x,focus:C,setValue:h,value:v,onChange:_,isDisabled:s,isFocusable:i,htmlProps:f}}var[iH,hP]=Tt({name:"RadioGroupContext",strict:!1}),oh=Pe((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:i,isDisabled:l,isFocusable:f,...p}=e,{value:h,onChange:m,getRootProps:v,name:x,htmlProps:C}=aH(p),b=d.useMemo(()=>({name:x,size:r,onChange:m,colorScheme:n,value:h,variant:o,isDisabled:l,isFocusable:f}),[x,r,m,n,h,o,l,f]);return a.jsx(iH,{value:b,children:a.jsx(_e.div,{...v(C,t),className:et("chakra-radio-group",i),children:s})})});oh.displayName="RadioGroup";var lH={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function cH(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:i,onChange:l,isInvalid:f,name:p,value:h,id:m,"data-radiogroup":v,"aria-describedby":x,...C}=e,b=`radio-${d.useId()}`,w=jd(),_=!!hP()||!!v;let I=!!w&&!_?w.id:b;I=m??I;const M=o??(w==null?void 0:w.isDisabled),E=s??(w==null?void 0:w.isReadOnly),O=i??(w==null?void 0:w.isRequired),D=f??(w==null?void 0:w.isInvalid),[A,R]=d.useState(!1),[$,K]=d.useState(!1),[B,U]=d.useState(!1),[Y,W]=d.useState(!1),[L,X]=d.useState(!!t),z=typeof n<"u",q=z?n:L;d.useEffect(()=>R3(R),[]);const ne=d.useCallback(de=>{if(E||M){de.preventDefault();return}z||X(de.target.checked),l==null||l(de)},[z,M,E,l]),Q=d.useCallback(de=>{de.key===" "&&W(!0)},[W]),ie=d.useCallback(de=>{de.key===" "&&W(!1)},[W]),oe=d.useCallback((de={},me=null)=>({...de,ref:me,"data-active":at(Y),"data-hover":at(B),"data-disabled":at(M),"data-invalid":at(D),"data-checked":at(q),"data-focus":at($),"data-focus-visible":at($&&A),"data-readonly":at(E),"aria-hidden":!0,onMouseDown:Fe(de.onMouseDown,()=>W(!0)),onMouseUp:Fe(de.onMouseUp,()=>W(!1)),onMouseEnter:Fe(de.onMouseEnter,()=>U(!0)),onMouseLeave:Fe(de.onMouseLeave,()=>U(!1))}),[Y,B,M,D,q,$,E,A]),{onFocus:V,onBlur:G}=w??{},J=d.useCallback((de={},me=null)=>{const ye=M&&!r;return{...de,id:I,ref:me,type:"radio",name:p,value:h,onChange:Fe(de.onChange,ne),onBlur:Fe(G,de.onBlur,()=>K(!1)),onFocus:Fe(V,de.onFocus,()=>K(!0)),onKeyDown:Fe(de.onKeyDown,Q),onKeyUp:Fe(de.onKeyUp,ie),checked:q,disabled:ye,readOnly:E,required:O,"aria-invalid":co(D),"aria-disabled":co(ye),"aria-required":co(O),"data-readonly":at(E),"aria-describedby":x,style:lH}},[M,r,I,p,h,ne,G,V,Q,ie,q,E,O,D,x]);return{state:{isInvalid:D,isFocused:$,isChecked:q,isActive:Y,isHovered:B,isDisabled:M,isReadOnly:E,isRequired:O},getCheckboxProps:oe,getRadioProps:oe,getInputProps:J,getLabelProps:(de={},me=null)=>({...de,ref:me,onMouseDown:Fe(de.onMouseDown,uH),"data-disabled":at(M),"data-checked":at(q),"data-invalid":at(D)}),getRootProps:(de,me=null)=>({...de,ref:me,"data-disabled":at(M),"data-checked":at(q),"data-invalid":at(D)}),htmlProps:C}}function uH(e){e.preventDefault(),e.stopPropagation()}function dH(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var zs=Pe((e,t)=>{var n;const r=hP(),{onChange:o,value:s}=e,i=Hn("Radio",{...r,...e}),l=Xt(e),{spacing:f="0.5rem",children:p,isDisabled:h=r==null?void 0:r.isDisabled,isFocusable:m=r==null?void 0:r.isFocusable,inputProps:v,...x}=l;let C=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(C=r.value===s);let b=o;r!=null&&r.onChange&&s!=null&&(b=cm(r.onChange,o));const w=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:k,getCheckboxProps:_,getLabelProps:j,getRootProps:I,htmlProps:M}=cH({...x,isChecked:C,isFocusable:m,isDisabled:h,onChange:b,name:w}),[E,O]=dH(M,Pj),D=_(O),A=k(v,t),R=j(),$=Object.assign({},E,I()),K={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...i.container},B={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.control},U={userSelect:"none",marginStart:f,...i.label};return a.jsxs(_e.label,{className:"chakra-radio",...$,__css:K,children:[a.jsx("input",{className:"chakra-radio__input",...A}),a.jsx(_e.span,{className:"chakra-radio__control",...D,__css:B}),p&&a.jsx(_e.span,{className:"chakra-radio__label",...R,__css:U,children:p})]})});zs.displayName="Radio";var mP=Pe(function(t,n){const{children:r,placeholder:o,className:s,...i}=t;return a.jsxs(_e.select,{...i,ref:n,className:et("chakra-select",s),children:[o&&a.jsx("option",{value:"",children:o}),r]})});mP.displayName="SelectField";function fH(e,t){const n={},r={};for(const[o,s]of Object.entries(e))t.includes(o)?n[o]=s:r[o]=s;return[n,r]}var gP=Pe((e,t)=>{var n;const r=Hn("Select",e),{rootProps:o,placeholder:s,icon:i,color:l,height:f,h:p,minH:h,minHeight:m,iconColor:v,iconSize:x,...C}=Xt(e),[b,w]=fH(C,Pj),k=Jx(w),_={width:"100%",height:"fit-content",position:"relative",color:l},j={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return a.jsxs(_e.div,{className:"chakra-select__wrapper",__css:_,...b,...o,children:[a.jsx(mP,{ref:t,height:p??f,minH:h??m,placeholder:s,...k,__css:j,children:e.children}),a.jsx(vP,{"data-disabled":at(k.disabled),...(v||l)&&{color:v||l},__css:r.icon,...x&&{fontSize:x},children:i})]})});gP.displayName="Select";var pH=e=>a.jsx("svg",{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),hH=_e("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),vP=e=>{const{children:t=a.jsx(pH,{}),...n}=e,r=d.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return a.jsx(hH,{...n,className:"chakra-select__icon-wrapper",children:d.isValidElement(t)?r:null})};vP.displayName="SelectIcon";function mH(){const e=d.useRef(!0);return d.useEffect(()=>{e.current=!1},[]),e.current}function gH(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}var vH=_e("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),A1=Ij("skeleton-start-color"),N1=Ij("skeleton-end-color"),xH=aa({from:{opacity:0},to:{opacity:1}}),bH=aa({from:{borderColor:A1.reference,background:A1.reference},to:{borderColor:N1.reference,background:N1.reference}}),zm=Pe((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=Qa("Skeleton",n),o=mH(),{startColor:s="",endColor:i="",isLoaded:l,fadeDuration:f,speed:p,className:h,fitContent:m,...v}=Xt(n),[x,C]=ds("colors",[s,i]),b=gH(l),w=et("chakra-skeleton",h),k={...x&&{[A1.variable]:x},...C&&{[N1.variable]:C}};if(l){const _=o||b?"none":`${xH} ${f}s`;return a.jsx(_e.div,{ref:t,className:w,__css:{animation:_},...v})}return a.jsx(vH,{ref:t,className:w,...v,__css:{width:m?"fit-content":void 0,...r,...k,_dark:{...r._dark,...k},animation:`${p}s linear infinite alternate ${bH}`}})});zm.displayName="Skeleton";var ro=e=>e?"":void 0,nc=e=>e?!0:void 0,ei=(...e)=>e.filter(Boolean).join(" ");function rc(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function yH(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function Ou(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var Dp={width:0,height:0},Zf=e=>e||Dp;function xP(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=b=>{var w;const k=(w=r[b])!=null?w:Dp;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Ou({orientation:t,vertical:{bottom:`calc(${n[b]}% - ${k.height/2}px)`},horizontal:{left:`calc(${n[b]}% - ${k.width/2}px)`}})}},i=t==="vertical"?r.reduce((b,w)=>Zf(b).height>Zf(w).height?b:w,Dp):r.reduce((b,w)=>Zf(b).width>Zf(w).width?b:w,Dp),l={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Ou({orientation:t,vertical:i?{paddingLeft:i.width/2,paddingRight:i.width/2}:{},horizontal:i?{paddingTop:i.height/2,paddingBottom:i.height/2}:{}})},f={position:"absolute",...Ou({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},p=n.length===1,h=[0,o?100-n[0]:n[0]],m=p?h:n;let v=m[0];!p&&o&&(v=100-v);const x=Math.abs(m[m.length-1]-m[0]),C={...f,...Ou({orientation:t,vertical:o?{height:`${x}%`,top:`${v}%`}:{height:`${x}%`,bottom:`${v}%`},horizontal:o?{width:`${x}%`,right:`${v}%`}:{width:`${x}%`,left:`${v}%`}})};return{trackStyle:f,innerTrackStyle:C,rootStyle:l,getThumbStyle:s}}function bP(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function CH(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function wH(e){const t=kH(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function yP(e){return!!e.touches}function SH(e){return yP(e)&&e.touches.length>1}function kH(e){var t;return(t=e.view)!=null?t:window}function _H(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function jH(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function CP(e,t="page"){return yP(e)?_H(e,t):jH(e,t)}function PH(e){return t=>{const n=wH(t);(!n||n&&t.button===0)&&e(t)}}function IH(e,t=!1){function n(o){e(o,{point:CP(o)})}return t?PH(n):n}function Rp(e,t,n,r){return CH(e,t,IH(n,t==="pointerdown"),r)}var EH=Object.defineProperty,MH=(e,t,n)=>t in e?EH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Po=(e,t,n)=>(MH(e,typeof t!="symbol"?t+"":t,n),n),OH=class{constructor(e,t,n){Po(this,"history",[]),Po(this,"startEvent",null),Po(this,"lastEvent",null),Po(this,"lastEventInfo",null),Po(this,"handlers",{}),Po(this,"removeListeners",()=>{}),Po(this,"threshold",3),Po(this,"win"),Po(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const l=dv(this.lastEventInfo,this.history),f=this.startEvent!==null,p=NH(l.offset,{x:0,y:0})>=this.threshold;if(!f&&!p)return;const{timestamp:h}=_w();this.history.push({...l.point,timestamp:h});const{onStart:m,onMove:v}=this.handlers;f||(m==null||m(this.lastEvent,l),this.startEvent=this.lastEvent),v==null||v(this.lastEvent,l)}),Po(this,"onPointerMove",(l,f)=>{this.lastEvent=l,this.lastEventInfo=f,JN.update(this.updatePoint,!0)}),Po(this,"onPointerUp",(l,f)=>{const p=dv(f,this.history),{onEnd:h,onSessionEnd:m}=this.handlers;m==null||m(l,p),this.end(),!(!h||!this.startEvent)&&(h==null||h(l,p))});var r;if(this.win=(r=e.view)!=null?r:window,SH(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:CP(e)},{timestamp:s}=_w();this.history=[{...o.point,timestamp:s}];const{onSessionStart:i}=t;i==null||i(e,dv(o,this.history)),this.removeListeners=AH(Rp(this.win,"pointermove",this.onPointerMove),Rp(this.win,"pointerup",this.onPointerUp),Rp(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),eT.update(this.updatePoint)}};function uS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dv(e,t){return{point:e.point,delta:uS(e.point,t[t.length-1]),offset:uS(e.point,t[0]),velocity:RH(t,.1)}}var DH=e=>e*1e3;function RH(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=e[e.length-1];for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>DH(t)));)n--;if(!r)return{x:0,y:0};const s=(o.timestamp-r.timestamp)/1e3;if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function AH(...e){return t=>e.reduce((n,r)=>r(n),t)}function fv(e,t){return Math.abs(e-t)}function dS(e){return"x"in e&&"y"in e}function NH(e,t){if(typeof e=="number"&&typeof t=="number")return fv(e,t);if(dS(e)&&dS(t)){const n=fv(e.x,t.x),r=fv(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function wP(e){const t=d.useRef(null);return t.current=e,t}function SP(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:i,threshold:l}=t,f=!!(n||r||o||s||i),p=d.useRef(null),h=wP({onSessionStart:s,onSessionEnd:i,onStart:r,onMove:n,onEnd(m,v){p.current=null,o==null||o(m,v)}});d.useEffect(()=>{var m;(m=p.current)==null||m.updateHandlers(h.current)}),d.useEffect(()=>{const m=e.current;if(!m||!f)return;function v(x){p.current=new OH(x,h.current,l)}return Rp(m,"pointerdown",v)},[e,f,h,l]),d.useEffect(()=>()=>{var m;(m=p.current)==null||m.end(),p.current=null},[])}function TH(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[s]=o;let i,l;if("borderBoxSize"in s){const f=s.borderBoxSize,p=Array.isArray(f)?f[0]:f;i=p.inlineSize,l=p.blockSize}else i=e.offsetWidth,l=e.offsetHeight;t({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var $H=globalThis!=null&&globalThis.document?d.useLayoutEffect:d.useEffect;function LH(e,t){var n,r;if(!e||!e.parentElement)return;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window,s=new o.MutationObserver(()=>{t()});return s.observe(e.parentElement,{childList:!0}),()=>{s.disconnect()}}function kP({getNodes:e,observeMutation:t=!0}){const[n,r]=d.useState([]),[o,s]=d.useState(0);return $H(()=>{const i=e(),l=i.map((f,p)=>TH(f,h=>{r(m=>[...m.slice(0,p),h,...m.slice(p+1)])}));if(t){const f=i[0];l.push(LH(f,()=>{s(p=>p+1)}))}return()=>{l.forEach(f=>{f==null||f()})}},[o]),n}function zH(e){return typeof e=="object"&&e!==null&&"current"in e}function FH(e){const[t]=kP({observeMutation:!1,getNodes(){return[zH(e)?e.current:e]}});return t}function BH(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:i,direction:l="ltr",orientation:f="horizontal",id:p,isDisabled:h,isReadOnly:m,onChangeStart:v,onChangeEnd:x,step:C=1,getAriaValueText:b,"aria-valuetext":w,"aria-label":k,"aria-labelledby":_,name:j,focusThumbOnChange:I=!0,minStepsBetweenThumbs:M=0,...E}=e,O=tn(v),D=tn(x),A=tn(b),R=bP({isReversed:i,direction:l,orientation:f}),[$,K]=Rc({value:o,defaultValue:s??[25,75],onChange:r});if(!Array.isArray($))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof $}\``);const[B,U]=d.useState(!1),[Y,W]=d.useState(!1),[L,X]=d.useState(-1),z=!(h||m),q=d.useRef($),ne=$.map(ke=>Zl(ke,t,n)),Q=M*C,ie=HH(ne,t,n,Q),oe=d.useRef({eventSource:null,value:[],valueBounds:[]});oe.current.value=ne,oe.current.valueBounds=ie;const V=ne.map(ke=>n-ke+t),J=(R?V:ne).map(ke=>Zp(ke,t,n)),se=f==="vertical",re=d.useRef(null),fe=d.useRef(null),de=kP({getNodes(){const ke=fe.current,ze=ke==null?void 0:ke.querySelectorAll("[role=slider]");return ze?Array.from(ze):[]}}),me=d.useId(),he=yH(p??me),ue=d.useCallback(ke=>{var ze,Le;if(!re.current)return;oe.current.eventSource="pointer";const Ve=re.current.getBoundingClientRect(),{clientX:ct,clientY:vn}=(Le=(ze=ke.touches)==null?void 0:ze[0])!=null?Le:ke,_t=se?Ve.bottom-vn:ct-Ve.left,jt=se?Ve.height:Ve.width;let sr=_t/jt;return R&&(sr=1-sr),N3(sr,t,n)},[se,R,n,t]),De=(n-t)/10,je=C||(n-t)/100,Be=d.useMemo(()=>({setValueAtIndex(ke,ze){if(!z)return;const Le=oe.current.valueBounds[ke];ze=parseFloat(y1(ze,Le.min,je)),ze=Zl(ze,Le.min,Le.max);const Ve=[...oe.current.value];Ve[ke]=ze,K(Ve)},setActiveIndex:X,stepUp(ke,ze=je){const Le=oe.current.value[ke],Ve=R?Le-ze:Le+ze;Be.setValueAtIndex(ke,Ve)},stepDown(ke,ze=je){const Le=oe.current.value[ke],Ve=R?Le+ze:Le-ze;Be.setValueAtIndex(ke,Ve)},reset(){K(q.current)}}),[je,R,K,z]),rt=d.useCallback(ke=>{const ze=ke.key,Ve={ArrowRight:()=>Be.stepUp(L),ArrowUp:()=>Be.stepUp(L),ArrowLeft:()=>Be.stepDown(L),ArrowDown:()=>Be.stepDown(L),PageUp:()=>Be.stepUp(L,De),PageDown:()=>Be.stepDown(L,De),Home:()=>{const{min:ct}=ie[L];Be.setValueAtIndex(L,ct)},End:()=>{const{max:ct}=ie[L];Be.setValueAtIndex(L,ct)}}[ze];Ve&&(ke.preventDefault(),ke.stopPropagation(),Ve(ke),oe.current.eventSource="keyboard")},[Be,L,De,ie]),{getThumbStyle:Ue,rootStyle:Ct,trackStyle:Xe,innerTrackStyle:tt}=d.useMemo(()=>xP({isReversed:R,orientation:f,thumbRects:de,thumbPercents:J}),[R,f,J,de]),ve=d.useCallback(ke=>{var ze;const Le=ke??L;if(Le!==-1&&I){const Ve=he.getThumb(Le),ct=(ze=fe.current)==null?void 0:ze.ownerDocument.getElementById(Ve);ct&&setTimeout(()=>ct.focus())}},[I,L,he]);la(()=>{oe.current.eventSource==="keyboard"&&(D==null||D(oe.current.value))},[ne,D]);const Re=ke=>{const ze=ue(ke)||0,Le=oe.current.value.map(jt=>Math.abs(jt-ze)),Ve=Math.min(...Le);let ct=Le.indexOf(Ve);const vn=Le.filter(jt=>jt===Ve);vn.length>1&&ze>oe.current.value[ct]&&(ct=ct+vn.length-1),X(ct),Be.setValueAtIndex(ct,ze),ve(ct)},st=ke=>{if(L==-1)return;const ze=ue(ke)||0;X(L),Be.setValueAtIndex(L,ze),ve(L)};SP(fe,{onPanSessionStart(ke){z&&(U(!0),Re(ke),O==null||O(oe.current.value))},onPanSessionEnd(){z&&(U(!1),D==null||D(oe.current.value))},onPan(ke){z&&st(ke)}});const mt=d.useCallback((ke={},ze=null)=>({...ke,...E,id:he.root,ref:yt(ze,fe),tabIndex:-1,"aria-disabled":nc(h),"data-focused":ro(Y),style:{...ke.style,...Ct}}),[E,h,Y,Ct,he]),ge=d.useCallback((ke={},ze=null)=>({...ke,ref:yt(ze,re),id:he.track,"data-disabled":ro(h),style:{...ke.style,...Xe}}),[h,Xe,he]),Ye=d.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:he.innerTrack,style:{...ke.style,...tt}}),[tt,he]),ot=d.useCallback((ke,ze=null)=>{var Le;const{index:Ve,...ct}=ke,vn=ne[Ve];if(vn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${Ve}\`. The \`value\` or \`defaultValue\` length is : ${ne.length}`);const _t=ie[Ve];return{...ct,ref:ze,role:"slider",tabIndex:z?0:void 0,id:he.getThumb(Ve),"data-active":ro(B&&L===Ve),"aria-valuetext":(Le=A==null?void 0:A(vn))!=null?Le:w==null?void 0:w[Ve],"aria-valuemin":_t.min,"aria-valuemax":_t.max,"aria-valuenow":vn,"aria-orientation":f,"aria-disabled":nc(h),"aria-readonly":nc(m),"aria-label":k==null?void 0:k[Ve],"aria-labelledby":k!=null&&k[Ve]||_==null?void 0:_[Ve],style:{...ke.style,...Ue(Ve)},onKeyDown:rc(ke.onKeyDown,rt),onFocus:rc(ke.onFocus,()=>{W(!0),X(Ve)}),onBlur:rc(ke.onBlur,()=>{W(!1),X(-1)})}},[he,ne,ie,z,B,L,A,w,f,h,m,k,_,Ue,rt,W]),lt=d.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:he.output,htmlFor:ne.map((Le,Ve)=>he.getThumb(Ve)).join(" "),"aria-live":"off"}),[he,ne]),Me=d.useCallback((ke,ze=null)=>{const{value:Le,...Ve}=ke,ct=!(Le<t||Le>n),vn=Le>=ne[0]&&Le<=ne[ne.length-1];let _t=Zp(Le,t,n);_t=R?100-_t:_t;const jt={position:"absolute",pointerEvents:"none",...Ou({orientation:f,vertical:{bottom:`${_t}%`},horizontal:{left:`${_t}%`}})};return{...Ve,ref:ze,id:he.getMarker(ke.value),role:"presentation","aria-hidden":!0,"data-disabled":ro(h),"data-invalid":ro(!ct),"data-highlighted":ro(vn),style:{...ke.style,...jt}}},[h,R,n,t,f,ne,he]),$e=d.useCallback((ke,ze=null)=>{const{index:Le,...Ve}=ke;return{...Ve,ref:ze,id:he.getInput(Le),type:"hidden",value:ne[Le],name:Array.isArray(j)?j[Le]:`${j}-${Le}`}},[j,ne,he]);return{state:{value:ne,isFocused:Y,isDragging:B,getThumbPercent:ke=>J[ke],getThumbMinValue:ke=>ie[ke].min,getThumbMaxValue:ke=>ie[ke].max},actions:Be,getRootProps:mt,getTrackProps:ge,getInnerTrackProps:Ye,getThumbProps:ot,getMarkerProps:Me,getInputProps:$e,getOutputProps:lt}}function HH(e,t,n,r){return e.map((o,s)=>{const i=s===0?t:e[s-1]+r,l=s===e.length-1?n:e[s+1]-r;return{min:i,max:l}})}var[WH,Fm]=Tt({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[VH,Bm]=Tt({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),_P=Pe(function(t,n){const r={orientation:"horizontal",...t},o=Hn("Slider",r),s=Xt(r),{direction:i}=xd();s.direction=i;const{getRootProps:l,...f}=BH(s),p=d.useMemo(()=>({...f,name:r.name}),[f,r.name]);return a.jsx(WH,{value:p,children:a.jsx(VH,{value:o,children:a.jsx(_e.div,{...l({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});_P.displayName="RangeSlider";var T1=Pe(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=Fm(),i=Bm(),l=r(t,n);return a.jsxs(_e.div,{...l,className:ei("chakra-slider__thumb",t.className),__css:i.thumb,children:[l.children,s&&a.jsx("input",{...o({index:t.index})})]})});T1.displayName="RangeSliderThumb";var jP=Pe(function(t,n){const{getTrackProps:r}=Fm(),o=Bm(),s=r(t,n);return a.jsx(_e.div,{...s,className:ei("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});jP.displayName="RangeSliderTrack";var PP=Pe(function(t,n){const{getInnerTrackProps:r}=Fm(),o=Bm(),s=r(t,n);return a.jsx(_e.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});PP.displayName="RangeSliderFilledTrack";var Ap=Pe(function(t,n){const{getMarkerProps:r}=Fm(),o=Bm(),s=r(t,n);return a.jsx(_e.div,{...s,className:ei("chakra-slider__marker",t.className),__css:o.mark})});Ap.displayName="RangeSliderMark";function UH(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:i,isReversed:l,direction:f="ltr",orientation:p="horizontal",id:h,isDisabled:m,isReadOnly:v,onChangeStart:x,onChangeEnd:C,step:b=1,getAriaValueText:w,"aria-valuetext":k,"aria-label":_,"aria-labelledby":j,name:I,focusThumbOnChange:M=!0,...E}=e,O=tn(x),D=tn(C),A=tn(w),R=bP({isReversed:l,direction:f,orientation:p}),[$,K]=Rc({value:s,defaultValue:i??KH(n,r),onChange:o}),[B,U]=d.useState(!1),[Y,W]=d.useState(!1),L=!(m||v),X=(r-n)/10,z=b||(r-n)/100,q=Zl($,n,r),ne=r-q+n,ie=Zp(R?ne:q,n,r),oe=p==="vertical",V=wP({min:n,max:r,step:b,isDisabled:m,value:q,isInteractive:L,isReversed:R,isVertical:oe,eventSource:null,focusThumbOnChange:M,orientation:p}),G=d.useRef(null),J=d.useRef(null),se=d.useRef(null),re=d.useId(),fe=h??re,[de,me]=[`slider-thumb-${fe}`,`slider-track-${fe}`],ye=d.useCallback(Me=>{var $e,Rt;if(!G.current)return;const ke=V.current;ke.eventSource="pointer";const ze=G.current.getBoundingClientRect(),{clientX:Le,clientY:Ve}=(Rt=($e=Me.touches)==null?void 0:$e[0])!=null?Rt:Me,ct=oe?ze.bottom-Ve:Le-ze.left,vn=oe?ze.height:ze.width;let _t=ct/vn;R&&(_t=1-_t);let jt=N3(_t,ke.min,ke.max);return ke.step&&(jt=parseFloat(y1(jt,ke.min,ke.step))),jt=Zl(jt,ke.min,ke.max),jt},[oe,R,V]),he=d.useCallback(Me=>{const $e=V.current;$e.isInteractive&&(Me=parseFloat(y1(Me,$e.min,z)),Me=Zl(Me,$e.min,$e.max),K(Me))},[z,K,V]),ue=d.useMemo(()=>({stepUp(Me=z){const $e=R?q-Me:q+Me;he($e)},stepDown(Me=z){const $e=R?q+Me:q-Me;he($e)},reset(){he(i||0)},stepTo(Me){he(Me)}}),[he,R,q,z,i]),De=d.useCallback(Me=>{const $e=V.current,ke={ArrowRight:()=>ue.stepUp(),ArrowUp:()=>ue.stepUp(),ArrowLeft:()=>ue.stepDown(),ArrowDown:()=>ue.stepDown(),PageUp:()=>ue.stepUp(X),PageDown:()=>ue.stepDown(X),Home:()=>he($e.min),End:()=>he($e.max)}[Me.key];ke&&(Me.preventDefault(),Me.stopPropagation(),ke(Me),$e.eventSource="keyboard")},[ue,he,X,V]),je=(t=A==null?void 0:A(q))!=null?t:k,Be=FH(J),{getThumbStyle:rt,rootStyle:Ue,trackStyle:Ct,innerTrackStyle:Xe}=d.useMemo(()=>{const Me=V.current,$e=Be??{width:0,height:0};return xP({isReversed:R,orientation:Me.orientation,thumbRects:[$e],thumbPercents:[ie]})},[R,Be,ie,V]),tt=d.useCallback(()=>{V.current.focusThumbOnChange&&setTimeout(()=>{var $e;return($e=J.current)==null?void 0:$e.focus()})},[V]);la(()=>{const Me=V.current;tt(),Me.eventSource==="keyboard"&&(D==null||D(Me.value))},[q,D]);function ve(Me){const $e=ye(Me);$e!=null&&$e!==V.current.value&&K($e)}SP(se,{onPanSessionStart(Me){const $e=V.current;$e.isInteractive&&(U(!0),tt(),ve(Me),O==null||O($e.value))},onPanSessionEnd(){const Me=V.current;Me.isInteractive&&(U(!1),D==null||D(Me.value))},onPan(Me){V.current.isInteractive&&ve(Me)}});const Re=d.useCallback((Me={},$e=null)=>({...Me,...E,ref:yt($e,se),tabIndex:-1,"aria-disabled":nc(m),"data-focused":ro(Y),style:{...Me.style,...Ue}}),[E,m,Y,Ue]),st=d.useCallback((Me={},$e=null)=>({...Me,ref:yt($e,G),id:me,"data-disabled":ro(m),style:{...Me.style,...Ct}}),[m,me,Ct]),mt=d.useCallback((Me={},$e=null)=>({...Me,ref:$e,style:{...Me.style,...Xe}}),[Xe]),ge=d.useCallback((Me={},$e=null)=>({...Me,ref:yt($e,J),role:"slider",tabIndex:L?0:void 0,id:de,"data-active":ro(B),"aria-valuetext":je,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":q,"aria-orientation":p,"aria-disabled":nc(m),"aria-readonly":nc(v),"aria-label":_,"aria-labelledby":_?void 0:j,style:{...Me.style,...rt(0)},onKeyDown:rc(Me.onKeyDown,De),onFocus:rc(Me.onFocus,()=>W(!0)),onBlur:rc(Me.onBlur,()=>W(!1))}),[L,de,B,je,n,r,q,p,m,v,_,j,rt,De]),Ye=d.useCallback((Me,$e=null)=>{const Rt=!(Me.value<n||Me.value>r),ke=q>=Me.value,ze=Zp(Me.value,n,r),Le={position:"absolute",pointerEvents:"none",...GH({orientation:p,vertical:{bottom:R?`${100-ze}%`:`${ze}%`},horizontal:{left:R?`${100-ze}%`:`${ze}%`}})};return{...Me,ref:$e,role:"presentation","aria-hidden":!0,"data-disabled":ro(m),"data-invalid":ro(!Rt),"data-highlighted":ro(ke),style:{...Me.style,...Le}}},[m,R,r,n,p,q]),ot=d.useCallback((Me={},$e=null)=>({...Me,ref:$e,type:"hidden",value:q,name:I}),[I,q]);return{state:{value:q,isFocused:Y,isDragging:B},actions:ue,getRootProps:Re,getTrackProps:st,getInnerTrackProps:mt,getThumbProps:ge,getMarkerProps:Ye,getInputProps:ot}}function GH(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function KH(e,t){return t<e?e:e+(t-e)/2}var[qH,Hm]=Tt({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[XH,Wm]=Tt({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),Ab=Pe((e,t)=>{var n;const r={...e,orientation:(n=e==null?void 0:e.orientation)!=null?n:"horizontal"},o=Hn("Slider",r),s=Xt(r),{direction:i}=xd();s.direction=i;const{getInputProps:l,getRootProps:f,...p}=UH(s),h=f(),m=l({},t);return a.jsx(qH,{value:p,children:a.jsx(XH,{value:o,children:a.jsxs(_e.div,{...h,className:ei("chakra-slider",r.className),__css:o.container,children:[r.children,a.jsx("input",{...m})]})})})});Ab.displayName="Slider";var Nb=Pe((e,t)=>{const{getThumbProps:n}=Hm(),r=Wm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__thumb",e.className),__css:r.thumb})});Nb.displayName="SliderThumb";var Tb=Pe((e,t)=>{const{getTrackProps:n}=Hm(),r=Wm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__track",e.className),__css:r.track})});Tb.displayName="SliderTrack";var $b=Pe((e,t)=>{const{getInnerTrackProps:n}=Hm(),r=Wm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__filled-track",e.className),__css:r.filledTrack})});$b.displayName="SliderFilledTrack";var $l=Pe((e,t)=>{const{getMarkerProps:n}=Hm(),r=Wm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__marker",e.className),__css:r.mark})});$l.displayName="SliderMark";var Lb=Pe(function(t,n){const r=Hn("Switch",t),{spacing:o="0.5rem",children:s,...i}=Xt(t),{getIndicatorProps:l,getInputProps:f,getCheckboxProps:p,getRootProps:h,getLabelProps:m}=A3(i),v=d.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),x=d.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),C=d.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return a.jsxs(_e.label,{...h(),className:et("chakra-switch",t.className),__css:v,children:[a.jsx("input",{className:"chakra-switch__input",...f({},n)}),a.jsx(_e.span,{...p(),className:"chakra-switch__track",__css:x,children:a.jsx(_e.span,{__css:r.thumb,className:"chakra-switch__thumb",...l()})}),s&&a.jsx(_e.span,{className:"chakra-switch__label",...m(),__css:C,children:s})]})});Lb.displayName="Switch";var[YH,QH,ZH,JH]=Yx();function eW(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:i,lazyBehavior:l="unmount",orientation:f="horizontal",direction:p="ltr",...h}=e,[m,v]=d.useState(n??0),[x,C]=Rc({defaultValue:n??0,value:o,onChange:r});d.useEffect(()=>{o!=null&&v(o)},[o]);const b=ZH(),w=d.useId();return{id:`tabs-${(t=e.id)!=null?t:w}`,selectedIndex:x,focusedIndex:m,setSelectedIndex:C,setFocusedIndex:v,isManual:s,isLazy:i,lazyBehavior:l,orientation:f,descendants:b,direction:p,htmlProps:h}}var[tW,Vm]=Tt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function nW(e){const{focusedIndex:t,orientation:n,direction:r}=Vm(),o=QH(),s=d.useCallback(i=>{const l=()=>{var _;const j=o.nextEnabled(t);j&&((_=j.node)==null||_.focus())},f=()=>{var _;const j=o.prevEnabled(t);j&&((_=j.node)==null||_.focus())},p=()=>{var _;const j=o.firstEnabled();j&&((_=j.node)==null||_.focus())},h=()=>{var _;const j=o.lastEnabled();j&&((_=j.node)==null||_.focus())},m=n==="horizontal",v=n==="vertical",x=i.key,C=r==="ltr"?"ArrowLeft":"ArrowRight",b=r==="ltr"?"ArrowRight":"ArrowLeft",k={[C]:()=>m&&f(),[b]:()=>m&&l(),ArrowDown:()=>v&&l(),ArrowUp:()=>v&&f(),Home:p,End:h}[x];k&&(i.preventDefault(),k(i))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Fe(e.onKeyDown,s)}}function rW(e){const{isDisabled:t=!1,isFocusable:n=!1,...r}=e,{setSelectedIndex:o,isManual:s,id:i,setFocusedIndex:l,selectedIndex:f}=Vm(),{index:p,register:h}=JH({disabled:t&&!n}),m=p===f,v=()=>{o(p)},x=()=>{l(p),!s&&!(t&&n)&&o(p)},C=A5({...r,ref:yt(h,e.ref),isDisabled:t,isFocusable:n,onClick:Fe(e.onClick,v)}),b="button";return{...C,id:IP(i,p),role:"tab",tabIndex:m?0:-1,type:b,"aria-selected":m,"aria-controls":EP(i,p),onFocus:t?void 0:Fe(e.onFocus,x)}}var[oW,sW]=Tt({});function aW(e){const t=Vm(),{id:n,selectedIndex:r}=t,s=_d(e.children).map((i,l)=>d.createElement(oW,{key:l,value:{isSelected:l===r,id:EP(n,l),tabId:IP(n,l),selectedIndex:r}},i));return{...e,children:s}}function iW(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=Vm(),{isSelected:s,id:i,tabId:l}=sW(),f=d.useRef(!1);s&&(f.current=!0);const p=Ib({wasSelected:f.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:p?t:null,role:"tabpanel","aria-labelledby":l,hidden:!s,id:i}}function IP(e,t){return`${e}--tab-${t}`}function EP(e,t){return`${e}--tabpanel-${t}`}var[lW,Um]=Tt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),Yi=Pe(function(t,n){const r=Hn("Tabs",t),{children:o,className:s,...i}=Xt(t),{htmlProps:l,descendants:f,...p}=eW(i),h=d.useMemo(()=>p,[p]),{isFitted:m,...v}=l;return a.jsx(YH,{value:f,children:a.jsx(tW,{value:h,children:a.jsx(lW,{value:r,children:a.jsx(_e.div,{className:et("chakra-tabs",s),ref:n,...v,__css:r.root,children:o})})})})});Yi.displayName="Tabs";var Qi=Pe(function(t,n){const r=nW({...t,ref:n}),s={display:"flex",...Um().tablist};return a.jsx(_e.div,{...r,className:et("chakra-tabs__tablist",t.className),__css:s})});Qi.displayName="TabList";var fo=Pe(function(t,n){const r=iW({...t,ref:n}),o=Um();return a.jsx(_e.div,{outline:"0",...r,className:et("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});fo.displayName="TabPanel";var zc=Pe(function(t,n){const r=aW(t),o=Um();return a.jsx(_e.div,{...r,width:"100%",ref:n,className:et("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});zc.displayName="TabPanels";var Pr=Pe(function(t,n){const r=Um(),o=rW({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return a.jsx(_e.button,{...o,className:et("chakra-tabs__tab",t.className),__css:s})});Pr.displayName="Tab";function cW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var uW=["h","minH","height","minHeight"],MP=Pe((e,t)=>{const n=Qa("Textarea",e),{className:r,rows:o,...s}=Xt(e),i=Jx(s),l=o?cW(n,uW):n;return a.jsx(_e.textarea,{ref:t,rows:o,...i,className:et("chakra-textarea",r),__css:l})});MP.displayName="Textarea";var dW={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]}}}},$1=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Np=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function fW(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:i=o,closeOnEsc:l=!0,onOpen:f,onClose:p,placement:h,id:m,isOpen:v,defaultIsOpen:x,arrowSize:C=10,arrowShadowColor:b,arrowPadding:w,modifiers:k,isDisabled:_,gutter:j,offset:I,direction:M,...E}=e,{isOpen:O,onOpen:D,onClose:A}=Pb({isOpen:v,defaultIsOpen:x,onOpen:f,onClose:p}),{referenceRef:R,getPopperProps:$,getArrowInnerProps:K,getArrowProps:B}=jb({enabled:O,placement:h,arrowPadding:w,modifiers:k,gutter:j,offset:I,direction:M}),U=d.useId(),W=`tooltip-${m??U}`,L=d.useRef(null),X=d.useRef(),z=d.useCallback(()=>{X.current&&(clearTimeout(X.current),X.current=void 0)},[]),q=d.useRef(),ne=d.useCallback(()=>{q.current&&(clearTimeout(q.current),q.current=void 0)},[]),Q=d.useCallback(()=>{ne(),A()},[A,ne]),ie=pW(L,Q),oe=d.useCallback(()=>{if(!_&&!X.current){O&&ie();const me=Np(L);X.current=me.setTimeout(D,t)}},[ie,_,O,D,t]),V=d.useCallback(()=>{z();const me=Np(L);q.current=me.setTimeout(Q,n)},[n,Q,z]),G=d.useCallback(()=>{O&&r&&V()},[r,V,O]),J=d.useCallback(()=>{O&&i&&V()},[i,V,O]),se=d.useCallback(me=>{O&&me.key==="Escape"&&V()},[O,V]);_i(()=>$1(L),"keydown",l?se:void 0),_i(()=>{const me=L.current;if(!me)return null;const ye=w5(me);return ye.localName==="body"?Np(L):ye},"scroll",()=>{O&&s&&Q()},{passive:!0,capture:!0}),d.useEffect(()=>{_&&(z(),O&&A())},[_,O,A,z]),d.useEffect(()=>()=>{z(),ne()},[z,ne]),_i(()=>L.current,"pointerleave",V);const re=d.useCallback((me={},ye=null)=>({...me,ref:yt(L,ye,R),onPointerEnter:Fe(me.onPointerEnter,ue=>{ue.pointerType!=="touch"&&oe()}),onClick:Fe(me.onClick,G),onPointerDown:Fe(me.onPointerDown,J),onFocus:Fe(me.onFocus,oe),onBlur:Fe(me.onBlur,V),"aria-describedby":O?W:void 0}),[oe,V,J,O,W,G,R]),fe=d.useCallback((me={},ye=null)=>$({...me,style:{...me.style,[jn.arrowSize.var]:C?`${C}px`:void 0,[jn.arrowShadowColor.var]:b}},ye),[$,C,b]),de=d.useCallback((me={},ye=null)=>{const he={...me.style,position:"relative",transformOrigin:jn.transformOrigin.varRef};return{ref:ye,...E,...me,id:W,role:"tooltip",style:he}},[E,W]);return{isOpen:O,show:oe,hide:V,getTriggerProps:re,getTooltipProps:de,getTooltipPositionerProps:fe,getArrowProps:B,getArrowInnerProps:K}}var pv="chakra-ui:close-tooltip";function pW(e,t){return d.useEffect(()=>{const n=$1(e);return n.addEventListener(pv,t),()=>n.removeEventListener(pv,t)},[t,e]),()=>{const n=$1(e),r=Np(e);n.dispatchEvent(new r.CustomEvent(pv))}}function hW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function mW(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var gW=_e(gn.div),Dt=Pe((e,t)=>{var n,r;const o=Qa("Tooltip",e),s=Xt(e),i=xd(),{children:l,label:f,shouldWrapChildren:p,"aria-label":h,hasArrow:m,bg:v,portalProps:x,background:C,backgroundColor:b,bgColor:w,motionProps:k,..._}=s,j=(r=(n=C??b)!=null?n:v)!=null?r:w;if(j){o.bg=j;const $=O7(i,"colors",j);o[jn.arrowBg.var]=$}const I=fW({..._,direction:i.direction}),M=typeof l=="string"||p;let E;if(M)E=a.jsx(_e.span,{display:"inline-block",tabIndex:0,...I.getTriggerProps(),children:l});else{const $=d.Children.only(l);E=d.cloneElement($,I.getTriggerProps($.props,$.ref))}const O=!!h,D=I.getTooltipProps({},t),A=O?hW(D,["role","id"]):D,R=mW(D,["role","id"]);return f?a.jsxs(a.Fragment,{children:[E,a.jsx(nr,{children:I.isOpen&&a.jsx(wd,{...x,children:a.jsx(_e.div,{...I.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:a.jsxs(gW,{variants:dW,initial:"exit",animate:"enter",exit:"exit",...k,...A,__css:o,children:[f,O&&a.jsx(_e.span,{srOnly:!0,...R,children:h}),m&&a.jsx(_e.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:a.jsx(_e.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):a.jsx(a.Fragment,{children:l})});Dt.displayName="Tooltip";const vo=e=>e.system,vW=e=>e.system.toastQueue,OP=ae(vo,e=>e.language,Ce),Pn=ae(e=>e,e=>e.system.isProcessing||!e.system.isConnected),xW=ae(vo,e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=e;return{consoleLogLevel:t,shouldLogToConsole:n}},{memoizeOptions:{resultEqualityCheck:kt}}),DP=e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=F(xW);return d.useEffect(()=>{n?(localStorage.setItem("ROARR_LOG","true"),localStorage.setItem("ROARR_FILTER",`context.logLevel:>=${D7[t]}`)):localStorage.setItem("ROARR_LOG","false"),AC.ROARR.write=R7.createLogWriter()},[t,n]),d.useEffect(()=>{const o={...A7};N7.set(AC.Roarr.child(o))},[]),d.useMemo(()=>Dc(e),[e])},bW=()=>{const e=te(),t=F(vW),n=k3();return d.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(T7())},[e,n,t]),null},Zi=()=>{const e=te();return d.useCallback(n=>e(Nt(zt(n))),[e])},yW=d.memo(bW);var CW=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 $d(e,t){var n=wW(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 wW(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=CW.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var SW=[".DS_Store","Thumbs.db"];function kW(e){return Ac(this,void 0,void 0,function(){return Nc(this,function(t){return sh(e)&&_W(e.dataTransfer)?[2,EW(e.dataTransfer,e.type)]:jW(e)?[2,PW(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,IW(e)]:[2,[]]})})}function _W(e){return sh(e)}function jW(e){return sh(e)&&sh(e.target)}function sh(e){return typeof e=="object"&&e!==null}function PW(e){return L1(e.target.files).map(function(t){return $d(t)})}function IW(e){return Ac(this,void 0,void 0,function(){var t;return Nc(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 $d(r)})]}})})}function EW(e,t){return Ac(this,void 0,void 0,function(){var n,r;return Nc(this,function(o){switch(o.label){case 0:return e.items?(n=L1(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(MW))]):[3,2];case 1:return r=o.sent(),[2,fS(RP(r))];case 2:return[2,fS(L1(e.files).map(function(s){return $d(s)}))]}})})}function fS(e){return e.filter(function(t){return SW.indexOf(t.name)===-1})}function L1(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function MW(e){if(typeof e.webkitGetAsEntry!="function")return pS(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?AP(t):pS(e)}function RP(e){return e.reduce(function(t,n){return w1(w1([],Nw(t),!1),Nw(Array.isArray(n)?RP(n):[n]),!1)},[])}function pS(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=$d(t);return Promise.resolve(n)}function OW(e){return Ac(this,void 0,void 0,function(){return Nc(this,function(t){return[2,e.isDirectory?AP(e):DW(e)]})})}function AP(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var i=this;t.readEntries(function(l){return Ac(i,void 0,void 0,function(){var f,p,h;return Nc(this,function(m){switch(m.label){case 0:if(l.length)return[3,5];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return f=m.sent(),n(f),[3,4];case 3:return p=m.sent(),r(p),[3,4];case 4:return[3,6];case 5:h=Promise.all(l.map(OW)),o.push(h),s(),m.label=6;case 6:return[2]}})})},function(l){r(l)})}s()})}function DW(e){return Ac(this,void 0,void 0,function(){return Nc(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=$d(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var RW=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(i){var l=i.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?s===l.replace(/\/.*$/,""):o===l})}return!0};function hS(e){return TW(e)||NW(e)||TP(e)||AW()}function AW(){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 NW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TW(e){if(Array.isArray(e))return z1(e)}function mS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function gS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mS(Object(n),!0).forEach(function(r){NP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rd(e,t){return zW(e)||LW(e,t)||TP(e,t)||$W()}function $W(){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 TP(e,t){if(e){if(typeof e=="string")return z1(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 z1(e,t)}}function z1(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 LW(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,l;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,l=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function zW(e){if(Array.isArray(e))return e}var FW="file-invalid-type",BW="file-too-large",HW="file-too-small",WW="too-many-files",VW=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:FW,message:"File type must be ".concat(n)}},vS=function(t){return{code:BW,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},xS=function(t){return{code:HW,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},UW={code:WW,message:"Too many files"};function $P(e,t){var n=e.type==="application/x-moz-file"||RW(e,t);return[n,n?null:VW(t)]}function LP(e,t,n){if(bi(e.size))if(bi(t)&&bi(n)){if(e.size>n)return[!1,vS(n)];if(e.size<t)return[!1,xS(t)]}else{if(bi(t)&&e.size<t)return[!1,xS(t)];if(bi(n)&&e.size>n)return[!1,vS(n)]}return[!0,null]}function bi(e){return e!=null}function GW(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,l=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(f){var p=$P(f,n),h=rd(p,1),m=h[0],v=LP(f,r,o),x=rd(v,1),C=x[0],b=l?l(f):null;return m&&C&&!b})}function ah(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Jf(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 bS(e){e.preventDefault()}function KW(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function qW(e){return e.indexOf("Edge/")!==-1}function XW(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return KW(e)||qW(e)}function ss(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),i=1;i<o;i++)s[i-1]=arguments[i];return t.some(function(l){return!ah(r)&&l&&l.apply(void 0,[r].concat(s)),ah(r)})}}function YW(){return"showOpenFilePicker"in window}function QW(e){if(bi(e)){var t=Object.entries(e).filter(function(n){var r=rd(n,2),o=r[0],s=r[1],i=!0;return zP(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),i=!1),(!Array.isArray(s)||!s.every(FP))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=rd(r,2),s=o[0],i=o[1];return gS(gS({},n),{},NP({},s,i))},{});return[{description:"Files",accept:t}]}return e}function ZW(e){if(bi(e))return Object.entries(e).reduce(function(t,n){var r=rd(n,2),o=r[0],s=r[1];return[].concat(hS(t),[o],hS(s))},[]).filter(function(t){return zP(t)||FP(t)}).join(",")}function JW(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function eV(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function zP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function FP(e){return/^.*\.[\w]+$/.test(e)}var tV=["children"],nV=["open"],rV=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],oV=["refKey","onChange","onClick"];function sV(e){return lV(e)||iV(e)||BP(e)||aV()}function aV(){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 iV(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lV(e){if(Array.isArray(e))return F1(e)}function hv(e,t){return dV(e)||uV(e,t)||BP(e,t)||cV()}function cV(){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 BP(e,t){if(e){if(typeof e=="string")return F1(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 F1(e,t)}}function F1(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 uV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,l;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,l=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function dV(e){if(Array.isArray(e))return e}function yS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function an(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yS(Object(n),!0).forEach(function(r){B1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ih(e,t){if(e==null)return{};var n=fV(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fV(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var zb=d.forwardRef(function(e,t){var n=e.children,r=ih(e,tV),o=Fb(r),s=o.open,i=ih(o,nV);return d.useImperativeHandle(t,function(){return{open:s}},[s]),H.createElement(d.Fragment,null,n(an(an({},i),{},{open:s})))});zb.displayName="Dropzone";var HP={disabled:!1,getFilesFromEvent:kW,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};zb.defaultProps=HP;zb.propTypes={children:Bt.func,accept:Bt.objectOf(Bt.arrayOf(Bt.string)),multiple:Bt.bool,preventDropOnDocument:Bt.bool,noClick:Bt.bool,noKeyboard:Bt.bool,noDrag:Bt.bool,noDragEventsBubbling:Bt.bool,minSize:Bt.number,maxSize:Bt.number,maxFiles:Bt.number,disabled:Bt.bool,getFilesFromEvent:Bt.func,onFileDialogCancel:Bt.func,onFileDialogOpen:Bt.func,useFsAccessApi:Bt.bool,autoFocus:Bt.bool,onDragEnter:Bt.func,onDragLeave:Bt.func,onDragOver:Bt.func,onDrop:Bt.func,onDropAccepted:Bt.func,onDropRejected:Bt.func,onError:Bt.func,validator:Bt.func};var H1={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Fb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=an(an({},HP),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,l=t.multiple,f=t.maxFiles,p=t.onDragEnter,h=t.onDragLeave,m=t.onDragOver,v=t.onDrop,x=t.onDropAccepted,C=t.onDropRejected,b=t.onFileDialogCancel,w=t.onFileDialogOpen,k=t.useFsAccessApi,_=t.autoFocus,j=t.preventDropOnDocument,I=t.noClick,M=t.noKeyboard,E=t.noDrag,O=t.noDragEventsBubbling,D=t.onError,A=t.validator,R=d.useMemo(function(){return ZW(n)},[n]),$=d.useMemo(function(){return QW(n)},[n]),K=d.useMemo(function(){return typeof w=="function"?w:CS},[w]),B=d.useMemo(function(){return typeof b=="function"?b:CS},[b]),U=d.useRef(null),Y=d.useRef(null),W=d.useReducer(pV,H1),L=hv(W,2),X=L[0],z=L[1],q=X.isFocused,ne=X.isFileDialogActive,Q=d.useRef(typeof window<"u"&&window.isSecureContext&&k&&YW()),ie=function(){!Q.current&&ne&&setTimeout(function(){if(Y.current){var Re=Y.current.files;Re.length||(z({type:"closeDialog"}),B())}},300)};d.useEffect(function(){return window.addEventListener("focus",ie,!1),function(){window.removeEventListener("focus",ie,!1)}},[Y,ne,B,Q]);var oe=d.useRef([]),V=function(Re){U.current&&U.current.contains(Re.target)||(Re.preventDefault(),oe.current=[])};d.useEffect(function(){return j&&(document.addEventListener("dragover",bS,!1),document.addEventListener("drop",V,!1)),function(){j&&(document.removeEventListener("dragover",bS),document.removeEventListener("drop",V))}},[U,j]),d.useEffect(function(){return!r&&_&&U.current&&U.current.focus(),function(){}},[U,_,r]);var G=d.useCallback(function(ve){D?D(ve):console.error(ve)},[D]),J=d.useCallback(function(ve){ve.preventDefault(),ve.persist(),Ue(ve),oe.current=[].concat(sV(oe.current),[ve.target]),Jf(ve)&&Promise.resolve(o(ve)).then(function(Re){if(!(ah(ve)&&!O)){var st=Re.length,mt=st>0&&GW({files:Re,accept:R,minSize:i,maxSize:s,multiple:l,maxFiles:f,validator:A}),ge=st>0&&!mt;z({isDragAccept:mt,isDragReject:ge,isDragActive:!0,type:"setDraggedFiles"}),p&&p(ve)}}).catch(function(Re){return G(Re)})},[o,p,G,O,R,i,s,l,f,A]),se=d.useCallback(function(ve){ve.preventDefault(),ve.persist(),Ue(ve);var Re=Jf(ve);if(Re&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return Re&&m&&m(ve),!1},[m,O]),re=d.useCallback(function(ve){ve.preventDefault(),ve.persist(),Ue(ve);var Re=oe.current.filter(function(mt){return U.current&&U.current.contains(mt)}),st=Re.indexOf(ve.target);st!==-1&&Re.splice(st,1),oe.current=Re,!(Re.length>0)&&(z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Jf(ve)&&h&&h(ve))},[U,h,O]),fe=d.useCallback(function(ve,Re){var st=[],mt=[];ve.forEach(function(ge){var Ye=$P(ge,R),ot=hv(Ye,2),lt=ot[0],Me=ot[1],$e=LP(ge,i,s),Rt=hv($e,2),ke=Rt[0],ze=Rt[1],Le=A?A(ge):null;if(lt&&ke&&!Le)st.push(ge);else{var Ve=[Me,ze];Le&&(Ve=Ve.concat(Le)),mt.push({file:ge,errors:Ve.filter(function(ct){return ct})})}}),(!l&&st.length>1||l&&f>=1&&st.length>f)&&(st.forEach(function(ge){mt.push({file:ge,errors:[UW]})}),st.splice(0)),z({acceptedFiles:st,fileRejections:mt,type:"setFiles"}),v&&v(st,mt,Re),mt.length>0&&C&&C(mt,Re),st.length>0&&x&&x(st,Re)},[z,l,R,i,s,f,v,x,C,A]),de=d.useCallback(function(ve){ve.preventDefault(),ve.persist(),Ue(ve),oe.current=[],Jf(ve)&&Promise.resolve(o(ve)).then(function(Re){ah(ve)&&!O||fe(Re,ve)}).catch(function(Re){return G(Re)}),z({type:"reset"})},[o,fe,G,O]),me=d.useCallback(function(){if(Q.current){z({type:"openDialog"}),K();var ve={multiple:l,types:$};window.showOpenFilePicker(ve).then(function(Re){return o(Re)}).then(function(Re){fe(Re,null),z({type:"closeDialog"})}).catch(function(Re){JW(Re)?(B(Re),z({type:"closeDialog"})):eV(Re)?(Q.current=!1,Y.current?(Y.current.value=null,Y.current.click()):G(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."))):G(Re)});return}Y.current&&(z({type:"openDialog"}),K(),Y.current.value=null,Y.current.click())},[z,K,B,k,fe,G,$,l]),ye=d.useCallback(function(ve){!U.current||!U.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),me())},[U,me]),he=d.useCallback(function(){z({type:"focus"})},[]),ue=d.useCallback(function(){z({type:"blur"})},[]),De=d.useCallback(function(){I||(XW()?setTimeout(me,0):me())},[I,me]),je=function(Re){return r?null:Re},Be=function(Re){return M?null:je(Re)},rt=function(Re){return E?null:je(Re)},Ue=function(Re){O&&Re.stopPropagation()},Ct=d.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=ve.refKey,st=Re===void 0?"ref":Re,mt=ve.role,ge=ve.onKeyDown,Ye=ve.onFocus,ot=ve.onBlur,lt=ve.onClick,Me=ve.onDragEnter,$e=ve.onDragOver,Rt=ve.onDragLeave,ke=ve.onDrop,ze=ih(ve,rV);return an(an(B1({onKeyDown:Be(ss(ge,ye)),onFocus:Be(ss(Ye,he)),onBlur:Be(ss(ot,ue)),onClick:je(ss(lt,De)),onDragEnter:rt(ss(Me,J)),onDragOver:rt(ss($e,se)),onDragLeave:rt(ss(Rt,re)),onDrop:rt(ss(ke,de)),role:typeof mt=="string"&&mt!==""?mt:"presentation"},st,U),!r&&!M?{tabIndex:0}:{}),ze)}},[U,ye,he,ue,De,J,se,re,de,M,E,r]),Xe=d.useCallback(function(ve){ve.stopPropagation()},[]),tt=d.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=ve.refKey,st=Re===void 0?"ref":Re,mt=ve.onChange,ge=ve.onClick,Ye=ih(ve,oV),ot=B1({accept:R,multiple:l,type:"file",style:{display:"none"},onChange:je(ss(mt,de)),onClick:je(ss(ge,Xe)),tabIndex:-1},st,Y);return an(an({},ot),Ye)}},[Y,n,l,de,r]);return an(an({},X),{},{isFocused:q&&!r,getRootProps:Ct,getInputProps:tt,rootRef:U,inputRef:Y,open:je(me)})}function pV(e,t){switch(t.type){case"focus":return an(an({},e),{},{isFocused:!0});case"blur":return an(an({},e),{},{isFocused:!1});case"openDialog":return an(an({},H1),{},{isFileDialogActive:!0});case"closeDialog":return an(an({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return an(an({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return an(an({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return an({},H1);default:return e}}function CS(){}function W1(){return W1=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},W1.apply(this,arguments)}var WP=["shift","alt","meta","mod","ctrl"],hV={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function $a(e){return(hV[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function mV(e){return WP.includes(e)}function mv(e,t){return t===void 0&&(t=","),e.split(t)}function gv(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(i){return $a(i)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},s=r.filter(function(i){return!WP.includes(i)});return W1({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&VP([$a(e.key),$a(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&UP([$a(e.key),$a(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){La.clear()})})();var La=new Set;function Bb(e){return Array.isArray(e)}function Tp(e,t){t===void 0&&(t=",");var n=Bb(e)?e:e.split(t);return n.every(function(r){return La.has(r.trim().toLowerCase())})}function VP(e){var t=Array.isArray(e)?e:[e];La.has("meta")&&La.forEach(function(n){return!mV(n)&&La.delete(n.toLowerCase())}),t.forEach(function(n){return La.add(n.toLowerCase())})}function UP(e){var t=Array.isArray(e)?e:[e];e==="meta"?La.clear():t.forEach(function(n){return La.delete(n.toLowerCase())})}function gV(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function vV(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function xV(e){return GP(e,["input","textarea","select"])}function GP(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return Bb(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function bV(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 yV=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,i=n.mod,l=n.shift,f=n.ctrl,p=n.keys,h=t.key,m=t.code,v=t.ctrlKey,x=t.metaKey,C=t.shiftKey,b=t.altKey,w=$a(m),k=h.toLowerCase();if(!r){if(o===!b&&k!=="alt"||l===!C&&k!=="shift")return!1;if(i){if(!x&&!v)return!1}else if(s===!x&&k!=="meta"&&k!=="os"||f===!v&&k!=="ctrl"&&k!=="control")return!1}return p&&p.length===1&&(p.includes(k)||p.includes(w))?!0:p?Tp(p):!p},CV=d.createContext(void 0),wV=function(){return d.useContext(CV)};function KP(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&&KP(e[r],t[r])},!0):e===t}var SV=d.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),kV=function(){return d.useContext(SV)};function _V(e){var t=d.useRef(void 0);return KP(t.current,e)||(t.current=e),t.current}var wS=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},jV=typeof window<"u"?d.useLayoutEffect:d.useEffect;function Qe(e,t,n,r){var o=d.useRef(null),s=d.useRef(!1),i=n instanceof Array?r instanceof Array?void 0:r:n,l=Bb(e)?e.join(i==null?void 0:i.splitKey):e,f=n instanceof Array?n:r instanceof Array?r:void 0,p=d.useCallback(t,f??[]),h=d.useRef(p);f?h.current=p:h.current=t;var m=_V(i),v=kV(),x=v.enabledScopes,C=wV();return jV(function(){if(!((m==null?void 0:m.enabled)===!1||!bV(x,m==null?void 0:m.scopes))){var b=function(I,M){var E;if(M===void 0&&(M=!1),!(xV(I)&&!GP(I,m==null?void 0:m.enableOnFormTags))&&!(m!=null&&m.ignoreEventWhen!=null&&m.ignoreEventWhen(I))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){wS(I);return}(E=I.target)!=null&&E.isContentEditable&&!(m!=null&&m.enableOnContentEditable)||mv(l,m==null?void 0:m.splitKey).forEach(function(O){var D,A=gv(O,m==null?void 0:m.combinationKey);if(yV(I,A,m==null?void 0:m.ignoreModifiers)||(D=A.keys)!=null&&D.includes("*")){if(M&&s.current)return;if(gV(I,A,m==null?void 0:m.preventDefault),!vV(I,A,m==null?void 0:m.enabled)){wS(I);return}h.current(I,A),M||(s.current=!0)}})}},w=function(I){I.key!==void 0&&(VP($a(I.code)),((m==null?void 0:m.keydown)===void 0&&(m==null?void 0:m.keyup)!==!0||m!=null&&m.keydown)&&b(I))},k=function(I){I.key!==void 0&&(UP($a(I.code)),s.current=!1,m!=null&&m.keyup&&b(I,!0))},_=o.current||(i==null?void 0:i.document)||document;return _.addEventListener("keyup",k),_.addEventListener("keydown",w),C&&mv(l,m==null?void 0:m.splitKey).forEach(function(j){return C.addHotkey(gv(j,m==null?void 0:m.combinationKey,m==null?void 0:m.description))}),function(){_.removeEventListener("keyup",k),_.removeEventListener("keydown",w),C&&mv(l,m==null?void 0:m.splitKey).forEach(function(j){return C.removeHotkey(gv(j,m==null?void 0:m.combinationKey,m==null?void 0:m.description))})}}},[l,m,x]),o}const PV=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return Qe("esc",()=>{r(!1)}),a.jsxs(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:[a.jsx(T,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:"base.700",_dark:{bg:"base.900"},opacity:.7,alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(T,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"full",height:"full",alignItems:"center",justifyContent:"center",p:4},children:a.jsx(T,{sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",flexDir:"column",gap:4,borderWidth:3,borderRadius:"xl",borderStyle:"dashed",color:"base.100",borderColor:"base.100",_dark:{borderColor:"base.200"}},children:t?a.jsx(oo,{size:"lg",children:"Drop to Upload"}):a.jsxs(a.Fragment,{children:[a.jsx(oo,{size:"lg",children:"Invalid Upload"}),a.jsx(oo,{size:"md",children:"Must be single JPEG or PNG image"})]})})})]})},IV=d.memo(PV),EV=ae([xe,wn],({gallery:e},t)=>{let n={type:"TOAST"};t==="unifiedCanvas"&&(n={type:"SET_CANVAS_INITIAL_IMAGE"}),t==="img2img"&&(n={type:"SET_INITIAL_IMAGE"});const{autoAddBoardId:r}=e;return{autoAddBoardId:r,postUploadAction:n}},Ce),MV=e=>{const{children:t}=e,{autoAddBoardId:n,postUploadAction:r}=F(EV),o=F(Pn),s=Zi(),{t:i}=we(),[l,f]=d.useState(!1),[p]=Ej(),h=d.useCallback(j=>{f(!0),s({title:i("toast.uploadFailed"),description:j.errors.map(I=>I.message).join(`
`),status:"error"})},[i,s]),m=d.useCallback(async j=>{p({file:j,image_category:"user",is_intermediate:!1,postUploadAction:r,board_id:n==="none"?void 0:n})},[n,r,p]),v=d.useCallback((j,I)=>{if(I.length>1){s({title:i("toast.uploadFailed"),description:i("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}I.forEach(M=>{h(M)}),j.forEach(M=>{m(M)})},[i,s,m,h]),{getRootProps:x,getInputProps:C,isDragAccept:b,isDragReject:w,isDragActive:k,inputRef:_}=Fb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>f(!0),disabled:o,multiple:!1});return d.useEffect(()=>{const j=async I=>{var M,E;_.current&&(M=I.clipboardData)!=null&&M.files&&(_.current.files=I.clipboardData.files,(E=_.current)==null||E.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",j),()=>{document.removeEventListener("paste",j)}},[_]),a.jsxs(Ie,{...x({style:{}}),onKeyDown:j=>{j.key},children:[a.jsx("input",{...C()}),t,a.jsx(nr,{children:k&&l&&a.jsx(gn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(IV,{isDragAccept:b,isDragReject:w,setIsHandlingUpload:f})},"image-upload-overlay")})]})},OV=d.memo(MV),DV=Pe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...i}={},isChecked:l,...f}=e;return a.jsx(Dt,{label:r,placement:o,hasArrow:s,...i,children:a.jsx(gc,{ref:t,colorScheme:l?"accent":"base",...f,children:n})})}),it=d.memo(DV);function RV(e){const t=d.createContext(null);return[({children:o,value:s})=>H.createElement(t.Provider,{value:s},o),()=>{const o=d.useContext(t);if(o===null)throw new Error(e);return o}]}function qP(e){return Array.isArray(e)?e:[e]}const AV=()=>{};function NV(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||AV:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function XP({data:e}){const t=[],n=[],r=e.reduce((o,s,i)=>(s.group?o[s.group]?o[s.group].push(i):o[s.group]=[i]:n.push(i),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(s=>e[s]))}),t.push(...n.map(o=>e[o])),t}function YP(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==H.Fragment:!1}function QP(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=QP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ZP(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=QP(t))&&(r&&(r+=" "),r+=n);return r}const TV={app:100,modal:200,popover:300,overlay:400,max:9999};function Hb(e){return TV[e]}function $V(e,t){const n=d.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,o)=>r===t[o]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const LV=$7({key:"mantine",prepend:!0});function zV(){return g3()||LV}var FV=Object.defineProperty,SS=Object.getOwnPropertySymbols,BV=Object.prototype.hasOwnProperty,HV=Object.prototype.propertyIsEnumerable,kS=(e,t,n)=>t in e?FV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WV=(e,t)=>{for(var n in t||(t={}))BV.call(t,n)&&kS(e,n,t[n]);if(SS)for(var n of SS(t))HV.call(t,n)&&kS(e,n,t[n]);return e};const vv="ref";function VV(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(vv in n))return{args:e,ref:t};t=n[vv];const r=WV({},n);return delete r[vv],{args:[r],ref:t}}const{cssFactory:UV}=(()=>{function e(n,r,o){const s=[],i=F7(n,s,o);return s.length<2?o:i+r(s)}function t(n){const{cache:r}=n,o=(...i)=>{const{ref:l,args:f}=VV(i),p=L7(f,r.registered);return z7(r,p,!1),`${r.key}-${p.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...i)=>e(r.registered,o,ZP(i))}}return{cssFactory:t}})();function JP(){const e=zV();return $V(()=>UV({cache:e}),[e])}function GV({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const i=n.reduce((l,f)=>(Object.keys(f.classNames).forEach(p=>{typeof l[p]!="string"?l[p]=`${f.classNames[p]}`:l[p]=`${l[p]} ${f.classNames[p]}`}),l),{});return Object.keys(t).reduce((l,f)=>(l[f]=e(t[f],i[f],r!=null&&r[f],Array.isArray(o)?o.filter(Boolean).map(p=>`${(s==null?void 0:s.key)||"mantine"}-${p}-${f}`).join(" "):o?`${(s==null?void 0:s.key)||"mantine"}-${o}-${f}`:null),l),{})}var KV=Object.defineProperty,_S=Object.getOwnPropertySymbols,qV=Object.prototype.hasOwnProperty,XV=Object.prototype.propertyIsEnumerable,jS=(e,t,n)=>t in e?KV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xv=(e,t)=>{for(var n in t||(t={}))qV.call(t,n)&&jS(e,n,t[n]);if(_S)for(var n of _S(t))XV.call(t,n)&&jS(e,n,t[n]);return e};function V1(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=xv(xv({},e[n]),t[n]):e[n]=xv({},t[n])}),e}function PS(e,t,n,r){const o=s=>typeof s=="function"?s(t,n||{},r):s||{};return Array.isArray(e)?e.map(s=>o(s.styles)).reduce((s,i)=>V1(s,i),{}):o(e)}function YV({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,i)=>(i.variants&&r in i.variants&&V1(s,i.variants[r](t,n,{variant:r,size:o})),i.sizes&&o in i.sizes&&V1(s,i.sizes[o](t,n,{variant:r,size:o})),s),{})}function or(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=ca(),i=uN(o==null?void 0:o.name),l=g3(),f={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:p,cx:h}=JP(),m=t(s,r,f),v=PS(o==null?void 0:o.styles,s,r,f),x=PS(i,s,r,f),C=YV({ctx:i,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),b=Object.fromEntries(Object.keys(m).map(w=>{const k=h({[p(m[w])]:!(o!=null&&o.unstyled)},p(C[w]),p(x[w]),p(v[w]));return[w,k]}));return{classes:GV({cx:h,classes:b,context:i,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:l}),cx:h,theme:s}}return n}function IS(e){return`___ref-${e||""}`}var QV=Object.defineProperty,ZV=Object.defineProperties,JV=Object.getOwnPropertyDescriptors,ES=Object.getOwnPropertySymbols,eU=Object.prototype.hasOwnProperty,tU=Object.prototype.propertyIsEnumerable,MS=(e,t,n)=>t in e?QV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cu=(e,t)=>{for(var n in t||(t={}))eU.call(t,n)&&MS(e,n,t[n]);if(ES)for(var n of ES(t))tU.call(t,n)&&MS(e,n,t[n]);return e},wu=(e,t)=>ZV(e,JV(t));const Su={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${Oe(10)})`},transitionProperty:"transform, opacity"},ep={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(-${Oe(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${Oe(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Oe(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Oe(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:wu(Cu({},Su),{common:{transformOrigin:"center center"}}),"pop-bottom-left":wu(Cu({},Su),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":wu(Cu({},Su),{common:{transformOrigin:"bottom right"}}),"pop-top-left":wu(Cu({},Su),{common:{transformOrigin:"top left"}}),"pop-top-right":wu(Cu({},Su),{common:{transformOrigin:"top right"}})},OS=["mousedown","touchstart"];function nU(e,t,n){const r=d.useRef();return d.useEffect(()=>{const o=s=>{const{target:i}=s??{};if(Array.isArray(n)){const l=(i==null?void 0:i.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(i)&&i.tagName!=="HTML";n.every(p=>!!p&&!s.composedPath().includes(p))&&!l&&e()}else r.current&&!r.current.contains(i)&&e()};return(t||OS).forEach(s=>document.addEventListener(s,o)),()=>{(t||OS).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function rU(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function oU(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function sU(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=d.useState(n?t:oU(e,t)),s=d.useRef();return d.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),rU(s.current,i=>o(i.matches))},[e]),r}const e6=typeof document<"u"?d.useLayoutEffect:d.useEffect;function $o(e,t){const n=d.useRef(!1);d.useEffect(()=>()=>{n.current=!1},[]),d.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function aU({opened:e,shouldReturnFocus:t=!0}){const n=d.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return $o(()=>{let o=-1;const s=i=>{i.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const iU=/input|select|textarea|button|object/,t6="a, input, select, textarea, button, object, [tabindex]";function lU(e){return e.style.display==="none"}function cU(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(lU(n))return!1;n=n.parentNode}return!0}function n6(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function U1(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(n6(e));return(iU.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&cU(e)}function r6(e){const t=n6(e);return(Number.isNaN(t)||t>=0)&&U1(e)}function uU(e){return Array.from(e.querySelectorAll(t6)).filter(r6)}function dU(e,t){const n=uU(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();if(!(r===o.activeElement||e===o.activeElement))return;t.preventDefault();const i=n[t.shiftKey?n.length-1:0];i&&i.focus()}function Wb(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function fU(e,t="body > :not(script)"){const n=Wb(),r=Array.from(document.querySelectorAll(t)).map(o=>{var s;if((s=o==null?void 0:o.shadowRoot)!=null&&s.contains(e)||o.contains(e))return;const i=o.getAttribute("aria-hidden"),l=o.getAttribute("data-hidden"),f=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!l&&!f&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:l||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function pU(e=!0){const t=d.useRef(),n=d.useRef(null),r=s=>{let i=s.querySelector("[data-autofocus]");if(!i){const l=Array.from(s.querySelectorAll(t6));i=l.find(r6)||l.find(U1)||null,!i&&U1(s)&&(i=s)}i&&i.focus({preventScroll:!0})},o=d.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=fU(s),t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)}},[e]);return d.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=i=>{i.key==="Tab"&&t.current&&dU(t.current,i)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const hU=H["useId".toString()]||(()=>{});function mU(){const e=hU();return e?`mantine-${e.replace(/:/g,"")}`:""}function Vb(e){const t=mU(),[n,r]=d.useState(t);return e6(()=>{r(Wb())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function DS(e,t,n){d.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function o6(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function gU(...e){return t=>{e.forEach(n=>o6(n,t))}}function Ld(...e){return d.useCallback(gU(...e),e)}function od({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=d.useState(t!==void 0?t:n),i=l=>{s(l),r==null||r(l)};return e!==void 0?[e,r,!0]:[o,i,!1]}function s6(e,t){return sU("(prefers-reduced-motion: reduce)",e,t)}const vU=e=>e<.5?2*e*e:-1+(4-2*e)*e,xU=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const i=!!n,f=(n||document.body).getBoundingClientRect(),p=t.getBoundingClientRect(),h=m=>p[m]-f[m];if(e==="y"){const m=h("top");if(m===0)return 0;if(r==="start"){const x=m-o;return x<=p.height*(s?0:1)||!s?x:0}const v=i?f.height:window.innerHeight;if(r==="end"){const x=m+o-v+p.height;return x>=-p.height*(s?0:1)||!s?x:0}return r==="center"?m-v/2+p.height/2:0}if(e==="x"){const m=h("left");if(m===0)return 0;if(r==="start"){const x=m-o;return x<=p.width||!s?x:0}const v=i?f.width:window.innerWidth;if(r==="end"){const x=m+o-v+p.width;return x>=-p.width||!s?x:0}return r==="center"?m-v/2+p.width/2:0}return 0},bU=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const n=e==="y"?"scrollTop":"scrollLeft";if(t)return t[n];const{body:r,documentElement:o}=document;return r[n]+o[n]},yU=({axis:e,parent:t,distance:n})=>{if(!t&&typeof document>"u")return;const r=e==="y"?"scrollTop":"scrollLeft";if(t)t[r]=n;else{const{body:o,documentElement:s}=document;o[r]=n,s[r]=n}};function a6({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=vU,offset:o=0,cancelable:s=!0,isList:i=!1}={}){const l=d.useRef(0),f=d.useRef(0),p=d.useRef(!1),h=d.useRef(null),m=d.useRef(null),v=s6(),x=()=>{l.current&&cancelAnimationFrame(l.current)},C=d.useCallback(({alignment:w="start"}={})=>{var k;p.current=!1,l.current&&x();const _=(k=bU({parent:h.current,axis:t}))!=null?k:0,j=xU({parent:h.current,target:m.current,axis:t,alignment:w,offset:o,isList:i})-(h.current?0:_);function I(){f.current===0&&(f.current=performance.now());const E=performance.now()-f.current,O=v||e===0?1:E/e,D=_+j*r(O);yU({parent:h.current,axis:t,distance:D}),!p.current&&O<1?l.current=requestAnimationFrame(I):(typeof n=="function"&&n(),f.current=0,l.current=0,x())}I()},[t,e,r,i,o,n,v]),b=()=>{s&&(p.current=!0)};return DS("wheel",b,{passive:!0}),DS("touchmove",b,{passive:!0}),d.useEffect(()=>x,[]),{scrollableRef:h,targetRef:m,scrollIntoView:C,cancel:x}}var RS=Object.getOwnPropertySymbols,CU=Object.prototype.hasOwnProperty,wU=Object.prototype.propertyIsEnumerable,SU=(e,t)=>{var n={};for(var r in e)CU.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&RS)for(var r of RS(e))t.indexOf(r)<0&&wU.call(e,r)&&(n[r]=e[r]);return n};function Gm(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:i,ml:l,mr:f,p,px:h,py:m,pt:v,pb:x,pl:C,pr:b,bg:w,c:k,opacity:_,ff:j,fz:I,fw:M,lts:E,ta:O,lh:D,fs:A,tt:R,td:$,w:K,miw:B,maw:U,h:Y,mih:W,mah:L,bgsz:X,bgp:z,bgr:q,bga:ne,pos:Q,top:ie,left:oe,bottom:V,right:G,inset:J,display:se}=t,re=SU(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:dN({m:n,mx:r,my:o,mt:s,mb:i,ml:l,mr:f,p,px:h,py:m,pt:v,pb:x,pl:C,pr:b,bg:w,c:k,opacity:_,ff:j,fz:I,fw:M,lts:E,ta:O,lh:D,fs:A,tt:R,td:$,w:K,miw:B,maw:U,h:Y,mih:W,mah:L,bgsz:X,bgp:z,bgr:q,bga:ne,pos:Q,top:ie,left:oe,bottom:V,right:G,inset:J,display:se}),rest:re}}function kU(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>bw(ut({size:r,sizes:t.breakpoints}))-bw(ut({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function _U({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return kU(e,t).reduce((i,l)=>{if(l==="base"&&e.base!==void 0){const p=n(e.base,t);return Array.isArray(r)?(r.forEach(h=>{i[h]=p}),i):(i[r]=p,i)}const f=n(e[l],t);return Array.isArray(r)?(i[t.fn.largerThan(l)]={},r.forEach(p=>{i[t.fn.largerThan(l)][p]=f}),i):(i[t.fn.largerThan(l)]={[r]:f},i)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,i)=>(s[i]=o,s),{}):{[r]:o}}function jU(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function PU(e){return Oe(e)}function IU(e){return e}function EU(e,t){return ut({size:e,sizes:t.fontSizes})}const MU=["-xs","-sm","-md","-lg","-xl"];function OU(e,t){return MU.includes(e)?`calc(${ut({size:e.replace("-",""),sizes:t.spacing})} * -1)`:ut({size:e,sizes:t.spacing})}const DU={identity:IU,color:jU,size:PU,fontSize:EU,spacing:OU},RU={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"}};var AU=Object.defineProperty,AS=Object.getOwnPropertySymbols,NU=Object.prototype.hasOwnProperty,TU=Object.prototype.propertyIsEnumerable,NS=(e,t,n)=>t in e?AU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,TS=(e,t)=>{for(var n in t||(t={}))NU.call(t,n)&&NS(e,n,t[n]);if(AS)for(var n of AS(t))TU.call(t,n)&&NS(e,n,t[n]);return e};function $S(e,t,n=RU){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(_U({value:e[s],getValue:DU[n[s].type],property:n[s].property,theme:t})),o),[]).reduce((o,s)=>(Object.keys(s).forEach(i=>{typeof s[i]=="object"&&s[i]!==null&&i in o?o[i]=TS(TS({},o[i]),s[i]):o[i]=s[i]}),o),{})}function LS(e,t){return typeof e=="function"?e(t):e}function $U(e,t,n){const r=ca(),{css:o,cx:s}=JP();return Array.isArray(e)?s(n,o($S(t,r)),e.map(i=>o(LS(i,r)))):s(n,o(LS(e,r)),o($S(t,r)))}var LU=Object.defineProperty,lh=Object.getOwnPropertySymbols,i6=Object.prototype.hasOwnProperty,l6=Object.prototype.propertyIsEnumerable,zS=(e,t,n)=>t in e?LU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zU=(e,t)=>{for(var n in t||(t={}))i6.call(t,n)&&zS(e,n,t[n]);if(lh)for(var n of lh(t))l6.call(t,n)&&zS(e,n,t[n]);return e},FU=(e,t)=>{var n={};for(var r in e)i6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lh)for(var r of lh(e))t.indexOf(r)<0&&l6.call(e,r)&&(n[r]=e[r]);return n};const c6=d.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:i}=n,l=FU(n,["className","component","style","sx"]);const{systemStyles:f,rest:p}=Gm(l),h=o||"div";return H.createElement(h,zU({ref:t,className:$U(i,f,r),style:s},p))});c6.displayName="@mantine/core/Box";const Mr=c6;var BU=Object.defineProperty,HU=Object.defineProperties,WU=Object.getOwnPropertyDescriptors,FS=Object.getOwnPropertySymbols,VU=Object.prototype.hasOwnProperty,UU=Object.prototype.propertyIsEnumerable,BS=(e,t,n)=>t in e?BU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,HS=(e,t)=>{for(var n in t||(t={}))VU.call(t,n)&&BS(e,n,t[n]);if(FS)for(var n of FS(t))UU.call(t,n)&&BS(e,n,t[n]);return e},GU=(e,t)=>HU(e,WU(t)),KU=or(e=>({root:GU(HS(HS({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const qU=KU;var XU=Object.defineProperty,ch=Object.getOwnPropertySymbols,u6=Object.prototype.hasOwnProperty,d6=Object.prototype.propertyIsEnumerable,WS=(e,t,n)=>t in e?XU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YU=(e,t)=>{for(var n in t||(t={}))u6.call(t,n)&&WS(e,n,t[n]);if(ch)for(var n of ch(t))d6.call(t,n)&&WS(e,n,t[n]);return e},QU=(e,t)=>{var n={};for(var r in e)u6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ch)for(var r of ch(e))t.indexOf(r)<0&&d6.call(e,r)&&(n[r]=e[r]);return n};const f6=d.forwardRef((e,t)=>{const n=Sn("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:i}=n,l=QU(n,["className","component","unstyled","variant"]),{classes:f,cx:p}=qU(null,{name:"UnstyledButton",unstyled:s,variant:i});return H.createElement(Mr,YU({component:o,ref:t,className:p(f.root,r),type:o==="button"?"button":void 0},l))});f6.displayName="@mantine/core/UnstyledButton";const ZU=f6;var JU=Object.defineProperty,eG=Object.defineProperties,tG=Object.getOwnPropertyDescriptors,VS=Object.getOwnPropertySymbols,nG=Object.prototype.hasOwnProperty,rG=Object.prototype.propertyIsEnumerable,US=(e,t,n)=>t in e?JU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G1=(e,t)=>{for(var n in t||(t={}))nG.call(t,n)&&US(e,n,t[n]);if(VS)for(var n of VS(t))rG.call(t,n)&&US(e,n,t[n]);return e},GS=(e,t)=>eG(e,tG(t));const oG=["subtle","filled","outline","light","default","transparent","gradient"],tp={xs:Oe(18),sm:Oe(22),md:Oe(28),lg:Oe(34),xl:Oe(44)};function sG({variant:e,theme:t,color:n,gradient:r}){const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:oG.includes(e)?G1({border:`${Oe(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var aG=or((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:GS(G1({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:ut({size:s,sizes:tp}),minHeight:ut({size:s,sizes:tp}),width:ut({size:s,sizes:tp}),minWidth:ut({size:s,sizes:tp})},sG({variant:o,theme:e,color:n,gradient:r})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":GS(G1({content:'""'},e.fn.cover(Oe(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}})}));const iG=aG;var lG=Object.defineProperty,uh=Object.getOwnPropertySymbols,p6=Object.prototype.hasOwnProperty,h6=Object.prototype.propertyIsEnumerable,KS=(e,t,n)=>t in e?lG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qS=(e,t)=>{for(var n in t||(t={}))p6.call(t,n)&&KS(e,n,t[n]);if(uh)for(var n of uh(t))h6.call(t,n)&&KS(e,n,t[n]);return e},XS=(e,t)=>{var n={};for(var r in e)p6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uh)for(var r of uh(e))t.indexOf(r)<0&&h6.call(e,r)&&(n[r]=e[r]);return n};function cG(e){var t=e,{size:n,color:r}=t,o=XS(t,["size","color"]);const s=o,{style:i}=s,l=XS(s,["style"]);return H.createElement("svg",qS({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,style:qS({width:n},i)},l),H.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},H.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var uG=Object.defineProperty,dh=Object.getOwnPropertySymbols,m6=Object.prototype.hasOwnProperty,g6=Object.prototype.propertyIsEnumerable,YS=(e,t,n)=>t in e?uG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QS=(e,t)=>{for(var n in t||(t={}))m6.call(t,n)&&YS(e,n,t[n]);if(dh)for(var n of dh(t))g6.call(t,n)&&YS(e,n,t[n]);return e},ZS=(e,t)=>{var n={};for(var r in e)m6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dh)for(var r of dh(e))t.indexOf(r)<0&&g6.call(e,r)&&(n[r]=e[r]);return n};function dG(e){var t=e,{size:n,color:r}=t,o=ZS(t,["size","color"]);const s=o,{style:i}=s,l=ZS(s,["style"]);return H.createElement("svg",QS({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r,style:QS({width:n,height:n},i)},l),H.createElement("g",{fill:"none",fillRule:"evenodd"},H.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},H.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),H.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},H.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var fG=Object.defineProperty,fh=Object.getOwnPropertySymbols,v6=Object.prototype.hasOwnProperty,x6=Object.prototype.propertyIsEnumerable,JS=(e,t,n)=>t in e?fG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,e4=(e,t)=>{for(var n in t||(t={}))v6.call(t,n)&&JS(e,n,t[n]);if(fh)for(var n of fh(t))x6.call(t,n)&&JS(e,n,t[n]);return e},t4=(e,t)=>{var n={};for(var r in e)v6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fh)for(var r of fh(e))t.indexOf(r)<0&&x6.call(e,r)&&(n[r]=e[r]);return n};function pG(e){var t=e,{size:n,color:r}=t,o=t4(t,["size","color"]);const s=o,{style:i}=s,l=t4(s,["style"]);return H.createElement("svg",e4({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,style:e4({width:n},i)},l),H.createElement("circle",{cx:"15",cy:"15",r:"15"},H.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},H.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),H.createElement("circle",{cx:"105",cy:"15",r:"15"},H.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),H.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var hG=Object.defineProperty,ph=Object.getOwnPropertySymbols,b6=Object.prototype.hasOwnProperty,y6=Object.prototype.propertyIsEnumerable,n4=(e,t,n)=>t in e?hG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mG=(e,t)=>{for(var n in t||(t={}))b6.call(t,n)&&n4(e,n,t[n]);if(ph)for(var n of ph(t))y6.call(t,n)&&n4(e,n,t[n]);return e},gG=(e,t)=>{var n={};for(var r in e)b6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ph)for(var r of ph(e))t.indexOf(r)<0&&y6.call(e,r)&&(n[r]=e[r]);return n};const bv={bars:cG,oval:dG,dots:pG},vG={xs:Oe(18),sm:Oe(22),md:Oe(36),lg:Oe(44),xl:Oe(58)},xG={size:"md"};function C6(e){const t=Sn("Loader",xG,e),{size:n,color:r,variant:o}=t,s=gG(t,["size","color","variant"]),i=ca(),l=o in bv?o:i.loader;return H.createElement(Mr,mG({role:"presentation",component:bv[l]||bv.bars,size:ut({size:n,sizes:vG}),color:i.fn.variant({variant:"filled",primaryFallback:!1,color:r||i.primaryColor}).background},s))}C6.displayName="@mantine/core/Loader";var bG=Object.defineProperty,hh=Object.getOwnPropertySymbols,w6=Object.prototype.hasOwnProperty,S6=Object.prototype.propertyIsEnumerable,r4=(e,t,n)=>t in e?bG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,o4=(e,t)=>{for(var n in t||(t={}))w6.call(t,n)&&r4(e,n,t[n]);if(hh)for(var n of hh(t))S6.call(t,n)&&r4(e,n,t[n]);return e},yG=(e,t)=>{var n={};for(var r in e)w6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hh)for(var r of hh(e))t.indexOf(r)<0&&S6.call(e,r)&&(n[r]=e[r]);return n};const CG={color:"gray",size:"md",variant:"subtle"},k6=d.forwardRef((e,t)=>{const n=Sn("ActionIcon",CG,e),{className:r,color:o,children:s,radius:i,size:l,variant:f,gradient:p,disabled:h,loaderProps:m,loading:v,unstyled:x,__staticSelector:C}=n,b=yG(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:w,cx:k,theme:_}=iG({radius:i,color:o,gradient:p},{name:["ActionIcon",C],unstyled:x,size:l,variant:f}),j=H.createElement(C6,o4({color:_.fn.variant({color:o,variant:f}).color,size:"100%","data-action-icon-loader":!0},m));return H.createElement(ZU,o4({className:k(w.root,r),ref:t,disabled:h,"data-disabled":h||void 0,"data-loading":v||void 0,unstyled:x},b),v?j:s)});k6.displayName="@mantine/core/ActionIcon";const wG=k6;var SG=Object.defineProperty,kG=Object.defineProperties,_G=Object.getOwnPropertyDescriptors,mh=Object.getOwnPropertySymbols,_6=Object.prototype.hasOwnProperty,j6=Object.prototype.propertyIsEnumerable,s4=(e,t,n)=>t in e?SG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jG=(e,t)=>{for(var n in t||(t={}))_6.call(t,n)&&s4(e,n,t[n]);if(mh)for(var n of mh(t))j6.call(t,n)&&s4(e,n,t[n]);return e},PG=(e,t)=>kG(e,_G(t)),IG=(e,t)=>{var n={};for(var r in e)_6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mh)for(var r of mh(e))t.indexOf(r)<0&&j6.call(e,r)&&(n[r]=e[r]);return n};function P6(e){const t=Sn("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,i=IG(t,["children","target","className","innerRef"]),l=ca(),[f,p]=d.useState(!1),h=d.useRef();return e6(()=>(p(!0),h.current=r?typeof r=="string"?document.querySelector(r):r:document.createElement("div"),r||document.body.appendChild(h.current),()=>{!r&&document.body.removeChild(h.current)}),[r]),f?so.createPortal(H.createElement("div",PG(jG({className:o,dir:l.dir},i),{ref:s}),n),h.current):null}P6.displayName="@mantine/core/Portal";var EG=Object.defineProperty,gh=Object.getOwnPropertySymbols,I6=Object.prototype.hasOwnProperty,E6=Object.prototype.propertyIsEnumerable,a4=(e,t,n)=>t in e?EG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MG=(e,t)=>{for(var n in t||(t={}))I6.call(t,n)&&a4(e,n,t[n]);if(gh)for(var n of gh(t))E6.call(t,n)&&a4(e,n,t[n]);return e},OG=(e,t)=>{var n={};for(var r in e)I6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gh)for(var r of gh(e))t.indexOf(r)<0&&E6.call(e,r)&&(n[r]=e[r]);return n};function M6(e){var t=e,{withinPortal:n=!0,children:r}=t,o=OG(t,["withinPortal","children"]);return n?H.createElement(P6,MG({},o),r):H.createElement(H.Fragment,null,r)}M6.displayName="@mantine/core/OptionalPortal";var DG=Object.defineProperty,vh=Object.getOwnPropertySymbols,O6=Object.prototype.hasOwnProperty,D6=Object.prototype.propertyIsEnumerable,i4=(e,t,n)=>t in e?DG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l4=(e,t)=>{for(var n in t||(t={}))O6.call(t,n)&&i4(e,n,t[n]);if(vh)for(var n of vh(t))D6.call(t,n)&&i4(e,n,t[n]);return e},RG=(e,t)=>{var n={};for(var r in e)O6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vh)for(var r of vh(e))t.indexOf(r)<0&&D6.call(e,r)&&(n[r]=e[r]);return n};function R6(e){const t=e,{width:n,height:r,style:o}=t,s=RG(t,["width","height","style"]);return H.createElement("svg",l4({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:l4({width:n,height:r},o)},s),H.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}R6.displayName="@mantine/core/CloseIcon";var AG=Object.defineProperty,xh=Object.getOwnPropertySymbols,A6=Object.prototype.hasOwnProperty,N6=Object.prototype.propertyIsEnumerable,c4=(e,t,n)=>t in e?AG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NG=(e,t)=>{for(var n in t||(t={}))A6.call(t,n)&&c4(e,n,t[n]);if(xh)for(var n of xh(t))N6.call(t,n)&&c4(e,n,t[n]);return e},TG=(e,t)=>{var n={};for(var r in e)A6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xh)for(var r of xh(e))t.indexOf(r)<0&&N6.call(e,r)&&(n[r]=e[r]);return n};const $G={xs:Oe(12),sm:Oe(16),md:Oe(20),lg:Oe(28),xl:Oe(34)},LG={size:"sm"},T6=d.forwardRef((e,t)=>{const n=Sn("CloseButton",LG,e),{iconSize:r,size:o,children:s}=n,i=TG(n,["iconSize","size","children"]),l=Oe(r||$G[o]);return H.createElement(wG,NG({ref:t,__staticSelector:"CloseButton",size:o},i),s||H.createElement(R6,{width:l,height:l}))});T6.displayName="@mantine/core/CloseButton";const $6=T6;var zG=Object.defineProperty,FG=Object.defineProperties,BG=Object.getOwnPropertyDescriptors,u4=Object.getOwnPropertySymbols,HG=Object.prototype.hasOwnProperty,WG=Object.prototype.propertyIsEnumerable,d4=(e,t,n)=>t in e?zG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,np=(e,t)=>{for(var n in t||(t={}))HG.call(t,n)&&d4(e,n,t[n]);if(u4)for(var n of u4(t))WG.call(t,n)&&d4(e,n,t[n]);return e},VG=(e,t)=>FG(e,BG(t));function UG({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function GG({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function KG(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function qG({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var XG=or((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:i,gradient:l,weight:f,transform:p,align:h,strikethrough:m,italic:v},{size:x})=>{const C=e.fn.variant({variant:"gradient",gradient:l});return{root:VG(np(np(np(np({},e.fn.fontStyles()),e.fn.focusStyles()),KG(n)),qG({theme:e,truncate:r})),{color:GG({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||x===void 0?"inherit":ut({size:x,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:UG({underline:i,strikethrough:m}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":f,textTransform:p,textAlign:h,fontStyle:v?"italic":void 0}),gradient:{backgroundImage:C.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const YG=XG;var QG=Object.defineProperty,bh=Object.getOwnPropertySymbols,L6=Object.prototype.hasOwnProperty,z6=Object.prototype.propertyIsEnumerable,f4=(e,t,n)=>t in e?QG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZG=(e,t)=>{for(var n in t||(t={}))L6.call(t,n)&&f4(e,n,t[n]);if(bh)for(var n of bh(t))z6.call(t,n)&&f4(e,n,t[n]);return e},JG=(e,t)=>{var n={};for(var r in e)L6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bh)for(var r of bh(e))t.indexOf(r)<0&&z6.call(e,r)&&(n[r]=e[r]);return n};const eK={variant:"text"},F6=d.forwardRef((e,t)=>{const n=Sn("Text",eK,e),{className:r,size:o,weight:s,transform:i,color:l,align:f,variant:p,lineClamp:h,truncate:m,gradient:v,inline:x,inherit:C,underline:b,strikethrough:w,italic:k,classNames:_,styles:j,unstyled:I,span:M,__staticSelector:E}=n,O=JG(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:D,cx:A}=YG({color:l,lineClamp:h,truncate:m,inline:x,inherit:C,underline:b,strikethrough:w,italic:k,weight:s,transform:i,align:f,gradient:v},{unstyled:I,name:E||"Text",variant:p,size:o});return H.createElement(Mr,ZG({ref:t,className:A(D.root,{[D.gradient]:p==="gradient"},r),component:M?"span":"div"},O))});F6.displayName="@mantine/core/Text";const wc=F6,rp={xs:Oe(1),sm:Oe(2),md:Oe(3),lg:Oe(4),xl:Oe(5)};function op(e,t){const n=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?n:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var tK=or((e,{color:t},{size:n,variant:r})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:Oe(1),borderTop:`${ut({size:n,sizes:rp})} ${r} ${op(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${ut({size:n,sizes:rp})} ${r} ${op(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:Oe(ut({size:n,sizes:rp})),borderTopColor:op(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:Oe(ut({size:n,sizes:rp})),borderLeftColor:op(e,t),borderLeftStyle:r}}));const nK=tK;var rK=Object.defineProperty,oK=Object.defineProperties,sK=Object.getOwnPropertyDescriptors,yh=Object.getOwnPropertySymbols,B6=Object.prototype.hasOwnProperty,H6=Object.prototype.propertyIsEnumerable,p4=(e,t,n)=>t in e?rK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h4=(e,t)=>{for(var n in t||(t={}))B6.call(t,n)&&p4(e,n,t[n]);if(yh)for(var n of yh(t))H6.call(t,n)&&p4(e,n,t[n]);return e},aK=(e,t)=>oK(e,sK(t)),iK=(e,t)=>{var n={};for(var r in e)B6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yh)for(var r of yh(e))t.indexOf(r)<0&&H6.call(e,r)&&(n[r]=e[r]);return n};const lK={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},K1=d.forwardRef((e,t)=>{const n=Sn("Divider",lK,e),{className:r,color:o,orientation:s,size:i,label:l,labelPosition:f,labelProps:p,variant:h,styles:m,classNames:v,unstyled:x}=n,C=iK(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:b,cx:w}=nK({color:o},{classNames:v,styles:m,unstyled:x,name:"Divider",variant:h,size:i}),k=s==="vertical",_=s==="horizontal",j=!!l&&_,I=!(p!=null&&p.color);return H.createElement(Mr,h4({ref:t,className:w(b.root,{[b.vertical]:k,[b.horizontal]:_,[b.withLabel]:j},r),role:"separator"},C),j&&H.createElement(wc,aK(h4({},p),{size:(p==null?void 0:p.size)||"xs",mt:Oe(2),className:w(b.label,b[f],{[b.labelDefaultStyles]:I})}),l))});K1.displayName="@mantine/core/Divider";var cK=Object.defineProperty,uK=Object.defineProperties,dK=Object.getOwnPropertyDescriptors,m4=Object.getOwnPropertySymbols,fK=Object.prototype.hasOwnProperty,pK=Object.prototype.propertyIsEnumerable,g4=(e,t,n)=>t in e?cK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v4=(e,t)=>{for(var n in t||(t={}))fK.call(t,n)&&g4(e,n,t[n]);if(m4)for(var n of m4(t))pK.call(t,n)&&g4(e,n,t[n]);return e},hK=(e,t)=>uK(e,dK(t)),mK=or((e,t,{size:n})=>({item:hK(v4({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${ut({size:n,sizes:e.spacing})} / 1.5) ${ut({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:ut({size:n,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":v4({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${ut({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${ut({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${ut({size:n,sizes:e.spacing})} / 1.5) ${ut({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const gK=mK;var vK=Object.defineProperty,x4=Object.getOwnPropertySymbols,xK=Object.prototype.hasOwnProperty,bK=Object.prototype.propertyIsEnumerable,b4=(e,t,n)=>t in e?vK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yK=(e,t)=>{for(var n in t||(t={}))xK.call(t,n)&&b4(e,n,t[n]);if(x4)for(var n of x4(t))bK.call(t,n)&&b4(e,n,t[n]);return e};function Ub({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:i,onItemHover:l,onItemSelect:f,itemsRefs:p,itemComponent:h,size:m,nothingFound:v,creatable:x,createLabel:C,unstyled:b,variant:w}){const{classes:k}=gK(null,{classNames:n,styles:r,unstyled:b,name:i,variant:w,size:m}),_=[],j=[];let I=null;const M=(O,D)=>{const A=typeof o=="function"?o(O.value):!1;return H.createElement(h,yK({key:O.value,className:k.item,"data-disabled":O.disabled||void 0,"data-hovered":!O.disabled&&t===D||void 0,"data-selected":!O.disabled&&A||void 0,selected:A,onMouseEnter:()=>l(D),id:`${s}-${D}`,role:"option",tabIndex:-1,"aria-selected":t===D,ref:R=>{p&&p.current&&(p.current[O.value]=R)},onMouseDown:O.disabled?null:R=>{R.preventDefault(),f(O)},disabled:O.disabled,variant:w},O))};let E=null;if(e.forEach((O,D)=>{O.creatable?I=D:O.group?(E!==O.group&&(E=O.group,j.push(H.createElement("div",{className:k.separator,key:`__mantine-divider-${D}`},H.createElement(K1,{classNames:{label:k.separatorLabel},label:O.group})))),j.push(M(O,D))):_.push(M(O,D))}),x){const O=e[I];_.push(H.createElement("div",{key:Wb(),className:k.item,"data-hovered":t===I||void 0,onMouseEnter:()=>l(I),onMouseDown:D=>{D.preventDefault(),f(O)},tabIndex:-1,ref:D=>{p&&p.current&&(p.current[O.value]=D)}},C))}return j.length>0&&_.length>0&&_.unshift(H.createElement("div",{className:k.separator,key:"empty-group-separator"},H.createElement(K1,null))),j.length>0||_.length>0?H.createElement(H.Fragment,null,j,_):H.createElement(wc,{size:m,unstyled:b,className:k.nothingFound},v)}Ub.displayName="@mantine/core/SelectItems";var CK=Object.defineProperty,Ch=Object.getOwnPropertySymbols,W6=Object.prototype.hasOwnProperty,V6=Object.prototype.propertyIsEnumerable,y4=(e,t,n)=>t in e?CK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wK=(e,t)=>{for(var n in t||(t={}))W6.call(t,n)&&y4(e,n,t[n]);if(Ch)for(var n of Ch(t))V6.call(t,n)&&y4(e,n,t[n]);return e},SK=(e,t)=>{var n={};for(var r in e)W6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ch)for(var r of Ch(e))t.indexOf(r)<0&&V6.call(e,r)&&(n[r]=e[r]);return n};const Gb=d.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=SK(n,["label","value"]);return H.createElement("div",wK({ref:t},s),r||o)});Gb.displayName="@mantine/core/DefaultItem";function kK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function U6(...e){return t=>e.forEach(n=>kK(n,t))}function Ji(...e){return d.useCallback(U6(...e),e)}const G6=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(jK);if(s){const i=s.props.children,l=o.map(f=>f===s?d.Children.count(i)>1?d.Children.only(null):d.isValidElement(i)?i.props.children:null:f);return d.createElement(q1,nn({},r,{ref:t}),d.isValidElement(i)?d.cloneElement(i,void 0,l):null)}return d.createElement(q1,nn({},r,{ref:t}),n)});G6.displayName="Slot";const q1=d.forwardRef((e,t)=>{const{children:n,...r}=e;return d.isValidElement(n)?d.cloneElement(n,{...PK(r,n.props),ref:U6(t,n.ref)}):d.Children.count(n)>1?d.Children.only(null):null});q1.displayName="SlotClone";const _K=({children:e})=>d.createElement(d.Fragment,null,e);function jK(e){return d.isValidElement(e)&&e.type===_K}function PK(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{s(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}const IK=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],zd=IK.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,l=s?G6:t;return d.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),d.createElement(l,nn({},i,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),X1=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function EK(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Fd=e=>{const{present:t,children:n}=e,r=MK(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=Ji(r.ref,o.ref);return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Fd.displayName="Presence";function MK(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[l,f]=EK(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const p=sp(r.current);s.current=l==="mounted"?p:"none"},[l]),X1(()=>{const p=r.current,h=o.current;if(h!==e){const v=s.current,x=sp(p);e?f("MOUNT"):x==="none"||(p==null?void 0:p.display)==="none"?f("UNMOUNT"):f(h&&v!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),X1(()=>{if(t){const p=m=>{const x=sp(r.current).includes(m.animationName);m.target===t&&x&&so.flushSync(()=>f("ANIMATION_END"))},h=m=>{m.target===t&&(s.current=sp(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:d.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function sp(e){return(e==null?void 0:e.animationName)||"none"}function OK(e,t=[]){let n=[];function r(s,i){const l=d.createContext(i),f=n.length;n=[...n,i];function p(m){const{scope:v,children:x,...C}=m,b=(v==null?void 0:v[e][f])||l,w=d.useMemo(()=>C,Object.values(C));return d.createElement(b.Provider,{value:w},x)}function h(m,v){const x=(v==null?void 0:v[e][f])||l,C=d.useContext(x);if(C)return C;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${s}\``)}return p.displayName=s+"Provider",[p,h]}const o=()=>{const s=n.map(i=>d.createContext(i));return function(l){const f=(l==null?void 0:l[e])||s;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:f}}),[l,f])}};return o.scopeName=e,[r,DK(o,...t)]}function DK(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((l,{useScope:f,scopeName:p})=>{const m=f(s)[`__scope${p}`];return{...l,...m}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function yi(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const RK=d.createContext(void 0);function AK(e){const t=d.useContext(RK);return e||t||"ltr"}function NK(e,[t,n]){return Math.min(n,Math.max(t,e))}function Pi(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function TK(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const K6="ScrollArea",[q6,Jge]=OK(K6),[$K,xo]=q6(K6),LK=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[l,f]=d.useState(null),[p,h]=d.useState(null),[m,v]=d.useState(null),[x,C]=d.useState(null),[b,w]=d.useState(null),[k,_]=d.useState(0),[j,I]=d.useState(0),[M,E]=d.useState(!1),[O,D]=d.useState(!1),A=Ji(t,$=>f($)),R=AK(o);return d.createElement($K,{scope:n,type:r,dir:R,scrollHideDelay:s,scrollArea:l,viewport:p,onViewportChange:h,content:m,onContentChange:v,scrollbarX:x,onScrollbarXChange:C,scrollbarXEnabled:M,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:O,onScrollbarYEnabledChange:D,onCornerWidthChange:_,onCornerHeightChange:I},d.createElement(zd.div,nn({dir:R},i,{ref:A,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})))}),zK="ScrollAreaViewport",FK=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=xo(zK,n),i=d.useRef(null),l=Ji(t,i,s.onViewportChange);return d.createElement(d.Fragment,null,d.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),d.createElement(zd.div,nn({"data-radix-scroll-area-viewport":""},o,{ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),d.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),da="ScrollAreaScrollbar",BK=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=xo(da,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,l=e.orientation==="horizontal";return d.useEffect(()=>(l?s(!0):i(!0),()=>{l?s(!1):i(!1)}),[l,s,i]),o.type==="hover"?d.createElement(HK,nn({},r,{ref:t,forceMount:n})):o.type==="scroll"?d.createElement(WK,nn({},r,{ref:t,forceMount:n})):o.type==="auto"?d.createElement(X6,nn({},r,{ref:t,forceMount:n})):o.type==="always"?d.createElement(Kb,nn({},r,{ref:t})):null}),HK=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=xo(da,e.__scopeScrollArea),[s,i]=d.useState(!1);return d.useEffect(()=>{const l=o.scrollArea;let f=0;if(l){const p=()=>{window.clearTimeout(f),i(!0)},h=()=>{f=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",p),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(f),l.removeEventListener("pointerenter",p),l.removeEventListener("pointerleave",h)}}},[o.scrollArea,o.scrollHideDelay]),d.createElement(Fd,{present:n||s},d.createElement(X6,nn({"data-state":s?"visible":"hidden"},r,{ref:t})))}),WK=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=xo(da,e.__scopeScrollArea),s=e.orientation==="horizontal",i=qm(()=>f("SCROLL_END"),100),[l,f]=TK("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(l==="idle"){const p=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[l,o.scrollHideDelay,f]),d.useEffect(()=>{const p=o.viewport,h=s?"scrollLeft":"scrollTop";if(p){let m=p[h];const v=()=>{const x=p[h];m!==x&&(f("SCROLL"),i()),m=x};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[o.viewport,s,f,i]),d.createElement(Fd,{present:n||l!=="hidden"},d.createElement(Kb,nn({"data-state":l==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Pi(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Pi(e.onPointerLeave,()=>f("POINTER_LEAVE"))})))}),X6=d.forwardRef((e,t)=>{const n=xo(da,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=d.useState(!1),l=e.orientation==="horizontal",f=qm(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;i(l?p:h)}},10);return Sc(n.viewport,f),Sc(n.content,f),d.createElement(Fd,{present:r||s},d.createElement(Kb,nn({"data-state":s?"visible":"hidden"},o,{ref:t})))}),Kb=d.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=xo(da,e.__scopeScrollArea),s=d.useRef(null),i=d.useRef(0),[l,f]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=J6(l.viewport,l.content),h={...r,sizes:l,onSizesChange:f,hasThumb:p>0&&p<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:v=>i.current=v};function m(v,x){return QK(v,i.current,l,x)}return n==="horizontal"?d.createElement(VK,nn({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollLeft,x=C4(v,l,o.dir);s.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollLeft=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollLeft=m(v,o.dir))}})):n==="vertical"?d.createElement(UK,nn({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollTop,x=C4(v,l);s.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollTop=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollTop=m(v))}})):null}),VK=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=xo(da,e.__scopeScrollArea),[i,l]=d.useState(),f=d.useRef(null),p=Ji(t,f,s.onScrollbarXChange);return d.useEffect(()=>{f.current&&l(getComputedStyle(f.current))},[f]),d.createElement(Q6,nn({"data-orientation":"horizontal"},o,{ref:p,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Km(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,m)=>{if(s.viewport){const v=s.viewport.scrollLeft+h.deltaX;e.onWheelScroll(v),tI(v,m)&&h.preventDefault()}},onResize:()=>{f.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:wh(i.paddingLeft),paddingEnd:wh(i.paddingRight)}})}}))}),UK=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=xo(da,e.__scopeScrollArea),[i,l]=d.useState(),f=d.useRef(null),p=Ji(t,f,s.onScrollbarYChange);return d.useEffect(()=>{f.current&&l(getComputedStyle(f.current))},[f]),d.createElement(Q6,nn({"data-orientation":"vertical"},o,{ref:p,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Km(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,m)=>{if(s.viewport){const v=s.viewport.scrollTop+h.deltaY;e.onWheelScroll(v),tI(v,m)&&h.preventDefault()}},onResize:()=>{f.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:wh(i.paddingTop),paddingEnd:wh(i.paddingBottom)}})}}))}),[GK,Y6]=q6(da),Q6=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:f,onDragScroll:p,onWheelScroll:h,onResize:m,...v}=e,x=xo(da,n),[C,b]=d.useState(null),w=Ji(t,A=>b(A)),k=d.useRef(null),_=d.useRef(""),j=x.viewport,I=r.content-r.viewport,M=yi(h),E=yi(f),O=qm(m,10);function D(A){if(k.current){const R=A.clientX-k.current.left,$=A.clientY-k.current.top;p({x:R,y:$})}}return d.useEffect(()=>{const A=R=>{const $=R.target;(C==null?void 0:C.contains($))&&M(R,I)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[j,C,I,M]),d.useEffect(E,[r,E]),Sc(C,O),Sc(x.content,O),d.createElement(GK,{scope:n,scrollbar:C,hasThumb:o,onThumbChange:yi(s),onThumbPointerUp:yi(i),onThumbPositionChange:E,onThumbPointerDown:yi(l)},d.createElement(zd.div,nn({},v,{ref:w,style:{position:"absolute",...v.style},onPointerDown:Pi(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),k.current=C.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",D(A))}),onPointerMove:Pi(e.onPointerMove,D),onPointerUp:Pi(e.onPointerUp,A=>{const R=A.target;R.hasPointerCapture(A.pointerId)&&R.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=_.current,k.current=null})})))}),Y1="ScrollAreaThumb",KK=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Y6(Y1,e.__scopeScrollArea);return d.createElement(Fd,{present:n||o.hasThumb},d.createElement(qK,nn({ref:t},r)))}),qK=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=xo(Y1,n),i=Y6(Y1,n),{onThumbPositionChange:l}=i,f=Ji(t,m=>i.onThumbChange(m)),p=d.useRef(),h=qm(()=>{p.current&&(p.current(),p.current=void 0)},100);return d.useEffect(()=>{const m=s.viewport;if(m){const v=()=>{if(h(),!p.current){const x=ZK(m,l);p.current=x,l()}};return l(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[s.viewport,h,l]),d.createElement(zd.div,nn({"data-state":i.hasThumb?"visible":"hidden"},o,{ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Pi(e.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),C=m.clientX-x.left,b=m.clientY-x.top;i.onThumbPointerDown({x:C,y:b})}),onPointerUp:Pi(e.onPointerUp,i.onThumbPointerUp)}))}),Z6="ScrollAreaCorner",XK=d.forwardRef((e,t)=>{const n=xo(Z6,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.createElement(YK,nn({},e,{ref:t})):null}),YK=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=xo(Z6,n),[s,i]=d.useState(0),[l,f]=d.useState(0),p=!!(s&&l);return Sc(o.scrollbarX,()=>{var h;const m=((h=o.scrollbarX)===null||h===void 0?void 0:h.offsetHeight)||0;o.onCornerHeightChange(m),f(m)}),Sc(o.scrollbarY,()=>{var h;const m=((h=o.scrollbarY)===null||h===void 0?void 0:h.offsetWidth)||0;o.onCornerWidthChange(m),i(m)}),p?d.createElement(zd.div,nn({},r,{ref:t,style:{width:s,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function wh(e){return e?parseInt(e,10):0}function J6(e,t){const n=e/t;return isNaN(n)?0:n}function Km(e){const t=J6(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function QK(e,t,n,r="ltr"){const o=Km(n),s=o/2,i=t||s,l=o-i,f=n.scrollbar.paddingStart+i,p=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return eI([f,p],m)(e)}function C4(e,t,n="ltr"){const r=Km(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,l=s-r,f=n==="ltr"?[0,i]:[i*-1,0],p=NK(e,f);return eI([0,i],[0,l])(p)}function eI(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function tI(e,t){return e>0&&e<t}const ZK=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,l=n.top!==s.top;(i||l)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function qm(e,t){const n=yi(e),r=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),d.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Sc(e,t){const n=yi(t);X1(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const JK=LK,eq=FK,w4=BK,S4=KK,tq=XK;var nq=or((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?Oe(t):void 0,paddingBottom:n?Oe(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${Oe(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${IS("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:Oe(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:Oe(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:IS("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:Oe(t),position:"relative",transition:"background-color 150ms ease",display:o?"none":void 0,overflow:"hidden","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:Oe(44),minHeight:Oe(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:r?1:0,display:o?"none":void 0}}));const rq=nq;var oq=Object.defineProperty,sq=Object.defineProperties,aq=Object.getOwnPropertyDescriptors,Sh=Object.getOwnPropertySymbols,nI=Object.prototype.hasOwnProperty,rI=Object.prototype.propertyIsEnumerable,k4=(e,t,n)=>t in e?oq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q1=(e,t)=>{for(var n in t||(t={}))nI.call(t,n)&&k4(e,n,t[n]);if(Sh)for(var n of Sh(t))rI.call(t,n)&&k4(e,n,t[n]);return e},oI=(e,t)=>sq(e,aq(t)),sI=(e,t)=>{var n={};for(var r in e)nI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sh)for(var r of Sh(e))t.indexOf(r)<0&&rI.call(e,r)&&(n[r]=e[r]);return n};const aI={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},Xm=d.forwardRef((e,t)=>{const n=Sn("ScrollArea",aI,e),{children:r,className:o,classNames:s,styles:i,scrollbarSize:l,scrollHideDelay:f,type:p,dir:h,offsetScrollbars:m,viewportRef:v,onScrollPositionChange:x,unstyled:C,variant:b,viewportProps:w}=n,k=sI(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[_,j]=d.useState(!1),I=ca(),{classes:M,cx:E}=rq({scrollbarSize:l,offsetScrollbars:m,scrollbarHovered:_,hidden:p==="never"},{name:"ScrollArea",classNames:s,styles:i,unstyled:C,variant:b});return H.createElement(JK,{type:p==="never"?"always":p,scrollHideDelay:f,dir:h||I.dir,ref:t,asChild:!0},H.createElement(Mr,Q1({className:E(M.root,o)},k),H.createElement(eq,oI(Q1({},w),{className:M.viewport,ref:v,onScroll:typeof x=="function"?({currentTarget:O})=>x({x:O.scrollLeft,y:O.scrollTop}):void 0}),r),H.createElement(w4,{orientation:"horizontal",className:M.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(S4,{className:M.thumb})),H.createElement(w4,{orientation:"vertical",className:M.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(S4,{className:M.thumb})),H.createElement(tq,{className:M.corner})))}),iI=d.forwardRef((e,t)=>{const n=Sn("ScrollAreaAutosize",aI,e),{children:r,classNames:o,styles:s,scrollbarSize:i,scrollHideDelay:l,type:f,dir:p,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:x,sx:C,variant:b,viewportProps:w}=n,k=sI(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return H.createElement(Mr,oI(Q1({},k),{ref:t,sx:[{display:"flex"},...qP(C)]}),H.createElement(Mr,{sx:{display:"flex",flexDirection:"column",flex:1}},H.createElement(Xm,{classNames:o,styles:s,scrollHideDelay:l,scrollbarSize:i,type:f,dir:p,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:x,variant:b,viewportProps:w},r)))});iI.displayName="@mantine/core/ScrollAreaAutosize";Xm.displayName="@mantine/core/ScrollArea";Xm.Autosize=iI;const lI=Xm;var iq=Object.defineProperty,lq=Object.defineProperties,cq=Object.getOwnPropertyDescriptors,kh=Object.getOwnPropertySymbols,cI=Object.prototype.hasOwnProperty,uI=Object.prototype.propertyIsEnumerable,_4=(e,t,n)=>t in e?iq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j4=(e,t)=>{for(var n in t||(t={}))cI.call(t,n)&&_4(e,n,t[n]);if(kh)for(var n of kh(t))uI.call(t,n)&&_4(e,n,t[n]);return e},uq=(e,t)=>lq(e,cq(t)),dq=(e,t)=>{var n={};for(var r in e)cI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kh)for(var r of kh(e))t.indexOf(r)<0&&uI.call(e,r)&&(n[r]=e[r]);return n};const Ym=d.forwardRef((e,t)=>{var n=e,{style:r}=n,o=dq(n,["style"]);return H.createElement(lI,uq(j4({},o),{style:j4({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});Ym.displayName="@mantine/core/SelectScrollArea";var fq=or(()=>({dropdown:{},itemsWrapper:{padding:Oe(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const pq=fq;function Fc(e){return e.split("-")[1]}function qb(e){return e==="y"?"height":"width"}function Lo(e){return e.split("-")[0]}function ti(e){return["top","bottom"].includes(Lo(e))?"x":"y"}function P4(e,t,n){let{reference:r,floating:o}=e;const s=r.x+r.width/2-o.width/2,i=r.y+r.height/2-o.height/2,l=ti(t),f=qb(l),p=r[f]/2-o[f]/2,h=l==="x";let m;switch(Lo(t)){case"top":m={x:s,y:r.y-o.height};break;case"bottom":m={x:s,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:i};break;case"left":m={x:r.x-o.width,y:i};break;default:m={x:r.x,y:r.y}}switch(Fc(t)){case"start":m[l]-=p*(n&&h?-1:1);break;case"end":m[l]+=p*(n&&h?-1:1)}return m}const hq=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),f=await(i.isRTL==null?void 0:i.isRTL(t));let p=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:m}=P4(p,r,f),v=r,x={},C=0;for(let b=0;b<l.length;b++){const{name:w,fn:k}=l[b],{x:_,y:j,data:I,reset:M}=await k({x:h,y:m,initialPlacement:r,placement:v,strategy:o,middlewareData:x,rects:p,platform:i,elements:{reference:e,floating:t}});h=_??h,m=j??m,x={...x,[w]:{...x[w],...I}},M&&C<=50&&(C++,typeof M=="object"&&(M.placement&&(v=M.placement),M.rects&&(p=M.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):M.rects),{x:h,y:m}=P4(p,v,f)),b=-1)}return{x:h,y:m,placement:v,strategy:o,middlewareData:x}};function na(e,t){return typeof e=="function"?e(t):e}function Xb(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function kc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Yb(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:v=!1,padding:x=0}=na(t,e),C=Xb(x),b=l[v?m==="floating"?"reference":"floating":m],w=kc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:p,rootBoundary:h,strategy:f})),k=m==="floating"?{...i.floating,x:r,y:o}:i.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),j=await(s.isElement==null?void 0:s.isElement(_))&&await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1},I=kc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:k,offsetParent:_,strategy:f}):k);return{top:(w.top-I.top+C.top)/j.y,bottom:(I.bottom-w.bottom+C.bottom)/j.y,left:(w.left-I.left+C.left)/j.x,right:(I.right-w.right+C.right)/j.x}}const Ka=Math.min,ls=Math.max;function Z1(e,t,n){return ls(e,Ka(t,n))}const I4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l}=t,{element:f,padding:p=0}=na(e,t)||{};if(f==null)return{};const h=Xb(p),m={x:n,y:r},v=ti(o),x=qb(v),C=await i.getDimensions(f),b=v==="y",w=b?"top":"left",k=b?"bottom":"right",_=b?"clientHeight":"clientWidth",j=s.reference[x]+s.reference[v]-m[v]-s.floating[x],I=m[v]-s.reference[v],M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let E=M?M[_]:0;E&&await(i.isElement==null?void 0:i.isElement(M))||(E=l.floating[_]||s.floating[x]);const O=j/2-I/2,D=E/2-C[x]/2-1,A=Ka(h[w],D),R=Ka(h[k],D),$=A,K=E-C[x]-R,B=E/2-C[x]/2+O,U=Z1($,B,K),Y=Fc(o)!=null&&B!=U&&s.reference[x]/2-(B<$?A:R)-C[x]/2<0?B<$?$-B:K-B:0;return{[v]:m[v]-Y,data:{[v]:U,centerOffset:B-U+Y}}}}),mq=["top","right","bottom","left"];mq.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const gq={left:"right",right:"left",bottom:"top",top:"bottom"};function _h(e){return e.replace(/left|right|bottom|top/g,t=>gq[t])}function vq(e,t,n){n===void 0&&(n=!1);const r=Fc(e),o=ti(e),s=qb(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=_h(i)),{main:i,cross:_h(i)}}const xq={start:"end",end:"start"};function yv(e){return e.replace(/start|end/g,t=>xq[t])}const bq=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:s,initialPlacement:i,platform:l,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:C=!0,...b}=na(e,t),w=Lo(r),k=Lo(i)===i,_=await(l.isRTL==null?void 0:l.isRTL(f.floating)),j=m||(k||!C?[_h(i)]:function($){const K=_h($);return[yv($),K,yv(K)]}(i));m||x==="none"||j.push(...function($,K,B,U){const Y=Fc($);let W=function(L,X,z){const q=["left","right"],ne=["right","left"],Q=["top","bottom"],ie=["bottom","top"];switch(L){case"top":case"bottom":return z?X?ne:q:X?q:ne;case"left":case"right":return X?Q:ie;default:return[]}}(Lo($),B==="start",U);return Y&&(W=W.map(L=>L+"-"+Y),K&&(W=W.concat(W.map(yv)))),W}(i,C,x,_));const I=[i,...j],M=await Yb(t,b),E=[];let O=((n=o.flip)==null?void 0:n.overflows)||[];if(p&&E.push(M[w]),h){const{main:$,cross:K}=vq(r,s,_);E.push(M[$],M[K])}if(O=[...O,{placement:r,overflows:E}],!E.every($=>$<=0)){var D,A;const $=(((D=o.flip)==null?void 0:D.index)||0)+1,K=I[$];if(K)return{data:{index:$,overflows:O},reset:{placement:K}};let B=(A=O.filter(U=>U.overflows[0]<=0).sort((U,Y)=>U.overflows[1]-Y.overflows[1])[0])==null?void 0:A.placement;if(!B)switch(v){case"bestFit":{var R;const U=(R=O.map(Y=>[Y.placement,Y.overflows.filter(W=>W>0).reduce((W,L)=>W+L,0)]).sort((Y,W)=>Y[1]-W[1])[0])==null?void 0:R[0];U&&(B=U);break}case"initialPlacement":B=i}if(r!==B)return{reset:{placement:B}}}return{}}}};function E4(e){const t=Ka(...e.map(r=>r.left)),n=Ka(...e.map(r=>r.top));return{x:t,y:n,width:ls(...e.map(r=>r.right))-t,height:ls(...e.map(r=>r.bottom))-n}}const yq=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:i}=t,{padding:l=2,x:f,y:p}=na(e,t),h=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),m=function(b){const w=b.slice().sort((j,I)=>j.y-I.y),k=[];let _=null;for(let j=0;j<w.length;j++){const I=w[j];!_||I.y-_.y>_.height/2?k.push([I]):k[k.length-1].push(I),_=I}return k.map(j=>kc(E4(j)))}(h),v=kc(E4(h)),x=Xb(l),C=await s.getElementRects({reference:{getBoundingClientRect:function(){if(m.length===2&&m[0].left>m[1].right&&f!=null&&p!=null)return m.find(b=>f>b.left-x.left&&f<b.right+x.right&&p>b.top-x.top&&p<b.bottom+x.bottom)||v;if(m.length>=2){if(ti(n)==="x"){const M=m[0],E=m[m.length-1],O=Lo(n)==="top",D=M.top,A=E.bottom,R=O?M.left:E.left,$=O?M.right:E.right;return{top:D,bottom:A,left:R,right:$,width:$-R,height:A-D,x:R,y:D}}const b=Lo(n)==="left",w=ls(...m.map(M=>M.right)),k=Ka(...m.map(M=>M.left)),_=m.filter(M=>b?M.left===k:M.right===w),j=_[0].top,I=_[_.length-1].bottom;return{top:j,bottom:I,left:k,right:w,width:w-k,height:I-j,x:k,y:j}}return v}},floating:r.floating,strategy:i});return o.reference.x!==C.reference.x||o.reference.y!==C.reference.y||o.reference.width!==C.reference.width||o.reference.height!==C.reference.height?{reset:{rects:C}}:{}}}},Cq=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(s,i){const{placement:l,platform:f,elements:p}=s,h=await(f.isRTL==null?void 0:f.isRTL(p.floating)),m=Lo(l),v=Fc(l),x=ti(l)==="x",C=["left","top"].includes(m)?-1:1,b=h&&x?-1:1,w=na(i,s);let{mainAxis:k,crossAxis:_,alignmentAxis:j}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...w};return v&&typeof j=="number"&&(_=v==="end"?-1*j:j),x?{x:_*b,y:k*C}:{x:k*C,y:_*b}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function dI(e){return e==="x"?"y":"x"}const wq=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:w=>{let{x:k,y:_}=w;return{x:k,y:_}}},...f}=na(e,t),p={x:n,y:r},h=await Yb(t,f),m=ti(Lo(o)),v=dI(m);let x=p[m],C=p[v];if(s){const w=m==="y"?"bottom":"right";x=Z1(x+h[m==="y"?"top":"left"],x,x-h[w])}if(i){const w=v==="y"?"bottom":"right";C=Z1(C+h[v==="y"?"top":"left"],C,C-h[w])}const b=l.fn({...t,[m]:x,[v]:C});return{...b,data:{x:b.x-n,y:b.y-r}}}}},Sq=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:f=!0,crossAxis:p=!0}=na(e,t),h={x:n,y:r},m=ti(o),v=dI(m);let x=h[m],C=h[v];const b=na(l,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(f){const j=m==="y"?"height":"width",I=s.reference[m]-s.floating[j]+w.mainAxis,M=s.reference[m]+s.reference[j]-w.mainAxis;x<I?x=I:x>M&&(x=M)}if(p){var k,_;const j=m==="y"?"width":"height",I=["top","left"].includes(Lo(o)),M=s.reference[v]-s.floating[j]+(I&&((k=i.offset)==null?void 0:k[v])||0)+(I?0:w.crossAxis),E=s.reference[v]+s.reference[j]+(I?0:((_=i.offset)==null?void 0:_[v])||0)-(I?w.crossAxis:0);C<M?C=M:C>E&&(C=E)}return{[m]:x,[v]:C}}}},kq=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...l}=na(e,t),f=await Yb(t,l),p=Lo(n),h=Fc(n),m=ti(n)==="x",{width:v,height:x}=r.floating;let C,b;p==="top"||p==="bottom"?(C=p,b=h===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=p,C=h==="end"?"top":"bottom");const w=x-f[C],k=v-f[b],_=!t.middlewareData.shift;let j=w,I=k;if(m){const E=v-f.left-f.right;I=h||_?Ka(k,E):E}else{const E=x-f.top-f.bottom;j=h||_?Ka(w,E):E}if(_&&!h){const E=ls(f.left,0),O=ls(f.right,0),D=ls(f.top,0),A=ls(f.bottom,0);m?I=v-2*(E!==0||O!==0?E+O:ls(f.left,f.right)):j=x-2*(D!==0||A!==0?D+A:ls(f.top,f.bottom))}await i({...t,availableWidth:I,availableHeight:j});const M=await o.getDimensions(s.floating);return v!==M.width||x!==M.height?{reset:{rects:!0}}:{}}}};function Lr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vs(e){return Lr(e).getComputedStyle(e)}function fI(e){return e instanceof Lr(e).Node}function qa(e){return fI(e)?(e.nodeName||"").toLowerCase():"#document"}function Uo(e){return e instanceof HTMLElement||e instanceof Lr(e).HTMLElement}function M4(e){return typeof ShadowRoot<"u"&&(e instanceof Lr(e).ShadowRoot||e instanceof ShadowRoot)}function sd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=vs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function _q(e){return["table","td","th"].includes(qa(e))}function J1(e){const t=Qb(),n=vs(e);return n.transform!=="none"||n.perspective!=="none"||!!n.containerType&&n.containerType!=="normal"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Qb(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Qm(e){return["html","body","#document"].includes(qa(e))}const ex=Math.min,oc=Math.max,jh=Math.round,ap=Math.floor,Xa=e=>({x:e,y:e});function pI(e){const t=vs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Uo(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=jh(n)!==s||jh(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function Ys(e){return e instanceof Element||e instanceof Lr(e).Element}function Zb(e){return Ys(e)?e:e.contextElement}function sc(e){const t=Zb(e);if(!Uo(t))return Xa(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=pI(t);let i=(s?jh(n.width):n.width)/r,l=(s?jh(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}const jq=Xa(0);function hI(e){const t=Lr(e);return Qb()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:jq}function Hi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Zb(e);let i=Xa(1);t&&(r?Ys(r)&&(i=sc(r)):i=sc(e));const l=function(v,x,C){return x===void 0&&(x=!1),!(!C||x&&C!==Lr(v))&&x}(s,n,r)?hI(s):Xa(0);let f=(o.left+l.x)/i.x,p=(o.top+l.y)/i.y,h=o.width/i.x,m=o.height/i.y;if(s){const v=Lr(s),x=r&&Ys(r)?Lr(r):r;let C=v.frameElement;for(;C&&r&&x!==v;){const b=sc(C),w=C.getBoundingClientRect(),k=getComputedStyle(C),_=w.left+(C.clientLeft+parseFloat(k.paddingLeft))*b.x,j=w.top+(C.clientTop+parseFloat(k.paddingTop))*b.y;f*=b.x,p*=b.y,h*=b.x,m*=b.y,f+=_,p+=j,C=Lr(C).frameElement}}return kc({width:h,height:m,x:f,y:p})}function Zm(e){return Ys(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Qs(e){var t;return(t=(fI(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mI(e){return Hi(Qs(e)).left+Zm(e).scrollLeft}function _c(e){if(qa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||M4(e)&&e.host||Qs(e);return M4(t)?t.host:t}function gI(e){const t=_c(e);return Qm(t)?e.ownerDocument?e.ownerDocument.body:e.body:Uo(t)&&sd(t)?t:gI(t)}function Ph(e,t){var n;t===void 0&&(t=[]);const r=gI(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Lr(r);return o?t.concat(s,s.visualViewport||[],sd(r)?r:[]):t.concat(r,Ph(r))}function O4(e,t,n){let r;if(t==="viewport")r=function(o,s){const i=Lr(o),l=Qs(o),f=i.visualViewport;let p=l.clientWidth,h=l.clientHeight,m=0,v=0;if(f){p=f.width,h=f.height;const x=Qb();(!x||x&&s==="fixed")&&(m=f.offsetLeft,v=f.offsetTop)}return{width:p,height:h,x:m,y:v}}(e,n);else if(t==="document")r=function(o){const s=Qs(o),i=Zm(o),l=o.ownerDocument.body,f=oc(s.scrollWidth,s.clientWidth,l.scrollWidth,l.clientWidth),p=oc(s.scrollHeight,s.clientHeight,l.scrollHeight,l.clientHeight);let h=-i.scrollLeft+mI(o);const m=-i.scrollTop;return vs(l).direction==="rtl"&&(h+=oc(s.clientWidth,l.clientWidth)-f),{width:f,height:p,x:h,y:m}}(Qs(e));else if(Ys(t))r=function(o,s){const i=Hi(o,!0,s==="fixed"),l=i.top+o.clientTop,f=i.left+o.clientLeft,p=Uo(o)?sc(o):Xa(1);return{width:o.clientWidth*p.x,height:o.clientHeight*p.y,x:f*p.x,y:l*p.y}}(t,n);else{const o=hI(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return kc(r)}function vI(e,t){const n=_c(e);return!(n===t||!Ys(n)||Qm(n))&&(vs(n).position==="fixed"||vI(n,t))}function Pq(e,t,n){const r=Uo(t),o=Qs(t),s=n==="fixed",i=Hi(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const f=Xa(0);if(r||!r&&!s)if((qa(t)!=="body"||sd(o))&&(l=Zm(t)),Uo(t)){const p=Hi(t,!0,s,t);f.x=p.x+t.clientLeft,f.y=p.y+t.clientTop}else o&&(f.x=mI(o));return{x:i.left+l.scrollLeft-f.x,y:i.top+l.scrollTop-f.y,width:i.width,height:i.height}}function D4(e,t){return Uo(e)&&vs(e).position!=="fixed"?t?t(e):e.offsetParent:null}function R4(e,t){const n=Lr(e);if(!Uo(e))return n;let r=D4(e,t);for(;r&&_q(r)&&vs(r).position==="static";)r=D4(r,t);return r&&(qa(r)==="html"||qa(r)==="body"&&vs(r).position==="static"&&!J1(r))?n:r||function(o){let s=_c(o);for(;Uo(s)&&!Qm(s);){if(J1(s))return s;s=_c(s)}return null}(e)||n}const Iq={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Uo(n),s=Qs(n);if(n===s)return t;let i={scrollLeft:0,scrollTop:0},l=Xa(1);const f=Xa(0);if((o||!o&&r!=="fixed")&&((qa(n)!=="body"||sd(s))&&(i=Zm(n)),Uo(n))){const p=Hi(n);l=sc(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-i.scrollLeft*l.x+f.x,y:t.y*l.y-i.scrollTop*l.y+f.y}},getDocumentElement:Qs,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?function(f,p){const h=p.get(f);if(h)return h;let m=Ph(f).filter(b=>Ys(b)&&qa(b)!=="body"),v=null;const x=vs(f).position==="fixed";let C=x?_c(f):f;for(;Ys(C)&&!Qm(C);){const b=vs(C),w=J1(C);w||b.position!=="fixed"||(v=null),(x?!w&&!v:!w&&b.position==="static"&&v&&["absolute","fixed"].includes(v.position)||sd(C)&&!w&&vI(f,C))?m=m.filter(k=>k!==C):v=b,C=_c(C)}return p.set(f,m),m}(t,this._c):[].concat(n),r],i=s[0],l=s.reduce((f,p)=>{const h=O4(t,p,o);return f.top=oc(h.top,f.top),f.right=ex(h.right,f.right),f.bottom=ex(h.bottom,f.bottom),f.left=oc(h.left,f.left),f},O4(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:R4,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||R4,s=this.getDimensions;return{reference:Pq(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return pI(e)},getScale:sc,isElement:Ys,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function Eq(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=Zb(e),h=o||s?[...p?Ph(p):[],...Ph(t)]:[];h.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const m=p&&l?function(w,k){let _,j=null;const I=Qs(w);function M(){clearTimeout(_),j&&j.disconnect(),j=null}return function E(O,D){O===void 0&&(O=!1),D===void 0&&(D=1),M();const{left:A,top:R,width:$,height:K}=w.getBoundingClientRect();if(O||k(),!$||!K)return;const B={rootMargin:-ap(R)+"px "+-ap(I.clientWidth-(A+$))+"px "+-ap(I.clientHeight-(R+K))+"px "+-ap(A)+"px",threshold:oc(0,ex(1,D))||1};let U=!0;function Y(W){const L=W[0].intersectionRatio;if(L!==D){if(!U)return E();L?E(!1,L):_=setTimeout(()=>{E(!1,1e-7)},100)}U=!1}try{j=new IntersectionObserver(Y,{...B,root:I.ownerDocument})}catch{j=new IntersectionObserver(Y,B)}j.observe(w)}(!0),M}(p,n):null;let v,x=-1,C=null;i&&(C=new ResizeObserver(w=>{let[k]=w;k&&k.target===p&&C&&(C.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{C&&C.observe(t)})),n()}),p&&!f&&C.observe(p),C.observe(t));let b=f?Hi(e):null;return f&&function w(){const k=Hi(e);!b||k.x===b.x&&k.y===b.y&&k.width===b.width&&k.height===b.height||n(),b=k,v=requestAnimationFrame(w)}(),n(),()=>{h.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),m&&m(),C&&C.disconnect(),C=null,f&&cancelAnimationFrame(v)}}const Mq=(e,t,n)=>{const r=new Map,o={platform:Iq,...n},s={...o.platform,_c:r};return hq(e,t,{...o,platform:s})},Oq=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?I4({element:t.current,padding:n}).fn(o):{}:t?I4({element:t,padding:n}).fn(o):{}}}};var $p=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Ih(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Ih(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ih(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function A4(e){const t=d.useRef(e);return $p(()=>{t.current=e}),t}function Dq(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:i}=e,[l,f]=d.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=d.useState(r);Ih(p,r)||h(r);const m=d.useRef(null),v=d.useRef(null),x=d.useRef(l),C=A4(s),b=A4(o),[w,k]=d.useState(null),[_,j]=d.useState(null),I=d.useCallback(R=>{m.current!==R&&(m.current=R,k(R))},[]),M=d.useCallback(R=>{v.current!==R&&(v.current=R,j(R))},[]),E=d.useCallback(()=>{if(!m.current||!v.current)return;const R={placement:t,strategy:n,middleware:p};b.current&&(R.platform=b.current),Mq(m.current,v.current,R).then($=>{const K={...$,isPositioned:!0};O.current&&!Ih(x.current,K)&&(x.current=K,so.flushSync(()=>{f(K)}))})},[p,t,n,b]);$p(()=>{i===!1&&x.current.isPositioned&&(x.current.isPositioned=!1,f(R=>({...R,isPositioned:!1})))},[i]);const O=d.useRef(!1);$p(()=>(O.current=!0,()=>{O.current=!1}),[]),$p(()=>{if(w&&_){if(C.current)return C.current(w,_,E);E()}},[w,_,E,C]);const D=d.useMemo(()=>({reference:m,floating:v,setReference:I,setFloating:M}),[I,M]),A=d.useMemo(()=>({reference:w,floating:_}),[w,_]);return d.useMemo(()=>({...l,update:E,refs:D,elements:A,reference:I,floating:M}),[l,E,D,A,I,M])}var Rq=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Aq(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const Nq=d.createContext(null),Tq=()=>d.useContext(Nq);function $q(e){return(e==null?void 0:e.ownerDocument)||document}function Lq(e){return $q(e).defaultView||window}function ip(e){return e?e instanceof Lq(e).Element:!1}const zq=Nx["useInsertionEffect".toString()],Fq=zq||(e=>e());function Bq(e){const t=d.useRef(()=>{});return Fq(()=>{t.current=e}),d.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Hq(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=Dq(e),s=Tq(),i=d.useRef(null),l=d.useRef({}),f=d.useState(()=>Aq())[0],[p,h]=d.useState(null),m=d.useCallback(k=>{const _=ip(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;o.refs.setReference(_)},[o.refs]),v=d.useCallback(k=>{(ip(k)||k===null)&&(i.current=k,h(k)),(ip(o.refs.reference.current)||o.refs.reference.current===null||k!==null&&!ip(k))&&o.refs.setReference(k)},[o.refs]),x=d.useMemo(()=>({...o.refs,setReference:v,setPositionReference:m,domReference:i}),[o.refs,v,m]),C=d.useMemo(()=>({...o.elements,domReference:p}),[o.elements,p]),b=Bq(n),w=d.useMemo(()=>({...o,refs:x,elements:C,dataRef:l,nodeId:r,events:f,open:t,onOpenChange:b}),[o,r,f,t,b,x,C]);return Rq(()=>{const k=s==null?void 0:s.nodesRef.current.find(_=>_.id===r);k&&(k.context=w)}),d.useMemo(()=>({...o,context:w,refs:x,reference:v,positionReference:m}),[o,x,w,v,m])}function Wq({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=d.useState(0);d.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return Eq(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),$o(()=>{t.update()},r),$o(()=>{s(i=>i+1)},[e])}function Vq(e){const t=[Cq(e.offset)];return e.middlewares.shift&&t.push(wq({limiter:Sq()})),e.middlewares.flip&&t.push(bq()),e.middlewares.inline&&t.push(yq()),t.push(Oq({element:e.arrowRef,padding:e.arrowOffset})),t}function Uq(e){const[t,n]=od({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var i;(i=e.onClose)==null||i.call(e),n(!1)},o=()=>{var i,l;t?((i=e.onClose)==null||i.call(e),n(!1)):((l=e.onOpen)==null||l.call(e),n(!0))},s=Hq({placement:e.position,middleware:[...Vq(e),...e.width==="target"?[kq({apply({rects:i}){var l,f;Object.assign((f=(l=s.refs.floating.current)==null?void 0:l.style)!=null?f:{},{width:`${i.reference.width}px`})}})]:[]]});return Wq({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),$o(()=>{var i;(i=e.onPositionChange)==null||i.call(e,s.placement)},[s.placement]),$o(()=>{var i,l;e.opened?(l=e.onOpen)==null||l.call(e):(i=e.onClose)==null||i.call(e)},[e.opened]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const xI={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[Gq,bI]=RV(xI.context);var Kq=Object.defineProperty,qq=Object.defineProperties,Xq=Object.getOwnPropertyDescriptors,Eh=Object.getOwnPropertySymbols,yI=Object.prototype.hasOwnProperty,CI=Object.prototype.propertyIsEnumerable,N4=(e,t,n)=>t in e?Kq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lp=(e,t)=>{for(var n in t||(t={}))yI.call(t,n)&&N4(e,n,t[n]);if(Eh)for(var n of Eh(t))CI.call(t,n)&&N4(e,n,t[n]);return e},Yq=(e,t)=>qq(e,Xq(t)),Qq=(e,t)=>{var n={};for(var r in e)yI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Eh)for(var r of Eh(e))t.indexOf(r)<0&&CI.call(e,r)&&(n[r]=e[r]);return n};const Zq={refProp:"ref",popupType:"dialog"},wI=d.forwardRef((e,t)=>{const n=Sn("PopoverTarget",Zq,e),{children:r,refProp:o,popupType:s}=n,i=Qq(n,["children","refProp","popupType"]);if(!YP(r))throw new Error(xI.children);const l=i,f=bI(),p=Ld(f.reference,r.ref,t),h=f.withRoles?{"aria-haspopup":s,"aria-expanded":f.opened,"aria-controls":f.getDropdownId(),id:f.getTargetId()}:{};return d.cloneElement(r,lp(Yq(lp(lp(lp({},l),h),f.targetProps),{className:ZP(f.targetProps.className,l.className,r.props.className),[o]:p}),f.controlled?null:{onClick:f.onToggle}))});wI.displayName="@mantine/core/PopoverTarget";var Jq=or((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${Oe(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm} ${e.spacing.md}`,boxShadow:e.shadows[n]||n||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`${Oe(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const eX=Jq;var tX=Object.defineProperty,T4=Object.getOwnPropertySymbols,nX=Object.prototype.hasOwnProperty,rX=Object.prototype.propertyIsEnumerable,$4=(e,t,n)=>t in e?tX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,El=(e,t)=>{for(var n in t||(t={}))nX.call(t,n)&&$4(e,n,t[n]);if(T4)for(var n of T4(t))rX.call(t,n)&&$4(e,n,t[n]);return e};const L4={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function oX({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in ep?El(El(El({transitionProperty:ep[e].transitionProperty},o),ep[e].common),ep[e][L4[t]]):null:El(El(El({transitionProperty:e.transitionProperty},o),e.common),e[L4[t]])}function sX({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:i,onExited:l}){const f=ca(),p=s6(),h=f.respectReducedMotion?p:!1,[m,v]=d.useState(h?0:e),[x,C]=d.useState(r?"entered":"exited"),b=d.useRef(-1),w=k=>{const _=k?o:s,j=k?i:l;C(k?"pre-entering":"pre-exiting"),window.clearTimeout(b.current);const I=h?0:k?e:t;if(v(I),I===0)typeof _=="function"&&_(),typeof j=="function"&&j(),C(k?"entered":"exited");else{const M=window.setTimeout(()=>{typeof _=="function"&&_(),C(k?"entering":"exiting")},10);b.current=window.setTimeout(()=>{window.clearTimeout(M),typeof j=="function"&&j(),C(k?"entered":"exited")},I)}};return $o(()=>{w(r)},[r]),d.useEffect(()=>()=>window.clearTimeout(b.current),[]),{transitionDuration:m,transitionStatus:x,transitionTimingFunction:n||f.transitionTimingFunction}}function SI({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:i,onExit:l,onEntered:f,onEnter:p,onExited:h}){const{transitionDuration:m,transitionStatus:v,transitionTimingFunction:x}=sX({mounted:o,exitDuration:r,duration:n,timingFunction:i,onExit:l,onEntered:f,onEnter:p,onExited:h});return m===0?o?H.createElement(H.Fragment,null,s({})):e?s({display:"none"}):null:v==="exited"?e?s({display:"none"}):null:H.createElement(H.Fragment,null,s(oX({transition:t,duration:m,state:v,timingFunction:x})))}SI.displayName="@mantine/core/Transition";function kI({children:e,active:t=!0,refProp:n="ref"}){const r=pU(t),o=Ld(r,e==null?void 0:e.ref);return YP(e)?d.cloneElement(e,{[n]:o}):e}kI.displayName="@mantine/core/FocusTrap";var aX=Object.defineProperty,iX=Object.defineProperties,lX=Object.getOwnPropertyDescriptors,z4=Object.getOwnPropertySymbols,cX=Object.prototype.hasOwnProperty,uX=Object.prototype.propertyIsEnumerable,F4=(e,t,n)=>t in e?aX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ja=(e,t)=>{for(var n in t||(t={}))cX.call(t,n)&&F4(e,n,t[n]);if(z4)for(var n of z4(t))uX.call(t,n)&&F4(e,n,t[n]);return e},cp=(e,t)=>iX(e,lX(t));function B4(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function H4(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const dX={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function fX({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:i,dir:l}){const[f,p="center"]=e.split("-"),h={width:Oe(t),height:Oe(t),transform:"rotate(45deg)",position:"absolute",[dX[f]]:Oe(r)},m=Oe(-t/2);return f==="left"?cp(ja(ja({},h),B4(p,i,n,o)),{right:m,borderLeftColor:"transparent",borderBottomColor:"transparent"}):f==="right"?cp(ja(ja({},h),B4(p,i,n,o)),{left:m,borderRightColor:"transparent",borderTopColor:"transparent"}):f==="top"?cp(ja(ja({},h),H4(p,s,n,o,l)),{bottom:m,borderTopColor:"transparent",borderLeftColor:"transparent"}):f==="bottom"?cp(ja(ja({},h),H4(p,s,n,o,l)),{top:m,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var pX=Object.defineProperty,hX=Object.defineProperties,mX=Object.getOwnPropertyDescriptors,Mh=Object.getOwnPropertySymbols,_I=Object.prototype.hasOwnProperty,jI=Object.prototype.propertyIsEnumerable,W4=(e,t,n)=>t in e?pX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gX=(e,t)=>{for(var n in t||(t={}))_I.call(t,n)&&W4(e,n,t[n]);if(Mh)for(var n of Mh(t))jI.call(t,n)&&W4(e,n,t[n]);return e},vX=(e,t)=>hX(e,mX(t)),xX=(e,t)=>{var n={};for(var r in e)_I.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mh)for(var r of Mh(e))t.indexOf(r)<0&&jI.call(e,r)&&(n[r]=e[r]);return n};const PI=d.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:l,visible:f,arrowX:p,arrowY:h}=n,m=xX(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const v=ca();return f?H.createElement("div",vX(gX({},m),{ref:t,style:fX({position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:l,dir:v.dir,arrowX:p,arrowY:h})})):null});PI.displayName="@mantine/core/FloatingArrow";var bX=Object.defineProperty,yX=Object.defineProperties,CX=Object.getOwnPropertyDescriptors,Oh=Object.getOwnPropertySymbols,II=Object.prototype.hasOwnProperty,EI=Object.prototype.propertyIsEnumerable,V4=(e,t,n)=>t in e?bX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ml=(e,t)=>{for(var n in t||(t={}))II.call(t,n)&&V4(e,n,t[n]);if(Oh)for(var n of Oh(t))EI.call(t,n)&&V4(e,n,t[n]);return e},up=(e,t)=>yX(e,CX(t)),wX=(e,t)=>{var n={};for(var r in e)II.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Oh)for(var r of Oh(e))t.indexOf(r)<0&&EI.call(e,r)&&(n[r]=e[r]);return n};const SX={};function MI(e){var t;const n=Sn("PopoverDropdown",SX,e),{style:r,className:o,children:s,onKeyDownCapture:i}=n,l=wX(n,["style","className","children","onKeyDownCapture"]),f=bI(),{classes:p,cx:h}=eX({radius:f.radius,shadow:f.shadow},{name:f.__staticSelector,classNames:f.classNames,styles:f.styles,unstyled:f.unstyled,variant:f.variant}),m=aU({opened:f.opened,shouldReturnFocus:f.returnFocus}),v=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:"dialog"}:{};return f.disabled?null:H.createElement(M6,up(Ml({},f.portalProps),{withinPortal:f.withinPortal}),H.createElement(SI,up(Ml({mounted:f.opened},f.transitionProps),{transition:f.transitionProps.transition||"fade",duration:(t=f.transitionProps.duration)!=null?t:150,keepMounted:f.keepMounted,exitDuration:typeof f.transitionProps.exitDuration=="number"?f.transitionProps.exitDuration:f.transitionProps.duration}),x=>{var C,b;return H.createElement(kI,{active:f.trapFocus},H.createElement(Mr,Ml(up(Ml({},v),{tabIndex:-1,ref:f.floating,style:up(Ml(Ml({},r),x),{zIndex:f.zIndex,top:(C=f.y)!=null?C:0,left:(b=f.x)!=null?b:0,width:f.width==="target"?void 0:Oe(f.width)}),className:h(p.dropdown,o),onKeyDownCapture:NV(f.onClose,{active:f.closeOnEscape,onTrigger:m,onKeyDown:i}),"data-position":f.placement}),l),s,H.createElement(PI,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,arrowPosition:f.arrowPosition,className:p.arrow})))}))}MI.displayName="@mantine/core/PopoverDropdown";function kX(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}var U4=Object.getOwnPropertySymbols,_X=Object.prototype.hasOwnProperty,jX=Object.prototype.propertyIsEnumerable,PX=(e,t)=>{var n={};for(var r in e)_X.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&U4)for(var r of U4(e))t.indexOf(r)<0&&jX.call(e,r)&&(n[r]=e[r]);return n};const IX={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Hb("popover"),__staticSelector:"Popover",width:"max-content"};function Bc(e){var t,n,r,o,s,i;const l=d.useRef(null),f=Sn("Popover",IX,e),{children:p,position:h,offset:m,onPositionChange:v,positionDependencies:x,opened:C,transitionProps:b,width:w,middlewares:k,withArrow:_,arrowSize:j,arrowOffset:I,arrowRadius:M,arrowPosition:E,unstyled:O,classNames:D,styles:A,closeOnClickOutside:R,withinPortal:$,portalProps:K,closeOnEscape:B,clickOutsideEvents:U,trapFocus:Y,onClose:W,onOpen:L,onChange:X,zIndex:z,radius:q,shadow:ne,id:Q,defaultOpened:ie,__staticSelector:oe,withRoles:V,disabled:G,returnFocus:J,variant:se,keepMounted:re}=f,fe=PX(f,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[de,me]=d.useState(null),[ye,he]=d.useState(null),ue=Vb(Q),De=ca(),je=Uq({middlewares:k,width:w,position:kX(De.dir,h),offset:typeof m=="number"?m+(_?j/2:0):m,arrowRef:l,arrowOffset:I,onPositionChange:v,positionDependencies:x,opened:C,defaultOpened:ie,onChange:X,onOpen:L,onClose:W});nU(()=>je.opened&&R&&je.onClose(),U,[de,ye]);const Be=d.useCallback(Ue=>{me(Ue),je.floating.reference(Ue)},[je.floating.reference]),rt=d.useCallback(Ue=>{he(Ue),je.floating.floating(Ue)},[je.floating.floating]);return H.createElement(Gq,{value:{returnFocus:J,disabled:G,controlled:je.controlled,reference:Be,floating:rt,x:je.floating.x,y:je.floating.y,arrowX:(r=(n=(t=je.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(i=(s=(o=je.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:i.y,opened:je.opened,arrowRef:l,transitionProps:b,width:w,withArrow:_,arrowSize:j,arrowOffset:I,arrowRadius:M,arrowPosition:E,placement:je.floating.placement,trapFocus:Y,withinPortal:$,portalProps:K,zIndex:z,radius:q,shadow:ne,closeOnEscape:B,onClose:je.onClose,onToggle:je.onToggle,getTargetId:()=>`${ue}-target`,getDropdownId:()=>`${ue}-dropdown`,withRoles:V,targetProps:fe,__staticSelector:oe,classNames:D,styles:A,unstyled:O,variant:se,keepMounted:re}},p)}Bc.Target=wI;Bc.Dropdown=MI;Bc.displayName="@mantine/core/Popover";var EX=Object.defineProperty,Dh=Object.getOwnPropertySymbols,OI=Object.prototype.hasOwnProperty,DI=Object.prototype.propertyIsEnumerable,G4=(e,t,n)=>t in e?EX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MX=(e,t)=>{for(var n in t||(t={}))OI.call(t,n)&&G4(e,n,t[n]);if(Dh)for(var n of Dh(t))DI.call(t,n)&&G4(e,n,t[n]);return e},OX=(e,t)=>{var n={};for(var r in e)OI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dh)for(var r of Dh(e))t.indexOf(r)<0&&DI.call(e,r)&&(n[r]=e[r]);return n};function DX(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:i,innerRef:l,__staticSelector:f,styles:p,classNames:h,unstyled:m}=t,v=OX(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:x}=pq(null,{name:f,styles:p,classNames:h,unstyled:m});return H.createElement(Bc.Dropdown,MX({p:0,onMouseDown:C=>C.preventDefault()},v),H.createElement("div",{style:{maxHeight:Oe(o),display:"flex"}},H.createElement(Mr,{component:r||"div",id:`${i}-items`,"aria-labelledby":`${i}-label`,role:"listbox",onMouseDown:C=>C.preventDefault(),style:{flex:1,overflowY:r!==Ym?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},H.createElement("div",{className:x.itemsWrapper,style:{flexDirection:s}},n))))}function Ba({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:s,__staticSelector:i,onDirectionChange:l,switchDirectionOnFlip:f,zIndex:p,dropdownPosition:h,positionDependencies:m=[],classNames:v,styles:x,unstyled:C,readOnly:b,variant:w}){return H.createElement(Bc,{unstyled:C,classNames:v,styles:x,width:"target",withRoles:!1,opened:e,middlewares:{flip:h==="flip",shift:!1},position:h==="flip"?"bottom":h,positionDependencies:m,zIndex:p,__staticSelector:i,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:b,onPositionChange:k=>f&&(l==null?void 0:l(k==="top"?"column-reverse":"column")),variant:w},s)}Ba.Target=Bc.Target;Ba.Dropdown=DX;var RX=Object.defineProperty,AX=Object.defineProperties,NX=Object.getOwnPropertyDescriptors,Rh=Object.getOwnPropertySymbols,RI=Object.prototype.hasOwnProperty,AI=Object.prototype.propertyIsEnumerable,K4=(e,t,n)=>t in e?RX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dp=(e,t)=>{for(var n in t||(t={}))RI.call(t,n)&&K4(e,n,t[n]);if(Rh)for(var n of Rh(t))AI.call(t,n)&&K4(e,n,t[n]);return e},TX=(e,t)=>AX(e,NX(t)),$X=(e,t)=>{var n={};for(var r in e)RI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rh)for(var r of Rh(e))t.indexOf(r)<0&&AI.call(e,r)&&(n[r]=e[r]);return n};function NI(e,t,n){const r=Sn(e,t,n),{label:o,description:s,error:i,required:l,classNames:f,styles:p,className:h,unstyled:m,__staticSelector:v,sx:x,errorProps:C,labelProps:b,descriptionProps:w,wrapperProps:k,id:_,size:j,style:I,inputContainer:M,inputWrapperOrder:E,withAsterisk:O,variant:D}=r,A=$X(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),R=Vb(_),{systemStyles:$,rest:K}=Gm(A),B=dp({label:o,description:s,error:i,required:l,classNames:f,className:h,__staticSelector:v,sx:x,errorProps:C,labelProps:b,descriptionProps:w,unstyled:m,styles:p,id:R,size:j,style:I,inputContainer:M,inputWrapperOrder:E,withAsterisk:O,variant:D},k);return TX(dp({},K),{classNames:f,styles:p,unstyled:m,wrapperProps:dp(dp({},B),$),inputProps:{required:l,classNames:f,styles:p,unstyled:m,id:R,size:j,__staticSelector:v,error:i,variant:D}})}var LX=or((e,t,{size:n})=>({label:{display:"inline-block",fontSize:ut({size:n,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const zX=LX;var FX=Object.defineProperty,Ah=Object.getOwnPropertySymbols,TI=Object.prototype.hasOwnProperty,$I=Object.prototype.propertyIsEnumerable,q4=(e,t,n)=>t in e?FX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BX=(e,t)=>{for(var n in t||(t={}))TI.call(t,n)&&q4(e,n,t[n]);if(Ah)for(var n of Ah(t))$I.call(t,n)&&q4(e,n,t[n]);return e},HX=(e,t)=>{var n={};for(var r in e)TI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ah)for(var r of Ah(e))t.indexOf(r)<0&&$I.call(e,r)&&(n[r]=e[r]);return n};const WX={labelElement:"label",size:"sm"},Jb=d.forwardRef((e,t)=>{const n=Sn("InputLabel",WX,e),{labelElement:r,children:o,required:s,size:i,classNames:l,styles:f,unstyled:p,className:h,htmlFor:m,__staticSelector:v,variant:x,onMouseDown:C}=n,b=HX(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:w,cx:k}=zX(null,{name:["InputWrapper",v],classNames:l,styles:f,unstyled:p,variant:x,size:i});return H.createElement(Mr,BX({component:r,ref:t,className:k(w.label,h),htmlFor:r==="label"?m:void 0,onMouseDown:_=>{C==null||C(_),!_.defaultPrevented&&_.detail>1&&_.preventDefault()}},b),o,s&&H.createElement("span",{className:w.required,"aria-hidden":!0}," *"))});Jb.displayName="@mantine/core/InputLabel";var VX=or((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${ut({size:n,sizes:e.fontSizes})} - ${Oe(2)})`,lineHeight:1.2,display:"block"}}));const UX=VX;var GX=Object.defineProperty,Nh=Object.getOwnPropertySymbols,LI=Object.prototype.hasOwnProperty,zI=Object.prototype.propertyIsEnumerable,X4=(e,t,n)=>t in e?GX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KX=(e,t)=>{for(var n in t||(t={}))LI.call(t,n)&&X4(e,n,t[n]);if(Nh)for(var n of Nh(t))zI.call(t,n)&&X4(e,n,t[n]);return e},qX=(e,t)=>{var n={};for(var r in e)LI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Nh)for(var r of Nh(e))t.indexOf(r)<0&&zI.call(e,r)&&(n[r]=e[r]);return n};const XX={size:"sm"},ey=d.forwardRef((e,t)=>{const n=Sn("InputError",XX,e),{children:r,className:o,classNames:s,styles:i,unstyled:l,size:f,__staticSelector:p,variant:h}=n,m=qX(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:x}=UX(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:l,variant:h,size:f});return H.createElement(wc,KX({className:x(v.error,o),ref:t},m),r)});ey.displayName="@mantine/core/InputError";var YX=or((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${ut({size:n,sizes:e.fontSizes})} - ${Oe(2)})`,lineHeight:1.2,display:"block"}}));const QX=YX;var ZX=Object.defineProperty,Th=Object.getOwnPropertySymbols,FI=Object.prototype.hasOwnProperty,BI=Object.prototype.propertyIsEnumerable,Y4=(e,t,n)=>t in e?ZX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JX=(e,t)=>{for(var n in t||(t={}))FI.call(t,n)&&Y4(e,n,t[n]);if(Th)for(var n of Th(t))BI.call(t,n)&&Y4(e,n,t[n]);return e},eY=(e,t)=>{var n={};for(var r in e)FI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Th)for(var r of Th(e))t.indexOf(r)<0&&BI.call(e,r)&&(n[r]=e[r]);return n};const tY={size:"sm"},ty=d.forwardRef((e,t)=>{const n=Sn("InputDescription",tY,e),{children:r,className:o,classNames:s,styles:i,unstyled:l,size:f,__staticSelector:p,variant:h}=n,m=eY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:x}=QX(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:l,variant:h,size:f});return H.createElement(wc,JX({color:"dimmed",className:x(v.description,o),ref:t,unstyled:l},m),r)});ty.displayName="@mantine/core/InputDescription";const HI=d.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),nY=HI.Provider,rY=()=>d.useContext(HI);function oY(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),o=e[r-1],s=e[r+1];return{offsetBottom:t&&s==="description"||n&&s==="error",offsetTop:t&&o==="description"||n&&o==="error"}}var sY=Object.defineProperty,aY=Object.defineProperties,iY=Object.getOwnPropertyDescriptors,Q4=Object.getOwnPropertySymbols,lY=Object.prototype.hasOwnProperty,cY=Object.prototype.propertyIsEnumerable,Z4=(e,t,n)=>t in e?sY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uY=(e,t)=>{for(var n in t||(t={}))lY.call(t,n)&&Z4(e,n,t[n]);if(Q4)for(var n of Q4(t))cY.call(t,n)&&Z4(e,n,t[n]);return e},dY=(e,t)=>aY(e,iY(t)),fY=or(e=>({root:dY(uY({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const pY=fY;var hY=Object.defineProperty,mY=Object.defineProperties,gY=Object.getOwnPropertyDescriptors,$h=Object.getOwnPropertySymbols,WI=Object.prototype.hasOwnProperty,VI=Object.prototype.propertyIsEnumerable,J4=(e,t,n)=>t in e?hY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pa=(e,t)=>{for(var n in t||(t={}))WI.call(t,n)&&J4(e,n,t[n]);if($h)for(var n of $h(t))VI.call(t,n)&&J4(e,n,t[n]);return e},ek=(e,t)=>mY(e,gY(t)),vY=(e,t)=>{var n={};for(var r in e)WI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$h)for(var r of $h(e))t.indexOf(r)<0&&VI.call(e,r)&&(n[r]=e[r]);return n};const xY={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},UI=d.forwardRef((e,t)=>{const n=Sn("InputWrapper",xY,e),{className:r,label:o,children:s,required:i,id:l,error:f,description:p,labelElement:h,labelProps:m,descriptionProps:v,errorProps:x,classNames:C,styles:b,size:w,inputContainer:k,__staticSelector:_,unstyled:j,inputWrapperOrder:I,withAsterisk:M,variant:E}=n,O=vY(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:D,cx:A}=pY(null,{classNames:C,styles:b,name:["InputWrapper",_],unstyled:j,variant:E,size:w}),R={classNames:C,styles:b,unstyled:j,size:w,variant:E,__staticSelector:_},$=typeof M=="boolean"?M:i,K=l?`${l}-error`:x==null?void 0:x.id,B=l?`${l}-description`:v==null?void 0:v.id,Y=`${!!f&&typeof f!="boolean"?K:""} ${p?B:""}`,W=Y.trim().length>0?Y.trim():void 0,L=o&&H.createElement(Jb,Pa(Pa({key:"label",labelElement:h,id:l?`${l}-label`:void 0,htmlFor:l,required:$},R),m),o),X=p&&H.createElement(ty,ek(Pa(Pa({key:"description"},v),R),{size:(v==null?void 0:v.size)||R.size,id:(v==null?void 0:v.id)||B}),p),z=H.createElement(d.Fragment,{key:"input"},k(s)),q=typeof f!="boolean"&&f&&H.createElement(ey,ek(Pa(Pa({},x),R),{size:(x==null?void 0:x.size)||R.size,key:"error",id:(x==null?void 0:x.id)||K}),f),ne=I.map(Q=>{switch(Q){case"label":return L;case"input":return z;case"description":return X;case"error":return q;default:return null}});return H.createElement(nY,{value:Pa({describedBy:W},oY(I,{hasDescription:!!X,hasError:!!q}))},H.createElement(Mr,Pa({className:A(D.root,r),ref:t},O),ne))});UI.displayName="@mantine/core/InputWrapper";var bY=Object.defineProperty,Lh=Object.getOwnPropertySymbols,GI=Object.prototype.hasOwnProperty,KI=Object.prototype.propertyIsEnumerable,tk=(e,t,n)=>t in e?bY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yY=(e,t)=>{for(var n in t||(t={}))GI.call(t,n)&&tk(e,n,t[n]);if(Lh)for(var n of Lh(t))KI.call(t,n)&&tk(e,n,t[n]);return e},CY=(e,t)=>{var n={};for(var r in e)GI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lh)for(var r of Lh(e))t.indexOf(r)<0&&KI.call(e,r)&&(n[r]=e[r]);return n};const wY={},qI=d.forwardRef((e,t)=>{const n=Sn("InputPlaceholder",wY,e),{sx:r}=n,o=CY(n,["sx"]);return H.createElement(Mr,yY({component:"span",sx:[s=>s.fn.placeholderStyles(),...qP(r)],ref:t},o))});qI.displayName="@mantine/core/InputPlaceholder";var SY=Object.defineProperty,kY=Object.defineProperties,_Y=Object.getOwnPropertyDescriptors,nk=Object.getOwnPropertySymbols,jY=Object.prototype.hasOwnProperty,PY=Object.prototype.propertyIsEnumerable,rk=(e,t,n)=>t in e?SY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fp=(e,t)=>{for(var n in t||(t={}))jY.call(t,n)&&rk(e,n,t[n]);if(nk)for(var n of nk(t))PY.call(t,n)&&rk(e,n,t[n]);return e},Cv=(e,t)=>kY(e,_Y(t));const to={xs:Oe(30),sm:Oe(36),md:Oe(42),lg:Oe(50),xl:Oe(60)},IY=["default","filled","unstyled"];function EY({theme:e,variant:t}){return IY.includes(t)?t==="default"?{border:`${Oe(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:`${Oe(1)} solid transparent`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:Oe(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var MY=or((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:i,offsetBottom:l,offsetTop:f,pointer:p},{variant:h,size:m})=>{const v=e.fn.variant({variant:"filled",color:"red"}).background,x=h==="default"||h==="filled"?{minHeight:ut({size:m,sizes:to}),paddingLeft:`calc(${ut({size:m,sizes:to})} / 3)`,paddingRight:s?o||ut({size:m,sizes:to}):`calc(${ut({size:m,sizes:to})} / 3)`,borderRadius:e.fn.radius(n)}:h==="unstyled"&&s?{paddingRight:o||ut({size:m,sizes:to})}:null;return{wrapper:{position:"relative",marginTop:f?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:l?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:Cv(fp(fp(Cv(fp({},e.fn.fontStyles()),{height:t?h==="unstyled"?void 0:"auto":ut({size:m,sizes:to}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${ut({size:m,sizes:to})} - ${Oe(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:ut({size:m,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:p?"pointer":void 0}),EY({theme:e,variant:h})),x),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:v,borderColor:v,"&::placeholder":{opacity:1,color:v}},"&[data-with-icon]":{paddingLeft:typeof i=="number"?Oe(i):ut({size:m,sizes:to})},"&::placeholder":Cv(fp({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:i?Oe(i):ut({size:m,sizes:to}),color:r?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||ut({size:m,sizes:to})}}});const OY=MY;var DY=Object.defineProperty,RY=Object.defineProperties,AY=Object.getOwnPropertyDescriptors,zh=Object.getOwnPropertySymbols,XI=Object.prototype.hasOwnProperty,YI=Object.prototype.propertyIsEnumerable,ok=(e,t,n)=>t in e?DY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pp=(e,t)=>{for(var n in t||(t={}))XI.call(t,n)&&ok(e,n,t[n]);if(zh)for(var n of zh(t))YI.call(t,n)&&ok(e,n,t[n]);return e},sk=(e,t)=>RY(e,AY(t)),NY=(e,t)=>{var n={};for(var r in e)XI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zh)for(var r of zh(e))t.indexOf(r)<0&&YI.call(e,r)&&(n[r]=e[r]);return n};const TY={size:"sm",variant:"default"},el=d.forwardRef((e,t)=>{const n=Sn("Input",TY,e),{className:r,error:o,required:s,disabled:i,variant:l,icon:f,style:p,rightSectionWidth:h,iconWidth:m,rightSection:v,rightSectionProps:x,radius:C,size:b,wrapperProps:w,classNames:k,styles:_,__staticSelector:j,multiline:I,sx:M,unstyled:E,pointer:O}=n,D=NY(n,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:A,offsetTop:R,describedBy:$}=rY(),{classes:K,cx:B}=OY({radius:C,multiline:I,invalid:!!o,rightSectionWidth:h?Oe(h):void 0,iconWidth:m,withRightSection:!!v,offsetBottom:A,offsetTop:R,pointer:O},{classNames:k,styles:_,name:["Input",j],unstyled:E,variant:l,size:b}),{systemStyles:U,rest:Y}=Gm(D);return H.createElement(Mr,pp(pp({className:B(K.wrapper,r),sx:M,style:p},U),w),f&&H.createElement("div",{className:K.icon},f),H.createElement(Mr,sk(pp({component:"input"},Y),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":$,disabled:i,"data-disabled":i||void 0,"data-with-icon":!!f||void 0,"data-invalid":!!o||void 0,className:K.input})),v&&H.createElement("div",sk(pp({},x),{className:K.rightSection}),v))});el.displayName="@mantine/core/Input";el.Wrapper=UI;el.Label=Jb;el.Description=ty;el.Error=ey;el.Placeholder=qI;const jc=el;var $Y=Object.defineProperty,Fh=Object.getOwnPropertySymbols,QI=Object.prototype.hasOwnProperty,ZI=Object.prototype.propertyIsEnumerable,ak=(e,t,n)=>t in e?$Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ik=(e,t)=>{for(var n in t||(t={}))QI.call(t,n)&&ak(e,n,t[n]);if(Fh)for(var n of Fh(t))ZI.call(t,n)&&ak(e,n,t[n]);return e},LY=(e,t)=>{var n={};for(var r in e)QI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fh)for(var r of Fh(e))t.indexOf(r)<0&&ZI.call(e,r)&&(n[r]=e[r]);return n};const zY={multiple:!1},JI=d.forwardRef((e,t)=>{const n=Sn("FileButton",zY,e),{onChange:r,children:o,multiple:s,accept:i,name:l,form:f,resetRef:p,disabled:h,capture:m,inputProps:v}=n,x=LY(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),C=d.useRef(),b=()=>{!h&&C.current.click()},w=_=>{r(s?Array.from(_.currentTarget.files):_.currentTarget.files[0]||null)};return o6(p,()=>{C.current.value=""}),H.createElement(H.Fragment,null,o(ik({onClick:b},x)),H.createElement("input",ik({style:{display:"none"},type:"file",accept:i,multiple:s,onChange:w,ref:Ld(t,C),name:l,form:f,capture:m},v)))});JI.displayName="@mantine/core/FileButton";const eE={xs:Oe(16),sm:Oe(22),md:Oe(26),lg:Oe(30),xl:Oe(36)},FY={xs:Oe(10),sm:Oe(12),md:Oe(14),lg:Oe(16),xl:Oe(18)};var BY=or((e,{disabled:t,radius:n,readOnly:r},{size:o,variant:s})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:s==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:ut({size:o,sizes:eE}),paddingLeft:`calc(${ut({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?ut({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:ut({size:o,sizes:FY}),borderRadius:ut({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${Oe(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${ut({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const HY=BY;var WY=Object.defineProperty,Bh=Object.getOwnPropertySymbols,tE=Object.prototype.hasOwnProperty,nE=Object.prototype.propertyIsEnumerable,lk=(e,t,n)=>t in e?WY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VY=(e,t)=>{for(var n in t||(t={}))tE.call(t,n)&&lk(e,n,t[n]);if(Bh)for(var n of Bh(t))nE.call(t,n)&&lk(e,n,t[n]);return e},UY=(e,t)=>{var n={};for(var r in e)tE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Bh)for(var r of Bh(e))t.indexOf(r)<0&&nE.call(e,r)&&(n[r]=e[r]);return n};const GY={xs:16,sm:22,md:24,lg:26,xl:30};function rE(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:i,disabled:l,readOnly:f,size:p,radius:h="sm",variant:m,unstyled:v}=t,x=UY(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:C,cx:b}=HY({disabled:l,readOnly:f,radius:h},{name:"MultiSelect",classNames:r,styles:o,unstyled:v,size:p,variant:m});return H.createElement("div",VY({className:b(C.defaultValue,s)},x),H.createElement("span",{className:C.defaultValueLabel},n),!l&&!f&&H.createElement($6,{"aria-hidden":!0,onMouseDown:i,size:GY[p],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:C.defaultValueRemove,tabIndex:-1,unstyled:v}))}rE.displayName="@mantine/core/MultiSelect/DefaultValue";function KY({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,disableSelectedItemFiltering:i}){if(!t&&s.length===0)return e;if(!t){const f=[];for(let p=0;p<e.length;p+=1)(i||!s.some(h=>h===e[p].value&&!e[p].disabled))&&f.push(e[p]);return f}const l=[];for(let f=0;f<e.length&&(o(r,!i&&s.some(p=>p===e[f].value&&!e[f].disabled),e[f])&&l.push(e[f]),!(l.length>=n));f+=1);return l}var qY=Object.defineProperty,Hh=Object.getOwnPropertySymbols,oE=Object.prototype.hasOwnProperty,sE=Object.prototype.propertyIsEnumerable,ck=(e,t,n)=>t in e?qY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uk=(e,t)=>{for(var n in t||(t={}))oE.call(t,n)&&ck(e,n,t[n]);if(Hh)for(var n of Hh(t))sE.call(t,n)&&ck(e,n,t[n]);return e},XY=(e,t)=>{var n={};for(var r in e)oE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hh)for(var r of Hh(e))t.indexOf(r)<0&&sE.call(e,r)&&(n[r]=e[r]);return n};const YY={xs:Oe(14),sm:Oe(18),md:Oe(20),lg:Oe(24),xl:Oe(28)};function QY(e){var t=e,{size:n,error:r,style:o}=t,s=XY(t,["size","error","style"]);const i=ca(),l=ut({size:n,sizes:YY});return H.createElement("svg",uk({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:uk({color:r?i.colors.red[6]:i.colors.gray[6],width:l,height:l},o),"data-chevron":!0},s),H.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var ZY=Object.defineProperty,JY=Object.defineProperties,eQ=Object.getOwnPropertyDescriptors,dk=Object.getOwnPropertySymbols,tQ=Object.prototype.hasOwnProperty,nQ=Object.prototype.propertyIsEnumerable,fk=(e,t,n)=>t in e?ZY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rQ=(e,t)=>{for(var n in t||(t={}))tQ.call(t,n)&&fk(e,n,t[n]);if(dk)for(var n of dk(t))nQ.call(t,n)&&fk(e,n,t[n]);return e},oQ=(e,t)=>JY(e,eQ(t));function aE({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?H.createElement($6,oQ(rQ({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):H.createElement(QY,{error:o,size:r})}aE.displayName="@mantine/core/SelectRightSection";var sQ=Object.defineProperty,aQ=Object.defineProperties,iQ=Object.getOwnPropertyDescriptors,Wh=Object.getOwnPropertySymbols,iE=Object.prototype.hasOwnProperty,lE=Object.prototype.propertyIsEnumerable,pk=(e,t,n)=>t in e?sQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wv=(e,t)=>{for(var n in t||(t={}))iE.call(t,n)&&pk(e,n,t[n]);if(Wh)for(var n of Wh(t))lE.call(t,n)&&pk(e,n,t[n]);return e},hk=(e,t)=>aQ(e,iQ(t)),lQ=(e,t)=>{var n={};for(var r in e)iE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wh)for(var r of Wh(e))t.indexOf(r)<0&&lE.call(e,r)&&(n[r]=e[r]);return n};function cE(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,i=lQ(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const l=typeof n=="function"?n(s):n;return{rightSection:!i.readOnly&&!(i.disabled&&i.shouldClear)&&H.createElement(aE,wv({},i)),styles:hk(wv({},l),{rightSection:hk(wv({},l==null?void 0:l.rightSection),{pointerEvents:i.shouldClear?void 0:"none"})})}}var cQ=Object.defineProperty,uQ=Object.defineProperties,dQ=Object.getOwnPropertyDescriptors,mk=Object.getOwnPropertySymbols,fQ=Object.prototype.hasOwnProperty,pQ=Object.prototype.propertyIsEnumerable,gk=(e,t,n)=>t in e?cQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hQ=(e,t)=>{for(var n in t||(t={}))fQ.call(t,n)&&gk(e,n,t[n]);if(mk)for(var n of mk(t))pQ.call(t,n)&&gk(e,n,t[n]);return e},mQ=(e,t)=>uQ(e,dQ(t)),gQ=or((e,{invalid:t},{size:n})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${ut({size:n,sizes:to})} - ${Oe(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:ut({size:n,sizes:to})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${Oe(2)}) calc(${e.spacing.xs} / 2)`},searchInput:mQ(hQ({},e.fn.fontStyles()),{flex:1,minWidth:Oe(60),backgroundColor:"transparent",border:0,outline:0,fontSize:ut({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:ut({size:n,sizes:eE}),"&::placeholder":{opacity:1,color:t?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}}));const vQ=gQ;var xQ=Object.defineProperty,bQ=Object.defineProperties,yQ=Object.getOwnPropertyDescriptors,Vh=Object.getOwnPropertySymbols,uE=Object.prototype.hasOwnProperty,dE=Object.prototype.propertyIsEnumerable,vk=(e,t,n)=>t in e?xQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ol=(e,t)=>{for(var n in t||(t={}))uE.call(t,n)&&vk(e,n,t[n]);if(Vh)for(var n of Vh(t))dE.call(t,n)&&vk(e,n,t[n]);return e},xk=(e,t)=>bQ(e,yQ(t)),CQ=(e,t)=>{var n={};for(var r in e)uE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vh)for(var r of Vh(e))t.indexOf(r)<0&&dE.call(e,r)&&(n[r]=e[r]);return n};function wQ(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function SQ(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function bk(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const n=t.map(r=>typeof r=="object"?r.value:r);return e.filter(r=>n.includes(r))}const kQ={size:"sm",valueComponent:rE,itemComponent:Gb,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:wQ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:SQ,switchDirectionOnFlip:!1,zIndex:Hb("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},fE=d.forwardRef((e,t)=>{const n=Sn("MultiSelect",kQ,e),{className:r,style:o,required:s,label:i,description:l,size:f,error:p,classNames:h,styles:m,wrapperProps:v,value:x,defaultValue:C,data:b,onChange:w,valueComponent:k,itemComponent:_,id:j,transitionProps:I,maxDropdownHeight:M,shadow:E,nothingFound:O,onFocus:D,onBlur:A,searchable:R,placeholder:$,filter:K,limit:B,clearSearchOnChange:U,clearable:Y,clearSearchOnBlur:W,variant:L,onSearchChange:X,searchValue:z,disabled:q,initiallyOpened:ne,radius:Q,icon:ie,rightSection:oe,rightSectionWidth:V,creatable:G,getCreateLabel:J,shouldCreate:se,onCreate:re,sx:fe,dropdownComponent:de,onDropdownClose:me,onDropdownOpen:ye,maxSelectedValues:he,withinPortal:ue,portalProps:De,switchDirectionOnFlip:je,zIndex:Be,selectOnBlur:rt,name:Ue,dropdownPosition:Ct,errorProps:Xe,labelProps:tt,descriptionProps:ve,form:Re,positionDependencies:st,onKeyDown:mt,unstyled:ge,inputContainer:Ye,inputWrapperOrder:ot,readOnly:lt,withAsterisk:Me,clearButtonProps:$e,hoverOnSearchChange:Rt,disableSelectedItemFiltering:ke}=n,ze=CQ(n,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:Le,cx:Ve,theme:ct}=vQ({invalid:!!p},{name:"MultiSelect",classNames:h,styles:m,unstyled:ge,size:f,variant:L}),{systemStyles:vn,rest:_t}=Gm(ze),jt=d.useRef(),sr=d.useRef({}),In=Vb(j),[dn,rn]=d.useState(ne),[Yt,mr]=d.useState(-1),[yo,ar]=d.useState("column"),[ir,Is]=od({value:z,defaultValue:"",finalValue:void 0,onChange:X}),[Es,pa]=d.useState(!1),{scrollIntoView:ha,targetRef:al,scrollableRef:ma}=a6({duration:0,offset:5,cancelable:!1,isList:!0}),il=G&&typeof J=="function";let qe=null;const At=b.map(Je=>typeof Je=="string"?{label:Je,value:Je}:Je),En=XP({data:At}),[vt,ga]=od({value:bk(x,b),defaultValue:bk(C,b),finalValue:[],onChange:w}),Rr=d.useRef(!!he&&he<vt.length),qd=Je=>{if(!lt){const wt=vt.filter(xt=>xt!==Je);ga(wt),he&&wt.length<he&&(Rr.current=!1)}},Og=Je=>{Is(Je.currentTarget.value),!q&&!Rr.current&&R&&rn(!0)},Dg=Je=>{typeof D=="function"&&D(Je),!q&&!Rr.current&&R&&rn(!0)},Mn=KY({data:En,searchable:R,searchValue:ir,limit:B,filter:K,value:vt,disableSelectedItemFiltering:ke});il&&se(ir,En)&&(qe=J(ir),Mn.push({label:ir,value:ir,creatable:!0}));const Ms=Math.min(Yt,Mn.length-1),Xd=(Je,wt,xt)=>{let St=Je;for(;xt(St);)if(St=wt(St),!Mn[St].disabled)return St;return Je};$o(()=>{mr(Rt&&ir?0:-1)},[ir,Rt]),$o(()=>{!q&&vt.length>b.length&&rn(!1),he&&vt.length<he&&(Rr.current=!1),he&&vt.length>=he&&(Rr.current=!0,rn(!1))},[vt]);const ll=Je=>{if(!lt)if(U&&Is(""),vt.includes(Je.value))qd(Je.value);else{if(Je.creatable&&typeof re=="function"){const wt=re(Je.value);typeof wt<"u"&&wt!==null&&ga(typeof wt=="string"?[...vt,wt]:[...vt,wt.value])}else ga([...vt,Je.value]);vt.length===he-1&&(Rr.current=!0,rn(!1)),Mn.length===1&&rn(!1)}},Yc=Je=>{typeof A=="function"&&A(Je),rt&&Mn[Ms]&&dn&&ll(Mn[Ms]),W&&Is(""),rn(!1)},ai=Je=>{if(Es||(mt==null||mt(Je),lt)||Je.key!=="Backspace"&&he&&Rr.current)return;const wt=yo==="column",xt=()=>{mr(Kn=>{var Wt;const kn=Xd(Kn,lr=>lr+1,lr=>lr<Mn.length-1);return dn&&(al.current=sr.current[(Wt=Mn[kn])==null?void 0:Wt.value],ha({alignment:wt?"end":"start"})),kn})},St=()=>{mr(Kn=>{var Wt;const kn=Xd(Kn,lr=>lr-1,lr=>lr>0);return dn&&(al.current=sr.current[(Wt=Mn[kn])==null?void 0:Wt.value],ha({alignment:wt?"start":"end"})),kn})};switch(Je.key){case"ArrowUp":{Je.preventDefault(),rn(!0),wt?St():xt();break}case"ArrowDown":{Je.preventDefault(),rn(!0),wt?xt():St();break}case"Enter":{Je.preventDefault(),Mn[Ms]&&dn?ll(Mn[Ms]):rn(!0);break}case" ":{R||(Je.preventDefault(),Mn[Ms]&&dn?ll(Mn[Ms]):rn(!0));break}case"Backspace":{vt.length>0&&ir.length===0&&(ga(vt.slice(0,-1)),rn(!0),he&&(Rr.current=!1));break}case"Home":{if(!R){Je.preventDefault(),dn||rn(!0);const Kn=Mn.findIndex(Wt=>!Wt.disabled);mr(Kn),ha({alignment:wt?"end":"start"})}break}case"End":{if(!R){Je.preventDefault(),dn||rn(!0);const Kn=Mn.map(Wt=>!!Wt.disabled).lastIndexOf(!1);mr(Kn),ha({alignment:wt?"end":"start"})}break}case"Escape":rn(!1)}},Qc=vt.map(Je=>{let wt=En.find(xt=>xt.value===Je&&!xt.disabled);return!wt&&il&&(wt={value:Je,label:Je}),wt}).filter(Je=>!!Je).map((Je,wt)=>H.createElement(k,xk(Ol({},Je),{variant:L,disabled:q,className:Le.value,readOnly:lt,onRemove:xt=>{xt.preventDefault(),xt.stopPropagation(),qd(Je.value)},key:Je.value,size:f,styles:m,classNames:h,radius:Q,index:wt}))),Zc=Je=>vt.includes(Je),Rg=()=>{var Je;Is(""),ga([]),(Je=jt.current)==null||Je.focus(),he&&(Rr.current=!1)},va=!lt&&(Mn.length>0?dn:dn&&!!O);return $o(()=>{const Je=va?ye:me;typeof Je=="function"&&Je()},[va]),H.createElement(jc.Wrapper,Ol(Ol({required:s,id:In,label:i,error:p,description:l,size:f,className:r,style:o,classNames:h,styles:m,__staticSelector:"MultiSelect",sx:fe,errorProps:Xe,descriptionProps:ve,labelProps:tt,inputContainer:Ye,inputWrapperOrder:ot,unstyled:ge,withAsterisk:Me,variant:L},vn),v),H.createElement(Ba,{opened:va,transitionProps:I,shadow:"sm",withinPortal:ue,portalProps:De,__staticSelector:"MultiSelect",onDirectionChange:ar,switchDirectionOnFlip:je,zIndex:Be,dropdownPosition:Ct,positionDependencies:[...st,ir],classNames:h,styles:m,unstyled:ge,variant:L},H.createElement(Ba.Target,null,H.createElement("div",{className:Le.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":dn&&va?`${In}-items`:null,"aria-controls":In,"aria-expanded":dn,onMouseLeave:()=>mr(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:Ue,value:vt.join(","),form:Re,disabled:q}),H.createElement(jc,Ol({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:f,variant:L,disabled:q,error:p,required:s,radius:Q,icon:ie,unstyled:ge,onMouseDown:Je=>{var wt;Je.preventDefault(),!q&&!Rr.current&&rn(!dn),(wt=jt.current)==null||wt.focus()},classNames:xk(Ol({},h),{input:Ve({[Le.input]:!R},h==null?void 0:h.input)})},cE({theme:ct,rightSection:oe,rightSectionWidth:V,styles:m,size:f,shouldClear:Y&&vt.length>0,onClear:Rg,error:p,disabled:q,clearButtonProps:$e,readOnly:lt})),H.createElement("div",{className:Le.values,"data-clearable":Y||void 0},Qc,H.createElement("input",Ol({ref:Ld(t,jt),type:"search",id:In,className:Ve(Le.searchInput,{[Le.searchInputPointer]:!R,[Le.searchInputInputHidden]:!dn&&vt.length>0||!R&&vt.length>0,[Le.searchInputEmpty]:vt.length===0}),onKeyDown:ai,value:ir,onChange:Og,onFocus:Dg,onBlur:Yc,readOnly:!R||Rr.current||lt,placeholder:vt.length===0?$:void 0,disabled:q,"data-mantine-stop-propagation":dn,autoComplete:"off",onCompositionStart:()=>pa(!0),onCompositionEnd:()=>pa(!1)},_t)))))),H.createElement(Ba.Dropdown,{component:de||Ym,maxHeight:M,direction:yo,id:In,innerRef:ma,__staticSelector:"MultiSelect",classNames:h,styles:m},H.createElement(Ub,{data:Mn,hovered:Ms,classNames:h,styles:m,uuid:In,__staticSelector:"MultiSelect",onItemHover:mr,onItemSelect:ll,itemsRefs:sr,itemComponent:_,size:f,nothingFound:O,isItemSelected:Zc,creatable:G&&!!qe,createLabel:qe,unstyled:ge,variant:L}))))});fE.displayName="@mantine/core/MultiSelect";var _Q=Object.defineProperty,jQ=Object.defineProperties,PQ=Object.getOwnPropertyDescriptors,Uh=Object.getOwnPropertySymbols,pE=Object.prototype.hasOwnProperty,hE=Object.prototype.propertyIsEnumerable,yk=(e,t,n)=>t in e?_Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sv=(e,t)=>{for(var n in t||(t={}))pE.call(t,n)&&yk(e,n,t[n]);if(Uh)for(var n of Uh(t))hE.call(t,n)&&yk(e,n,t[n]);return e},IQ=(e,t)=>jQ(e,PQ(t)),EQ=(e,t)=>{var n={};for(var r in e)pE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Uh)for(var r of Uh(e))t.indexOf(r)<0&&hE.call(e,r)&&(n[r]=e[r]);return n};const MQ={type:"text",size:"sm",__staticSelector:"TextInput"},mE=d.forwardRef((e,t)=>{const n=NI("TextInput",MQ,e),{inputProps:r,wrapperProps:o}=n,s=EQ(n,["inputProps","wrapperProps"]);return H.createElement(jc.Wrapper,Sv({},o),H.createElement(jc,IQ(Sv(Sv({},r),s),{ref:t})))});mE.displayName="@mantine/core/TextInput";function OQ({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:i}){if(!t)return e;const l=s!=null&&e.find(p=>p.value===s)||null;if(l&&!i&&(l==null?void 0:l.label)===r){if(n){if(n>=e.length)return e;const p=e.indexOf(l),h=p+n,m=h-e.length;return m>0?e.slice(p-m):e.slice(p,h)}return e}const f=[];for(let p=0;p<e.length&&(o(r,e[p])&&f.push(e[p]),!(f.length>=n));p+=1);return f}var DQ=or(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const RQ=DQ;var AQ=Object.defineProperty,NQ=Object.defineProperties,TQ=Object.getOwnPropertyDescriptors,Gh=Object.getOwnPropertySymbols,gE=Object.prototype.hasOwnProperty,vE=Object.prototype.propertyIsEnumerable,Ck=(e,t,n)=>t in e?AQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ku=(e,t)=>{for(var n in t||(t={}))gE.call(t,n)&&Ck(e,n,t[n]);if(Gh)for(var n of Gh(t))vE.call(t,n)&&Ck(e,n,t[n]);return e},kv=(e,t)=>NQ(e,TQ(t)),$Q=(e,t)=>{var n={};for(var r in e)gE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gh)for(var r of Gh(e))t.indexOf(r)<0&&vE.call(e,r)&&(n[r]=e[r]);return n};function LQ(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function zQ(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const FQ={required:!1,size:"sm",shadow:"sm",itemComponent:Gb,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:LQ,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:zQ,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:Hb("popover"),positionDependencies:[],dropdownPosition:"flip"},ny=d.forwardRef((e,t)=>{const n=NI("Select",FQ,e),{inputProps:r,wrapperProps:o,shadow:s,data:i,value:l,defaultValue:f,onChange:p,itemComponent:h,onKeyDown:m,onBlur:v,onFocus:x,transitionProps:C,initiallyOpened:b,unstyled:w,classNames:k,styles:_,filter:j,maxDropdownHeight:I,searchable:M,clearable:E,nothingFound:O,limit:D,disabled:A,onSearchChange:R,searchValue:$,rightSection:K,rightSectionWidth:B,creatable:U,getCreateLabel:Y,shouldCreate:W,selectOnBlur:L,onCreate:X,dropdownComponent:z,onDropdownClose:q,onDropdownOpen:ne,withinPortal:Q,portalProps:ie,switchDirectionOnFlip:oe,zIndex:V,name:G,dropdownPosition:J,allowDeselect:se,placeholder:re,filterDataOnExactSearchMatch:fe,form:de,positionDependencies:me,readOnly:ye,clearButtonProps:he,hoverOnSearchChange:ue}=n,De=$Q(n,["inputProps","wrapperProps","shadow","data","value","defaultValue","onChange","itemComponent","onKeyDown","onBlur","onFocus","transitionProps","initiallyOpened","unstyled","classNames","styles","filter","maxDropdownHeight","searchable","clearable","nothingFound","limit","disabled","onSearchChange","searchValue","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","selectOnBlur","onCreate","dropdownComponent","onDropdownClose","onDropdownOpen","withinPortal","portalProps","switchDirectionOnFlip","zIndex","name","dropdownPosition","allowDeselect","placeholder","filterDataOnExactSearchMatch","form","positionDependencies","readOnly","clearButtonProps","hoverOnSearchChange"]),{classes:je,cx:Be,theme:rt}=RQ(),[Ue,Ct]=d.useState(b),[Xe,tt]=d.useState(-1),ve=d.useRef(),Re=d.useRef({}),[st,mt]=d.useState("column"),ge=st==="column",{scrollIntoView:Ye,targetRef:ot,scrollableRef:lt}=a6({duration:0,offset:5,cancelable:!1,isList:!0}),Me=se===void 0?E:se,$e=qe=>{if(Ue!==qe){Ct(qe);const At=qe?ne:q;typeof At=="function"&&At()}},Rt=U&&typeof Y=="function";let ke=null;const ze=i.map(qe=>typeof qe=="string"?{label:qe,value:qe}:qe),Le=XP({data:ze}),[Ve,ct,vn]=od({value:l,defaultValue:f,finalValue:null,onChange:p}),_t=Le.find(qe=>qe.value===Ve),[jt,sr]=od({value:$,defaultValue:(_t==null?void 0:_t.label)||"",finalValue:void 0,onChange:R}),In=qe=>{sr(qe),M&&typeof R=="function"&&R(qe)},dn=()=>{var qe;ye||(ct(null),vn||In(""),(qe=ve.current)==null||qe.focus())};d.useEffect(()=>{const qe=Le.find(At=>At.value===Ve);qe?In(qe.label):(!Rt||!Ve)&&In("")},[Ve]),d.useEffect(()=>{_t&&(!M||!Ue)&&In(_t.label)},[_t==null?void 0:_t.label]);const rn=qe=>{if(!ye)if(Me&&(_t==null?void 0:_t.value)===qe.value)ct(null),$e(!1);else{if(qe.creatable&&typeof X=="function"){const At=X(qe.value);typeof At<"u"&&At!==null&&ct(typeof At=="string"?At:At.value)}else ct(qe.value);vn||In(qe.label),tt(-1),$e(!1),ve.current.focus()}},Yt=OQ({data:Le,searchable:M,limit:D,searchValue:jt,filter:j,filterDataOnExactSearchMatch:fe,value:Ve});Rt&&W(jt,Yt)&&(ke=Y(jt),Yt.push({label:jt,value:jt,creatable:!0}));const mr=(qe,At,En)=>{let vt=qe;for(;En(vt);)if(vt=At(vt),!Yt[vt].disabled)return vt;return qe};$o(()=>{tt(ue&&jt?0:-1)},[jt,ue]);const yo=Ve?Yt.findIndex(qe=>qe.value===Ve):0,ar=!ye&&(Yt.length>0?Ue:Ue&&!!O),ir=()=>{tt(qe=>{var At;const En=mr(qe,vt=>vt-1,vt=>vt>0);return ot.current=Re.current[(At=Yt[En])==null?void 0:At.value],ar&&Ye({alignment:ge?"start":"end"}),En})},Is=()=>{tt(qe=>{var At;const En=mr(qe,vt=>vt+1,vt=>vt<Yt.length-1);return ot.current=Re.current[(At=Yt[En])==null?void 0:At.value],ar&&Ye({alignment:ge?"end":"start"}),En})},Es=()=>window.setTimeout(()=>{var qe;ot.current=Re.current[(qe=Yt[yo])==null?void 0:qe.value],Ye({alignment:ge?"end":"start"})},50);$o(()=>{ar&&Es()},[ar]);const pa=qe=>{switch(typeof m=="function"&&m(qe),qe.key){case"ArrowUp":{qe.preventDefault(),Ue?ge?ir():Is():(tt(yo),$e(!0),Es());break}case"ArrowDown":{qe.preventDefault(),Ue?ge?Is():ir():(tt(yo),$e(!0),Es());break}case"Home":{if(!M){qe.preventDefault(),Ue||$e(!0);const At=Yt.findIndex(En=>!En.disabled);tt(At),ar&&Ye({alignment:ge?"end":"start"})}break}case"End":{if(!M){qe.preventDefault(),Ue||$e(!0);const At=Yt.map(En=>!!En.disabled).lastIndexOf(!1);tt(At),ar&&Ye({alignment:ge?"end":"start"})}break}case"Escape":{qe.preventDefault(),$e(!1),tt(-1);break}case" ":{M||(qe.preventDefault(),Yt[Xe]&&Ue?rn(Yt[Xe]):($e(!0),tt(yo),Es()));break}case"Enter":M||qe.preventDefault(),Yt[Xe]&&Ue&&(qe.preventDefault(),rn(Yt[Xe]))}},ha=qe=>{typeof v=="function"&&v(qe);const At=Le.find(En=>En.value===Ve);L&&Yt[Xe]&&Ue&&rn(Yt[Xe]),In((At==null?void 0:At.label)||""),$e(!1)},al=qe=>{typeof x=="function"&&x(qe),M&&$e(!0)},ma=qe=>{ye||(In(qe.currentTarget.value),E&&qe.currentTarget.value===""&&ct(null),tt(-1),$e(!0))},il=()=>{ye||($e(!Ue),Ve&&!Ue&&tt(yo))};return H.createElement(jc.Wrapper,kv(ku({},o),{__staticSelector:"Select"}),H.createElement(Ba,{opened:ar,transitionProps:C,shadow:s,withinPortal:Q,portalProps:ie,__staticSelector:"Select",onDirectionChange:mt,switchDirectionOnFlip:oe,zIndex:V,dropdownPosition:J,positionDependencies:[...me,jt],classNames:k,styles:_,unstyled:w,variant:r.variant},H.createElement(Ba.Target,null,H.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":ar?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":ar,onMouseLeave:()=>tt(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:G,value:Ve||"",form:de,disabled:A}),H.createElement(jc,ku(kv(ku(ku({autoComplete:"off",type:"search"},r),De),{ref:Ld(t,ve),onKeyDown:pa,__staticSelector:"Select",value:jt,placeholder:re,onChange:ma,"aria-autocomplete":"list","aria-controls":ar?`${r.id}-items`:null,"aria-activedescendant":Xe>=0?`${r.id}-${Xe}`:null,onMouseDown:il,onBlur:ha,onFocus:al,readOnly:!M||ye,disabled:A,"data-mantine-stop-propagation":ar,name:null,classNames:kv(ku({},k),{input:Be({[je.input]:!M},k==null?void 0:k.input)})}),cE({theme:rt,rightSection:K,rightSectionWidth:B,styles:_,size:r.size,shouldClear:E&&!!_t,onClear:dn,error:o.error,clearButtonProps:he,disabled:A,readOnly:ye}))))),H.createElement(Ba.Dropdown,{component:z||Ym,maxHeight:I,direction:st,id:r.id,innerRef:lt,__staticSelector:"Select",classNames:k,styles:_},H.createElement(Ub,{data:Yt,hovered:Xe,classNames:k,styles:_,isItemSelected:qe=>qe===Ve,uuid:r.id,__staticSelector:"Select",onItemHover:tt,onItemSelect:rn,itemsRefs:Re,itemComponent:h,size:r.size,nothingFound:O,creatable:Rt&&!!ke,createLabel:ke,"aria-label":o.label,unstyled:w,variant:r.variant}))))});ny.displayName="@mantine/core/Select";const Bd=()=>{const[e,t,n,r,o,s,i,l,f,p,h,m,v,x,C,b,w,k,_,j,I,M,E,O,D,A,R,$,K,B,U,Y,W,L,X,z,q,ne,Q,ie,oe,V,G,J,se,re,fe,de,me,ye,he,ue,De,je,Be,rt,Ue,Ct,Xe,tt,ve,Re,st,mt,ge,Ye,ot,lt,Me,$e,Rt,ke,ze,Le,Ve,ct]=ds("colors",["base.50","base.100","base.150","base.200","base.250","base.300","base.350","base.400","base.450","base.500","base.550","base.600","base.650","base.700","base.750","base.800","base.850","base.900","base.950","accent.50","accent.100","accent.150","accent.200","accent.250","accent.300","accent.350","accent.400","accent.450","accent.500","accent.550","accent.600","accent.650","accent.700","accent.750","accent.800","accent.850","accent.900","accent.950","baseAlpha.50","baseAlpha.100","baseAlpha.150","baseAlpha.200","baseAlpha.250","baseAlpha.300","baseAlpha.350","baseAlpha.400","baseAlpha.450","baseAlpha.500","baseAlpha.550","baseAlpha.600","baseAlpha.650","baseAlpha.700","baseAlpha.750","baseAlpha.800","baseAlpha.850","baseAlpha.900","baseAlpha.950","accentAlpha.50","accentAlpha.100","accentAlpha.150","accentAlpha.200","accentAlpha.250","accentAlpha.300","accentAlpha.350","accentAlpha.400","accentAlpha.450","accentAlpha.500","accentAlpha.550","accentAlpha.600","accentAlpha.650","accentAlpha.700","accentAlpha.750","accentAlpha.800","accentAlpha.850","accentAlpha.900","accentAlpha.950"]);return{base50:e,base100:t,base150:n,base200:r,base250:o,base300:s,base350:i,base400:l,base450:f,base500:p,base550:h,base600:m,base650:v,base700:x,base750:C,base800:b,base850:w,base900:k,base950:_,accent50:j,accent100:I,accent150:M,accent200:E,accent250:O,accent300:D,accent350:A,accent400:R,accent450:$,accent500:K,accent550:B,accent600:U,accent650:Y,accent700:W,accent750:L,accent800:X,accent850:z,accent900:q,accent950:ne,baseAlpha50:Q,baseAlpha100:ie,baseAlpha150:oe,baseAlpha200:V,baseAlpha250:G,baseAlpha300:J,baseAlpha350:se,baseAlpha400:re,baseAlpha450:fe,baseAlpha500:de,baseAlpha550:me,baseAlpha600:ye,baseAlpha650:he,baseAlpha700:ue,baseAlpha750:De,baseAlpha800:je,baseAlpha850:Be,baseAlpha900:rt,baseAlpha950:Ue,accentAlpha50:Ct,accentAlpha100:Xe,accentAlpha150:tt,accentAlpha200:ve,accentAlpha250:Re,accentAlpha300:st,accentAlpha350:mt,accentAlpha400:ge,accentAlpha450:Ye,accentAlpha500:ot,accentAlpha550:lt,accentAlpha600:Me,accentAlpha650:$e,accentAlpha700:Rt,accentAlpha750:ke,accentAlpha800:ze,accentAlpha850:Le,accentAlpha900:Ve,accentAlpha950:ct}},Ae=(e,t)=>n=>n==="light"?e:t,xE=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:l,base800:f,base900:p,accent200:h,accent300:m,accent400:v,accent500:x,accent600:C}=Bd(),{colorMode:b}=ia(),[w]=ds("shadows",["dark-lg"]),[k,_,j]=ds("space",[1,2,6]),[I]=ds("radii",["base"]),[M]=ds("lineHeights",["base"]);return d.useCallback(()=>({label:{color:Ae(l,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,l)(b)}},input:{border:"unset",backgroundColor:Ae(e,p)(b),borderRadius:I,borderStyle:"solid",borderWidth:"2px",borderColor:Ae(n,f)(b),color:Ae(p,t)(b),minHeight:"unset",lineHeight:M,height:"auto",paddingRight:0,paddingLeft:0,paddingInlineStart:_,paddingInlineEnd:j,paddingTop:k,paddingBottom:k,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(b)},"&:focus":{borderColor:Ae(m,C)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(h,C)(b)},"&[data-disabled]":{backgroundColor:Ae(r,l)(b),color:Ae(i,o)(b),cursor:"not-allowed"}},value:{backgroundColor:Ae(t,p)(b),color:Ae(p,t)(b),button:{color:Ae(p,t)(b)},"&:hover":{backgroundColor:Ae(r,l)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,f)(b),borderColor:Ae(n,f)(b),boxShadow:w},item:{backgroundColor:Ae(n,f)(b),color:Ae(f,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)},"&[data-active]":{backgroundColor:Ae(r,l)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)}},"&[data-selected]":{backgroundColor:Ae(v,C)(b),color:Ae(e,t)(b),fontWeight:600,"&:hover":{backgroundColor:Ae(x,x)(b),color:Ae("white",e)(b)}},"&[data-disabled]":{color:Ae(s,i)(b),cursor:"not-allowed"}},rightSection:{width:32,button:{color:Ae(p,t)(b)}}}),[h,m,v,x,C,t,n,r,o,e,s,i,l,f,p,w,b,M,I,k,_,j])},BQ=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,onChange:o,label:s,disabled:i,...l}=e,f=te(),[p,h]=d.useState(""),m=d.useCallback(b=>{b.shiftKey&&f(Ir(!0))},[f]),v=d.useCallback(b=>{b.shiftKey||f(Ir(!1))},[f]),x=d.useCallback(b=>{o&&o(b)},[o]),C=xE();return a.jsx(Dt,{label:n,placement:"top",hasArrow:!0,children:a.jsx(ny,{ref:r,label:s?a.jsx(un,{isDisabled:i,children:a.jsx(Gn,{children:s})}):void 0,disabled:i,searchValue:p,onSearchChange:h,onChange:x,onKeyDown:m,onKeyUp:v,searchable:t,maxDropdownHeight:300,styles:C,...l})})},Gt=d.memo(BQ),HQ=ae([xe],({changeBoardModal:e})=>{const{isModalOpen:t,imagesToChange:n}=e;return{isModalOpen:t,imagesToChange:n}},Ce),WQ=()=>{const e=te(),[t,n]=d.useState(),{data:r,isFetching:o}=um(),{imagesToChange:s,isModalOpen:i}=F(HQ),[l]=B7(),[f]=H7(),p=d.useMemo(()=>{const x=[{label:"Uncategorized",value:"none"}];return(r??[]).forEach(C=>x.push({label:C.board_name,value:C.board_id})),x},[r]),h=d.useCallback(()=>{e(NC()),e(Tx(!1))},[e]),m=d.useCallback(()=>{!s.length||!t||(t==="none"?f({imageDTOs:s}):l({imageDTOs:s,board_id:t}),n(null),e(NC()))},[l,e,s,f,t]),v=d.useRef(null);return a.jsx(Ad,{isOpen:i,onClose:h,leastDestructiveRef:v,isCentered:!0,children:a.jsx(Wo,{children:a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:"Change Board"}),a.jsx(Vo,{children:a.jsxs(T,{sx:{flexDir:"column",gap:4},children:[a.jsxs(be,{children:["Moving ",`${s.length}`," image",`${s.length>1?"s":""}`," to board:"]}),a.jsx(Gt,{placeholder:o?"Loading...":"Select Board",disabled:o,onChange:x=>n(x),value:t,data:p})]})}),a.jsxs(gs,{children:[a.jsx(it,{ref:v,onClick:h,children:"Cancel"}),a.jsx(it,{colorScheme:"accent",onClick:m,ml:3,children:"Move"})]})]})})})},VQ=d.memo(WQ),UQ=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:i,helperText:l,...f}=e;return a.jsx(Dt,{label:i,hasArrow:!0,placement:"top",isDisabled:!i,children:a.jsx(un,{isDisabled:n,width:r,alignItems:"center",...o,children:a.jsxs(T,{sx:{flexDir:"column",w:"full"},children:[a.jsxs(T,{sx:{alignItems:"center",w:"full"},children:[t&&a.jsx(Gn,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx,pe:4},...s,children:t}),a.jsx(Lb,{...f})]}),l&&a.jsx(M3,{children:a.jsx(be,{variant:"subtext",children:l})})]})})})},Ut=d.memo(UQ),GQ=e=>{const{imageUsage:t,topMessage:n="This image is currently in use in the following features:",bottomMessage:r="If you delete this image, those features will immediately be reset."}=e;return!t||!Ro(t)?null:a.jsxs(a.Fragment,{children:[a.jsx(be,{children:n}),a.jsxs(Id,{sx:{paddingInlineStart:6},children:[t.isInitialImage&&a.jsx(No,{children:"Image to Image"}),t.isCanvasImage&&a.jsx(No,{children:"Unified Canvas"}),t.isControlNetImage&&a.jsx(No,{children:"ControlNet"}),t.isNodesImage&&a.jsx(No,{children:"Node Editor"})]}),a.jsx(be,{children:r})]})},bE=d.memo(GQ),KQ=ae([xe,W7],(e,t)=>{const{system:n,config:r,deleteImageModal:o}=e,{shouldConfirmOnDelete:s}=n,{canRestoreDeletedImagesFromBin:i}=r,{imagesToDelete:l,isModalOpen:f}=o,p=(l??[]).map(({image_name:m})=>Mj(e,m)),h={isInitialImage:Ro(p,m=>m.isInitialImage),isCanvasImage:Ro(p,m=>m.isCanvasImage),isNodesImage:Ro(p,m=>m.isNodesImage),isControlNetImage:Ro(p,m=>m.isControlNetImage)};return{shouldConfirmOnDelete:s,canRestoreDeletedImagesFromBin:i,imagesToDelete:l,imagesUsage:t,isModalOpen:f,imageUsageSummary:h}},Ce),qQ=()=>{const e=te(),{t}=we(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imagesToDelete:o,imagesUsage:s,isModalOpen:i,imageUsageSummary:l}=F(KQ),f=d.useCallback(v=>e(Oj(!v.target.checked)),[e]),p=d.useCallback(()=>{e(TC()),e(V7(!1))},[e]),h=d.useCallback(()=>{!o.length||!s.length||(e(TC()),e(U7({imageDTOs:o,imagesUsage:s})))},[e,o,s]),m=d.useRef(null);return a.jsx(Ad,{isOpen:i,onClose:p,leastDestructiveRef:m,isCentered:!0,children:a.jsx(Wo,{children:a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),a.jsx(Vo,{children:a.jsxs(T,{direction:"column",gap:3,children:[a.jsx(bE,{imageUsage:l}),a.jsx(Fr,{}),a.jsx(be,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),a.jsx(be,{children:t("common.areYouSure")}),a.jsx(Ut,{label:t("common.dontAskMeAgain"),isChecked:!n,onChange:f})]})}),a.jsxs(gs,{children:[a.jsx(it,{ref:m,onClick:p,children:"Cancel"}),a.jsx(it,{colorScheme:"error",onClick:h,ml:3,children:"Delete"})]})]})})})},XQ=d.memo(qQ),yE=Pe((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...i}=e;return a.jsx(Dt,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:a.jsx(ps,{ref:t,role:n,colorScheme:s?"accent":"base",...i})})});yE.displayName="IAIIconButton";const Te=d.memo(yE);var CE={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},wk=H.createContext&&H.createContext(CE),Ha=globalThis&&globalThis.__assign||function(){return Ha=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Ha.apply(this,arguments)},YQ=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function wE(e){return e&&e.map(function(t,n){return H.createElement(t.tag,Ha({key:n},t.attr),wE(t.child))})}function Ne(e){return function(t){return H.createElement(QQ,Ha({attr:Ha({},e.attr)},t),wE(e.child))}}function QQ(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,i=YQ(e,["attr","size","title"]),l=o||n.size||"1em",f;return n.className&&(f=n.className),e.className&&(f=(f?f+" ":"")+e.className),H.createElement("svg",Ha({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,i,{className:f,style:Ha(Ha({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&H.createElement("title",null,s),e.children)};return wk!==void 0?H.createElement(wk.Consumer,null,function(n){return t(n)}):t(CE)}function ZQ(e){return Ne({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 JQ(e){return Ne({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 eZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 448 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 34zm192-34l-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.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"}}]})(e)}function tZ(e){return Ne({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 nZ(e){return Ne({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 rZ(e){return Ne({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 oZ(e){return Ne({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 sZ(e){return Ne({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 SE(e){return Ne({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 aZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"}}]})(e)}function iZ(e){return Ne({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 kE(e){return Ne({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 lZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"}}]})(e)}function _E(e){return Ne({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 jE(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"}}]})(e)}function Hc(e){return Ne({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 cZ(e){return Ne({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 uZ(e){return Ne({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 Jm(e){return Ne({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 dZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"}}]})(e)}function fZ(e){return Ne({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 pZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"}}]})(e)}function hZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 192 512"},child:[{tag:"path",attr:{d:"M176 432c0 44.112-35.888 80-80 80s-80-35.888-80-80 35.888-80 80-80 80 35.888 80 80zM25.26 25.199l13.6 272C39.499 309.972 50.041 320 62.83 320h66.34c12.789 0 23.331-10.028 23.97-22.801l13.6-272C167.425 11.49 156.496 0 142.77 0H49.23C35.504 0 24.575 11.49 25.26 25.199z"}}]})(e)}function mZ(e){return Ne({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 gZ(e){return Ne({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 PE(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M432,320H400a16,16,0,0,0-16,16V448H64V128H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V336A16,16,0,0,0,432,320ZM488,0h-128c-21.37,0-32.05,25.91-17,41l35.73,35.73L135,320.37a24,24,0,0,0,0,34L157.67,377a24,24,0,0,0,34,0L435.28,133.32,471,169c15,15,41,4.5,41-17V24A24,24,0,0,0,488,0Z"}}]})(e)}function vZ(e){return Ne({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 xZ(e){return Ne({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 bZ(e){return Ne({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 yZ(e){return Ne({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 IE(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"}}]})(e)}function CZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"}}]})(e)}function wZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M360 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24 0 90.965 51.016 167.734 120.842 192C75.016 280.266 24 357.035 24 448c-13.255 0-24 10.745-24 24v16c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24 0-90.965-51.016-167.734-120.842-192C308.984 231.734 360 154.965 360 64c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24zm-75.078 384H99.08c17.059-46.797 52.096-80 92.92-80 40.821 0 75.862 33.196 92.922 80zm.019-256H99.078C91.988 108.548 88 86.748 88 64h208c0 22.805-3.987 44.587-11.059 64z"}}]})(e)}function Wi(e){return Ne({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 SZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M480 416v16c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v208c0 44.112 35.888 80 80 80h336zm96-80V80c0-26.51-21.49-48-48-48H144c-26.51 0-48 21.49-48 48v256c0 26.51 21.49 48 48 48h384c26.51 0 48-21.49 48-48zM256 128c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-96 144l55.515-55.515c4.686-4.686 12.284-4.686 16.971 0L272 256l135.515-135.515c4.686-4.686 12.284-4.686 16.971 0L512 208v112H160v-48z"}}]})(e)}function EE(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"}}]})(e)}function kZ(e){return Ne({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 _Z(e){return Ne({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 ME(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"}}]})(e)}function OE(e){return Ne({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"}}]})(e)}function jZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"}}]})(e)}function DE(e){return Ne({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 PZ(e){return Ne({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 IZ(e){return Ne({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 Sk(e){return Ne({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 tl(e){return Ne({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 RE(e){return Ne({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 EZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504.971 359.029c9.373 9.373 9.373 24.569 0 33.941l-80 79.984c-15.01 15.01-40.971 4.49-40.971-16.971V416h-58.785a12.004 12.004 0 0 1-8.773-3.812l-70.556-75.596 53.333-57.143L352 336h32v-39.981c0-21.438 25.943-31.998 40.971-16.971l80 79.981zM12 176h84l52.781 56.551 53.333-57.143-70.556-75.596A11.999 11.999 0 0 0 122.785 96H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12zm372 0v39.984c0 21.46 25.961 31.98 40.971 16.971l80-79.984c9.373-9.373 9.373-24.569 0-33.941l-80-79.981C409.943 24.021 384 34.582 384 56.019V96h-58.785a12.004 12.004 0 0 0-8.773 3.812L96 336H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h110.785c3.326 0 6.503-1.381 8.773-3.812L352 176h32z"}}]})(e)}function MZ(e){return Ne({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 OZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M168 416c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88v-64h-88c-4.42 0-8-3.58-8-8v-16c0-4.42 3.58-8 8-8h88V32c0-17.67-14.33-32-32-32H32C14.33 0 0 14.33 0 32v448c0 17.67 14.33 32 32 32h192c17.67 0 32-14.33 32-32v-64h-88z"}}]})(e)}function eg(e){return Ne({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 DZ(e){return Ne({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 AE(e){return Ne({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 RZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 160H32c-17.673 0-32-14.327-32-32V64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z"}}]})(e)}function AZ(e){return Ne({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 kk(e){return Ne({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 NE(e){return Ne({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 NZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z"}}]})(e)}function TE(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M440.65 12.57l4 82.77A247.16 247.16 0 0 0 255.83 8C134.73 8 33.91 94.92 12.29 209.82A12 12 0 0 0 24.09 224h49.05a12 12 0 0 0 11.67-9.26 175.91 175.91 0 0 1 317-56.94l-101.46-4.86a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12H500a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12h-47.37a12 12 0 0 0-11.98 12.57zM255.83 432a175.61 175.61 0 0 1-146-77.8l101.8 4.87a12 12 0 0 0 12.57-12v-47.4a12 12 0 0 0-12-12H12a12 12 0 0 0-12 12V500a12 12 0 0 0 12 12h47.35a12 12 0 0 0 12-12.6l-4.15-82.57A247.17 247.17 0 0 0 255.83 504c121.11 0 221.93-86.92 243.55-201.82a12 12 0 0 0-11.8-14.18h-49.05a12 12 0 0 0-11.67 9.26A175.86 175.86 0 0 1 255.83 432z"}}]})(e)}function TZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"}}]})(e)}function Wr(e){return Ne({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 tg(e){return Ne({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 ng(e){return Ne({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 $Z(e){return Ne({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 $E(e){return Ne({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 qt=e=>{const t=F(i=>i.config.disabledTabs),n=F(i=>i.config.disabledFeatures),r=F(i=>i.config.disabledSDFeatures),o=d.useMemo(()=>n.includes(e)||r.includes(e)||t.includes(e),[n,r,t,e]),s=d.useMemo(()=>!(n.includes(e)||r.includes(e)||t.includes(e)),[n,r,t,e]);return{isFeatureDisabled:o,isFeatureEnabled:s}};function LZ(e){const{title:t,hotkey:n,description:r}=e;return a.jsxs(Ua,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs(Ua,{children:[a.jsx(be,{fontWeight:600,children:t}),r&&a.jsx(be,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),a.jsx(Ie,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function zZ({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Er(),{t:o}=we(),s=[{title:o("hotkeys.invoke.title"),desc:o("hotkeys.invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys.cancel.title"),desc:o("hotkeys.cancel.desc"),hotkey:"Shift+X"},{title:o("hotkeys.focusPrompt.title"),desc:o("hotkeys.focusPrompt.desc"),hotkey:"Alt+A"},{title:o("hotkeys.toggleOptions.title"),desc:o("hotkeys.toggleOptions.desc"),hotkey:"O"},{title:o("hotkeys.toggleGallery.title"),desc:o("hotkeys.toggleGallery.desc"),hotkey:"G"},{title:o("hotkeys.maximizeWorkSpace.title"),desc:o("hotkeys.maximizeWorkSpace.desc"),hotkey:"F"},{title:o("hotkeys.changeTabs.title"),desc:o("hotkeys.changeTabs.desc"),hotkey:"1-5"}],i=[{title:o("hotkeys.setPrompt.title"),desc:o("hotkeys.setPrompt.desc"),hotkey:"P"},{title:o("hotkeys.setSeed.title"),desc:o("hotkeys.setSeed.desc"),hotkey:"S"},{title:o("hotkeys.setParameters.title"),desc:o("hotkeys.setParameters.desc"),hotkey:"A"},{title:o("hotkeys.upscale.title"),desc:o("hotkeys.upscale.desc"),hotkey:"Shift+U"},{title:o("hotkeys.showInfo.title"),desc:o("hotkeys.showInfo.desc"),hotkey:"I"},{title:o("hotkeys.sendToImageToImage.title"),desc:o("hotkeys.sendToImageToImage.desc"),hotkey:"Shift+I"},{title:o("hotkeys.deleteImage.title"),desc:o("hotkeys.deleteImage.desc"),hotkey:"Del"},{title:o("hotkeys.closePanels.title"),desc:o("hotkeys.closePanels.desc"),hotkey:"Esc"}],l=[{title:o("hotkeys.previousImage.title"),desc:o("hotkeys.previousImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextImage.title"),desc:o("hotkeys.nextImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.increaseGalleryThumbSize.title"),desc:o("hotkeys.increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:o("hotkeys.decreaseGalleryThumbSize.title"),desc:o("hotkeys.decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],f=[{title:o("hotkeys.selectBrush.title"),desc:o("hotkeys.selectBrush.desc"),hotkey:"B"},{title:o("hotkeys.selectEraser.title"),desc:o("hotkeys.selectEraser.desc"),hotkey:"E"},{title:o("hotkeys.decreaseBrushSize.title"),desc:o("hotkeys.decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys.increaseBrushSize.title"),desc:o("hotkeys.increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys.decreaseBrushOpacity.title"),desc:o("hotkeys.decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys.increaseBrushOpacity.title"),desc:o("hotkeys.increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys.moveTool.title"),desc:o("hotkeys.moveTool.desc"),hotkey:"V"},{title:o("hotkeys.fillBoundingBox.title"),desc:o("hotkeys.fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys.eraseBoundingBox.title"),desc:o("hotkeys.eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys.colorPicker.title"),desc:o("hotkeys.colorPicker.desc"),hotkey:"C"},{title:o("hotkeys.toggleSnap.title"),desc:o("hotkeys.toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys.quickToggleMove.title"),desc:o("hotkeys.quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys.toggleLayer.title"),desc:o("hotkeys.toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys.clearMask.title"),desc:o("hotkeys.clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys.hideMask.title"),desc:o("hotkeys.hideMask.desc"),hotkey:"H"},{title:o("hotkeys.showHideBoundingBox.title"),desc:o("hotkeys.showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys.mergeVisible.title"),desc:o("hotkeys.mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys.saveToGallery.title"),desc:o("hotkeys.saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys.copyToClipboard.title"),desc:o("hotkeys.copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys.downloadImage.title"),desc:o("hotkeys.downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys.undoStroke.title"),desc:o("hotkeys.undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys.redoStroke.title"),desc:o("hotkeys.redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys.resetView.title"),desc:o("hotkeys.resetView.desc"),hotkey:"R"},{title:o("hotkeys.previousStagingImage.title"),desc:o("hotkeys.previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextStagingImage.title"),desc:o("hotkeys.nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.acceptStagingImage.title"),desc:o("hotkeys.acceptStagingImage.desc"),hotkey:"Enter"}],p=[{title:o("hotkeys.addNodes.title"),desc:o("hotkeys.addNodes.desc"),hotkey:"Shift + A / Space"}],h=m=>a.jsx(T,{flexDir:"column",gap:4,children:m.map((v,x)=>a.jsxs(T,{flexDir:"column",px:2,gap:4,children:[a.jsx(LZ,{title:v.title,description:v.desc,hotkey:v.hotkey}),x<m.length-1&&a.jsx(Fr,{})]},x))});return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:n}),a.jsxs(Fi,{isOpen:t,onClose:r,children:[a.jsx(Wo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{children:o("hotkeys.keyboardShortcuts")}),a.jsx(Td,{}),a.jsx(Vo,{children:a.jsx(I3,{allowMultiple:!0,children:a.jsxs(T,{flexDir:"column",gap:2,children:[a.jsxs(Nl,{children:[a.jsx(Rl,{children:a.jsxs(T,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.appHotkeys")}),a.jsx(Al,{})]})}),a.jsx(Tl,{children:h(s)})]}),a.jsxs(Nl,{children:[a.jsx(Rl,{children:a.jsxs(T,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.generalHotkeys")}),a.jsx(Al,{})]})}),a.jsx(Tl,{children:h(i)})]}),a.jsxs(Nl,{children:[a.jsx(Rl,{children:a.jsxs(T,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),a.jsx(Al,{})]})}),a.jsx(Tl,{children:h(l)})]}),a.jsxs(Nl,{children:[a.jsx(Rl,{children:a.jsxs(T,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),a.jsx(Al,{})]})}),a.jsx(Tl,{children:h(f)})]}),a.jsxs(Nl,{children:[a.jsx(Rl,{children:a.jsxs(T,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.nodesHotkeys")}),a.jsx(Al,{})]})}),a.jsx(Tl,{children:h(p)})]})]})})}),a.jsx(gs,{})]})]})]})}function _k(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function jk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var FZ=function(e,t){return typeof t=="boolean"?t:!e},BZ=function(e){return d.useReducer(FZ,e)};const HZ=BZ;function WZ(e,t){t===void 0&&(t=0);var n=d.useRef(!1),r=d.useRef(),o=d.useRef(e),s=d.useCallback(function(){return n.current},[]),i=d.useCallback(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},t)},[t]),l=d.useCallback(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return d.useEffect(function(){o.current=e},[e]),d.useEffect(function(){return i(),l},[t]),[s,l,i]}function VZ(e,t,n){t===void 0&&(t=0),n===void 0&&(n=[]);var r=WZ(e,t),o=r[0],s=r[1],i=r[2];return d.useEffect(i,n),[o,s]}var UZ=function(e,t){t===void 0&&(t=!0);var n=d.useState(!1),r=n[0],o=n[1];return d.useEffect(function(){var s=function(){return o(!0)},i=function(){return o(!1)};t&&e&&e.current&&(_k(e.current,"mouseover",s),_k(e.current,"mouseout",i));var l=e.current;return function(){t&&l&&(jk(l,"mouseover",s),jk(l,"mouseout",i))}},[t,e]),r};const LE=UZ,GZ=({showVersion:e=!0})=>{const{data:t}=G7(),n=d.useRef(null),r=LE(n);return a.jsxs(T,{alignItems:"center",gap:5,ps:1,ref:n,children:[a.jsx(qi,{src:Dj,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),a.jsxs(T,{sx:{gap:3,alignItems:"center"},children:[a.jsxs(be,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",a.jsx("strong",{children:"ai"})]}),a.jsx(nr,{children:e&&r&&t&&a.jsx(gn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(be,{sx:{fontWeight:600,marginTop:1,color:"base.300",fontSize:14},variant:"subtext",children:t.version})},"statusText")})]})]})},KZ=d.memo(GZ),qZ=e=>{const{tooltip:t,inputRef:n,label:r,disabled:o,required:s,...i}=e,l=xE();return a.jsx(Dt,{label:t,placement:"top",hasArrow:!0,children:a.jsx(ny,{label:r?a.jsx(un,{isRequired:s,isDisabled:o,children:a.jsx(Gn,{children:r})}):void 0,disabled:o,ref:n,styles:l,...i})})},Bn=d.memo(qZ),XZ={ar:bn.t("common.langArabic",{lng:"ar"}),nl:bn.t("common.langDutch",{lng:"nl"}),en:bn.t("common.langEnglish",{lng:"en"}),fr:bn.t("common.langFrench",{lng:"fr"}),de:bn.t("common.langGerman",{lng:"de"}),he:bn.t("common.langHebrew",{lng:"he"}),it:bn.t("common.langItalian",{lng:"it"}),ja:bn.t("common.langJapanese",{lng:"ja"}),ko:bn.t("common.langKorean",{lng:"ko"}),pl:bn.t("common.langPolish",{lng:"pl"}),pt_BR:bn.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:bn.t("common.langPortuguese",{lng:"pt"}),ru:bn.t("common.langRussian",{lng:"ru"}),zh_CN:bn.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:bn.t("common.langSpanish",{lng:"es"}),uk:bn.t("common.langUkranian",{lng:"ua"})};function Io(e){const{t}=we(),{label:n,textProps:r,useBadge:o=!1,badgeLabel:s=t("settings.experimental"),badgeProps:i,...l}=e;return a.jsxs(T,{justifyContent:"space-between",py:1,children:[a.jsxs(T,{gap:2,alignItems:"center",children:[a.jsx(be,{sx:{fontSize:14,_dark:{color:"base.300"}},...r,children:n}),o&&a.jsx(ua,{size:"xs",sx:{px:2,color:"base.700",bg:"accent.200",_dark:{bg:"accent.500",color:"base.200"}},...i,children:s})]}),a.jsx(Ut,{...l})]})}const YZ=e=>a.jsx(T,{sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base",bg:"base.100",_dark:{bg:"base.900"}},children:e.children}),Ll=d.memo(YZ);function QZ(){const e=te(),{data:t,refetch:n}=K7(),[r,{isLoading:o}]=q7(),s=d.useCallback(()=>{r().unwrap().then(l=>{e(X7()),e(Rj()),e(Nt({title:`Cleared ${l} intermediates`,status:"info"}))})},[r,e]);d.useEffect(()=>{n()},[n]);const i=t?`Clear ${t} Intermediate${t>1?"s":""}`:"No Intermediates to Clear";return a.jsxs(Ll,{children:[a.jsx(oo,{size:"sm",children:"Clear Intermediates"}),a.jsx(it,{colorScheme:"warning",onClick:s,isLoading:o,isDisabled:!t,children:i}),a.jsx(be,{fontWeight:"bold",children:"Clearing intermediates will reset your Canvas and ControlNet state."}),a.jsx(be,{variant:"subtext",children:"Intermediate images are byproducts of generation, different from the result images in the gallery. Clearing intermediates will free disk space."}),a.jsx(be,{variant:"subtext",children:"Your gallery images will not be deleted."})]})}const ZZ=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:l,base800:f,base900:p,accent200:h,accent300:m,accent400:v,accent500:x,accent600:C}=Bd(),{colorMode:b}=ia(),[w]=ds("shadows",["dark-lg"]);return d.useCallback(()=>({label:{color:Ae(l,r)(b)},separatorLabel:{color:Ae(s,s)(b),"::after":{borderTopColor:Ae(r,l)(b)}},searchInput:{":placeholder":{color:Ae(r,l)(b)}},input:{backgroundColor:Ae(e,p)(b),borderWidth:"2px",borderColor:Ae(n,f)(b),color:Ae(p,t)(b),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(b)},"&:focus":{borderColor:Ae(m,C)(b)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(b)},"&:focus-within":{borderColor:Ae(h,C)(b)},"&[data-disabled]":{backgroundColor:Ae(r,l)(b),color:Ae(i,o)(b),cursor:"not-allowed"}},value:{backgroundColor:Ae(n,f)(b),color:Ae(p,t)(b),button:{color:Ae(p,t)(b)},"&:hover":{backgroundColor:Ae(r,l)(b),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,f)(b),borderColor:Ae(n,f)(b),boxShadow:w},item:{backgroundColor:Ae(n,f)(b),color:Ae(f,n)(b),padding:6,"&[data-hovered]":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)},"&[data-active]":{backgroundColor:Ae(r,l)(b),"&:hover":{color:Ae(p,t)(b),backgroundColor:Ae(r,l)(b)}},"&[data-selected]":{backgroundColor:Ae(v,C)(b),color:Ae(e,t)(b),fontWeight:600,"&:hover":{backgroundColor:Ae(x,x)(b),color:Ae("white",e)(b)}},"&[data-disabled]":{color:Ae(s,i)(b),cursor:"not-allowed"}},rightSection:{width:24,padding:20,button:{color:Ae(p,t)(b)}}}),[h,m,v,x,C,t,n,r,o,e,s,i,l,f,p,w,b])},JZ=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,label:o,disabled:s,...i}=e,l=te(),f=d.useCallback(m=>{m.shiftKey&&l(Ir(!0))},[l]),p=d.useCallback(m=>{m.shiftKey||l(Ir(!1))},[l]),h=ZZ();return a.jsx(Dt,{label:n,placement:"top",hasArrow:!0,isOpen:!0,children:a.jsx(fE,{label:o?a.jsx(un,{isDisabled:s,children:a.jsx(Gn,{children:o})}):void 0,ref:r,disabled:s,onKeyDown:f,onKeyUp:p,searchable:t,maxDropdownHeight:300,styles:h,...i})})},eJ=d.memo(JZ),tJ=rr(dm,(e,t)=>({value:t,label:e})).sort((e,t)=>e.label.localeCompare(t.label));function nJ(){const e=te(),{t}=we(),n=F(o=>o.ui.favoriteSchedulers),r=d.useCallback(o=>{e(Y7(o))},[e]);return a.jsx(eJ,{label:t("settings.favoriteSchedulers"),value:n,data:tJ,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const rJ=ae([xe],({system:e,ui:t,generation:n})=>{const{shouldConfirmOnDelete:r,enableImageDebugging:o,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:l,shouldUseNSFWChecker:f,shouldUseWatermarker:p}=e,{shouldUseSliders:h,shouldShowProgressInViewer:m,shouldAutoChangeDimensions:v}=t,{shouldShowAdvancedOptions:x}=n;return{shouldConfirmOnDelete:r,enableImageDebugging:o,shouldUseSliders:h,shouldShowProgressInViewer:m,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:l,shouldShowAdvancedOptions:x,shouldUseNSFWChecker:f,shouldUseWatermarker:p,shouldAutoChangeDimensions:v}},{memoizeOptions:{resultEqualityCheck:kt}}),oJ=({children:e,config:t})=>{const n=te(),{t:r}=we(),[o,s]=d.useState(3),i=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,l=(t==null?void 0:t.shouldShowResetWebUiText)??!0,f=(t==null?void 0:t.shouldShowAdvancedOptionsSettings)??!0,p=(t==null?void 0:t.shouldShowClearIntermediates)??!0,h=(t==null?void 0:t.shouldShowLocalizationToggle)??!0;d.useEffect(()=>{i||n($C(!1))},[i,n]);const{isNSFWCheckerAvailable:m,isWatermarkerAvailable:v}=Aj(void 0,{selectFromResult:({data:Q})=>({isNSFWCheckerAvailable:(Q==null?void 0:Q.nsfw_methods.includes("nsfw_checker"))??!1,isWatermarkerAvailable:(Q==null?void 0:Q.watermarking_methods.includes("invisible_watermark"))??!1})}),{isOpen:x,onOpen:C,onClose:b}=Er(),{isOpen:w,onOpen:k,onClose:_}=Er(),{shouldConfirmOnDelete:j,enableImageDebugging:I,shouldUseSliders:M,shouldShowProgressInViewer:E,consoleLogLevel:O,shouldLogToConsole:D,shouldAntialiasProgressImage:A,shouldShowAdvancedOptions:R,shouldUseNSFWChecker:$,shouldUseWatermarker:K,shouldAutoChangeDimensions:B}=F(rJ),U=d.useCallback(()=>{Object.keys(window.localStorage).forEach(Q=>{(Q7.includes(Q)||Q.startsWith(Z7))&&localStorage.removeItem(Q)}),b(),k(),setInterval(()=>s(Q=>Q-1),1e3)},[b,k]);d.useEffect(()=>{o<=0&&window.location.reload()},[o]);const Y=d.useCallback(Q=>{n(J7(Q))},[n]),W=d.useCallback(Q=>{n(eD(Q))},[n]),L=d.useCallback(Q=>{n($C(Q.target.checked))},[n]),{colorMode:X,toggleColorMode:z}=ia(),q=qt("localization").isFeatureEnabled,ne=F(OP);return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:C}),a.jsxs(Fi,{isOpen:x,onClose:b,size:"2xl",isCentered:!0,children:[a.jsx(Wo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{bg:"none",children:r("common.settingsLabel")}),a.jsx(Td,{}),a.jsx(Vo,{children:a.jsxs(T,{sx:{gap:4,flexDirection:"column"},children:[a.jsxs(Ll,{children:[a.jsx(oo,{size:"sm",children:r("settings.general")}),a.jsx(Io,{label:r("settings.confirmOnDelete"),isChecked:j,onChange:Q=>n(Oj(Q.target.checked))}),f&&a.jsx(Io,{label:r("settings.showAdvancedOptions"),isChecked:R,onChange:Q=>n(tD(Q.target.checked))})]}),a.jsxs(Ll,{children:[a.jsx(oo,{size:"sm",children:r("settings.generation")}),a.jsx(nJ,{}),a.jsx(Io,{label:"Enable NSFW Checker",isDisabled:!m,isChecked:$,onChange:Q=>n(nD(Q.target.checked))}),a.jsx(Io,{label:"Enable Invisible Watermark",isDisabled:!v,isChecked:K,onChange:Q=>n(rD(Q.target.checked))})]}),a.jsxs(Ll,{children:[a.jsx(oo,{size:"sm",children:r("settings.ui")}),a.jsx(Io,{label:r("common.darkMode"),isChecked:X==="dark",onChange:z}),a.jsx(Io,{label:r("settings.useSlidersForAll"),isChecked:M,onChange:Q=>n(oD(Q.target.checked))}),a.jsx(Io,{label:r("settings.showProgressInViewer"),isChecked:E,onChange:Q=>n(Nj(Q.target.checked))}),a.jsx(Io,{label:r("settings.antialiasProgressImages"),isChecked:A,onChange:Q=>n(sD(Q.target.checked))}),a.jsx(Io,{label:r("settings.autoChangeDimensions"),isChecked:B,onChange:Q=>n(aD(Q.target.checked))}),h&&a.jsx(Bn,{disabled:!q,label:r("common.languagePickerLabel"),value:ne,data:Object.entries(XZ).map(([Q,ie])=>({value:Q,label:ie})),onChange:W})]}),i&&a.jsxs(Ll,{children:[a.jsx(oo,{size:"sm",children:r("settings.developer")}),a.jsx(Io,{label:r("settings.shouldLogToConsole"),isChecked:D,onChange:L}),a.jsx(Bn,{disabled:!D,label:r("settings.consoleLogLevel"),onChange:Y,value:O,data:iD.concat()}),a.jsx(Io,{label:r("settings.enableImageDebugging"),isChecked:I,onChange:Q=>n(lD(Q.target.checked))})]}),p&&a.jsx(QZ,{}),a.jsxs(Ll,{children:[a.jsx(oo,{size:"sm",children:r("settings.resetWebUI")}),a.jsx(it,{colorScheme:"error",onClick:U,children:r("settings.resetWebUI")}),l&&a.jsxs(a.Fragment,{children:[a.jsx(be,{variant:"subtext",children:r("settings.resetWebUIDesc1")}),a.jsx(be,{variant:"subtext",children:r("settings.resetWebUIDesc2")})]})]})]})}),a.jsx(gs,{children:a.jsx(it,{onClick:b,children:r("common.close")})})]})]}),a.jsxs(Fi,{closeOnOverlayClick:!1,isOpen:w,onClose:_,isCentered:!0,closeOnEsc:!1,children:[a.jsx(Wo,{backdropFilter:"blur(40px)"}),a.jsxs(Bi,{children:[a.jsx(Ho,{}),a.jsx(Vo,{children:a.jsx(T,{justifyContent:"center",children:a.jsx(be,{fontSize:"lg",children:a.jsxs(be,{children:[r("settings.resetComplete")," Reloading in ",o,"..."]})})})}),a.jsx(gs,{})]})]})]})},sJ=d.memo(oJ),aJ=ae(vo,e=>{const{isConnected:t,isProcessing:n,statusTranslationKey:r,currentIteration:o,totalIterations:s,currentStatusHasSteps:i}=e;return{isConnected:t,isProcessing:n,currentIteration:o,totalIterations:s,statusTranslationKey:r,currentStatusHasSteps:i}},Ce),Pk={ok:"green.400",working:"yellow.400",error:"red.400"},Ik={ok:"green.600",working:"yellow.500",error:"red.500"},iJ=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,statusTranslationKey:o}=F(aJ),{t:s}=we(),i=d.useRef(null),l=d.useMemo(()=>t?"working":e?"ok":"error",[t,e]),f=d.useMemo(()=>{if(n&&r)return` (${n}/${r})`},[n,r]),p=LE(i);return a.jsxs(T,{ref:i,h:"full",px:2,alignItems:"center",gap:5,children:[a.jsx(nr,{children:p&&a.jsx(gn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsxs(be,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:Ik[l],_dark:{color:Pk[l]}},children:[s(o),f]})},"statusText")}),a.jsx(An,{as:lZ,sx:{boxSize:"0.5rem",color:Ik[l],_dark:{color:Pk[l]}}})]})},lJ=d.memo(iJ),cJ=()=>{const{t:e}=we(),t=qt("bugLink").isFeatureEnabled,n=qt("discordLink").isFeatureEnabled,r=qt("githubLink").isFeatureEnabled,o="http://github.com/invoke-ai/InvokeAI",s="https://discord.gg/ZmtBAhwWhy";return a.jsxs(T,{sx:{gap:2,alignItems:"center"},children:[a.jsx(KZ,{}),a.jsx(Za,{}),a.jsx(lJ,{}),a.jsxs(Dd,{children:[a.jsx(Rd,{as:Te,variant:"link","aria-label":e("accessibility.menu"),icon:a.jsx(aZ,{}),sx:{boxSize:8}}),a.jsxs(Ga,{motionProps:mc,children:[a.jsxs(Cc,{title:e("common.communityLabel"),children:[r&&a.jsx(Ht,{as:"a",href:o,target:"_blank",icon:a.jsx(JQ,{}),children:e("common.githubLabel")}),t&&a.jsx(Ht,{as:"a",href:`${o}/issues`,target:"_blank",icon:a.jsx(iZ,{}),children:e("common.reportBugLabel")}),n&&a.jsx(Ht,{as:"a",href:s,target:"_blank",icon:a.jsx(ZQ,{}),children:e("common.discordLabel")})]}),a.jsxs(Cc,{title:e("common.settingsLabel"),children:[a.jsx(zZ,{children:a.jsx(Ht,{as:"button",icon:a.jsx(kZ,{}),children:e("common.hotkeysLabel")})}),a.jsx(sJ,{children:a.jsx(Ht,{as:"button",icon:a.jsx(jE,{}),children:e("common.settingsLabel")})})]})]})]})]})},uJ=d.memo(cJ),dJ=ae(vo,e=>{const{isUploading:t}=e;let n="";return t&&(n="Uploading..."),{tooltip:n,shouldShow:t}}),fJ=()=>{const{shouldShow:e,tooltip:t}=F(dJ);return e?a.jsx(T,{sx:{alignItems:"center",justifyContent:"center",color:"base.600"},children:a.jsx(Dt,{label:t,placement:"right",hasArrow:!0,children:a.jsx(Ki,{})})}):null},pJ=d.memo(fJ);/*!
* OverlayScrollbars
* Version: 2.2.1
*
* Copyright (c) Rene Haas | KingSora.
* https://github.com/KingSora
*
* Released under the MIT license.
*/function Ot(e,t){if(og(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Ot(Object.keys(e),n=>t(e[n],n,e));return e}function er(e,t){const n=ni(t);if(Ko(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?Dk(e,s,t):t.reduce((i,l)=>(i[l]=Dk(e,s,l),i),o)}return o}e&&Ot(Hr(t),o=>EJ(e,o,t[o]))}const Oo=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,i;const l=(h,m)=>{const v=s,x=h,C=m||(r?!r(v,x):v!==x);return(C||o)&&(s=x,i=v),[s,C,i]};return[t?h=>l(t(s,i),h):l,h=>[s,!!h,i]]},Hd=()=>typeof window<"u",zE=Hd()&&Node.ELEMENT_NODE,{toString:hJ,hasOwnProperty:_v}=Object.prototype,fa=e=>e===void 0,rg=e=>e===null,mJ=e=>fa(e)||rg(e)?`${e}`:hJ.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Wa=e=>typeof e=="number",ni=e=>typeof e=="string",ry=e=>typeof e=="boolean",Go=e=>typeof e=="function",Ko=e=>Array.isArray(e),ad=e=>typeof e=="object"&&!Ko(e)&&!rg(e),og=e=>{const t=!!e&&e.length,n=Wa(t)&&t>-1&&t%1==0;return Ko(e)||!Go(e)&&n?t>0&&ad(e)?t-1 in e:!0:!1},tx=e=>{if(!e||!ad(e)||mJ(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=_v.call(e,n),i=o&&_v.call(o,"isPrototypeOf");if(r&&!s&&!i)return!1;for(t in e);return fa(t)||_v.call(e,t)},Kh=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===zE:!1},sg=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===zE:!1},oy=(e,t,n)=>e.indexOf(t,n),Lt=(e,t,n)=>(!n&&!ni(t)&&og(t)?Array.prototype.push.apply(e,t):e.push(t),e),Vi=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{Lt(n,r)}):Ot(e,r=>{Lt(n,r)}),n)},sy=e=>!!e&&e.length===0,js=(e,t,n)=>{Ot(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},ag=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Hr=e=>e?Object.keys(e):[],cn=(e,t,n,r,o,s,i)=>{const l=[t,n,r,o,s,i];return(typeof e!="object"||rg(e))&&!Go(e)&&(e={}),Ot(l,f=>{Ot(Hr(f),p=>{const h=f[p];if(e===h)return!0;const m=Ko(h);if(h&&(tx(h)||m)){const v=e[p];let x=v;m&&!Ko(v)?x=[]:!m&&!tx(v)&&(x={}),e[p]=cn(x,h)}else e[p]=h})}),e},ay=e=>{for(const t in e)return!1;return!0},FE=(e,t,n,r)=>{if(fa(r))return n?n[e]:t;n&&(ni(r)||Wa(r))&&(n[e]=r)},Jn=(e,t,n)=>{if(fa(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},Cr=(e,t)=>{e&&e.removeAttribute(t)},Ii=(e,t,n,r)=>{if(n){const o=Jn(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const i=Vi(s).join(" ").trim();Jn(e,t,i)}},gJ=(e,t,n)=>{const r=Jn(e,t)||"";return new Set(r.split(" ")).has(n)},zo=(e,t)=>FE("scrollLeft",0,e,t),Zs=(e,t)=>FE("scrollTop",0,e,t),nx=Hd()&&Element.prototype,BE=(e,t)=>{const n=[],r=t?sg(t)?t:null:document;return r?Lt(n,r.querySelectorAll(e)):n},vJ=(e,t)=>{const n=t?sg(t)?t:null:document;return n?n.querySelector(e):null},qh=(e,t)=>sg(e)?(nx.matches||nx.msMatchesSelector).call(e,t):!1,iy=e=>e?Vi(e.childNodes):[],ra=e=>e?e.parentElement:null,Ul=(e,t)=>{if(sg(e)){const n=nx.closest;if(n)return n.call(e,t);do{if(qh(e,t))return e;e=ra(e)}while(e)}return null},xJ=(e,t,n)=>{const r=e&&Ul(e,t),o=e&&vJ(n,r),s=Ul(o,t)===r;return r&&o?r===e||o===e||s&&Ul(Ul(e,n),t)!==r:!1},ly=(e,t,n)=>{if(n&&e){let r=t,o;og(n)?(o=document.createDocumentFragment(),Ot(n,s=>{s===r&&(r=s.previousSibling),o.appendChild(s)})):o=n,t&&(r?r!==t&&(r=r.nextSibling):r=e.firstChild),e.insertBefore(o,r||null)}},lo=(e,t)=>{ly(e,null,t)},bJ=(e,t)=>{ly(ra(e),e,t)},Ek=(e,t)=>{ly(ra(e),e&&e.nextSibling,t)},xs=e=>{if(og(e))Ot(Vi(e),t=>xs(t));else if(e){const t=ra(e);t&&t.removeChild(e)}},Ei=e=>{const t=document.createElement("div");return e&&Jn(t,"class",e),t},HE=e=>{const t=Ei();return t.innerHTML=e.trim(),Ot(iy(t),n=>xs(n))},rx=e=>e.charAt(0).toUpperCase()+e.slice(1),yJ=()=>Ei().style,CJ=["-webkit-","-moz-","-o-","-ms-"],wJ=["WebKit","Moz","O","MS","webkit","moz","o","ms"],jv={},Pv={},SJ=e=>{let t=Pv[e];if(ag(Pv,e))return t;const n=rx(e),r=yJ();return Ot(CJ,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,rx(s)+n].find(l=>r[l]!==void 0))}),Pv[e]=t||""},Wd=e=>{if(Hd()){let t=jv[e]||window[e];return ag(jv,e)||(Ot(wJ,n=>(t=t||window[n+rx(e)],!t)),jv[e]=t),t}},kJ=Wd("MutationObserver"),Mk=Wd("IntersectionObserver"),Gl=Wd("ResizeObserver"),WE=Wd("cancelAnimationFrame"),VE=Wd("requestAnimationFrame"),Xh=Hd()&&window.setTimeout,ox=Hd()&&window.clearTimeout,_J=/[^\x20\t\r\n\f]+/g,UE=(e,t,n)=>{const r=e&&e.classList;let o,s=0,i=!1;if(r&&t&&ni(t)){const l=t.match(_J)||[];for(i=l.length>0;o=l[s++];)i=!!n(r,o)&&i}return i},cy=(e,t)=>{UE(e,t,(n,r)=>n.remove(r))},Js=(e,t)=>(UE(e,t,(n,r)=>n.add(r)),cy.bind(0,e,t)),ig=(e,t,n,r)=>{if(e&&t){let o=!0;return Ot(n,s=>{const i=r?r(e[s]):e[s],l=r?r(t[s]):t[s];i!==l&&(o=!1)}),o}return!1},GE=(e,t)=>ig(e,t,["w","h"]),KE=(e,t)=>ig(e,t,["x","y"]),jJ=(e,t)=>ig(e,t,["t","r","b","l"]),Ok=(e,t,n)=>ig(e,t,["width","height"],n&&(r=>Math.round(r))),ao=()=>{},zl=e=>{let t;const n=e?Xh:VE,r=e?ox:WE;return[o=>{r(t),t=n(o,Go(e)?e():e)},()=>r(t)]},uy=(e,t)=>{let n,r,o,s=ao;const{v:i,g:l,p:f}=t||{},p=function(C){s(),ox(n),n=r=void 0,s=ao,e.apply(this,C)},h=x=>f&&r?f(r,x):x,m=()=>{s!==ao&&p(h(o)||o)},v=function(){const C=Vi(arguments),b=Go(i)?i():i;if(Wa(b)&&b>=0){const k=Go(l)?l():l,_=Wa(k)&&k>=0,j=b>0?Xh:VE,I=b>0?ox:WE,E=h(C)||C,O=p.bind(0,E);s();const D=j(O,b);s=()=>I(D),_&&!n&&(n=Xh(m,k)),r=o=E}else p(C)};return v.m=m,v},PJ={opacity:1,zindex:1},hp=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},IJ=(e,t)=>!PJ[e.toLowerCase()]&&Wa(t)?`${t}px`:t,Dk=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],EJ=(e,t,n)=>{try{const{style:r}=e;fa(r[t])?r.setProperty(t,n):r[t]=IJ(t,n)}catch{}},id=e=>er(e,"direction")==="rtl",Rk=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,i=`${r}right${o}`,l=`${r}bottom${o}`,f=`${r}left${o}`,p=er(e,[s,i,l,f]);return{t:hp(p[s],!0),r:hp(p[i],!0),b:hp(p[l],!0),l:hp(p[f],!0)}},{round:Ak}=Math,dy={w:0,h:0},ld=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:dy,Lp=e=>e?{w:e.clientWidth,h:e.clientHeight}:dy,Yh=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:dy,Qh=e=>{const t=parseFloat(er(e,"height"))||0,n=parseFloat(er(e,"width"))||0;return{w:n-Ak(n),h:t-Ak(t)}},fs=e=>e.getBoundingClientRect();let mp;const MJ=()=>{if(fa(mp)){mp=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){mp=!0}}))}catch{}}return mp},qE=e=>e.split(" "),OJ=(e,t,n,r)=>{Ot(qE(t),o=>{e.removeEventListener(o,n,r)})},Nn=(e,t,n,r)=>{var o;const s=MJ(),i=(o=s&&r&&r.S)!=null?o:s,l=r&&r.$||!1,f=r&&r.C||!1,p=[],h=s?{passive:i,capture:l}:l;return Ot(qE(t),m=>{const v=f?x=>{e.removeEventListener(m,v,l),n&&n(x)}:n;Lt(p,OJ.bind(null,e,m,v,l)),e.addEventListener(m,v,h)}),js.bind(0,p)},XE=e=>e.stopPropagation(),YE=e=>e.preventDefault(),DJ={x:0,y:0},Iv=e=>{const t=e?fs(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:DJ},Nk=(e,t)=>{Ot(Ko(t)?t:[t],e)},fy=e=>{const t=new Map,n=(s,i)=>{if(s){const l=t.get(s);Nk(f=>{l&&l[f?"delete":"clear"](f)},i)}else t.forEach(l=>{l.clear()}),t.clear()},r=(s,i)=>{if(ni(s)){const p=t.get(s)||new Set;return t.set(s,p),Nk(h=>{Go(h)&&p.add(h)},i),n.bind(0,s,i)}ry(i)&&i&&n();const l=Hr(s),f=[];return Ot(l,p=>{const h=s[p];h&&Lt(f,r(p,h))}),js.bind(0,f)},o=(s,i)=>{const l=t.get(s);Ot(Vi(l),f=>{i&&!sy(i)?f.apply(0,i):f()})};return r(e||{}),[r,n,o]},Tk=e=>JSON.stringify(e,(t,n)=>{if(Go(n))throw new Error;return n}),RJ={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:[0,33],attributes:null,ignoreMutation:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},QE=(e,t)=>{const n={},r=Hr(t).concat(Hr(e));return Ot(r,o=>{const s=e[o],i=t[o];if(ad(s)&&ad(i))cn(n[o]={},QE(s,i)),ay(n[o])&&delete n[o];else if(ag(t,o)&&i!==s){let l=!0;if(Ko(s)||Ko(i))try{Tk(s)===Tk(i)&&(l=!1)}catch{}l&&(n[o]=i)}}),n},ZE="os-environment",JE=`${ZE}-flexbox-glue`,AJ=`${JE}-max`,eM="os-scrollbar-hidden",Ev="data-overlayscrollbars-initialize",Do="data-overlayscrollbars",tM=`${Do}-overflow-x`,nM=`${Do}-overflow-y`,ac="overflowVisible",NJ="scrollbarHidden",$k="scrollbarPressed",Zh="updating",Ma="data-overlayscrollbars-viewport",Mv="arrange",rM="scrollbarHidden",ic=ac,sx="data-overlayscrollbars-padding",TJ=ic,Lk="data-overlayscrollbars-content",py="os-size-observer",$J=`${py}-appear`,LJ=`${py}-listener`,zJ="os-trinsic-observer",FJ="os-no-css-vars",BJ="os-theme-none",Or="os-scrollbar",HJ=`${Or}-rtl`,WJ=`${Or}-horizontal`,VJ=`${Or}-vertical`,oM=`${Or}-track`,hy=`${Or}-handle`,UJ=`${Or}-visible`,GJ=`${Or}-cornerless`,zk=`${Or}-transitionless`,Fk=`${Or}-interaction`,Bk=`${Or}-unusable`,Hk=`${Or}-auto-hidden`,Wk=`${Or}-wheel`,KJ=`${oM}-interactive`,qJ=`${hy}-interactive`,sM={},Ui=()=>sM,XJ=e=>{const t=[];return Ot(Ko(e)?e:[e],n=>{const r=Hr(n);Ot(r,o=>{Lt(t,sM[o]=n[o])})}),t},YJ="__osOptionsValidationPlugin",QJ="__osSizeObserverPlugin",my="__osScrollbarsHidingPlugin",ZJ="__osClickScrollPlugin";let Ov;const Vk=(e,t,n,r)=>{lo(e,t);const o=Lp(t),s=ld(t),i=Qh(n);return r&&xs(t),{x:s.h-o.h+i.h,y:s.w-o.w+i.w}},JJ=e=>{let t=!1;const n=Js(e,eM);try{t=er(e,SJ("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},eee=(e,t)=>{const n="hidden";er(e,{overflowX:n,overflowY:n,direction:"rtl"}),zo(e,0);const r=Iv(e),o=Iv(t);zo(e,-999);const s=Iv(t);return{i:r.x===o.x,n:o.x!==s.x}},tee=(e,t)=>{const n=Js(e,JE),r=fs(e),o=fs(t),s=Ok(o,r,!0),i=Js(e,AJ),l=fs(e),f=fs(t),p=Ok(f,l,!0);return n(),i(),s&&p},nee=()=>{const{body:e}=document,n=HE(`<div class="${ZE}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=fy(),[i,l]=Oo({o:Vk(e,n,r),u:KE},Vk.bind(0,e,n,r,!0)),[f]=l(),p=JJ(n),h={x:f.x===0,y:f.y===0},m={elements:{host:null,padding:!p,viewport:_=>p&&_===_.ownerDocument.body&&_,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},v=cn({},RJ),x=cn.bind(0,{},v),C=cn.bind(0,{},m),b={k:f,A:h,I:p,L:er(n,"zIndex")==="-1",B:eee(n,r),V:tee(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:C,q:_=>cn(m,_)&&C(),F:x,G:_=>cn(v,_)&&x(),X:cn({},m),U:cn({},v)},w=window.addEventListener,k=uy(_=>s(_?"z":"r"),{v:33,g:99});if(Cr(n,"style"),xs(n),w("resize",k.bind(0,!1)),!p&&(!h.x||!h.y)){let _;w("resize",()=>{const j=Ui()[my];_=_||j&&j.R(),_&&_(b,i,k.bind(0,!0))})}return b},Dr=()=>(Ov||(Ov=nee()),Ov),gy=(e,t)=>Go(t)?t.apply(0,e):t,ree=(e,t,n,r)=>{const o=fa(r)?n:r;return gy(e,o)||t.apply(0,e)},aM=(e,t,n,r)=>{const o=fa(r)?n:r,s=gy(e,o);return!!s&&(Kh(s)?s:t.apply(0,e))},oee=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:i}=Dr(),{nativeScrollbarsOverlaid:l,body:f}=t,p=r??l,h=fa(o)?f:o,m=(s.x||s.y)&&p,v=e&&(rg(h)?!i:h);return!!m||!!v},vy=new WeakMap,see=(e,t)=>{vy.set(e,t)},aee=e=>{vy.delete(e)},iM=e=>vy.get(e),Uk=(e,t)=>e?t.split(".").reduce((n,r)=>n&&ag(n,r)?n[r]:void 0,e):void 0,ax=(e,t,n)=>r=>[Uk(e,r),n||Uk(t,r)!==void 0],lM=e=>{let t=e;return[()=>t,n=>{t=cn({},t,n)}]},gp="tabindex",vp=Ei.bind(0,""),Dv=e=>{lo(ra(e),iy(e)),xs(e)},iee=e=>{const t=Dr(),{N:n,I:r}=t,o=Ui()[my],s=o&&o.T,{elements:i}=n(),{host:l,padding:f,viewport:p,content:h}=i,m=Kh(e),v=m?{}:e,{elements:x}=v,{host:C,padding:b,viewport:w,content:k}=x||{},_=m?e:v.target,j=qh(_,"textarea"),I=_.ownerDocument,M=I.documentElement,E=_===I.body,O=I.defaultView,D=ree.bind(0,[_]),A=aM.bind(0,[_]),R=gy.bind(0,[_]),$=D.bind(0,vp,p),K=A.bind(0,vp,h),B=$(w),U=B===_,Y=U&&E,W=!U&&K(k),L=!U&&Kh(B)&&B===W,X=L&&!!R(h),z=X?$():B,q=X?W:K(),Q=Y?M:L?z:B,ie=j?D(vp,l,C):_,oe=Y?Q:ie,V=L?q:W,G=I.activeElement,J=!U&&O.top===O&&G===_,se={W:_,Z:oe,J:Q,K:!U&&A(vp,f,b),tt:V,nt:!U&&!r&&s&&s(t),ot:Y?M:Q,st:Y?I:Q,et:O,ct:I,rt:j,it:E,lt:m,ut:U,dt:L,ft:(Xe,tt)=>gJ(Q,U?Do:Ma,U?tt:Xe),_t:(Xe,tt,ve)=>Ii(Q,U?Do:Ma,U?tt:Xe,ve)},re=Hr(se).reduce((Xe,tt)=>{const ve=se[tt];return Lt(Xe,ve&&!ra(ve)?ve:!1)},[]),fe=Xe=>Xe?oy(re,Xe)>-1:null,{W:de,Z:me,K:ye,J:he,tt:ue,nt:De}=se,je=[()=>{Cr(me,Do),Cr(me,Ev),Cr(de,Ev),E&&(Cr(M,Do),Cr(M,Ev))}],Be=j&&fe(me);let rt=j?de:iy([ue,he,ye,me,de].find(Xe=>fe(Xe)===!1));const Ue=Y?de:ue||he;return[se,()=>{Jn(me,Do,U?"viewport":"host"),Jn(ye,sx,""),Jn(ue,Lk,""),U||Jn(he,Ma,"");const Xe=E&&!U?Js(ra(_),eM):ao;if(Be&&(Ek(de,me),Lt(je,()=>{Ek(me,de),xs(me)})),lo(Ue,rt),lo(me,ye),lo(ye||me,!U&&he),lo(he,ue),Lt(je,()=>{Xe(),Cr(ye,sx),Cr(ue,Lk),Cr(he,tM),Cr(he,nM),Cr(he,Ma),fe(ue)&&Dv(ue),fe(he)&&Dv(he),fe(ye)&&Dv(ye)}),r&&!U&&(Ii(he,Ma,rM,!0),Lt(je,Cr.bind(0,he,Ma))),De&&(bJ(he,De),Lt(je,xs.bind(0,De))),J){const tt=Jn(he,gp);Jn(he,gp,"-1"),he.focus();const ve=()=>tt?Jn(he,gp,tt):Cr(he,gp),Re=Nn(I,"pointerdown keydown",()=>{ve(),Re()});Lt(je,[ve,Re])}else G&&G.focus&&G.focus();rt=0},js.bind(0,je)]},lee=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=Dr(),{ht:i}=r(),{vt:l}=o,f=(n||!s)&&l;return f&&er(n,{height:i?"":"100%"}),{gt:f,wt:f}}},cee=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,ut:l}=e,[f,p]=Oo({u:jJ,o:Rk()},Rk.bind(0,o,"padding",""));return(h,m,v)=>{let[x,C]=p(v);const{I:b,V:w}=Dr(),{bt:k}=n(),{gt:_,wt:j,yt:I}=h,[M,E]=m("paddingAbsolute");(_||C||!w&&j)&&([x,C]=f(v));const D=!l&&(E||I||C);if(D){const A=!M||!s&&!b,R=x.r+x.l,$=x.t+x.b,K={marginRight:A&&!k?-R:0,marginBottom:A?-$:0,marginLeft:A&&k?-R:0,top:A?-x.t:0,right:A?k?-x.r:"auto":0,left:A?k?"auto":-x.l:0,width:A?`calc(100% + ${R}px)`:""},B={paddingTop:A?x.t:0,paddingRight:A?x.r:0,paddingBottom:A?x.b:0,paddingLeft:A?x.l:0};er(s||i,K),er(i,B),r({K:x,St:!A,P:s?B:cn({},K,B)})}return{xt:D}}},{max:ix}=Math,Oa=ix.bind(0,0),cM="visible",Gk="hidden",uee=42,xp={u:GE,o:{w:0,h:0}},dee={u:KE,o:{x:Gk,y:Gk}},fee=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Oa(e.w-t.w),h:Oa(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},bp=e=>e.indexOf(cM)===0,pee=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,nt:l,ut:f,_t:p,it:h,et:m}=e,{k:v,V:x,I:C,A:b}=Dr(),w=Ui()[my],k=!f&&!C&&(b.x||b.y),_=h&&f,[j,I]=Oo(xp,Qh.bind(0,i)),[M,E]=Oo(xp,Yh.bind(0,i)),[O,D]=Oo(xp),[A,R]=Oo(xp),[$]=Oo(dee),K=(X,z)=>{if(er(i,{height:""}),z){const{St:q,K:ne}=n(),{$t:Q,D:ie}=X,oe=Qh(o),V=Lp(o),G=er(i,"boxSizing")==="content-box",J=q||G?ne.b+ne.t:0,se=!(b.x&&G);er(i,{height:V.h+oe.h+(Q.x&&se?ie.x:0)-J})}},B=(X,z)=>{const q=!C&&!X?uee:0,ne=(fe,de,me)=>{const ye=er(i,fe),ue=(z?z[fe]:ye)==="scroll";return[ye,ue,ue&&!C?de?q:me:0,de&&!!q]},[Q,ie,oe,V]=ne("overflowX",b.x,v.x),[G,J,se,re]=ne("overflowY",b.y,v.y);return{Ct:{x:Q,y:G},$t:{x:ie,y:J},D:{x:oe,y:se},M:{x:V,y:re}}},U=(X,z,q,ne)=>{const Q=(J,se)=>{const re=bp(J),fe=se&&re&&J.replace(`${cM}-`,"")||"";return[se&&!re?J:"",bp(fe)?"hidden":fe]},[ie,oe]=Q(q.x,z.x),[V,G]=Q(q.y,z.y);return ne.overflowX=oe&&V?oe:ie,ne.overflowY=G&&ie?G:V,B(X,ne)},Y=(X,z,q,ne)=>{const{D:Q,M:ie}=X,{x:oe,y:V}=ie,{x:G,y:J}=Q,{P:se}=n(),re=z?"marginLeft":"marginRight",fe=z?"paddingLeft":"paddingRight",de=se[re],me=se.marginBottom,ye=se[fe],he=se.paddingBottom;ne.width=`calc(100% + ${J+-1*de}px)`,ne[re]=-J+de,ne.marginBottom=-G+me,q&&(ne[fe]=ye+(V?J:0),ne.paddingBottom=he+(oe?G:0))},[W,L]=w?w.H(k,x,i,l,n,B,Y):[()=>k,()=>[ao]];return(X,z,q)=>{const{gt:ne,Ot:Q,wt:ie,xt:oe,vt:V,yt:G}=X,{ht:J,bt:se}=n(),[re,fe]=z("showNativeOverlaidScrollbars"),[de,me]=z("overflow"),ye=re&&b.x&&b.y,he=!f&&!x&&(ne||ie||Q||fe||V),ue=bp(de.x),De=bp(de.y),je=ue||De;let Be=I(q),rt=E(q),Ue=D(q),Ct=R(q),Xe;if(fe&&C&&p(rM,NJ,!ye),he&&(Xe=B(ye),K(Xe,J)),ne||oe||ie||G||fe){je&&p(ic,ac,!1);const[ke,ze]=L(ye,se,Xe),[Le,Ve]=Be=j(q),[ct,vn]=rt=M(q),_t=Lp(i);let jt=ct,sr=_t;ke(),(vn||Ve||fe)&&ze&&!ye&&W(ze,ct,Le,se)&&(sr=Lp(i),jt=Yh(i));const In={w:Oa(ix(ct.w,jt.w)+Le.w),h:Oa(ix(ct.h,jt.h)+Le.h)},dn={w:Oa((_?m.innerWidth:sr.w+Oa(_t.w-ct.w))+Le.w),h:Oa((_?m.innerHeight+Le.h:sr.h+Oa(_t.h-ct.h))+Le.h)};Ct=A(dn),Ue=O(fee(In,dn),q)}const[tt,ve]=Ct,[Re,st]=Ue,[mt,ge]=rt,[Ye,ot]=Be,lt={x:Re.w>0,y:Re.h>0},Me=ue&&De&&(lt.x||lt.y)||ue&&lt.x&&!lt.y||De&&lt.y&&!lt.x;if(oe||G||ot||ge||ve||st||me||fe||he){const ke={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},ze=U(ye,lt,de,ke),Le=W(ze,mt,Ye,se);f||Y(ze,se,Le,ke),he&&K(ze,J),f?(Jn(o,tM,ke.overflowX),Jn(o,nM,ke.overflowY)):er(i,ke)}Ii(o,Do,ac,Me),Ii(s,sx,TJ,Me),f||Ii(i,Ma,ic,je);const[$e,Rt]=$(B(ye).Ct);return r({Ct:$e,zt:{x:tt.w,y:tt.h},Tt:{x:Re.w,y:Re.h},Et:lt}),{It:Rt,At:ve,Lt:st}}},Kk=(e,t,n)=>{const r={},o=t||{},s=Hr(e).concat(Hr(o));return Ot(s,i=>{const l=e[i],f=o[i];r[i]=!!(n||l||f)}),r},hee=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:i,A:l,V:f}=Dr(),p=!i&&(l.x||l.y),h=[lee(e,t),cee(e,t),pee(e,t)];return(m,v,x)=>{const C=Kk(cn({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},v),{},x),b=p||!f,w=b&&zo(r),k=b&&Zs(r);o("",Zh,!0);let _=C;return Ot(h,j=>{_=Kk(_,j(_,m,!!x)||{},x)}),zo(r,w),Zs(r,k),o("",Zh),s||(zo(n,0),Zs(n,0)),_}},mee=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},i=l=>{if(n){const f=n.reduce((p,h)=>{if(h){const[m,v]=h,x=v&&m&&(l?l(m):BE(m,e));x&&x.length&&v&&ni(v)&&Lt(p,[x,v.trim()],!0)}return p},[]);Ot(f,p=>Ot(p[0],h=>{const m=p[1],v=r.get(h)||[];if(e.contains(h)){const C=Nn(h,m,b=>{o?(C(),r.delete(h)):t(b)});r.set(h,Lt(v,C))}else js(v),r.delete(h)}))}};return n&&(r=new WeakMap,i()),[s,i]},qk=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:i,Dt:l,Mt:f,Rt:p,kt:h}=r||{},m=uy(()=>{o&&n(!0)},{v:33,g:99}),[v,x]=mee(e,m,l),C=s||[],b=i||[],w=C.concat(b),k=(j,I)=>{const M=p||ao,E=h||ao,O=new Set,D=new Set;let A=!1,R=!1;if(Ot(j,$=>{const{attributeName:K,target:B,type:U,oldValue:Y,addedNodes:W,removedNodes:L}=$,X=U==="attributes",z=U==="childList",q=e===B,ne=X&&ni(K)?Jn(B,K):0,Q=ne!==0&&Y!==ne,ie=oy(b,K)>-1&&Q;if(t&&(z||!q)){const oe=!X,V=X&&Q,G=V&&f&&qh(B,f),se=(G?!M(B,K,Y,ne):oe||V)&&!E($,!!G,e,r);Ot(W,re=>O.add(re)),Ot(L,re=>O.add(re)),R=R||se}!t&&q&&Q&&!M(B,K,Y,ne)&&(D.add(K),A=A||ie)}),O.size>0&&x($=>Vi(O).reduce((K,B)=>(Lt(K,BE($,B)),qh(B,$)?Lt(K,B):K),[])),t)return!I&&R&&n(!1),[!1];if(D.size>0||A){const $=[Vi(D),A];return!I&&n.apply(0,$),$}},_=new kJ(j=>k(j));return _.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:w,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(v(),_.disconnect(),o=!1)},()=>{if(o){m.m();const j=_.takeRecords();return!sy(j)&&k(j,!0)}}]},yp=3333333,Cp=e=>e&&(e.height||e.width),uM=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Ui()[QJ],{B:i}=Dr(),f=HE(`<div class="${py}"><div class="${LJ}"></div></div>`)[0],p=f.firstChild,h=id.bind(0,e),[m]=Oo({o:void 0,_:!0,u:(b,w)=>!(!b||!Cp(b)&&Cp(w))}),v=b=>{const w=Ko(b)&&b.length>0&&ad(b[0]),k=!w&&ry(b[0]);let _=!1,j=!1,I=!0;if(w){const[M,,E]=m(b.pop().contentRect),O=Cp(M),D=Cp(E);_=!E||!O,j=!D&&O,I=!_}else k?[,I]=b:j=b===!0;if(r&&I){const M=k?b[0]:id(f);zo(f,M?i.n?-yp:i.i?0:yp:yp),Zs(f,yp)}_||t({gt:!k,Yt:k?b:void 0,Vt:!!j})},x=[];let C=o?v:!1;return[()=>{js(x),xs(f)},()=>{if(Gl){const b=new Gl(v);b.observe(p),Lt(x,()=>{b.disconnect()})}else if(s){const[b,w]=s.O(p,v,o);C=b,Lt(x,w)}if(r){const[b]=Oo({o:void 0},h);Lt(x,Nn(f,"scroll",w=>{const k=b(),[_,j,I]=k;j&&(cy(p,"ltr rtl"),_?Js(p,"rtl"):Js(p,"ltr"),v([!!_,j,I])),XE(w)}))}C&&(Js(f,$J),Lt(x,Nn(f,"animationstart",C,{C:!!Gl}))),(Gl||s)&&lo(e,f)}]},gee=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,vee=(e,t)=>{let n;const r=Ei(zJ),o=[],[s]=Oo({o:!1}),i=(f,p)=>{if(f){const h=s(gee(f)),[,m]=h;if(m)return!p&&t(h),[h]}},l=(f,p)=>{if(f&&f.length>0)return i(f.pop(),p)};return[()=>{js(o),xs(r)},()=>{if(Mk)n=new Mk(f=>l(f),{root:e}),n.observe(r),Lt(o,()=>{n.disconnect()});else{const f=()=>{const m=ld(r);i(m)},[p,h]=uM(r,f);Lt(o,p),h(),f()}lo(e,r)},()=>{if(n)return l(n.takeRecords(),!0)}]},Xk=`[${Do}]`,xee=`[${Ma}]`,Rv=["tabindex"],Yk=["wrap","cols","rows"],Av=["id","class","style","open"],bee=(e,t,n)=>{let r,o,s;const{Z:i,J:l,tt:f,rt:p,ut:h,ft:m,_t:v}=e,{V:x}=Dr(),[C]=Oo({u:GE,o:{w:0,h:0}},()=>{const U=m(ic,ac),Y=m(Mv,""),W=Y&&zo(l),L=Y&&Zs(l);v(ic,ac),v(Mv,""),v("",Zh,!0);const X=Yh(f),z=Yh(l),q=Qh(l);return v(ic,ac,U),v(Mv,"",Y),v("",Zh),zo(l,W),Zs(l,L),{w:z.w+X.w+q.w,h:z.h+X.h+q.h}}),b=p?Yk:Av.concat(Yk),w=uy(n,{v:()=>r,g:()=>o,p(U,Y){const[W]=U,[L]=Y;return[Hr(W).concat(Hr(L)).reduce((X,z)=>(X[z]=W[z]||L[z],X),{})]}}),k=U=>{Ot(U||Rv,Y=>{if(oy(Rv,Y)>-1){const W=Jn(i,Y);ni(W)?Jn(l,Y,W):Cr(l,Y)}})},_=(U,Y)=>{const[W,L]=U,X={vt:L};return t({ht:W}),!Y&&n(X),X},j=({gt:U,Yt:Y,Vt:W})=>{const L=!U||W?n:w;let X=!1;if(Y){const[z,q]=Y;X=q,t({bt:z})}L({gt:U,yt:X})},I=(U,Y)=>{const[,W]=C(),L={wt:W};return W&&!Y&&(U?n:w)(L),L},M=(U,Y,W)=>{const L={Ot:Y};return Y?!W&&w(L):h||k(U),L},[E,O,D]=f||!x?vee(i,_):[ao,ao,ao],[A,R]=h?[ao,ao]:uM(i,j,{Vt:!0,Bt:!0}),[$,K]=qk(i,!1,M,{Pt:Av,Ht:Av.concat(Rv)}),B=h&&Gl&&new Gl(j.bind(0,{gt:!0}));return B&&B.observe(i),k(),[()=>{E(),A(),s&&s[0](),B&&B.disconnect(),$()},()=>{R(),O()},()=>{const U={},Y=K(),W=D(),L=s&&s[1]();return Y&&cn(U,M.apply(0,Lt(Y,!0))),W&&cn(U,_.apply(0,Lt(W,!0))),L&&cn(U,I.apply(0,Lt(L,!0))),U},U=>{const[Y]=U("update.ignoreMutation"),[W,L]=U("update.attributes"),[X,z]=U("update.elementEvents"),[q,ne]=U("update.debounce"),Q=z||L,ie=oe=>Go(Y)&&Y(oe);if(Q&&(s&&(s[1](),s[0]()),s=qk(f||l,!0,I,{Ht:b.concat(W||[]),Dt:X,Mt:Xk,kt:(oe,V)=>{const{target:G,attributeName:J}=oe;return(!V&&J&&!h?xJ(G,Xk,xee):!1)||!!Ul(G,`.${Or}`)||!!ie(oe)}})),ne)if(w.m(),Ko(q)){const oe=q[0],V=q[1];r=Wa(oe)&&oe,o=Wa(V)&&V}else Wa(q)?(r=q,o=!1):(r=!1,o=!1)}]},Qk={x:0,y:0},yee=e=>({K:{t:0,r:0,b:0,l:0},St:!1,P:{marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},zt:Qk,Tt:Qk,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:id(e.Z)}),Cee=(e,t)=>{const n=ax(t,{}),[r,o,s]=fy(),[i,l,f]=iee(e),p=lM(yee(i)),[h,m]=p,v=hee(i,p),x=(j,I,M)=>{const O=Hr(j).some(D=>j[D])||!ay(I)||M;return O&&s("u",[j,I,M]),O},[C,b,w,k]=bee(i,m,j=>x(v(n,j),{},!1)),_=h.bind(0);return _.jt=j=>r("u",j),_.Nt=()=>{const{W:j,J:I}=i,M=zo(j),E=Zs(j);b(),l(),zo(I,M),Zs(I,E)},_.qt=i,[(j,I)=>{const M=ax(t,j,I);return k(M),x(v(M,w(),I),j,!!I)},_,()=>{o(),C(),f()}]},{round:Zk}=Math,wee=e=>{const{width:t,height:n}=fs(e),{w:r,h:o}=ld(e);return{x:Zk(t)/r||1,y:Zk(n)/o||1}},See=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:i}=e,{pointers:l}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(l||[]).includes(i)},kee=(e,t)=>Nn(e,"mousedown",Nn.bind(0,t,"click",XE,{C:!0,$:!0}),{$:!0}),Jk="pointerup pointerleave pointercancel lostpointercapture",_ee=(e,t,n,r,o,s,i)=>{const{B:l}=Dr(),{Ft:f,Gt:p,Xt:h}=r,m=`scroll${i?"Left":"Top"}`,v=`client${i?"X":"Y"}`,x=i?"width":"height",C=i?"left":"top",b=i?"w":"h",w=i?"x":"y",k=(_,j)=>I=>{const{Tt:M}=s(),E=ld(p)[b]-ld(f)[b],D=j*I/E*M[w],R=id(h)&&i?l.n||l.i?1:-1:1;o[m]=_+D*R};return Nn(p,"pointerdown",_=>{const j=Ul(_.target,`.${hy}`)===f,I=j?f:p;if(Ii(t,Do,$k,!0),See(_,e,j)){const M=!j&&_.shiftKey,E=()=>fs(f),O=()=>fs(p),D=(z,q)=>(z||E())[C]-(q||O())[C],A=k(o[m]||0,1/wee(o)[w]),R=_[v],$=E(),K=O(),B=$[x],U=D($,K)+B/2,Y=R-K[C],W=j?0:Y-U,L=z=>{js(X),I.releasePointerCapture(z.pointerId)},X=[Ii.bind(0,t,Do,$k),Nn(n,Jk,L),Nn(n,"selectstart",z=>YE(z),{S:!1}),Nn(p,Jk,L),Nn(p,"pointermove",z=>{const q=z[v]-R;(j||M)&&A(W+q)})];if(M)A(W);else if(!j){const z=Ui()[ZJ];z&&Lt(X,z.O(A,D,W,B,Y))}I.setPointerCapture(_.pointerId)}})},jee=(e,t)=>(n,r,o,s,i,l)=>{const{Xt:f}=n,[p,h]=zl(333),m=!!i.scrollBy;let v=!0;return js.bind(0,[Nn(f,"pointerenter",()=>{r(Fk,!0)}),Nn(f,"pointerleave pointercancel",()=>{r(Fk)}),Nn(f,"wheel",x=>{const{deltaX:C,deltaY:b,deltaMode:w}=x;m&&v&&w===0&&ra(f)===s&&i.scrollBy({left:C,top:b,behavior:"smooth"}),v=!1,r(Wk,!0),p(()=>{v=!0,r(Wk)}),YE(x)},{S:!1,$:!0}),kee(f,o),_ee(e,s,o,n,i,t,l),h])},{min:lx,max:e_,abs:Pee,round:Iee}=Math,dM=(e,t,n,r)=>{if(r){const l=n?"x":"y",{Tt:f,zt:p}=r,h=p[l],m=f[l];return e_(0,lx(1,h/(h+m)))}const o=n?"width":"height",s=fs(e)[o],i=fs(t)[o];return e_(0,lx(1,s/i))},Eee=(e,t,n,r,o,s)=>{const{B:i}=Dr(),l=s?"x":"y",f=s?"Left":"Top",{Tt:p}=r,h=Iee(p[l]),m=Pee(n[`scroll${f}`]),v=s&&o,x=i.i?m:h-m,b=lx(1,(v?x:m)/h),w=dM(e,t,s);return 1/w*(1-w)*b},Mee=(e,t,n)=>{const{N:r,L:o}=Dr(),{scrollbars:s}=r(),{slot:i}=s,{ct:l,W:f,Z:p,J:h,lt:m,ot:v,it:x,ut:C}=t,{scrollbars:b}=m?{}:e,{slot:w}=b||{},k=aM([f,p,h],()=>C&&x?f:p,i,w),_=(W,L,X)=>{const z=X?Js:cy;Ot(W,q=>{z(q.Xt,L)})},j=(W,L)=>{Ot(W,X=>{const[z,q]=L(X);er(z,q)})},I=(W,L,X)=>{j(W,z=>{const{Ft:q,Gt:ne}=z;return[q,{[X?"width":"height"]:`${(100*dM(q,ne,X,L)).toFixed(3)}%`}]})},M=(W,L,X)=>{const z=X?"X":"Y";j(W,q=>{const{Ft:ne,Gt:Q,Xt:ie}=q,oe=Eee(ne,Q,v,L,id(ie),X);return[ne,{transform:oe===oe?`translate${z}(${(100*oe).toFixed(3)}%)`:""}]})},E=[],O=[],D=[],A=(W,L,X)=>{const z=ry(X),q=z?X:!0,ne=z?!X:!0;q&&_(O,W,L),ne&&_(D,W,L)},R=W=>{I(O,W,!0),I(D,W)},$=W=>{M(O,W,!0),M(D,W)},K=W=>{const L=W?WJ:VJ,X=W?O:D,z=sy(X)?zk:"",q=Ei(`${Or} ${L} ${z}`),ne=Ei(oM),Q=Ei(hy),ie={Xt:q,Gt:ne,Ft:Q};return o||Js(q,FJ),lo(q,ne),lo(ne,Q),Lt(X,ie),Lt(E,[xs.bind(0,q),n(ie,A,l,p,v,W)]),ie},B=K.bind(0,!0),U=K.bind(0,!1),Y=()=>{lo(k,O[0].Xt),lo(k,D[0].Xt),Xh(()=>{A(zk)},300)};return B(),U(),[{Ut:R,Wt:$,Zt:A,Jt:{Kt:O,Qt:B,tn:j.bind(0,O)},nn:{Kt:D,Qt:U,tn:j.bind(0,D)}},Y,js.bind(0,E)]},Oee=(e,t,n,r)=>{let o,s,i,l,f,p=0;const h=lM({}),[m]=h,[v,x]=zl(),[C,b]=zl(),[w,k]=zl(100),[_,j]=zl(100),[I,M]=zl(()=>p),[E,O,D]=Mee(e,n.qt,jee(t,n)),{Z:A,J:R,ot:$,st:K,ut:B,it:U}=n.qt,{Jt:Y,nn:W,Zt:L,Ut:X,Wt:z}=E,{tn:q}=Y,{tn:ne}=W,Q=J=>{const{Xt:se}=J,re=B&&!U&&ra(se)===R&&se;return[re,{transform:re?`translate(${zo($)}px, ${Zs($)}px)`:""}]},ie=(J,se)=>{if(M(),J)L(Hk);else{const re=()=>L(Hk,!0);p>0&&!se?I(re):re()}},oe=()=>{l=s,l&&ie(!0)},V=[k,M,j,b,x,D,Nn(A,"pointerover",oe,{C:!0}),Nn(A,"pointerenter",oe),Nn(A,"pointerleave",()=>{l=!1,s&&ie(!1)}),Nn(A,"pointermove",()=>{o&&v(()=>{k(),ie(!0),_(()=>{o&&ie(!1)})})}),Nn(K,"scroll",J=>{C(()=>{z(n()),i&&ie(!0),w(()=>{i&&!l&&ie(!1)})}),r(J),B&&q(Q),B&&ne(Q)})],G=m.bind(0);return G.qt=E,G.Nt=O,[(J,se,re)=>{const{At:fe,Lt:de,It:me,yt:ye}=re,{A:he}=Dr(),ue=ax(t,J,se),De=n(),{Tt:je,Ct:Be,bt:rt}=De,[Ue,Ct]=ue("showNativeOverlaidScrollbars"),[Xe,tt]=ue("scrollbars.theme"),[ve,Re]=ue("scrollbars.visibility"),[st,mt]=ue("scrollbars.autoHide"),[ge]=ue("scrollbars.autoHideDelay"),[Ye,ot]=ue("scrollbars.dragScroll"),[lt,Me]=ue("scrollbars.clickScroll"),$e=fe||de||ye,Rt=me||Re,ke=Ue&&he.x&&he.y,ze=(Le,Ve)=>{const ct=ve==="visible"||ve==="auto"&&Le==="scroll";return L(UJ,ct,Ve),ct};if(p=ge,Ct&&L(BJ,ke),tt&&(L(f),L(Xe,!0),f=Xe),mt&&(o=st==="move",s=st==="leave",i=st!=="never",ie(!i,!0)),ot&&L(qJ,Ye),Me&&L(KJ,lt),Rt){const Le=ze(Be.x,!0),Ve=ze(Be.y,!1);L(GJ,!(Le&&Ve))}$e&&(X(De),z(De),L(Bk,!je.x,!0),L(Bk,!je.y,!1),L(HJ,rt&&!U))},G,js.bind(0,V)]},fM=(e,t,n)=>{Go(e)&&e(t||void 0,n||void 0)},za=(e,t,n)=>{const{F:r,N:o,Y:s,j:i}=Dr(),l=Ui(),f=Kh(e),p=f?e:e.target,h=iM(p);if(t&&!h){let m=!1;const v=B=>{const U=Ui()[YJ],Y=U&&U.O;return Y?Y(B,!0):B},x=cn({},r(),v(t)),[C,b,w]=fy(n),[k,_,j]=Cee(e,x),[I,M,E]=Oee(e,x,_,B=>w("scroll",[K,B])),O=(B,U)=>k(B,!!U),D=O.bind(0,{},!0),A=s(D),R=i(D),$=B=>{aee(p),A(),R(),E(),j(),m=!0,w("destroyed",[K,!!B]),b()},K={options(B,U){if(B){const Y=U?r():{},W=QE(x,cn(Y,v(B)));ay(W)||(cn(x,W),O(W))}return cn({},x)},on:C,off:(B,U)=>{B&&U&&b(B,U)},state(){const{zt:B,Tt:U,Ct:Y,Et:W,K:L,St:X,bt:z}=_();return cn({},{overflowEdge:B,overflowAmount:U,overflowStyle:Y,hasOverflow:W,padding:L,paddingAbsolute:X,directionRTL:z,destroyed:m})},elements(){const{W:B,Z:U,K:Y,J:W,tt:L,ot:X,st:z}=_.qt,{Jt:q,nn:ne}=M.qt,Q=oe=>{const{Ft:V,Gt:G,Xt:J}=oe;return{scrollbar:J,track:G,handle:V}},ie=oe=>{const{Kt:V,Qt:G}=oe,J=Q(V[0]);return cn({},J,{clone:()=>{const se=Q(G());return I({},!0,{}),se}})};return cn({},{target:B,host:U,padding:Y||W,viewport:W,content:L||W,scrollOffsetElement:X,scrollEventElement:z,scrollbarHorizontal:ie(q),scrollbarVertical:ie(ne)})},update:B=>O({},B),destroy:$.bind(0)};return _.jt((B,U,Y)=>{I(U,Y,B)}),see(p,K),Ot(Hr(l),B=>fM(l[B],0,K)),oee(_.qt.it,o().cancel,!f&&e.cancel)?($(!0),K):(_.Nt(),M.Nt(),w("initialized",[K]),_.jt((B,U,Y)=>{const{gt:W,yt:L,vt:X,At:z,Lt:q,It:ne,wt:Q,Ot:ie}=B;w("updated",[K,{updateHints:{sizeChanged:W,directionChanged:L,heightIntrinsicChanged:X,overflowEdgeChanged:z,overflowAmountChanged:q,overflowStyleChanged:ne,contentMutation:Q,hostMutation:ie},changedOptions:U,force:Y}])}),K.update(!0),K)}return h};za.plugin=e=>{Ot(XJ(e),t=>fM(t,za))};za.valid=e=>{const t=e&&e.elements,n=Go(t)&&t();return tx(n)&&!!iM(n.target)};za.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:i,U:l,N:f,q:p,F:h,G:m}=Dr();return cn({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:i,staticDefaultOptions:l,getDefaultInitialization:f,setDefaultInitialization:p,getDefaultOptions:h,setDefaultOptions:m})};const Dee=()=>{if(typeof window>"u"){const p=()=>{};return[p,p]}let e,t;const n=window,r=typeof n.requestIdleCallback=="function",o=n.requestAnimationFrame,s=n.cancelAnimationFrame,i=r?n.requestIdleCallback:o,l=r?n.cancelIdleCallback:s,f=()=>{l(e),s(t)};return[(p,h)=>{f(),e=i(r?()=>{f(),t=o(p)}:p,typeof h=="object"?h:{timeout:2233})},f]},pM=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=d.useMemo(Dee,[]),i=d.useRef(null),l=d.useRef(r),f=d.useRef(t),p=d.useRef(n);return d.useEffect(()=>{l.current=r},[r]),d.useEffect(()=>{const{current:h}=i;f.current=t,za.valid(h)&&h.options(t||{},!0)},[t]),d.useEffect(()=>{const{current:h}=i;p.current=n,za.valid(h)&&h.on(n||{},!0)},[n]),d.useEffect(()=>()=>{var h;s(),(h=i.current)==null||h.destroy()},[]),d.useMemo(()=>[h=>{const m=i.current;if(za.valid(m))return;const v=l.current,x=f.current||{},C=p.current||{},b=()=>i.current=za(h,x,C);v?o(b,v):b()},()=>i.current],[])},Ree=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:i,...l}=e,f=n,p=d.useRef(null),h=d.useRef(null),[m,v]=pM({options:r,events:o,defer:s});return d.useEffect(()=>{const{current:x}=p,{current:C}=h;return x&&C&&m({target:x,elements:{viewport:C,content:C}}),()=>{var b;return(b=v())==null?void 0:b.destroy()}},[m,n]),d.useImperativeHandle(t,()=>({osInstance:v,getElement:()=>p.current}),[]),H.createElement(f,{"data-overlayscrollbars-initialize":"",ref:p,...l},H.createElement("div",{ref:h},i))},lg=d.forwardRef(Ree),Aee=e=>{const{boardToDelete:t,setBoardToDelete:n}=e,{t:r}=we(),o=F(_=>_.config.canRestoreDeletedImagesFromBin),{currentData:s,isFetching:i}=cD((t==null?void 0:t.board_id)??zr.skipToken),l=d.useMemo(()=>ae([xe],_=>{const j=(s??[]).map(M=>Mj(_,M));return{imageUsageSummary:{isInitialImage:Ro(j,M=>M.isInitialImage),isCanvasImage:Ro(j,M=>M.isCanvasImage),isNodesImage:Ro(j,M=>M.isNodesImage),isControlNetImage:Ro(j,M=>M.isControlNetImage)}}}),[s]),[f,{isLoading:p}]=uD(),[h,{isLoading:m}]=dD(),{imageUsageSummary:v}=F(l),x=d.useCallback(()=>{t&&(f(t.board_id),n(void 0))},[t,f,n]),C=d.useCallback(()=>{t&&(h(t.board_id),n(void 0))},[t,h,n]),b=d.useCallback(()=>{n(void 0)},[n]),w=d.useRef(null),k=d.useMemo(()=>m||p||i,[m,p,i]);return t?a.jsx(Ad,{isOpen:!!t,onClose:b,leastDestructiveRef:w,isCentered:!0,children:a.jsx(Wo,{children:a.jsxs(Nd,{children:[a.jsxs(Ho,{fontSize:"lg",fontWeight:"bold",children:["Delete ",t.board_name]}),a.jsx(Vo,{children:a.jsxs(T,{direction:"column",gap:3,children:[i?a.jsx(zm,{children:a.jsx(T,{sx:{w:"full",h:32}})}):a.jsx(bE,{imageUsage:v,topMessage:"This board contains images used in the following features:",bottomMessage:"Deleting this board and its images will reset any features currently using them."}),a.jsx(be,{children:"Deleted boards cannot be restored."}),a.jsx(be,{children:r(o?"gallery.deleteImageBin":"gallery.deleteImagePermanent")})]})}),a.jsx(gs,{children:a.jsxs(T,{sx:{justifyContent:"space-between",width:"full",gap:2},children:[a.jsx(it,{ref:w,onClick:b,children:"Cancel"}),a.jsx(it,{colorScheme:"warning",isLoading:k,onClick:x,children:"Delete Board Only"}),a.jsx(it,{colorScheme:"error",isLoading:k,onClick:C,children:"Delete Board and Images"})]})})]})})}):null},Nee=d.memo(Aee),Tee="My Board",$ee=()=>{const[e,{isLoading:t}]=fD(),n=d.useCallback(()=>{e(Tee)},[e]);return a.jsx(Te,{icon:a.jsx(tl,{}),isLoading:t,tooltip:"Add Board","aria-label":"Add Board",onClick:n,size:"sm"})},Lee=d.memo($ee);var hM=kd({displayName:"ExternalLinkIcon",path:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[a.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),a.jsx("path",{d:"M15 3h6v6"}),a.jsx("path",{d:"M10 14L21 3"})]})}),cg=kd({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),zee=kd({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),Fee=kd({displayName:"DeleteIcon",path:a.jsx("g",{fill:"currentColor",children:a.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"})})}),Bee=kd({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});const Hee=ae([xe],({gallery:e})=>{const{boardSearchText:t}=e;return{boardSearchText:t}},Ce),Wee=()=>{const e=te(),{boardSearchText:t}=F(Hee),n=d.useRef(null),r=d.useCallback(l=>{e(LC(l))},[e]),o=d.useCallback(()=>{e(LC(""))},[e]),s=d.useCallback(l=>{l.key==="Escape"&&o()},[o]),i=d.useCallback(l=>{r(l.target.value)},[r]);return d.useEffect(()=>{n.current&&n.current.focus()},[]),a.jsxs(I5,{children:[a.jsx(Pm,{ref:n,placeholder:"Search Boards...",value:t,onKeyDown:s,onChange:i}),t&&t.length&&a.jsx(mb,{children:a.jsx(ps,{onClick:o,size:"xs",variant:"ghost","aria-label":"Clear Search",opacity:.5,icon:a.jsx(zee,{boxSize:2})})})]})},Vee=d.memo(Wee);function mM(e){return pD(e)}function Uee(e){return hD(e)}const gM=(e,t)=>{if(!e||!(t!=null&&t.data.current))return!1;const{actionType:n}=e,{payloadType:r}=t.data.current;if(e.id===t.data.current.id)return!1;switch(n){case"ADD_FIELD_TO_LINEAR":return r==="NODE_FIELD";case"SET_CURRENT_IMAGE":return r==="IMAGE_DTO";case"SET_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_CONTROLNET_IMAGE":return r==="IMAGE_DTO";case"SET_CANVAS_INITIAL_IMAGE":return r==="IMAGE_DTO";case"SET_NODES_IMAGE":return r==="IMAGE_DTO";case"SET_MULTI_NODES_IMAGE":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BATCH":return r==="IMAGE_DTO"||"IMAGE_DTOS";case"ADD_TO_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:s}=t.data.current.payload,i=s.board_id??"none",l=e.context.boardId;return i!==l}return r==="IMAGE_DTOS"}case"REMOVE_FROM_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:s}=t.data.current.payload;return s.board_id!=="none"}return r==="IMAGE_DTOS"}default:return!1}},Gee=e=>{const{isOver:t,label:n="Drop"}=e,r=d.useRef(Fa()),{colorMode:o}=ia();return a.jsx(gn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsxs(T,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[a.jsx(T,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:Ae("base.700","base.900")(o),opacity:.7,borderRadius:"base",alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(T,{sx:{position:"absolute",top:.5,insetInlineStart:.5,insetInlineEnd:.5,bottom:.5,opacity:1,borderWidth:2,borderColor:t?Ae("base.50","base.50")(o):Ae("base.200","base.300")(o),borderRadius:"lg",borderStyle:"dashed",transitionProperty:"common",transitionDuration:"0.1s",alignItems:"center",justifyContent:"center"},children:a.jsx(Ie,{sx:{fontSize:"2xl",fontWeight:600,transform:t?"scale(1.1)":"scale(1)",color:t?Ae("base.50","base.50")(o):Ae("base.200","base.300")(o),transitionProperty:"common",transitionDuration:"0.1s"},children:n})})]})},r.current)},vM=d.memo(Gee),Kee=e=>{const{dropLabel:t,data:n,disabled:r}=e,o=d.useRef(Fa()),{isOver:s,setNodeRef:i,active:l}=mM({id:o.current,disabled:r,data:n});return a.jsx(Ie,{ref:i,position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",pointerEvents:"none",children:a.jsx(nr,{children:gM(n,l)&&a.jsx(vM,{isOver:s,label:t})})})},xy=d.memo(Kee),qee=({isSelected:e,isHovered:t})=>a.jsx(Ie,{className:"selection-box",sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",opacity:e?1:.7,transitionProperty:"common",transitionDuration:"0.1s",pointerEvents:"none",shadow:e?t?"hoverSelected.light":"selected.light":t?"hoverUnselected.light":void 0,_dark:{shadow:e?t?"hoverSelected.dark":"selected.dark":t?"hoverUnselected.dark":void 0}}}),by=d.memo(qee),Xee=()=>a.jsx(T,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(ua,{variant:"solid",sx:{bg:"accent.400",_dark:{bg:"accent.500"}},children:"auto"})}),xM=d.memo(Xee);function yy(e){const[t,n]=d.useState(!1),[r,o]=d.useState(!1),[s,i]=d.useState(!1),[l,f]=d.useState([0,0]),p=d.useRef(null),h=F(v=>v.ui.globalContextMenuCloseTrigger);d.useEffect(()=>{if(t)setTimeout(()=>{o(!0),setTimeout(()=>{i(!0)})});else{i(!1);const v=setTimeout(()=>{o(t)},1e3);return()=>clearTimeout(v)}},[t]),d.useEffect(()=>{n(!1),i(!1),o(!1)},[h]),LL("contextmenu",v=>{var x;(x=p.current)!=null&&x.contains(v.target)||v.target===p.current?(v.preventDefault(),n(!0),f([v.pageX,v.pageY])):n(!1)});const m=d.useCallback(()=>{var v,x;(x=(v=e.menuProps)==null?void 0:v.onClose)==null||x.call(v),n(!1)},[e.menuProps]);return a.jsxs(a.Fragment,{children:[e.children(p),r&&a.jsx(wd,{...e.portalProps,children:a.jsxs(Dd,{isOpen:s,gutter:0,...e.menuProps,onClose:m,children:[a.jsx(Rd,{"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:l[0],top:l[1],cursor:"default"},...e.menuButtonProps}),e.renderMenu()]})})]})}const ug=e=>{const{boardName:t}=um(void 0,{selectFromResult:({data:n})=>{const r=n==null?void 0:n.find(s=>s.board_id===e);return{boardName:(r==null?void 0:r.board_name)||"Uncategorized"}}});return t},Yee=({board:e,setBoardToDelete:t})=>{const n=d.useCallback(()=>{t&&t(e)},[e,t]);return a.jsxs(a.Fragment,{children:[e.image_count>0&&a.jsx(a.Fragment,{}),a.jsx(Ht,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Wr,{}),onClick:n,children:"Delete Board"})]})},Qee=d.memo(Yee),Zee=()=>a.jsx(a.Fragment,{}),Jee=d.memo(Zee),ete=({board:e,board_id:t,setBoardToDelete:n,children:r})=>{const o=te(),s=d.useMemo(()=>ae(xe,({gallery:v,system:x})=>{const C=v.autoAddBoardId===t,b=x.isProcessing,w=v.autoAssignBoardOnClick;return{isAutoAdd:C,isProcessing:b,autoAssignBoardOnClick:w}},Ce),[t]),{isAutoAdd:i,isProcessing:l,autoAssignBoardOnClick:f}=F(s),p=ug(t),h=d.useCallback(()=>{o(fm(t))},[t,o]),m=d.useCallback(v=>{v.preventDefault()},[]);return a.jsx(yy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>a.jsx(Ga,{sx:{visibility:"visible !important"},motionProps:mc,onContextMenu:m,children:a.jsxs(Cc,{title:p,children:[a.jsx(Ht,{icon:a.jsx(tl,{}),isDisabled:i||l||f,onClick:h,children:"Auto-add to this Board"}),!e&&a.jsx(Jee,{}),e&&a.jsx(Qee,{board:e,setBoardToDelete:n})]})}),children:r})},bM=d.memo(ete),tte=({board:e,isSelected:t,setBoardToDelete:n})=>{const r=te(),o=d.useMemo(()=>ae(xe,({gallery:R,system:$})=>{const K=e.board_id===R.autoAddBoardId,B=R.autoAssignBoardOnClick,U=$.isProcessing;return{isSelectedForAutoAdd:K,autoAssignBoardOnClick:B,isProcessing:U}},Ce),[e.board_id]),{isSelectedForAutoAdd:s,autoAssignBoardOnClick:i,isProcessing:l}=F(o),[f,p]=d.useState(!1),h=d.useCallback(()=>{p(!0)},[]),m=d.useCallback(()=>{p(!1)},[]),{data:v}=Tj(e.board_id),{data:x}=$j(e.board_id),C=d.useMemo(()=>{if(!(!v||!x))return`${v} image${v>1?"s":""}, ${x} asset${x>1?"s":""}`},[x,v]),{currentData:b}=po(e.cover_image_name??zr.skipToken),{board_name:w,board_id:k}=e,[_,j]=d.useState(w),I=d.useCallback(()=>{r(Lj(k)),i&&!l&&r(fm(k))},[k,i,l,r]),[M,{isLoading:E}]=mD(),O=d.useMemo(()=>({id:k,actionType:"ADD_TO_BOARD",context:{boardId:k}}),[k]),D=d.useCallback(async R=>{if(!R.trim()){j(w);return}if(R!==w)try{const{board_name:$}=await M({board_id:k,changes:{board_name:R}}).unwrap();j($)}catch{j(w)}},[k,w,M]),A=d.useCallback(R=>{j(R)},[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx(T,{onMouseOver:h,onMouseOut:m,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",w:"full",h:"full"},children:a.jsx(bM,{board:e,board_id:k,setBoardToDelete:n,children:R=>a.jsx(Dt,{label:C,openDelay:1e3,hasArrow:!0,children:a.jsxs(T,{ref:R,onClick:I,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[b!=null&&b.thumbnail_url?a.jsx(qi,{src:b==null?void 0:b.thumbnail_url,draggable:!1,sx:{objectFit:"cover",w:"full",h:"full",maxH:"full",borderRadius:"base",borderBottomRadius:"lg"}}):a.jsx(T,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(An,{boxSize:12,as:$Z,sx:{mt:-6,opacity:.7,color:"base.500",_dark:{color:"base.500"}}})}),s&&a.jsx(xM,{}),a.jsx(by,{isSelected:t,isHovered:f}),a.jsx(T,{sx:{position:"absolute",bottom:0,left:0,p:1,justifyContent:"center",alignItems:"center",w:"full",maxW:"full",borderBottomRadius:"base",bg:t?"accent.400":"base.500",color:t?"base.50":"base.100",_dark:{bg:t?"accent.500":"base.600",color:t?"base.50":"base.100"},lineHeight:"short",fontSize:"xs"},children:a.jsxs(km,{value:_,isDisabled:E,submitOnBlur:!0,onChange:A,onSubmit:D,sx:{w:"full"},children:[a.jsx(Sm,{sx:{p:0,fontWeight:t?700:500,textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},noOfLines:1}),a.jsx(wm,{sx:{p:0,_focusVisible:{p:0,textAlign:"center",boxShadow:"none"}}})]})}),a.jsx(xy,{data:O,dropLabel:a.jsx(be,{fontSize:"md",children:"Move"})})]})})})})})},nte=d.memo(tte),rte=ae(xe,({gallery:e,system:t})=>{const{autoAddBoardId:n,autoAssignBoardOnClick:r}=e,{isProcessing:o}=t;return{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}},Ce),yM=d.memo(({isSelected:e})=>{const t=te(),{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}=F(rte),s=ug("none"),i=d.useCallback(()=>{t(Lj("none")),r&&!o&&t(fm("none"))},[t,r,o]),[l,f]=d.useState(!1),p=d.useCallback(()=>{f(!0)},[]),h=d.useCallback(()=>{f(!1)},[]),m=d.useMemo(()=>({id:"no_board",actionType:"REMOVE_FROM_BOARD"}),[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx(T,{onMouseOver:p,onMouseOut:h,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"base",w:"full",h:"full"},children:a.jsx(bM,{board_id:"none",children:v=>a.jsxs(T,{ref:v,onClick:i,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(T,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(qi,{src:Dj,alt:"invoke-ai-logo",sx:{opacity:.4,filter:"grayscale(1)",mt:-6,w:16,h:16,minW:16,minH:16,userSelect:"none"}})}),n==="none"&&a.jsx(xM,{}),a.jsx(T,{sx:{position:"absolute",bottom:0,left:0,p:1,justifyContent:"center",alignItems:"center",w:"full",maxW:"full",borderBottomRadius:"base",bg:e?"accent.400":"base.500",color:e?"base.50":"base.100",_dark:{bg:e?"accent.500":"base.600",color:e?"base.50":"base.100"},lineHeight:"short",fontSize:"xs",fontWeight:e?700:500},children:s}),a.jsx(by,{isSelected:e,isHovered:l}),a.jsx(xy,{data:m,dropLabel:a.jsx(be,{fontSize:"md",children:"Move"})})]})})})})});yM.displayName="HoverableBoard";const ote=d.memo(yM),ste=ae([xe],({gallery:e})=>{const{selectedBoardId:t,boardSearchText:n}=e;return{selectedBoardId:t,boardSearchText:n}},Ce),ate=e=>{const{isOpen:t}=e,{selectedBoardId:n,boardSearchText:r}=F(ste),{data:o}=um(),s=r?o==null?void 0:o.filter(f=>f.board_name.toLowerCase().includes(r.toLowerCase())):o,[i,l]=d.useState();return a.jsxs(a.Fragment,{children:[a.jsx(ym,{in:t,animateOpacity:!0,children:a.jsxs(T,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[a.jsxs(T,{sx:{gap:2,alignItems:"center"},children:[a.jsx(Vee,{}),a.jsx(Lee,{})]}),a.jsx(lg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsxs(Ua,{className:"list-container",sx:{gridTemplateColumns:"repeat(auto-fill, minmax(108px, 1fr));",maxH:346},children:[a.jsx(ed,{sx:{p:1.5},children:a.jsx(ote,{isSelected:n==="none"})}),s&&s.map(f=>a.jsx(ed,{sx:{p:1.5},children:a.jsx(nte,{board:f,isSelected:n===f.board_id,setBoardToDelete:l})},f.board_id))]})})]})}),a.jsx(Nee,{boardToDelete:i,setBoardToDelete:l})]})},ite=d.memo(ate),lte=ae([xe],e=>{const{selectedBoardId:t}=e.gallery;return{selectedBoardId:t}},Ce),cte=e=>{const{isOpen:t,onToggle:n}=e,{selectedBoardId:r}=F(lte),o=ug(r),s=d.useMemo(()=>o.length>20?`${o.substring(0,20)}...`:o,[o]);return a.jsxs(T,{as:gc,onClick:n,size:"sm",sx:{position:"relative",gap:2,w:"full",justifyContent:"space-between",alignItems:"center",px:2},children:[a.jsx(be,{noOfLines:1,sx:{fontWeight:600,w:"100%",textAlign:"center",color:"base.800",_dark:{color:"base.200"}},children:s}),a.jsx(cg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]})},ute=d.memo(cte),dte=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return a.jsxs($m,{isLazy:o,...s,children:[a.jsx(Db,{children:t}),a.jsxs(Lm,{shadow:"dark-lg",children:[r&&a.jsx(cP,{}),n]})]})},Vd=d.memo(dte);function fte(e){return Ne({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)}const pte=e=>{const[t,n]=d.useState(!1),{label:r,value:o,min:s=1,max:i=100,step:l=1,onChange:f,tooltipSuffix:p="",withSliderMarks:h=!1,withInput:m=!1,isInteger:v=!1,inputWidth:x=16,withReset:C=!1,hideTooltip:b=!1,isCompact:w=!1,isDisabled:k=!1,sliderMarks:_,handleReset:j,sliderFormControlProps:I,sliderFormLabelProps:M,sliderMarkProps:E,sliderTrackProps:O,sliderThumbProps:D,sliderNumberInputProps:A,sliderNumberInputFieldProps:R,sliderNumberInputStepperProps:$,sliderTooltipProps:K,sliderIAIIconButtonProps:B,...U}=e,Y=te(),{t:W}=we(),[L,X]=d.useState(String(o));d.useEffect(()=>{X(o)},[o]);const z=d.useMemo(()=>A!=null&&A.min?A.min:s,[s,A==null?void 0:A.min]),q=d.useMemo(()=>A!=null&&A.max?A.max:i,[i,A==null?void 0:A.max]),ne=d.useCallback(se=>{f(se)},[f]),Q=d.useCallback(se=>{se.target.value===""&&(se.target.value=String(z));const re=Ri(v?Math.floor(Number(se.target.value)):Number(L),z,q),fe=Eu(re,l);f(fe),X(fe)},[v,L,z,q,f,l]),ie=d.useCallback(se=>{X(se)},[]),oe=d.useCallback(()=>{j&&j()},[j]),V=d.useCallback(se=>{se.target instanceof HTMLDivElement&&se.target.focus()},[]),G=d.useCallback(se=>{se.shiftKey&&Y(Ir(!0))},[Y]),J=d.useCallback(se=>{se.shiftKey||Y(Ir(!1))},[Y]);return a.jsxs(un,{onClick:V,sx:w?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},isDisabled:k,...I,children:[r&&a.jsx(Gn,{sx:m?{mb:-1.5}:{},...M,children:r}),a.jsxs(xb,{w:"100%",gap:2,alignItems:"center",children:[a.jsxs(Ab,{"aria-label":r,value:o,min:s,max:i,step:l,onChange:ne,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:k,...U,children:[h&&!_&&a.jsxs(a.Fragment,{children:[a.jsx($l,{value:s,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...E,children:s}),a.jsx($l,{value:i,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...E,children:i})]}),h&&_&&a.jsx(a.Fragment,{children:_.map((se,re)=>re===0?a.jsx($l,{value:se,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...E,children:se},se):re===_.length-1?a.jsx($l,{value:se,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...E,children:se},se):a.jsx($l,{value:se,sx:{transform:"translateX(-50%)"},...E,children:se},se))}),a.jsx(Tb,{...O,children:a.jsx($b,{})}),a.jsx(Dt,{hasArrow:!0,placement:"top",isOpen:t,label:`${o}${p}`,hidden:b,...K,children:a.jsx(Nb,{...D,zIndex:0})})]}),m&&a.jsxs(Dm,{min:z,max:q,step:l,value:L,onChange:ie,onBlur:Q,focusInputOnChange:!1,...A,children:[a.jsx(Am,{onKeyDown:G,onKeyUp:J,minWidth:x,...R}),a.jsxs(Rm,{...$,children:[a.jsx(Tm,{onClick:()=>f(Number(L))}),a.jsx(Nm,{onClick:()=>f(Number(L))})]})]}),C&&a.jsx(Te,{size:"sm","aria-label":W("accessibility.reset"),tooltip:W("accessibility.reset"),icon:a.jsx(fte,{}),isDisabled:k,onClick:oe,...B})]})]})},Ze=d.memo(pte),CM=d.forwardRef(({label:e,tooltip:t,description:n,disabled:r,...o},s)=>a.jsx(Dt,{label:t,placement:"top",hasArrow:!0,openDelay:500,children:a.jsx(Ie,{ref:s,...o,children:a.jsxs(Ie,{children:[a.jsx(wc,{children:e}),n&&a.jsx(wc,{size:"xs",color:"base.600",children:n})]})})}));CM.displayName="IAIMantineSelectItemWithTooltip";const ri=d.memo(CM),hte=ae([xe],({gallery:e,system:t})=>{const{autoAddBoardId:n,autoAssignBoardOnClick:r}=e,{isProcessing:o}=t;return{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}},Ce),mte=()=>{const e=te(),{autoAddBoardId:t,autoAssignBoardOnClick:n,isProcessing:r}=F(hte),o=d.useRef(null),{boards:s,hasBoards:i}=um(void 0,{selectFromResult:({data:f})=>{const p=[{label:"None",value:"none"}];return f==null||f.forEach(({board_id:h,board_name:m})=>{p.push({label:m,value:h})}),{boards:p,hasBoards:p.length>1}}}),l=d.useCallback(f=>{f&&e(fm(f))},[e]);return a.jsx(Gt,{label:"Auto-Add Board",inputRef:o,autoFocus:!0,placeholder:"Select a Board",value:t,data:s,nothingFound:"No matching Boards",itemComponent:ri,disabled:!i||n||r,filter:(f,p)=>{var h;return((h=p.label)==null?void 0:h.toLowerCase().includes(f.toLowerCase().trim()))||p.value.toLowerCase().includes(f.toLowerCase().trim())},onChange:l})},gte=d.memo(mte),vte=e=>{const{label:t,...n}=e,{colorMode:r}=ia();return a.jsx(Cm,{colorScheme:"accent",...n,children:a.jsx(be,{sx:{fontSize:"sm",color:Ae("base.800","base.200")(r)},children:t})})},ur=d.memo(vte),xte=ae([xe],e=>{const{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}=e.gallery;return{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}},Ce),bte=()=>{const e=te(),{t}=we(),{galleryImageMinimumWidth:n,shouldAutoSwitch:r,autoAssignBoardOnClick:o}=F(xte),s=d.useCallback(f=>{e(zC(f))},[e]),i=d.useCallback(()=>{e(zC(64))},[e]),l=d.useCallback(f=>{e(gD(f.target.checked))},[e]);return a.jsx(Vd,{triggerComponent:a.jsx(Te,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:a.jsx($E,{})}),children:a.jsxs(T,{direction:"column",gap:2,children:[a.jsx(Ze,{value:n,onChange:s,min:45,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:i}),a.jsx(Ut,{label:t("gallery.autoSwitchNewImages"),isChecked:r,onChange:l}),a.jsx(ur,{label:t("gallery.autoAssignBoardOnClick"),isChecked:o,onChange:f=>e(vD(f.target.checked))}),a.jsx(gte,{})]})})},yte=d.memo(bte),Cte=e=>e.image?a.jsx(zm,{sx:{w:`${e.image.width}px`,h:"auto",objectFit:"contain",aspectRatio:`${e.image.width}/${e.image.height}`}}):a.jsx(T,{sx:{opacity:.7,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(Ki,{size:"xl"})}),tr=e=>{const{icon:t=Wi,boxSize:n=16}=e;return a.jsxs(T,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",flexDir:"column",gap:2,userSelect:"none",opacity:.7,color:"base.700",_dark:{color:"base.500"},...e.sx},children:[t&&a.jsx(An,{as:t,boxSize:n,opacity:.7}),e.label&&a.jsx(be,{textAlign:"center",children:e.label})]})},dg=0,oi=1,Wc=2,wM=4;function wte(e,t){return n=>e(t(n))}function Ste(e,t){return t(e)}function SM(e,t){return n=>e(t,n)}function t_(e,t){return()=>e(t)}function Cy(e,t){return t(e),e}function nl(...e){return e}function kte(e){e()}function n_(e){return()=>e}function _te(...e){return()=>{e.map(kte)}}function fg(){}function pr(e,t){return e(oi,t)}function Rn(e,t){e(dg,t)}function wy(e){e(Wc)}function pg(e){return e(wM)}function Vt(e,t){return pr(e,SM(t,dg))}function r_(e,t){const n=e(oi,r=>{n(),t(r)});return n}function yn(){const e=[];return(t,n)=>{switch(t){case Wc:e.splice(0,e.length);return;case oi:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case dg:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function dt(e){let t=e;const n=yn();return(r,o)=>{switch(r){case oi:o(t);break;case dg:t=o;break;case wM:return t}return n(r,o)}}function jte(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case oi:return s?n===s?void 0:(r(),n=s,t=pr(e,s),t):(r(),fg);case Wc:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Wu(e){return Cy(yn(),t=>Vt(e,t))}function lc(e,t){return Cy(dt(t),n=>Vt(e,n))}function Pte(...e){return t=>e.reduceRight(Ste,t)}function ft(e,...t){const n=Pte(...t);return(r,o)=>{switch(r){case oi:return pr(e,n(o));case Wc:wy(e);return}}}function kM(e,t){return e===t}function kr(e=kM){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Un(e){return t=>n=>{e(n)&&t(n)}}function en(e){return t=>wte(t,e)}function Da(e){return t=>()=>t(e)}function wp(e,t){return n=>r=>n(t=e(t,r))}function cx(e){return t=>n=>{e>0?e--:t(n)}}function Du(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function o_(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function cs(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const l=Math.pow(2,i);pr(s,f=>{const p=n;n=n|l,t[i]=f,p!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const l=()=>s([i].concat(t));n===o?l():r=l}}function s_(...e){return function(t,n){switch(t){case oi:return _te(...e.map(r=>pr(r,n)));case Wc:return;default:throw new Error(`unrecognized action ${t}`)}}}function Pt(e,t=kM){return ft(e,kr(t))}function qs(...e){const t=yn(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const l=Math.pow(2,i);pr(s,f=>{n[i]=f,r=r|l,r===o&&Rn(t,n)})}),function(s,i){switch(s){case oi:return r===o&&i(n),pr(t,i);case Wc:return wy(t);default:throw new Error(`unrecognized action ${s}`)}}}function Ps(e,t=[],{singleton:n}={singleton:!0}){return{id:Ite(),constructor:e,dependencies:t,singleton:n}}const Ite=()=>Symbol();function Ete(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const l=o(s.map(f=>n(f)));return i&&t.set(r,l),l};return n(e)}function Mte(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)r.hasOwnProperty(i)||(n[i]=t[i]);return n}const Sp=typeof document<"u"?H.useLayoutEffect:H.useEffect;function Ote(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),l=H.createContext({});function f(b,w){b.propsReady&&Rn(b.propsReady,!1);for(const k of r){const _=b[t.required[k]];Rn(_,w[k])}for(const k of o)if(k in w){const _=b[t.optional[k]];Rn(_,w[k])}b.propsReady&&Rn(b.propsReady,!0)}function p(b){return s.reduce((w,k)=>(w[k]=_=>{const j=b[t.methods[k]];Rn(j,_)},w),{})}function h(b){return i.reduce((w,k)=>(w[k]=jte(b[t.events[k]]),w),{})}return{Component:H.forwardRef((b,w)=>{const{children:k,..._}=b,[j]=H.useState(()=>Cy(Ete(e),M=>f(M,_))),[I]=H.useState(t_(h,j));return Sp(()=>{for(const M of i)M in _&&pr(I[M],_[M]);return()=>{Object.values(I).map(wy)}},[_,I,j]),Sp(()=>{f(j,_)}),H.useImperativeHandle(w,n_(p(j))),H.createElement(l.Provider,{value:j},n?H.createElement(n,Mte([...r,...o,...i],_),k):k)}),usePublisher:b=>H.useCallback(SM(Rn,H.useContext(l)[b]),[b]),useEmitterValue:b=>{const k=H.useContext(l)[b],[_,j]=H.useState(t_(pg,k));return Sp(()=>pr(k,I=>{I!==_&&j(n_(I))}),[k,_]),_},useEmitter:(b,w)=>{const _=H.useContext(l)[b];Sp(()=>pr(_,w),[w,_])}}}const Dte=typeof document<"u"?H.useLayoutEffect:H.useEffect,Rte=Dte;var Sy=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Sy||{});const Ate={0:"debug",1:"log",2:"warn",3:"error"},Nte=()=>typeof globalThis>"u"?window:globalThis,_M=Ps(()=>{const e=dt(3);return{log:dt((n,r,o=1)=>{var s;const i=(s=Nte().VIRTUOSO_LOG_LEVEL)!=null?s:pg(e);o>=i&&console[Ate[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function jM(e,t=!0){const n=H.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=H.useMemo(()=>new ResizeObserver(s=>{const i=s[0].target;i.offsetParent!==null&&e(i)}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function hg(e,t=!0){return jM(e,t).callbackRef}function Jh(e,t){return Math.round(e.getBoundingClientRect()[t])}function PM(e,t){return Math.abs(e-t)<1.01}function IM(e,t,n,r=fg,o){const s=H.useRef(null),i=H.useRef(null),l=H.useRef(null),f=H.useCallback(m=>{const v=m.target,x=v===window||v===document,C=x?window.pageYOffset||document.documentElement.scrollTop:v.scrollTop,b=x?document.documentElement.scrollHeight:v.scrollHeight,w=x?window.innerHeight:v.offsetHeight,k=()=>{e({scrollTop:Math.max(C,0),scrollHeight:b,viewportHeight:w})};m.suppressFlushSync?k():xD.flushSync(k),i.current!==null&&(C===i.current||C<=0||C===b-w)&&(i.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t]);H.useEffect(()=>{const m=o||s.current;return r(o||s.current),f({target:m,suppressFlushSync:!0}),m.addEventListener("scroll",f,{passive:!0}),()=>{r(null),m.removeEventListener("scroll",f)}},[s,f,n,r,o]);function p(m){const v=s.current;if(!v||"offsetHeight"in v&&v.offsetHeight===0)return;const x=m.behavior==="smooth";let C,b,w;v===window?(b=Math.max(Jh(document.documentElement,"height"),document.documentElement.scrollHeight),C=window.innerHeight,w=document.documentElement.scrollTop):(b=v.scrollHeight,C=Jh(v,"height"),w=v.scrollTop);const k=b-C;if(m.top=Math.ceil(Math.max(Math.min(k,m.top),0)),PM(C,b)||m.top===w){e({scrollTop:w,scrollHeight:b,viewportHeight:C}),x&&t(!0);return}x?(i.current=m.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,i.current=null,t(!0)},1e3)):i.current=null,v.scrollTo(m)}function h(m){s.current.scrollBy(m)}return{scrollerRef:s,scrollByCallback:h,scrollToCallback:p}}const mg=Ps(()=>{const e=yn(),t=yn(),n=dt(0),r=yn(),o=dt(0),s=yn(),i=yn(),l=dt(0),f=dt(0),p=dt(0),h=dt(0),m=yn(),v=yn(),x=dt(!1);return Vt(ft(e,en(({scrollTop:C})=>C)),t),Vt(ft(e,en(({scrollHeight:C})=>C)),i),Vt(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:l,fixedHeaderHeight:f,fixedFooterHeight:p,footerHeight:h,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:m,scrollBy:v,statefulScrollTop:o,deviation:n,scrollingInProgress:x}},[],{singleton:!0}),Tte=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function $te(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Tte)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const em="up",Vu="down",Lte="none",zte={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Fte=0,EM=Ps(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=dt(!1),l=dt(!0),f=yn(),p=yn(),h=dt(4),m=dt(Fte),v=lc(ft(s_(ft(Pt(t),cx(1),Da(!0)),ft(Pt(t),cx(1),Da(!1),o_(100))),kr()),!1),x=lc(ft(s_(ft(s,Da(!0)),ft(s,Da(!1),o_(200))),kr()),!1);Vt(ft(qs(Pt(t),Pt(m)),en(([_,j])=>_<=j),kr()),l),Vt(ft(l,Du(50)),p);const C=Wu(ft(qs(e,Pt(n),Pt(r),Pt(o),Pt(h)),wp((_,[{scrollTop:j,scrollHeight:I},M,E,O,D])=>{const A=j+M-I>-D,R={viewportHeight:M,scrollTop:j,scrollHeight:I};if(A){let K,B;return j>_.state.scrollTop?(K="SCROLLED_DOWN",B=_.state.scrollTop-j):(K="SIZE_DECREASED",B=_.state.scrollTop-j||_.scrollTopDelta),{atBottom:!0,state:R,atBottomBecause:K,scrollTopDelta:B}}let $;return R.scrollHeight>_.state.scrollHeight?$="SIZE_INCREASED":M<_.state.viewportHeight?$="VIEWPORT_HEIGHT_DECREASING":j<_.state.scrollTop?$="SCROLLING_UPWARDS":$="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:$,state:R}},zte),kr((_,j)=>_&&_.atBottom===j.atBottom))),b=lc(ft(e,wp((_,{scrollTop:j,scrollHeight:I,viewportHeight:M})=>{if(PM(_.scrollHeight,I))return{scrollTop:j,scrollHeight:I,jump:0,changed:!1};{const E=I-(j+M)<1;return _.scrollTop!==j&&E?{scrollHeight:I,scrollTop:j,jump:_.scrollTop-j,changed:!0}:{scrollHeight:I,scrollTop:j,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Un(_=>_.changed),en(_=>_.jump)),0);Vt(ft(C,en(_=>_.atBottom)),i),Vt(ft(i,Du(50)),f);const w=dt(Vu);Vt(ft(e,en(({scrollTop:_})=>_),kr(),wp((_,j)=>pg(x)?{direction:_.direction,prevScrollTop:j}:{direction:j<_.prevScrollTop?em:Vu,prevScrollTop:j},{direction:Vu,prevScrollTop:0}),en(_=>_.direction)),w),Vt(ft(e,Du(50),Da(Lte)),w);const k=dt(0);return Vt(ft(v,Un(_=>!_),Da(0)),k),Vt(ft(t,Du(100),cs(v),Un(([_,j])=>!!j),wp(([_,j],[I])=>[j,I],[0,0]),en(([_,j])=>j-_)),k),{isScrolling:v,isAtTop:l,isAtBottom:i,atBottomState:C,atTopStateChange:p,atBottomStateChange:f,scrollDirection:w,atBottomThreshold:h,atTopThreshold:m,scrollVelocity:k,lastJumpDueToItemResize:b}},nl(mg)),Bte=Ps(([{log:e}])=>{const t=dt(!1),n=Wu(ft(t,Un(r=>r),kr()));return pr(t,r=>{r&&pg(e)("props updated",{},Sy.DEBUG)}),{propsReady:t,didMount:n}},nl(_M),{singleton:!0});function MM(e,t){e==0?t():requestAnimationFrame(()=>MM(e-1,t))}function Hte(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}function ux(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function Wte(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const tm="top",nm="bottom",a_="none";function i_(e,t,n){return typeof e=="number"?n===em&&t===tm||n===Vu&&t===nm?e:0:n===em?t===tm?e.main:e.reverse:t===nm?e.main:e.reverse}function l_(e,t){return typeof e=="number"?e:e[t]||0}const Vte=Ps(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=yn(),i=dt(0),l=dt(0),f=dt(0),p=lc(ft(qs(Pt(e),Pt(t),Pt(r),Pt(s,ux),Pt(f),Pt(i),Pt(o),Pt(n),Pt(l)),en(([h,m,v,[x,C],b,w,k,_,j])=>{const I=h-_,M=w+k,E=Math.max(v-I,0);let O=a_;const D=l_(j,tm),A=l_(j,nm);return x-=_,x+=v+k,C+=v+k,C-=_,x>h+M-D&&(O=em),C<h-E+m+A&&(O=Vu),O!==a_?[Math.max(I-v-i_(b,tm,O)-D,0),I-E-k+m+i_(b,nm,O)+A]:null}),Un(h=>h!=null),kr(ux)),[0,0]);return{listBoundary:s,overscan:f,topListHeight:i,increaseViewportBy:l,visibleRange:p}},nl(mg),{singleton:!0}),Ute=Ps(([{scrollVelocity:e}])=>{const t=dt(!1),n=yn(),r=dt(!1);return Vt(ft(e,cs(r,t,n),Un(([o,s])=>!!s),en(([o,s,i,l])=>{const{exit:f,enter:p}=s;if(i){if(f(o,l))return!1}else if(p(o,l))return!0;return i}),kr()),t),pr(ft(qs(t,e,n),cs(r)),([[o,s,i],l])=>o&&l&&l.change&&l.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},nl(EM),{singleton:!0});function Gte(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const Kte=Ps(([{scrollTo:e,scrollContainerState:t}])=>{const n=yn(),r=yn(),o=yn(),s=dt(!1),i=dt(void 0);return Vt(ft(qs(n,r),en(([{viewportHeight:l,scrollTop:f,scrollHeight:p},{offsetTop:h}])=>({scrollTop:Math.max(0,f-h),scrollHeight:p,viewportHeight:l}))),t),Vt(ft(e,cs(r),en(([l,{offsetTop:f}])=>({...l,top:l.top+f}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},nl(mg)),Nv="-webkit-sticky",c_="sticky",OM=Gte(()=>{if(typeof document>"u")return c_;const e=document.createElement("div");return e.style.position=Nv,e.style.position===Nv?Nv:c_});function qte(e,t){const n=H.useRef(null),r=H.useCallback(l=>{if(l===null||!l.offsetParent)return;const f=l.getBoundingClientRect(),p=f.width;let h,m;if(t){const v=t.getBoundingClientRect(),x=f.top-v.top;h=v.height-Math.max(0,x),m=x+t.scrollTop}else h=window.innerHeight-Math.max(0,f.top),m=f.top+window.pageYOffset;n.current={offsetTop:m,visibleHeight:h,visibleWidth:p},e(n.current)},[e,t]),{callbackRef:o,ref:s}=jM(r),i=H.useCallback(()=>{r(s.current)},[r,s]);return H.useEffect(()=>{if(t){t.addEventListener("scroll",i);const l=new ResizeObserver(i);return l.observe(t),()=>{t.removeEventListener("scroll",i),l.unobserve(t)}}else return window.addEventListener("scroll",i),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[i,t]),o}H.createContext(void 0);const DM=H.createContext(void 0);function Xte(e){return e}OM();const Yte={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},RM={width:"100%",height:"100%",position:"absolute",top:0};OM();function Mi(e,t){if(typeof e!="string")return{context:t}}function Qte({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...l}){const f=e("scrollContainerState"),p=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("scrollerRef"),v=n("context"),{scrollerRef:x,scrollByCallback:C,scrollToCallback:b}=IM(f,h,p,m);return t("scrollTo",b),t("scrollBy",C),H.createElement(p,{ref:x,style:{...Yte,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...l,...Mi(p,v)},i)})}function Zte({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...l}){const f=e("windowScrollContainerState"),p=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("totalListHeight"),v=n("deviation"),x=n("customScrollParent"),C=n("context"),{scrollerRef:b,scrollByCallback:w,scrollToCallback:k}=IM(f,h,p,fg,x);return Rte(()=>(b.current=x||window,()=>{b.current=null}),[b,x]),t("windowScrollTo",k),t("scrollBy",w),H.createElement(p,{style:{position:"relative",...s,...m!==0?{height:m+v}:{}},"data-virtuoso-scroller":!0,...l,...Mi(p,C)},i)})}const u_={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Jte={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:d_,ceil:f_,floor:rm,min:Tv,max:Uu}=Math;function ene(e){return{...Jte,items:e}}function p_(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>{const s=n===null?null:n[o+e];return{index:o+e,data:s}})}function tne(e,t){return e&&e.column===t.column&&e.row===t.row}function kp(e,t){return e&&e.width===t.width&&e.height===t.height}const nne=Ps(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:l,scrollContainerState:f,footerHeight:p,headerHeight:h},m,v,{propsReady:x,didMount:C},{windowViewportRect:b,useWindowScroll:w,customScrollParent:k,windowScrollContainerState:_,windowScrollTo:j},I])=>{const M=dt(0),E=dt(0),O=dt(u_),D=dt({height:0,width:0}),A=dt({height:0,width:0}),R=yn(),$=yn(),K=dt(0),B=dt(null),U=dt({row:0,column:0}),Y=yn(),W=yn(),L=dt(!1),X=dt(0),z=dt(!0),q=dt(!1);pr(ft(C,cs(X),Un(([G,J])=>!!J)),()=>{Rn(z,!1),Rn(E,0)}),pr(ft(qs(C,z,A,D,X,q),Un(([G,J,se,re,,fe])=>G&&!J&&se.height!==0&&re.height!==0&&!fe)),([,,,,G])=>{Rn(q,!0),MM(1,()=>{Rn(R,G)}),r_(ft(r),()=>{Rn(n,[0,0]),Rn(z,!0)})}),Vt(ft(W,Un(G=>G!=null&&G.scrollTop>0),Da(0)),E),pr(ft(C,cs(W),Un(([,G])=>G!=null)),([,G])=>{G&&(Rn(D,G.viewport),Rn(A,G==null?void 0:G.item),Rn(U,G.gap),G.scrollTop>0&&(Rn(L,!0),r_(ft(r,cx(1)),J=>{Rn(L,!1)}),Rn(i,{top:G.scrollTop})))}),Vt(ft(D,en(({height:G})=>G)),o),Vt(ft(qs(Pt(D,kp),Pt(A,kp),Pt(U,(G,J)=>G&&G.column===J.column&&G.row===J.row),Pt(r)),en(([G,J,se,re])=>({viewport:G,item:J,gap:se,scrollTop:re}))),Y),Vt(ft(qs(Pt(M),t,Pt(U,tne),Pt(A,kp),Pt(D,kp),Pt(B),Pt(E),Pt(L),Pt(z),Pt(X)),Un(([,,,,,,,G])=>!G),en(([G,[J,se],re,fe,de,me,ye,,he,ue])=>{const{row:De,column:je}=re,{height:Be,width:rt}=fe,{width:Ue}=de;if(ye===0&&(G===0||Ue===0))return u_;if(rt===0){const ot=Hte(ue,G),lt=ot===0?Math.max(ye-1,0):ot;return ene(p_(ot,lt,me))}const Ct=AM(Ue,rt,je);let Xe,tt;he?J===0&&se===0&&ye>0?(Xe=0,tt=ye-1):(Xe=Ct*rm((J+De)/(Be+De)),tt=Ct*f_((se+De)/(Be+De))-1,tt=Tv(G-1,Uu(tt,Ct-1)),Xe=Tv(tt,Uu(0,Xe))):(Xe=0,tt=-1);const ve=p_(Xe,tt,me),{top:Re,bottom:st}=h_(de,re,fe,ve),mt=f_(G/Ct),Ye=mt*Be+(mt-1)*De-st;return{items:ve,offsetTop:Re,offsetBottom:Ye,top:Re,bottom:st,itemHeight:Be,itemWidth:rt}})),O),Vt(ft(B,Un(G=>G!==null),en(G=>G.length)),M),Vt(ft(qs(D,A,O,U),Un(([G,J,{items:se}])=>se.length>0&&J.height!==0&&G.height!==0),en(([G,J,{items:se},re])=>{const{top:fe,bottom:de}=h_(G,re,J,se);return[fe,de]}),kr(ux)),n);const ne=dt(!1);Vt(ft(r,cs(ne),en(([G,J])=>J||G!==0)),ne);const Q=Wu(ft(Pt(O),Un(({items:G})=>G.length>0),cs(M,ne),Un(([{items:G},J,se])=>se&&G[G.length-1].index===J-1),en(([,G])=>G-1),kr())),ie=Wu(ft(Pt(O),Un(({items:G})=>G.length>0&&G[0].index===0),Da(0),kr())),oe=Wu(ft(Pt(O),cs(L),Un(([{items:G},J])=>G.length>0&&!J),en(([{items:G}])=>({startIndex:G[0].index,endIndex:G[G.length-1].index})),kr(Wte),Du(0)));Vt(oe,v.scrollSeekRangeChanged),Vt(ft(R,cs(D,A,M,U),en(([G,J,se,re,fe])=>{const de=$te(G),{align:me,behavior:ye,offset:he}=de;let ue=de.index;ue==="LAST"&&(ue=re-1),ue=Uu(0,ue,Tv(re-1,ue));let De=dx(J,fe,se,ue);return me==="end"?De=d_(De-J.height+se.height):me==="center"&&(De=d_(De-J.height/2+se.height/2)),he&&(De+=he),{top:De,behavior:ye}})),i);const V=lc(ft(O,en(G=>G.offsetBottom+G.bottom)),0);return Vt(ft(b,en(G=>({width:G.visibleWidth,height:G.visibleHeight}))),D),{data:B,totalCount:M,viewportDimensions:D,itemDimensions:A,scrollTop:r,scrollHeight:$,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:R,smoothScrollTargetReached:l,windowViewportRect:b,windowScrollTo:j,useWindowScroll:w,customScrollParent:k,windowScrollContainerState:_,deviation:K,scrollContainerState:f,footerHeight:p,headerHeight:h,initialItemCount:E,gap:U,restoreStateFrom:W,...v,initialTopMostItemIndex:X,gridState:O,totalListHeight:V,...m,startReached:ie,endReached:Q,rangeChanged:oe,stateChanged:Y,propsReady:x,stateRestoreInProgress:L,...I}},nl(Vte,mg,EM,Ute,Bte,Kte,_M));function h_(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=dx(e,t,n,r[0].index),i=dx(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function dx(e,t,n,r){const o=AM(e.width,n.width,t.column),s=rm(r/o),i=s*n.height+Uu(0,s-1)*t.row;return i>0?i+t.row:i}function AM(e,t,n){return Uu(1,rm((e+n)/(rm(t)+n)))}const rne=Ps(()=>{const e=dt(p=>`Item ${p}`),t=dt({}),n=dt(null),r=dt("virtuoso-grid-item"),o=dt("virtuoso-grid-list"),s=dt(Xte),i=dt("div"),l=dt(fg),f=(p,h=null)=>lc(ft(t,en(m=>m[p]),kr()),h);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:l,FooterComponent:f("Footer"),HeaderComponent:f("Header"),ListComponent:f("List","div"),ItemComponent:f("Item","div"),ScrollerComponent:f("Scroller","div"),ScrollSeekPlaceholder:f("ScrollSeekPlaceholder","div")}}),one=Ps(([e,t])=>({...e,...t}),nl(nne,rne)),sne=H.memo(function(){const t=ln("gridState"),n=ln("listClassName"),r=ln("itemClassName"),o=ln("itemContent"),s=ln("computeItemKey"),i=ln("isSeeking"),l=Fo("scrollHeight"),f=ln("ItemComponent"),p=ln("ListComponent"),h=ln("ScrollSeekPlaceholder"),m=ln("context"),v=Fo("itemDimensions"),x=Fo("gap"),C=ln("log"),b=ln("stateRestoreInProgress"),w=hg(k=>{const _=k.parentElement.parentElement.scrollHeight;l(_);const j=k.firstChild;if(j){const{width:I,height:M}=j.getBoundingClientRect();v({width:I,height:M})}x({row:m_("row-gap",getComputedStyle(k).rowGap,C),column:m_("column-gap",getComputedStyle(k).columnGap,C)})});return b?null:H.createElement(p,{ref:w,className:n,...Mi(p,m),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(k=>{const _=s(k.index,k.data,m);return i?H.createElement(h,{key:_,...Mi(h,m),index:k.index,height:t.itemHeight,width:t.itemWidth}):H.createElement(f,{...Mi(f,m),className:r,"data-index":k.index,key:_},o(k.index,k.data,m))}))}),ane=H.memo(function(){const t=ln("HeaderComponent"),n=Fo("headerHeight"),r=ln("headerFooterTag"),o=hg(i=>n(Jh(i,"height"))),s=ln("context");return t?H.createElement(r,{ref:o},H.createElement(t,Mi(t,s))):null}),ine=H.memo(function(){const t=ln("FooterComponent"),n=Fo("footerHeight"),r=ln("headerFooterTag"),o=hg(i=>n(Jh(i,"height"))),s=ln("context");return t?H.createElement(r,{ref:o},H.createElement(t,Mi(t,s))):null}),lne=({children:e})=>{const t=H.useContext(DM),n=Fo("itemDimensions"),r=Fo("viewportDimensions"),o=hg(s=>{r(s.getBoundingClientRect())});return H.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),H.createElement("div",{style:RM,ref:o},e)},cne=({children:e})=>{const t=H.useContext(DM),n=Fo("windowViewportRect"),r=Fo("itemDimensions"),o=ln("customScrollParent"),s=qte(n,o);return H.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),H.createElement("div",{ref:s,style:RM},e)},une=H.memo(function({...t}){const n=ln("useWindowScroll"),r=ln("customScrollParent"),o=r||n?pne:fne,s=r||n?cne:lne;return H.createElement(o,{...t},H.createElement(s,null,H.createElement(ane,null),H.createElement(sne,null),H.createElement(ine,null)))}),{Component:dne,usePublisher:Fo,useEmitterValue:ln,useEmitter:NM}=Ote(one,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged"}},une),fne=Qte({usePublisher:Fo,useEmitterValue:ln,useEmitter:NM}),pne=Zte({usePublisher:Fo,useEmitterValue:ln,useEmitter:NM});function m_(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Sy.WARN),t==="normal"?0:parseInt(t??"0",10)}const hne=dne,mne=e=>{const t=F(s=>s.gallery.galleryView),{data:n}=Tj(e),{data:r}=$j(e),o=d.useMemo(()=>t==="images"?n:r,[t,r,n]);return{totalImages:n,totalAssets:r,currentViewTotal:o}},gne=({imageDTO:e})=>a.jsx(T,{sx:{pointerEvents:"none",flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,p:2,alignItems:"flex-start",gap:2},children:a.jsxs(ua,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]})}),vne=d.memo(gne),ky=({postUploadAction:e,isDisabled:t})=>{const n=F(f=>f.gallery.autoAddBoardId),[r]=Ej(),o=d.useCallback(f=>{const p=f[0];p&&r({file:p,image_category:"user",is_intermediate:!1,postUploadAction:e??{type:"TOAST"},board_id:n==="none"?void 0:n})},[n,e,r]),{getRootProps:s,getInputProps:i,open:l}=Fb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:o,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:s,getUploadInputProps:i,openUploader:l}},gg=()=>{const e=te(),t=Zi(),{t:n}=we(),r=d.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),o=d.useCallback(()=>{t({title:n("toast.parameterNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),s=d.useCallback(()=>{t({title:n("toast.parametersSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),i=d.useCallback(()=>{t({title:n("toast.parametersNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),l=d.useCallback((E,O,D,A)=>{if(Hf(E)||Wf(O)||xu(D)||V0(A)){Hf(E)&&e($u(E)),Wf(O)&&e(Lu(O)),xu(D)&&e(zu(D)),xu(A)&&e(Fu(A)),r();return}o()},[e,r,o]),f=d.useCallback(E=>{if(!Hf(E)){o();return}e($u(E)),r()},[e,r,o]),p=d.useCallback(E=>{if(!Wf(E)){o();return}e(Lu(E)),r()},[e,r,o]),h=d.useCallback(E=>{if(!xu(E)){o();return}e(zu(E)),r()},[e,r,o]),m=d.useCallback(E=>{if(!V0(E)){o();return}e(Fu(E)),r()},[e,r,o]),v=d.useCallback(E=>{if(!FC(E)){o();return}e(Hp(E)),r()},[e,r,o]),x=d.useCallback(E=>{if(!U0(E)){o();return}e(Wp(E)),r()},[e,r,o]),C=d.useCallback(E=>{if(!BC(E)){o();return}e(n1(E)),r()},[e,r,o]),b=d.useCallback(E=>{if(!G0(E)){o();return}e(r1(E)),r()},[e,r,o]),w=d.useCallback(E=>{if(!K0(E)){o();return}e(Vp(E)),r()},[e,r,o]),k=d.useCallback(E=>{if(!HC(E)){o();return}e(Ai(E)),r()},[e,r,o]),_=d.useCallback(E=>{if(!WC(E)){o();return}e(Ni(E)),r()},[e,r,o]),j=d.useCallback(E=>{if(!VC(E)){o();return}e(Up(E)),r()},[e,r,o]),I=d.useCallback(E=>{e(pm(E))},[e]),M=d.useCallback(E=>{if(!E){i();return}const{cfg_scale:O,height:D,model:A,positive_prompt:R,negative_prompt:$,scheduler:K,seed:B,steps:U,width:Y,strength:W,positive_style_prompt:L,negative_style_prompt:X,refiner_model:z,refiner_cfg_scale:q,refiner_steps:ne,refiner_scheduler:Q,refiner_positive_aesthetic_score:ie,refiner_negative_aesthetic_score:oe,refiner_start:V}=E;U0(O)&&e(Wp(O)),BC(A)&&e(n1(A)),Hf(R)&&e($u(R)),Wf($)&&e(Lu($)),G0(K)&&e(r1(K)),FC(B)&&e(Hp(B)),K0(U)&&e(Vp(U)),HC(Y)&&e(Ai(Y)),WC(D)&&e(Ni(D)),VC(W)&&e(Up(W)),xu(L)&&e(zu(L)),V0(X)&&e(Fu(X)),bD(z)&&e(zj(z)),K0(ne)&&e(o1(ne)),U0(q)&&e(s1(q)),G0(Q)&&e(Fj(Q)),yD(ie)&&e(a1(ie)),CD(oe)&&e(i1(oe)),wD(V)&&e(l1(V)),s()},[i,s,e]);return{recallBothPrompts:l,recallPositivePrompt:f,recallNegativePrompt:p,recallSDXLPositiveStylePrompt:h,recallSDXLNegativeStylePrompt:m,recallSeed:v,recallCfgScale:x,recallModel:C,recallScheduler:b,recallSteps:w,recallWidth:k,recallHeight:_,recallStrength:j,recallAllParameters:M,sendToImageToImage:I}},TM=()=>{const e=Zi(),{t}=we(),n=d.useMemo(()=>!!navigator.clipboard&&!!window.ClipboardItem,[]),r=d.useCallback(async o=>{n||e({title:t("toast.problemCopyingImage"),description:"Your browser doesn't support the Clipboard API.",status:"error",duration:2500,isClosable:!0});try{const i=await(await fetch(o)).blob();await navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),e({title:t("toast.imageCopied"),status:"success",duration:2500,isClosable:!0})}catch(s){e({title:t("toast.problemCopyingImage"),description:String(s),status:"error",duration:2500,isClosable:!0})}},[n,t,e]);return{isClipboardAPIAvailable:n,copyImageToClipboard:r}};function xne(e){return Ne({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 vg(e){return Ne({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 bne(e){return Ne({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 yne(e){return Ne({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 Cne(e){return Ne({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 _y(e){return Ne({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}}]})(e)}function jy(e){return Ne({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}}]})(e)}function $M(e){return Ne({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"}}]})(e)}$x("gallery/requestedBoardImagesDeletion");const wne=$x("gallery/sentImageToCanvas"),LM=$x("gallery/sentImageToImg2Img"),Py=e=>e.config,Sne=e=>{const{imageDTO:t}=e,n=te(),{t:r}=we(),o=Zi(),s=qt("unifiedCanvas").isFeatureEnabled,{shouldFetchMetadataFromApi:i}=F(Py),{metadata:l,workflow:f,isLoading:p}=Lx({image:t,shouldFetchMetadataFromApi:i},{selectFromResult:K=>{var B,U;return{isLoading:K.isFetching,metadata:(B=K==null?void 0:K.currentData)==null?void 0:B.metadata,workflow:(U=K==null?void 0:K.currentData)==null?void 0:U.workflow}}}),[h]=zx(),[m]=Fx(),{isClipboardAPIAvailable:v,copyImageToClipboard:x}=TM(),C=d.useCallback(()=>{t&&n(hm([t]))},[n,t]),{recallBothPrompts:b,recallSeed:w,recallAllParameters:k}=gg(),_=d.useCallback(()=>{b(l==null?void 0:l.positive_prompt,l==null?void 0:l.negative_prompt,l==null?void 0:l.positive_style_prompt,l==null?void 0:l.negative_style_prompt)},[l==null?void 0:l.negative_prompt,l==null?void 0:l.positive_prompt,l==null?void 0:l.positive_style_prompt,l==null?void 0:l.negative_style_prompt,b]),j=d.useCallback(()=>{w(l==null?void 0:l.seed)},[l==null?void 0:l.seed,w]),I=d.useCallback(()=>{f&&n(Bx(f))},[n,f]),M=d.useCallback(()=>{n(LM()),n(pm(t))},[n,t]),E=d.useCallback(()=>{n(wne()),n(Bj(t)),n(Ra("unifiedCanvas")),o({title:r("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},[n,t,r,o]),O=d.useCallback(()=>{k(l)},[l,k]),D=d.useCallback(()=>{n(Hj([t])),n(Tx(!0))},[n,t]),A=d.useCallback(()=>{x(t.image_url)},[x,t.image_url]),R=d.useCallback(()=>{t&&h({imageDTOs:[t]})},[h,t]),$=d.useCallback(()=>{t&&m({imageDTOs:[t]})},[m,t]);return a.jsxs(a.Fragment,{children:[a.jsx(Ht,{as:"a",href:t.image_url,target:"_blank",icon:a.jsx(PE,{}),children:r("common.openInNewTab")}),v&&a.jsx(Ht,{icon:a.jsx(Hc,{}),onClickCapture:A,children:r("parameters.copyImage")}),a.jsx(Ht,{as:"a",download:!0,href:t.image_url,target:"_blank",icon:a.jsx(Jm,{}),w:"100%",children:r("parameters.downloadImage")}),a.jsx(Ht,{icon:p?a.jsx(_p,{}):a.jsx(vg,{}),onClickCapture:I,isDisabled:p||!f,children:r("nodes.loadWorkflow")}),a.jsx(Ht,{icon:p?a.jsx(_p,{}):a.jsx(RE,{}),onClickCapture:_,isDisabled:p||(l==null?void 0:l.positive_prompt)===void 0&&(l==null?void 0:l.negative_prompt)===void 0,children:r("parameters.usePrompt")}),a.jsx(Ht,{icon:p?a.jsx(_p,{}):a.jsx(AE,{}),onClickCapture:j,isDisabled:p||(l==null?void 0:l.seed)===void 0,children:r("parameters.useSeed")}),a.jsx(Ht,{icon:p?a.jsx(_p,{}):a.jsx(SE,{}),onClickCapture:O,isDisabled:p||!l,children:r("parameters.useAll")}),a.jsx(Ht,{icon:a.jsx(kk,{}),onClickCapture:M,id:"send-to-img2img",children:r("parameters.sendToImg2Img")}),s&&a.jsx(Ht,{icon:a.jsx(kk,{}),onClickCapture:E,id:"send-to-canvas",children:r("parameters.sendToUnifiedCanvas")}),a.jsx(Ht,{icon:a.jsx(IE,{}),onClickCapture:D,children:"Change Board"}),t.starred?a.jsx(Ht,{icon:a.jsx(jy,{}),onClickCapture:$,children:"Unstar Image"}):a.jsx(Ht,{icon:a.jsx(_y,{}),onClickCapture:R,children:"Star Image"}),a.jsx(Ht,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Wr,{}),onClickCapture:C,children:r("gallery.deleteImage")})]})},zM=d.memo(Sne),_p=()=>a.jsx(T,{w:"14px",alignItems:"center",justifyContent:"center",children:a.jsx(Ki,{size:"xs"})}),kne=()=>{const e=te(),t=F(h=>h.gallery.selection),[n]=zx(),[r]=Fx(),o=d.useCallback(()=>{e(Hj(t)),e(Tx(!0))},[e,t]),s=d.useCallback(()=>{e(hm(t))},[e,t]),i=d.useCallback(()=>{n({imageDTOs:t})},[n,t]),l=d.useCallback(()=>{r({imageDTOs:t})},[r,t]),f=d.useMemo(()=>t.every(h=>h.starred),[t]),p=d.useMemo(()=>t.every(h=>!h.starred),[t]);return a.jsxs(a.Fragment,{children:[f&&a.jsx(Ht,{icon:a.jsx(_y,{}),onClickCapture:l,children:"Unstar All"}),(p||!f&&!p)&&a.jsx(Ht,{icon:a.jsx(jy,{}),onClickCapture:i,children:"Star All"}),a.jsx(Ht,{icon:a.jsx(IE,{}),onClickCapture:o,children:"Change Board"}),a.jsx(Ht,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Wr,{}),onClickCapture:s,children:"Delete Selection"})]})},_ne=d.memo(kne),jne=ae([xe],({gallery:e})=>({selectionCount:e.selection.length}),Ce),Pne=({imageDTO:e,children:t})=>{const{selectionCount:n}=F(jne),r=d.useCallback(o=>{o.preventDefault()},[]);return a.jsx(yy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>e?n>1?a.jsx(Ga,{sx:{visibility:"visible !important"},motionProps:mc,onContextMenu:r,children:a.jsx(_ne,{})}):a.jsx(Ga,{sx:{visibility:"visible !important"},motionProps:mc,onContextMenu:r,children:a.jsx(zM,{imageDTO:e})}):null,children:t})},Ine=d.memo(Pne),Ene=e=>{const{data:t,disabled:n,...r}=e,o=d.useRef(Fa()),{attributes:s,listeners:i,setNodeRef:l}=Uee({id:o.current,disabled:n,data:t});return a.jsx(Ie,{ref:l,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,...s,...i,...r})},Mne=d.memo(Ene),One=a.jsx(An,{as:ng,sx:{boxSize:16}}),Dne=a.jsx(tr,{icon:Wi}),Rne=e=>{const{imageDTO:t,onError:n,onClick:r,withMetadataOverlay:o=!1,isDropDisabled:s=!1,isDragDisabled:i=!1,isUploadDisabled:l=!1,minSize:f=24,postUploadAction:p,imageSx:h,fitContainer:m=!1,droppableData:v,draggableData:x,dropLabel:C,isSelected:b=!1,thumbnail:w=!1,noContentFallback:k=Dne,uploadElement:_=One,useThumbailFallback:j,withHoverOverlay:I=!1,children:M,onMouseOver:E,onMouseOut:O}=e,{colorMode:D}=ia(),[A,R]=d.useState(!1),$=d.useCallback(W=>{E&&E(W),R(!0)},[E]),K=d.useCallback(W=>{O&&O(W),R(!1)},[O]),{getUploadButtonProps:B,getUploadInputProps:U}=ky({postUploadAction:p,isDisabled:l}),Y=l?{}:{cursor:"pointer",bg:Ae("base.200","base.700")(D),_hover:{bg:Ae("base.300","base.650")(D),color:Ae("base.500","base.300")(D)}};return a.jsx(Ine,{imageDTO:t,children:W=>a.jsxs(T,{ref:W,onMouseOver:$,onMouseOut:K,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative",minW:f||void 0,minH:f||void 0,userSelect:"none",cursor:i||!t?"default":"pointer"},children:[t&&a.jsxs(T,{sx:{w:"full",h:"full",position:m?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[a.jsx(qi,{src:w?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallbackSrc:j?t.thumbnail_url:void 0,fallback:j?void 0:a.jsx(Cte,{image:t}),onError:n,draggable:!1,sx:{w:t.width,objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",...h}}),o&&a.jsx(vne,{imageDTO:t}),a.jsx(by,{isSelected:b,isHovered:I?A:!1})]}),!t&&!l&&a.jsx(a.Fragment,{children:a.jsxs(T,{sx:{minH:f,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:Ae("base.500","base.500")(D),...Y},...B(),children:[a.jsx("input",{...U()}),_]})}),!t&&l&&k,t&&!i&&a.jsx(Mne,{data:x,disabled:i||!t,onClick:r}),M,!s&&a.jsx(xy,{data:v,disabled:s,dropLabel:C})]})})},Ya=d.memo(Rne),Ane=()=>a.jsx(zm,{sx:{position:"relative",height:"full",width:"full","::before":{content:"''",display:"block",pt:"100%"}},children:a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,height:"full",width:"full"}})}),Nne=d.memo(Ane),Tne=ae([xe,Hx],({gallery:e},t)=>{const n=e.selection;return{queryArgs:t,selection:n}},Ce),$ne=e=>{const t=te(),{queryArgs:n,selection:r}=F(Tne),{imageDTOs:o}=Wj(n,{selectFromResult:p=>({imageDTOs:p.data?SD.selectAll(p.data):[]})}),s=qt("multiselect").isFeatureEnabled,i=d.useCallback(p=>{var h;if(e){if(!s){t(bu([e]));return}if(p.shiftKey){const m=e.image_name,v=(h=r[r.length-1])==null?void 0:h.image_name,x=o.findIndex(b=>b.image_name===v),C=o.findIndex(b=>b.image_name===m);if(x>-1&&C>-1){const b=Math.min(x,C),w=Math.max(x,C),k=o.slice(b,w+1);t(bu(ww(r.concat(k))))}}else p.ctrlKey||p.metaKey?r.some(m=>m.image_name===e.image_name)&&r.length>1?t(bu(r.filter(m=>m.image_name!==e.image_name))):t(bu(ww(r.concat(e)))):t(bu([e]))}},[t,e,o,r,s]),l=d.useMemo(()=>e?r.some(p=>p.image_name===e.image_name):!1,[e,r]),f=d.useMemo(()=>r.length,[r.length]);return{selection:r,selectionCount:f,isSelected:l,handleClick:i}},Lne=e=>{const{onClick:t,tooltip:n,icon:r,styleOverrides:o}=e,s=Ti("drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-600))","drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-800))");return a.jsx(Te,{onClick:t,"aria-label":n,tooltip:n,icon:r,size:"sm",variant:"link",sx:{position:"absolute",top:1,insetInlineEnd:1,p:0,minW:0,svg:{transitionProperty:"common",transitionDuration:"normal",fill:"base.100",_hover:{fill:"base.50"},filter:s},...o}})},cc=d.memo(Lne),zne=e=>{const t=te(),{imageName:n}=e,{currentData:r}=po(n),o=F(j=>j.hotkeys.shift),{handleClick:s,isSelected:i,selection:l,selectionCount:f}=$ne(r),p=d.useCallback(j=>{j.stopPropagation(),r&&t(hm([r]))},[t,r]),h=d.useMemo(()=>{if(f>1)return{id:"gallery-image",payloadType:"IMAGE_DTOS",payload:{imageDTOs:l}};if(r)return{id:"gallery-image",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r,l,f]),[m]=zx(),[v]=Fx(),x=d.useCallback(()=>{r&&(r.starred&&v({imageDTOs:[r]}),r.starred||m({imageDTOs:[r]}))},[m,v,r]),[C,b]=d.useState(!1),w=d.useCallback(()=>{b(!0)},[]),k=d.useCallback(()=>{b(!1)},[]),_=d.useMemo(()=>{if(r!=null&&r.starred)return a.jsx(jy,{size:"20"});if(!(r!=null&&r.starred)&&C)return a.jsx(_y,{size:"20"})},[r==null?void 0:r.starred,C]);return r?a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none"},children:a.jsx(T,{userSelect:"none",sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1"},children:a.jsx(Ya,{onClick:s,imageDTO:r,draggableData:h,isSelected:i,minSize:0,imageSx:{w:"full",h:"full"},isDropDisabled:!0,isUploadDisabled:!0,thumbnail:!0,withHoverOverlay:!0,onMouseOver:w,onMouseOut:k,children:a.jsxs(a.Fragment,{children:[a.jsx(cc,{onClick:x,icon:_,tooltip:r.starred?"Unstar":"Star"}),C&&o&&a.jsx(cc,{onClick:p,icon:a.jsx(Wr,{}),tooltip:"Delete",styleOverrides:{bottom:2,top:"auto"}})]})})})}):a.jsx(Nne,{})},Fne=d.memo(zne),Bne=Pe((e,t)=>a.jsx(Ie,{className:"item-container",ref:t,p:1.5,children:e.children})),Hne=d.memo(Bne),Wne=Pe((e,t)=>{const n=F(r=>r.gallery.galleryImageMinimumWidth);return a.jsx(Ua,{...e,className:"list-container",ref:t,sx:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr));`},children:e.children})}),Vne=d.memo(Wne),Une={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},Gne=()=>{const{t:e}=we(),t=d.useRef(null),[n,r]=d.useState(null),[o,s]=pM(Une),i=F(w=>w.gallery.selectedBoardId),{currentViewTotal:l}=mne(i),f=F(Hx),{currentData:p,isFetching:h,isSuccess:m,isError:v}=Wj(f),[x]=Vj(),C=d.useMemo(()=>!p||!l?!1:p.ids.length<l,[p,l]),b=d.useCallback(()=>{C&&x({...f,offset:(p==null?void 0:p.ids.length)??0,limit:Uj})},[C,x,f,p==null?void 0:p.ids.length]);return d.useEffect(()=>{const{current:w}=t;return n&&w&&o({target:w,elements:{viewport:n}}),()=>{var k;return(k=s())==null?void 0:k.destroy()}},[n,o,s]),p?m&&(p==null?void 0:p.ids.length)===0?a.jsx(T,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(tr,{label:e("gallery.noImagesInGallery"),icon:Wi})}):m&&p?a.jsxs(a.Fragment,{children:[a.jsx(Ie,{ref:t,"data-overlayscrollbars":"",h:"100%",children:a.jsx(hne,{style:{height:"100%"},data:p.ids,endReached:b,components:{Item:Hne,List:Vne},scrollerRef:r,itemContent:(w,k)=>a.jsx(Fne,{imageName:k},k)})}),a.jsx(it,{onClick:b,isDisabled:!C,isLoading:h,loadingText:"Loading",flexShrink:0,children:`Load More (${p.ids.length} of ${l})`})]}):v?a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsx(tr,{label:"Unable to load Gallery",icon:pZ})}):null:a.jsx(T,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(tr,{label:"Loading...",icon:Wi})})},Kne=d.memo(Gne),qne=ae([xe],e=>{const{galleryView:t}=e.gallery;return{galleryView:t}},Ce),Xne=()=>{const e=d.useRef(null),t=d.useRef(null),{galleryView:n}=F(qne),r=te(),{isOpen:o,onToggle:s}=Er({defaultIsOpen:!0}),i=d.useCallback(()=>{r(UC("images"))},[r]),l=d.useCallback(()=>{r(UC("assets"))},[r]);return a.jsxs(R5,{layerStyle:"first",sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base",p:2},children:[a.jsxs(Ie,{sx:{w:"full"},children:[a.jsxs(T,{ref:e,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[a.jsx(ute,{isOpen:o,onToggle:s}),a.jsx(yte,{})]}),a.jsx(Ie,{children:a.jsx(ite,{isOpen:o})})]}),a.jsxs(T,{ref:t,direction:"column",gap:2,h:"full",w:"full",children:[a.jsx(T,{sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:a.jsx(Yi,{index:n==="images"?0:1,variant:"unstyled",size:"sm",sx:{w:"full"},children:a.jsx(Qi,{children:a.jsxs(pn,{isAttached:!0,sx:{w:"full"},children:[a.jsx(Pr,{as:it,size:"sm",isChecked:n==="images",onClick:i,sx:{w:"full"},leftIcon:a.jsx(SZ,{}),children:"Images"}),a.jsx(Pr,{as:it,size:"sm",isChecked:n==="assets",onClick:l,sx:{w:"full"},leftIcon:a.jsx(RZ,{}),children:"Assets"})]})})})}),a.jsx(Kne,{})]})]})},Yne=d.memo(Xne),Qne=ae(vo,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable,currentIteration:e.currentIteration,totalIterations:e.totalIterations,sessionId:e.sessionId,cancelType:e.cancelType,isCancelScheduled:e.isCancelScheduled}),{memoizeOptions:{resultEqualityCheck:kt}}),Zne=e=>{const t=te(),{btnGroupWidth:n="auto",asIconButton:r=!1,...o}=e,{isProcessing:s,isConnected:i,isCancelable:l,cancelType:f,isCancelScheduled:p,sessionId:h}=F(Qne),m=d.useCallback(()=>{if(h){if(f==="scheduled"){t(kD());return}t(_D({session_id:h}))}},[t,h,f]),{t:v}=we(),x=d.useCallback(w=>{const k=Array.isArray(w)?w[0]:w;t(jD(k))},[t]);Qe("shift+x",()=>{(i||s)&&l&&m()},[i,s,l]);const C=d.useMemo(()=>v(p?"parameters.cancel.isScheduled":f==="immediate"?"parameters.cancel.immediate":"parameters.cancel.schedule"),[v,f,p]),b=d.useMemo(()=>p?a.jsx(Qp,{}):f==="immediate"?a.jsx(Cne,{}):a.jsx(xne,{}),[f,p]);return a.jsxs(pn,{isAttached:!0,width:n,children:[r?a.jsx(Te,{icon:b,tooltip:C,"aria-label":C,isDisabled:!i||!s||!l,onClick:m,colorScheme:"error",id:"cancel-button",...o}):a.jsx(it,{leftIcon:b,tooltip:C,"aria-label":C,isDisabled:!i||!s||!l,onClick:m,colorScheme:"error",id:"cancel-button",...o,children:"Cancel"}),a.jsxs(Dd,{closeOnSelect:!1,children:[a.jsx(Rd,{as:Te,tooltip:v("parameters.cancel.setType"),"aria-label":v("parameters.cancel.setType"),icon:a.jsx(Bee,{w:"1em",h:"1em"}),paddingX:0,paddingY:0,colorScheme:"error",minWidth:5,...o}),a.jsx(Ga,{minWidth:"240px",children:a.jsxs(Q5,{value:f,title:"Cancel Type",type:"radio",onChange:x,children:[a.jsx(rh,{value:"immediate",children:v("parameters.cancel.immediate")}),a.jsx(rh,{value:"scheduled",children:v("parameters.cancel.schedule")})]})})]})]})},FM=d.memo(Zne),Jne=ae([xe,wn],(e,t)=>{const{generation:n,system:r,nodes:o}=e,{initialImage:s,model:i}=n,{isProcessing:l,isConnected:f}=r,p=[];return l&&p.push("System busy"),f||p.push("System disconnected"),t==="img2img"&&!s&&p.push("No initial image selected"),t==="nodes"?o.shouldValidateGraph&&(o.nodes.length||p.push("No nodes in graph"),o.nodes.forEach(h=>{if(!Cn(h))return;const m=o.nodeTemplates[h.data.type];if(!m){p.push("Missing node template");return}const v=PD([h],o.edges);Fn(h.data.inputs,x=>{const C=m.inputs[x.name],b=v.some(w=>w.target===h.id&&w.targetHandle===x.name);if(!C){p.push("Missing field template");return}if(C.required&&x.value===void 0&&!b){p.push(`${h.data.label||m.title} -> ${x.label||C.title} missing input`);return}})})):(i||p.push("No model selected"),e.controlNet.isEnabled&&rr(e.controlNet.controlNets).forEach((h,m)=>{h.isEnabled&&(h.model||p.push(`ControlNet ${m+1} has no model selected.`),(!h.controlImage||!h.processedControlImage&&h.processorType!=="none")&&p.push(`ControlNet ${m+1} has no control image`))})),{isReady:!p.length,isProcessing:l,reasons:p}},Ce),Ud=()=>{const{isReady:e,isProcessing:t,reasons:n}=F(Jne);return{isReady:e,isProcessing:t,reasons:n}},ere=ae(vo,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:kt}}),tre=()=>{const{t:e}=we(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=F(ere),s=n?Math.round(n*100/r):0;return a.jsx(pP,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!o,height:"full",colorScheme:"accent"})},nre=d.memo(tre);function BM(e){const{asIconButton:t=!1,sx:n,...r}=e,o=te(),{isReady:s,isProcessing:i}=Ud(),l=F(wn),f=d.useCallback(()=>{o(bd()),o(mm(l))},[o,l]),{t:p}=we();return Qe(["ctrl+enter","meta+enter"],f,{enabled:()=>s,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[s,l]),a.jsx(Ie,{style:{flexGrow:4},position:"relative",children:a.jsxs(Ie,{style:{position:"relative"},children:[!s&&a.jsx(Ie,{sx:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip",borderRadius:"base",...n},...r,children:a.jsx(nre,{})}),t?a.jsx(Te,{"aria-label":p("parameters.invoke"),type:"submit",icon:a.jsx(Sk,{}),isDisabled:!s,onClick:f,tooltip:a.jsx(fx,{}),colorScheme:"accent",isLoading:i,id:"invoke-button","data-progress":i,sx:{w:"full",flexGrow:1,...n},...r}):a.jsx(it,{tooltip:a.jsx(fx,{}),"aria-label":p("parameters.invoke"),type:"submit","data-progress":i,isDisabled:!s,onClick:f,colorScheme:"accent",id:"invoke-button",leftIcon:i?void 0:a.jsx(Sk,{}),isLoading:i,loadingText:p("parameters.invoke"),sx:{w:"full",flexGrow:1,fontWeight:700,...n},...r,children:"Invoke"})]})})}const rre=ae([xe],({gallery:e})=>{const{autoAddBoardId:t}=e;return{autoAddBoardId:t}},Ce),fx=d.memo(()=>{const{isReady:e,reasons:t}=Ud(),{autoAddBoardId:n}=F(rre),r=ug(n);return a.jsxs(T,{flexDir:"column",gap:1,children:[a.jsx(be,{fontWeight:600,children:e?"Ready to Invoke":"Unable to Invoke"}),t.length>0&&a.jsx(Id,{children:t.map((o,s)=>a.jsx(No,{children:a.jsx(be,{fontWeight:400,children:o})},`${o}.${s}`))}),a.jsx(Fr,{opacity:.2,borderColor:"base.50",_dark:{borderColor:"base.900"}}),a.jsxs(be,{fontWeight:400,fontStyle:"oblique 10deg",children:["Adding images to"," ",a.jsx(be,{as:"span",fontWeight:600,children:r||"Uncategorized"})]})]})});fx.displayName="InvokeButtonTooltipContent";const ore=()=>a.jsxs(T,{layerStyle:"first",sx:{gap:2,borderRadius:"base",p:2},children:[a.jsx(BM,{}),a.jsx(FM,{})]}),HM=d.memo(ore),{createElement:Pc,createContext:sre,forwardRef:WM,useCallback:Ls,useContext:VM,useEffect:ea,useImperativeHandle:UM,useLayoutEffect:are,useMemo:ire,useRef:$r,useState:Gu}=Nx,g_=Nx["useId".toString()],Ku=are,lre=typeof g_=="function"?g_:()=>null;let cre=0;function Iy(e=null){const t=lre(),n=$r(e||t||null);return n.current===null&&(n.current=""+cre++),n.current}const xg=sre(null);xg.displayName="PanelGroupContext";function GM({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:i=null,maxSize:l=null,minSize:f,onCollapse:p=null,onResize:h=null,order:m=null,style:v={},tagName:x="div"}){const C=VM(xg);if(C===null)throw Error("Panel components must be rendered within a PanelGroup container");const b=Iy(i),{collapsePanel:w,expandPanel:k,getPanelSize:_,getPanelStyle:j,registerPanel:I,resizePanel:M,units:E,unregisterPanel:O}=C;f==null&&(E==="percentages"?f=10:f=0);const D=$r({onCollapse:p,onResize:h});ea(()=>{D.current.onCollapse=p,D.current.onResize=h});const A=j(b,o),R=$r({size:v_(A)}),$=$r({callbacksRef:D,collapsedSize:n,collapsible:r,defaultSize:o,id:b,idWasAutoGenerated:i==null,maxSize:l,minSize:f,order:m});return Ku(()=>{R.current.size=v_(A),$.current.callbacksRef=D,$.current.collapsedSize=n,$.current.collapsible=r,$.current.defaultSize=o,$.current.id=b,$.current.idWasAutoGenerated=i==null,$.current.maxSize=l,$.current.minSize=f,$.current.order=m}),Ku(()=>(I(b,$),()=>{O(b)}),[m,b,I,O]),UM(s,()=>({collapse:()=>w(b),expand:()=>k(b),getCollapsed(){return R.current.size===0},getId(){return b},getSize(K){return _(b,K)},resize:(K,B)=>M(b,K,B)}),[w,k,_,b,M]),Pc(x,{children:e,className:t,"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-id":b,"data-panel-size":parseFloat(""+A.flexGrow).toFixed(1),id:`data-panel-id-${b}`,style:{...A,...v}})}const Va=WM((e,t)=>Pc(GM,{...e,forwardedRef:t}));GM.displayName="Panel";Va.displayName="forwardRef(Panel)";function v_(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const Gi=10;function Ru(e,t,n,r,o,s,i,l){const{id:f,panels:p,units:h}=t,m=h==="pixels"?Aa(f):NaN,{sizes:v}=l||{},x=v||s,C=Sr(p),b=x.concat();let w=0;{const j=o<0?r:n,I=C.findIndex(D=>D.current.id===j),M=C[I],E=x[I],O=px(h,m,M,E,E+Math.abs(o),e);if(E===O)return x;O===0&&E>0&&i.set(j,E),o=o<0?E-O:O-E}let k=o<0?n:r,_=C.findIndex(j=>j.current.id===k);for(;;){const j=C[_],I=x[_],M=Math.abs(o)-Math.abs(w),E=px(h,m,j,I,I-M,e);if(I!==E&&(E===0&&I>0&&i.set(j.current.id,I),w+=I-E,b[_]=E,w.toPrecision(Gi).localeCompare(Math.abs(o).toPrecision(Gi),void 0,{numeric:!0})>=0))break;if(o<0){if(--_<0)break}else if(++_>=C.length)break}return w===0?x:(k=o<0?r:n,_=C.findIndex(j=>j.current.id===k),b[_]=x[_]+w,b)}function Dl(e,t,n){t.forEach((r,o)=>{const s=e[o];if(!s)return;const{callbacksRef:i,collapsedSize:l,collapsible:f,id:p}=s.current,h=n[p];if(h!==r){n[p]=r;const{onCollapse:m,onResize:v}=i.current;v&&v(r,h),f&&m&&((h==null||h===l)&&r!==l?m(!1):h!==l&&r===l&&m(!0))}})}function ure({groupId:e,panels:t,units:n}){const r=n==="pixels"?Aa(e):NaN,o=Sr(t),s=Array(o.length);let i=0,l=100;for(let f=0;f<o.length;f++){const p=o[f],{defaultSize:h}=p.current;h!=null&&(i++,s[f]=n==="pixels"?h/r*100:h,l-=s[f])}for(let f=0;f<o.length;f++){const p=o[f];let{defaultSize:h,id:m,maxSize:v,minSize:x}=p.current;if(h!=null)continue;n==="pixels"&&(x=x/r*100,v!=null&&(v=v/r*100));const C=o.length-i,b=Math.min(v??100,Math.max(x,l/C));s[f]=b,i++,l-=b}if(l!==0)for(let f=0;f<o.length;f++){const p=o[f];let{maxSize:h,minSize:m}=p.current;n==="pixels"&&(m=m/r*100,h!=null&&(h=h/r*100));const v=Math.min(h??100,Math.max(m,s[f]+l));if(v!==s[f]&&(l-=v-s[f],s[f]=v,Math.abs(l).toFixed(3)==="0.000"))break}return Math.abs(l).toFixed(3),s}function $v(e,t){if(t.length<2)return[null,null];const n=t.findIndex(i=>i.current.id===e);if(n<0)return[null,null];const r=n===t.length-1,o=r?t[n-1].current.id:e,s=r?e:t[n+1].current.id;return[o,s]}function Aa(e){const t=cd(e);if(t==null)return NaN;const n=t.getAttribute("data-panel-group-direction"),r=Ey(e);return n==="horizontal"?t.offsetWidth-r.reduce((o,s)=>o+s.offsetWidth,0):t.offsetHeight-r.reduce((o,s)=>o+s.offsetHeight,0)}function KM(e,t,n){if(e.size===1)return"100";const o=Sr(e).findIndex(i=>i.current.id===t),s=n[o];return s==null?"0":s.toPrecision(Gi)}function dre(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function cd(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function bg(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function fre(e){return qM().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function qM(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function Ey(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function My(e,t,n){var f,p,h,m;const r=bg(t),o=Ey(e),s=r?o.indexOf(r):-1,i=((p=(f=n[s])==null?void 0:f.current)==null?void 0:p.id)??null,l=((m=(h=n[s+1])==null?void 0:h.current)==null?void 0:m.id)??null;return[i,l]}function Sr(e){return Array.from(e.values()).sort((t,n)=>{const r=t.current.order,o=n.current.order;return r==null&&o==null?0:r==null?-1:o==null?1:r-o})}function px(e,t,n,r,o,s=null){var h;let{collapsedSize:i,collapsible:l,maxSize:f,minSize:p}=n.current;if(e==="pixels"&&(i=i/t*100,f!=null&&(f=f/t*100),p=p/t*100),l){if(r>i){if(o<=p/2+i)return i}else if(!((h=s==null?void 0:s.type)==null?void 0:h.startsWith("key"))&&o<p)return i}return Math.min(f??100,Math.max(p,o))}function pre(e,t){const{collapsible:n,defaultSize:r,maxSize:o,minSize:s}=t.current;(s<0||e==="percentages"&&s>100)&&(t.current.minSize=0),o!=null&&(o<0||e==="percentages"&&o>100)&&(t.current.maxSize=null),r!==null&&(r<0||e==="percentages"&&r>100?t.current.defaultSize=null:r<s&&!n?t.current.defaultSize=s:o!=null&&r>o&&(t.current.defaultSize=o))}function Lv({groupId:e,panels:t,nextSizes:n,prevSizes:r,units:o}){n=[...n];const s=Sr(t),i=o==="pixels"?Aa(e):NaN;let l=0;for(let f=0;f<s.length;f++){const p=s[f],h=r[f],m=n[f],v=px(o,i,p,h,m);m!=v&&(l+=m-v,n[f]=v)}if(l.toFixed(3)!=="0.000")for(let f=0;f<s.length;f++){const p=s[f];let{maxSize:h,minSize:m}=p.current;o==="pixels"&&(m=m/i*100,h!=null&&(h=h/i*100));const v=Math.min(h??100,Math.max(m,n[f]+l));if(v!==n[f]&&(l-=v-n[f],n[f]=v,Math.abs(l).toFixed(3)==="0.000"))break}return l.toFixed(3),n}function XM(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function hre({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){ea(()=>{const{direction:i,panels:l}=e.current,f=cd(t);XM(f!=null,`No group found for id "${t}"`);const{height:p,width:h}=f.getBoundingClientRect(),v=Ey(t).map(x=>{const C=x.getAttribute("data-panel-resize-handle-id"),b=Sr(l),[w,k]=My(t,C,b);if(w==null||k==null)return()=>{};let _=0,j=100,I=0,M=0;b.forEach($=>{const{id:K,maxSize:B,minSize:U}=$.current;K===w?(_=U,j=B??100):(I+=U,M+=B??100)});const E=Math.min(j,100-I),O=Math.max(_,(b.length-1)*100-M),D=KM(l,w,o);x.setAttribute("aria-valuemax",""+Math.round(E)),x.setAttribute("aria-valuemin",""+Math.round(O)),x.setAttribute("aria-valuenow",""+Math.round(parseInt(D)));const A=$=>{if(!$.defaultPrevented)switch($.key){case"Enter":{$.preventDefault();const K=b.findIndex(B=>B.current.id===w);if(K>=0){const B=b[K],U=o[K];if(U!=null){let Y=0;U.toPrecision(Gi)<=B.current.minSize.toPrecision(Gi)?Y=i==="horizontal"?h:p:Y=-(i==="horizontal"?h:p);const W=Ru($,e.current,w,k,Y,o,s.current,null);o!==W&&r(W)}}break}}};x.addEventListener("keydown",A);const R=dre(w);return R!=null&&x.setAttribute("aria-controls",R.id),()=>{x.removeAttribute("aria-valuemax"),x.removeAttribute("aria-valuemin"),x.removeAttribute("aria-valuenow"),x.removeEventListener("keydown",A),R!=null&&x.removeAttribute("aria-controls")}});return()=>{v.forEach(x=>x())}},[e,t,n,s,r,o])}function mre({disabled:e,handleId:t,resizeHandler:n}){ea(()=>{if(e||n==null)return;const r=bg(t);if(r==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const i=qM(),l=fre(t);XM(l!==null);const f=s.shiftKey?l>0?l-1:i.length-1:l+1<i.length?l+1:0;i[f].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function zv(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function YM(e,t,n,r=0,o=null){const s=n==="horizontal";let i=0;if(hx(e))i=s?e.clientX:e.clientY;else if(mx(e)){const h=e.touches[0];i=s?h.screenX:h.screenY}else return 0;const l=bg(t),f=o||l.getBoundingClientRect(),p=s?f.left:f.top;return i-p-r}function gre(e,t,n,r,o,s,i){const{dragOffset:l=0,dragHandleRect:f,sizes:p}=i||{},h=p||s;if(vre(e)){const m=o==="horizontal",x=cd(t).getBoundingClientRect(),C=m?x.width:x.height,b=e.shiftKey?10:100,w=C/b;let k=0;switch(e.key){case"ArrowDown":k=m?0:w;break;case"ArrowLeft":k=m?-w:0;break;case"ArrowRight":k=m?w:0;break;case"ArrowUp":k=m?0:-w;break;case"End":k=C;break;case"Home":k=-C;break}const[_,j]=My(t,n,r),I=k<0?_:j,M=r.findIndex(O=>O.current.id===I),E=r[M];if(E.current.collapsible){const O=h[M];(O===0||O.toPrecision(Gi)===E.current.minSize.toPrecision(Gi))&&(k=k<0?-E.current.minSize*C:E.current.minSize*C)}return k}else return YM(e,n,o,l,f)}function vre(e){return e.type==="keydown"}function hx(e){return e.type.startsWith("mouse")}function mx(e){return e.type.startsWith("touch")}let gx=null,wi=null;function QM(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function xre(){wi!==null&&(document.head.removeChild(wi),gx=null,wi=null)}function Fv(e){if(gx===e)return;gx=e;const t=QM(e);wi===null&&(wi=document.createElement("style"),document.head.appendChild(wi)),wi.innerHTML=`*{cursor: ${t}!important;}`}function bre(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function ZM(e){return e.map(t=>{const{minSize:n,order:r}=t.current;return r?`${r}:${n}`:`${n}`}).sort((t,n)=>t.localeCompare(n)).join(",")}function JM(e,t){try{const n=t.getItem(`PanelGroup:sizes:${e}`);if(n){const r=JSON.parse(n);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function yre(e,t,n){const r=JM(e,n);if(r){const o=ZM(t);return r[o]??null}return null}function Cre(e,t,n,r){const o=ZM(t),s=JM(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(i){console.error(i)}}const Bv={};function x_(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}const Au={getItem:e=>(x_(Au),Au.getItem(e)),setItem:(e,t)=>{x_(Au),Au.setItem(e,t)}};function eO({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:i=null,onLayout:l,storage:f=Au,style:p={},tagName:h="div",units:m="percentages"}){const v=Iy(i),[x,C]=Gu(null),[b,w]=Gu(new Map),k=$r(null);$r({didLogDefaultSizeWarning:!1,didLogIdAndOrderWarning:!1,didLogInvalidLayoutWarning:!1,prevPanelIds:[]});const _=$r({onLayout:l});ea(()=>{_.current.onLayout=l});const j=$r({}),[I,M]=Gu([]),E=$r(new Map),O=$r(0),D=$r({direction:r,id:v,panels:b,sizes:I,units:m});UM(s,()=>({getId:()=>v,getLayout:z=>{const{sizes:q,units:ne}=D.current;if((z??ne)==="pixels"){const ie=Aa(v);return q.map(oe=>oe/100*ie)}else return q},setLayout:(z,q)=>{const{id:ne,panels:Q,sizes:ie,units:oe}=D.current;if((q||oe)==="pixels"){const se=Aa(ne);z=z.map(re=>re/se*100)}const V=j.current,G=Sr(Q),J=Lv({groupId:ne,panels:Q,nextSizes:z,prevSizes:ie,units:oe});zv(ie,J)||(M(J),Dl(G,J,V))}}),[v]),Ku(()=>{D.current.direction=r,D.current.id=v,D.current.panels=b,D.current.sizes=I,D.current.units=m}),hre({committedValuesRef:D,groupId:v,panels:b,setSizes:M,sizes:I,panelSizeBeforeCollapse:E}),ea(()=>{const{onLayout:z}=_.current,{panels:q,sizes:ne}=D.current;if(ne.length>0){z&&z(ne);const Q=j.current,ie=Sr(q);Dl(ie,ne,Q)}},[I]),Ku(()=>{const{id:z,sizes:q,units:ne}=D.current;if(q.length===b.size)return;let Q=null;if(e){const ie=Sr(b);Q=yre(e,ie,f)}if(Q!=null){const ie=Lv({groupId:z,panels:b,nextSizes:Q,prevSizes:Q,units:ne});M(ie)}else{const ie=ure({groupId:z,panels:b,units:ne});M(ie)}},[e,b,f]),ea(()=>{if(e){if(I.length===0||I.length!==b.size)return;const z=Sr(b);Bv[e]||(Bv[e]=bre(Cre,100)),Bv[e](e,z,I,f)}},[e,b,I,f]),Ku(()=>{if(m==="pixels"){const z=new ResizeObserver(()=>{const{panels:q,sizes:ne}=D.current,Q=Lv({groupId:v,panels:q,nextSizes:ne,prevSizes:ne,units:m});zv(ne,Q)||M(Q)});return z.observe(cd(v)),()=>{z.disconnect()}}},[v,m]);const A=Ls((z,q)=>{const{panels:ne,units:Q}=D.current,oe=Sr(ne).findIndex(J=>J.current.id===z),V=I[oe];if((q??Q)==="pixels"){const J=Aa(v);return V/100*J}else return V},[v,I]),R=Ls((z,q)=>{const{panels:ne}=D.current;return ne.size===0?{flexBasis:0,flexGrow:q??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:KM(ne,z,I),flexShrink:1,overflow:"hidden",pointerEvents:o&&x!==null?"none":void 0}},[x,o,I]),$=Ls((z,q)=>{const{units:ne}=D.current;pre(ne,q),w(Q=>{if(Q.has(z))return Q;const ie=new Map(Q);return ie.set(z,q),ie})},[]),K=Ls(z=>ne=>{ne.preventDefault();const{direction:Q,panels:ie,sizes:oe}=D.current,V=Sr(ie),[G,J]=My(v,z,V);if(G==null||J==null)return;let se=gre(ne,v,z,V,Q,oe,k.current);if(se===0)return;const fe=cd(v).getBoundingClientRect(),de=Q==="horizontal";document.dir==="rtl"&&de&&(se=-se);const me=de?fe.width:fe.height,ye=se/me*100,he=Ru(ne,D.current,G,J,ye,oe,E.current,k.current),ue=!zv(oe,he);if((hx(ne)||mx(ne))&&O.current!=ye&&Fv(ue?de?"horizontal":"vertical":de?se<0?"horizontal-min":"horizontal-max":se<0?"vertical-min":"vertical-max"),ue){const De=j.current;M(he),Dl(V,he,De)}O.current=ye},[v]),B=Ls(z=>{w(q=>{if(!q.has(z))return q;const ne=new Map(q);return ne.delete(z),ne})},[]),U=Ls(z=>{const{panels:q,sizes:ne}=D.current,Q=q.get(z);if(Q==null)return;const{collapsedSize:ie,collapsible:oe}=Q.current;if(!oe)return;const V=Sr(q),G=V.indexOf(Q);if(G<0)return;const J=ne[G];if(J===ie)return;E.current.set(z,J);const[se,re]=$v(z,V);if(se==null||re==null)return;const de=G===V.length-1?J:ie-J,me=Ru(null,D.current,se,re,de,ne,E.current,null);if(ne!==me){const ye=j.current;M(me),Dl(V,me,ye)}},[]),Y=Ls(z=>{const{panels:q,sizes:ne}=D.current,Q=q.get(z);if(Q==null)return;const{collapsedSize:ie,minSize:oe}=Q.current,V=E.current.get(z)||oe;if(!V)return;const G=Sr(q),J=G.indexOf(Q);if(J<0||ne[J]!==ie)return;const[re,fe]=$v(z,G);if(re==null||fe==null)return;const me=J===G.length-1?ie-V:V,ye=Ru(null,D.current,re,fe,me,ne,E.current,null);if(ne!==ye){const he=j.current;M(ye),Dl(G,ye,he)}},[]),W=Ls((z,q,ne)=>{const{id:Q,panels:ie,sizes:oe,units:V}=D.current;if((ne||V)==="pixels"){const rt=Aa(Q);q=q/rt*100}const G=ie.get(z);if(G==null)return;let{collapsedSize:J,collapsible:se,maxSize:re,minSize:fe}=G.current;if(V==="pixels"){const rt=Aa(Q);fe=fe/rt*100,re!=null&&(re=re/rt*100)}const de=Sr(ie),me=de.indexOf(G);if(me<0)return;const ye=oe[me];if(ye===q)return;se&&q===J||(q=Math.min(re??100,Math.max(fe,q)));const[he,ue]=$v(z,de);if(he==null||ue==null)return;const je=me===de.length-1?ye-q:q-ye,Be=Ru(null,D.current,he,ue,je,oe,E.current,null);if(oe!==Be){const rt=j.current;M(Be),Dl(de,Be,rt)}},[]),L=ire(()=>({activeHandleId:x,collapsePanel:U,direction:r,expandPanel:Y,getPanelSize:A,getPanelStyle:R,groupId:v,registerPanel:$,registerResizeHandle:K,resizePanel:W,startDragging:(z,q)=>{if(C(z),hx(q)||mx(q)){const ne=bg(z);k.current={dragHandleRect:ne.getBoundingClientRect(),dragOffset:YM(q,z,r),sizes:D.current.sizes}}},stopDragging:()=>{xre(),C(null),k.current=null},units:m,unregisterPanel:B}),[x,U,r,Y,A,R,v,$,K,W,m,B]),X={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Pc(xg.Provider,{children:Pc(h,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":v,"data-panel-group-units":m,style:{...X,...p}}),value:L})}const yg=WM((e,t)=>Pc(eO,{...e,forwardedRef:t}));eO.displayName="PanelGroup";yg.displayName="forwardRef(PanelGroup)";function vx({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:i="div"}){const l=$r(null),f=$r({onDragging:o});ea(()=>{f.current.onDragging=o});const p=VM(xg);if(p===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:h,direction:m,groupId:v,registerResizeHandle:x,startDragging:C,stopDragging:b}=p,w=Iy(r),k=h===w,[_,j]=Gu(!1),[I,M]=Gu(null),E=Ls(()=>{l.current.blur(),b();const{onDragging:A}=f.current;A&&A(!1)},[b]);ea(()=>{if(n)M(null);else{const D=x(w);M(()=>D)}},[n,w,x]),ea(()=>{if(n||I==null||!k)return;const D=K=>{I(K)},A=K=>{I(K)},$=l.current.ownerDocument;return $.body.addEventListener("contextmenu",E),$.body.addEventListener("mousemove",D),$.body.addEventListener("touchmove",D),$.body.addEventListener("mouseleave",A),window.addEventListener("mouseup",E),window.addEventListener("touchend",E),()=>{$.body.removeEventListener("contextmenu",E),$.body.removeEventListener("mousemove",D),$.body.removeEventListener("touchmove",D),$.body.removeEventListener("mouseleave",A),window.removeEventListener("mouseup",E),window.removeEventListener("touchend",E)}},[m,n,k,I,E]),mre({disabled:n,handleId:w,resizeHandler:I});const O={cursor:QM(m),touchAction:"none",userSelect:"none"};return Pc(i,{children:e,className:t,"data-resize-handle-active":k?"pointer":_?"keyboard":void 0,"data-panel-group-direction":m,"data-panel-group-id":v,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":w,onBlur:()=>j(!1),onFocus:()=>j(!0),onMouseDown:D=>{C(w,D.nativeEvent);const{onDragging:A}=f.current;A&&A(!0)},onMouseUp:E,onTouchCancel:E,onTouchEnd:E,onTouchStart:D=>{C(w,D.nativeEvent);const{onDragging:A}=f.current;A&&A(!0)},ref:l,role:"separator",style:{...O,...s},tabIndex:0})}vx.displayName="PanelResizeHandle";const wre=e=>{const{direction:t="horizontal",collapsedDirection:n,isCollapsed:r=!1,...o}=e,s=Ti("base.100","base.850"),i=Ti("base.300","base.700");return t==="horizontal"?a.jsx(vx,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx(T,{className:"resize-handle-horizontal",sx:{w:n?2.5:4,h:"full",justifyContent:n?n==="left"?"flex-start":"flex-end":"center",alignItems:"center",div:{bg:s},_hover:{div:{bg:i}}},...o,children:a.jsx(Ie,{sx:{w:1,h:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})}):a.jsx(vx,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx(T,{className:"resize-handle-vertical",sx:{w:"full",h:n?2.5:4,alignItems:n?n==="top"?"flex-start":"flex-end":"center",justifyContent:"center",div:{bg:s},_hover:{div:{bg:i}}},...o,children:a.jsx(Ie,{sx:{h:1,w:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})})},om=d.memo(wre),Oy=()=>{const e=te(),t=F(o=>o.ui.panels),n=d.useCallback(o=>t[o]??"",[t]),r=d.useCallback((o,s)=>{e(ID({name:o,value:s}))},[e]);return{getItem:n,setItem:r}};const Sre=e=>{const{label:t,data:n,fileName:r,withDownload:o=!0,withCopy:s=!0}=e,i=d.useMemo(()=>ED(n)?n:JSON.stringify(n,null,2),[n]),l=d.useCallback(()=>{navigator.clipboard.writeText(i)},[i]),f=d.useCallback(()=>{const p=new Blob([i]),h=document.createElement("a");h.href=URL.createObjectURL(p),h.download=`${r||t}.json`,document.body.appendChild(h),h.click(),h.remove()},[i,t,r]);return a.jsxs(T,{layerStyle:"second",sx:{borderRadius:"base",flexGrow:1,w:"full",h:"full",position:"relative"},children:[a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"auto",p:4,fontSize:"sm"},children:a.jsx(lg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsx("pre",{children:i})})}),a.jsxs(T,{sx:{position:"absolute",top:0,insetInlineEnd:0,p:2},children:[o&&a.jsx(Dt,{label:`Download ${t} JSON`,children:a.jsx(ps,{"aria-label":`Download ${t} JSON`,icon:a.jsx(Jm,{}),variant:"ghost",opacity:.7,onClick:f})}),s&&a.jsx(Dt,{label:`Copy ${t} JSON`,children:a.jsx(ps,{"aria-label":`Copy ${t} JSON`,icon:a.jsx(Hc,{}),variant:"ghost",opacity:.7,onClick:l})})]})]})},Oi=d.memo(Sre),kre=ae(xe,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(r=>r.id===t);return{data:n==null?void 0:n.data}},Ce),_re=()=>{const{data:e}=F(kre);return e?a.jsx(Oi,{data:e,label:"Node Data"}):a.jsx(tr,{label:"No node selected",icon:null})},jre=d.memo(_re),Pre=e=>a.jsx(T,{sx:{w:"full",h:"full",position:"relative"},children:a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx(lg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:e.children})})}),Dy=d.memo(Pre),Ire=({output:e})=>{const{image:t}=e,{data:n}=po(t.image_name);return a.jsx(Ya,{imageDTO:n})},Ere=d.memo(Ire),Mre=ae(xe,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(s=>s.id===t),r=n?e.nodeTemplates[n.data.type]:void 0,o=e.nodeExecutionStates[t??"__UNKNOWN_NODE__"];return{node:n,template:r,nes:o}},Ce),Ore=()=>{const{node:e,template:t,nes:n}=F(Mre);return!e||!n||!Cn(e)?a.jsx(tr,{label:"No node selected",icon:null}):n.outputs.length===0?a.jsx(tr,{label:"No outputs recorded",icon:null}):a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Dy,{children:a.jsx(T,{sx:{position:"relative",flexDir:"column",alignItems:"flex-start",p:1,gap:2,h:"full",w:"full"},children:(t==null?void 0:t.outputType)==="image_output"?n.outputs.map((r,o)=>a.jsx(Ere,{output:r},Rre(r,o))):a.jsx(Oi,{data:n.outputs,label:"Node Outputs"})})})})},Dre=d.memo(Ore),Rre=(e,t)=>`${e.type}-${t}`,Are=ae(xe,({nodes:e})=>{const t=e.selectedNodes[e.selectedNodes.length-1],n=e.nodes.find(o=>o.id===t);return{template:n?e.nodeTemplates[n.data.type]:void 0}},Ce),Nre=()=>{const{template:e}=F(Are);return e?a.jsx(Oi,{data:e,label:"Node Template"}):a.jsx(tr,{label:"No node selected",icon:null})},Tre=d.memo(Nre),$re=()=>a.jsx(T,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(Yi,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(Qi,{children:[a.jsx(Pr,{children:"Outputs"}),a.jsx(Pr,{children:"Data"}),a.jsx(Pr,{children:"Template"})]}),a.jsxs(zc,{children:[a.jsx(fo,{children:a.jsx(Dre,{})}),a.jsx(fo,{children:a.jsx(jre,{})}),a.jsx(fo,{children:a.jsx(Tre,{})})]})]})}),Lre=d.memo($re),Ry=e=>{e.stopPropagation()},zre={display:"flex",flexDirection:"row",alignItems:"center",gap:10},Fre=e=>{const{label:t="",labelPos:n="top",isDisabled:r=!1,isInvalid:o,formControlProps:s,...i}=e,l=te(),f=d.useCallback(h=>{h.shiftKey&&l(Ir(!0))},[l]),p=d.useCallback(h=>{h.shiftKey||l(Ir(!1))},[l]);return a.jsxs(un,{isInvalid:o,isDisabled:r,...s,style:n==="side"?zre:void 0,children:[t!==""&&a.jsx(Gn,{children:t}),a.jsx(Pm,{...i,onPaste:Ry,onKeyDown:f,onKeyUp:p})]})},io=d.memo(Fre),Bre=Pe((e,t)=>{const n=te(),r=d.useCallback(s=>{s.shiftKey&&n(Ir(!0))},[n]),o=d.useCallback(s=>{s.shiftKey||n(Ir(!1))},[n]);return a.jsx(MP,{ref:t,onPaste:Ry,onKeyDown:r,onKeyUp:o,...e})}),oa=d.memo(Bre),Hre=ae(xe,({nodes:e})=>{const{author:t,name:n,description:r,tags:o,version:s,contact:i,notes:l}=e.workflow;return{name:n,author:t,description:r,tags:o,version:s,contact:i,notes:l}},Ce),Wre=()=>{const{author:e,name:t,description:n,tags:r,version:o,contact:s,notes:i}=F(Hre),l=te(),f=d.useCallback(b=>{l(MD(b.target.value))},[l]),p=d.useCallback(b=>{l(OD(b.target.value))},[l]),h=d.useCallback(b=>{l(DD(b.target.value))},[l]),m=d.useCallback(b=>{l(RD(b.target.value))},[l]),v=d.useCallback(b=>{l(AD(b.target.value))},[l]),x=d.useCallback(b=>{l(ND(b.target.value))},[l]),C=d.useCallback(b=>{l(TD(b.target.value))},[l]);return a.jsx(Dy,{children:a.jsxs(T,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:[a.jsxs(T,{sx:{gap:2,w:"full"},children:[a.jsx(io,{label:"Name",value:t,onChange:f}),a.jsx(io,{label:"Version",value:o,onChange:m})]}),a.jsxs(T,{sx:{gap:2,w:"full"},children:[a.jsx(io,{label:"Author",value:e,onChange:p}),a.jsx(io,{label:"Contact",value:s,onChange:h})]}),a.jsx(io,{label:"Tags",value:r,onChange:x}),a.jsxs(un,{as:T,sx:{flexDir:"column"},children:[a.jsx(Gn,{children:"Short Description"}),a.jsx(oa,{onChange:v,value:n,fontSize:"sm",sx:{resize:"none"}})]}),a.jsxs(un,{as:T,sx:{flexDir:"column",h:"full"},children:[a.jsx(Gn,{children:"Notes"}),a.jsx(oa,{onChange:C,value:i,fontSize:"sm",sx:{h:"full",resize:"none"}})]})]})})},Vre=d.memo(Wre);function Ure(e,t,n){var r=this,o=d.useRef(null),s=d.useRef(0),i=d.useRef(null),l=d.useRef([]),f=d.useRef(),p=d.useRef(),h=d.useRef(e),m=d.useRef(!0);d.useEffect(function(){h.current=e},[e]);var v=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var x=!!(n=n||{}).leading,C=!("trailing"in n)||!!n.trailing,b="maxWait"in n,w=b?Math.max(+n.maxWait||0,t):null;d.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var k=d.useMemo(function(){var _=function(D){var A=l.current,R=f.current;return l.current=f.current=null,s.current=D,p.current=h.current.apply(R,A)},j=function(D,A){v&&cancelAnimationFrame(i.current),i.current=v?requestAnimationFrame(D):setTimeout(D,A)},I=function(D){if(!m.current)return!1;var A=D-o.current;return!o.current||A>=t||A<0||b&&D-s.current>=w},M=function(D){return i.current=null,C&&l.current?_(D):(l.current=f.current=null,p.current)},E=function D(){var A=Date.now();if(I(A))return M(A);if(m.current){var R=t-(A-o.current),$=b?Math.min(R,w-(A-s.current)):R;j(D,$)}},O=function(){var D=Date.now(),A=I(D);if(l.current=[].slice.call(arguments),f.current=r,o.current=D,A){if(!i.current&&m.current)return s.current=o.current,j(E,t),x?_(o.current):p.current;if(b)return j(E,t),_(o.current)}return i.current||j(E,t),p.current};return O.cancel=function(){i.current&&(v?cancelAnimationFrame(i.current):clearTimeout(i.current)),s.current=0,l.current=o.current=f.current=i.current=null},O.isPending=function(){return!!i.current},O.flush=function(){return i.current?M(Date.now()):p.current},O},[x,b,t,w,C,v]);return k}function Gre(e,t){return e===t}function b_(e){return typeof e=="function"?function(){return e}:e}function Kre(e,t,n){var r,o,s=n&&n.equalityFn||Gre,i=(r=d.useState(b_(e)),o=r[1],[r[0],d.useCallback(function(m){return o(b_(m))},[])]),l=i[0],f=i[1],p=Ure(d.useCallback(function(m){return f(m)},[f]),t,n),h=d.useRef(e);return s(h.current,e)||(p(e),h.current=e),[l,p]}const tO=()=>{const e=F(r=>r.nodes),[t]=Kre(e,300);return d.useMemo(()=>$D(t),[t])},qre=()=>{const e=tO();return a.jsx(T,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:a.jsx(Oi,{data:e,label:"Workflow"})})},Xre=d.memo(qre),Yre=({isSelected:e,isHovered:t})=>{const n=d.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.light";if(e)return"nodeSelected.light";if(t)return"nodeHovered.light"},[t,e]),r=d.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.dark";if(e)return"nodeSelected.dark";if(t)return"nodeHovered.dark"},[t,e]);return a.jsx(Ie,{className:"selection-box",sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",opacity:e||t?1:.5,transitionProperty:"common",transitionDuration:"0.1s",pointerEvents:"none",shadow:n,_dark:{shadow:r}}})},nO=d.memo(Yre),rO=e=>{const t=te(),n=d.useMemo(()=>ae(xe,({nodes:i})=>i.mouseOverNode===e,Ce),[e]),r=F(n),o=d.useCallback(()=>{!r&&t(GC(e))},[t,e,r]),s=d.useCallback(()=>{r&&t(GC(null))},[t,r]);return{isMouseOverNode:r,handleMouseOver:o,handleMouseOut:s}},oO=(e,t)=>{const n=d.useMemo(()=>ae(xe,({nodes:o})=>{var i;const s=o.nodes.find(l=>l.id===e);if(Cn(s))return(i=s==null?void 0:s.data.inputs[t])==null?void 0:i.label},Ce),[t,e]);return F(n)},sO=(e,t,n)=>{const r=d.useMemo(()=>ae(xe,({nodes:s})=>{var f;const i=s.nodes.find(p=>p.id===e);if(!Cn(i))return;const l=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return(f=l==null?void 0:l[Wx[n]][t])==null?void 0:f.title},Ce),[t,n,e]);return F(r)},aO=(e,t)=>{const n=d.useMemo(()=>ae(xe,({nodes:o})=>{const s=o.nodes.find(i=>i.id===e);if(Cn(s))return s==null?void 0:s.data.inputs[t]},Ce),[t,e]);return F(n)},Cg=(e,t,n)=>{const r=d.useMemo(()=>ae(xe,({nodes:s})=>{const i=s.nodes.find(f=>f.id===e);if(!Cn(i))return;const l=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return l==null?void 0:l[Wx[n]][t]},Ce),[t,n,e]);return F(r)},Qre=({nodeId:e,fieldName:t,kind:n})=>{const r=aO(e,t),o=Cg(e,t,n),s=LD(o),i=d.useMemo(()=>zD(r)?r.label&&(o!=null&&o.title)?`${r.label} (${o.title})`:r.label&&!o?r.label:!r.label&&o?o.title:"Unknown Field":(o==null?void 0:o.title)||"Unknown Field",[r,o]);return a.jsxs(T,{sx:{flexDir:"column"},children:[a.jsx(be,{sx:{fontWeight:600},children:i}),o&&a.jsx(be,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:o.description}),o&&a.jsxs(be,{children:["Type: ",yd[o.type].title]}),s&&a.jsxs(be,{children:["Input: ",FD(o.input)]})]})},Ay=d.memo(Qre),Zre=Pe((e,t)=>{const{nodeId:n,fieldName:r,kind:o,isMissingInput:s=!1,withTooltip:i=!1}=e,l=oO(n,r),f=sO(n,r,o),p=te(),[h,m]=d.useState(l||f||"Unknown Field"),v=d.useCallback(async C=>{C&&(C===l||C===f)||(m(C||f||"Unknown Field"),p(BD({nodeId:n,fieldName:r,label:C})))},[l,f,p,n,r]),x=d.useCallback(C=>{m(C)},[]);return d.useEffect(()=>{m(l||f||"Unknown Field")},[l,f]),a.jsx(Dt,{label:i?a.jsx(Ay,{nodeId:n,fieldName:r,kind:"input"}):void 0,openDelay:gm,placement:"top",hasArrow:!0,children:a.jsx(T,{ref:t,sx:{position:"relative",overflow:"hidden",alignItems:"center",justifyContent:"flex-start",gap:1,h:"full"},children:a.jsxs(km,{value:h,onChange:x,onSubmit:v,as:T,sx:{position:"relative",alignItems:"center",h:"full"},children:[a.jsx(Sm,{sx:{p:0,fontWeight:s?600:400,textAlign:"left",_hover:{fontWeight:"600 !important"}},noOfLines:1}),a.jsx(wm,{className:"nodrag",sx:{p:0,w:"full",fontWeight:600,color:"base.900",_dark:{color:"base.100"},_focusVisible:{p:0,textAlign:"left",boxShadow:"none"}}}),a.jsx(lO,{})]})})})}),iO=d.memo(Zre),lO=d.memo(()=>{const{isEditing:e,getEditButtonProps:t}=B3(),n=d.useCallback(r=>{const{onClick:o}=t();o&&(o(r),r.preventDefault())},[t]);return e?null:a.jsx(T,{onClick:n,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,cursor:"text"})});lO.displayName="EditableControls";const Jre=e=>{const{nodeId:t,field:n}=e,r=te(),o=d.useCallback(s=>{r(HD({nodeId:t,fieldName:n.name,value:s.target.checked}))},[r,n.name,t]);return a.jsx(Lb,{className:"nodrag",onChange:o,isChecked:n.value})},eoe=d.memo(Jre);function wg(){return(wg=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 cO(e,t){if(e==null)return{};var n,r,o={},s=Object.keys(e);for(r=0;r<s.length;r++)t.indexOf(n=s[r])>=0||(o[n]=e[n]);return o}function xx(e){var t=d.useRef(e),n=d.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Ic=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},qu=function(e){return"touches"in e},bx=function(e){return e&&e.ownerDocument.defaultView||self},y_=function(e,t,n){var r=e.getBoundingClientRect(),o=qu(t)?function(s,i){for(var l=0;l<s.length;l++)if(s[l].identifier===i)return s[l];return s[0]}(t.touches,n):t;return{left:Ic((o.pageX-(r.left+bx(e).pageXOffset))/r.width),top:Ic((o.pageY-(r.top+bx(e).pageYOffset))/r.height)}},C_=function(e){!qu(e)&&e.preventDefault()},Ny=H.memo(function(e){var t=e.onMove,n=e.onKey,r=cO(e,["onMove","onKey"]),o=d.useRef(null),s=xx(t),i=xx(n),l=d.useRef(null),f=d.useRef(!1),p=d.useMemo(function(){var x=function(w){C_(w),(qu(w)?w.touches.length>0:w.buttons>0)&&o.current?s(y_(o.current,w,l.current)):b(!1)},C=function(){return b(!1)};function b(w){var k=f.current,_=bx(o.current),j=w?_.addEventListener:_.removeEventListener;j(k?"touchmove":"mousemove",x),j(k?"touchend":"mouseup",C)}return[function(w){var k=w.nativeEvent,_=o.current;if(_&&(C_(k),!function(I,M){return M&&!qu(I)}(k,f.current)&&_)){if(qu(k)){f.current=!0;var j=k.changedTouches||[];j.length&&(l.current=j[0].identifier)}_.focus(),s(y_(_,k,l.current)),b(!0)}},function(w){var k=w.which||w.keyCode;k<37||k>40||(w.preventDefault(),i({left:k===39?.05:k===37?-.05:0,top:k===40?.05:k===38?-.05:0}))},b]},[i,s]),h=p[0],m=p[1],v=p[2];return d.useEffect(function(){return v},[v]),H.createElement("div",wg({},r,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:o,onKeyDown:m,tabIndex:0,role:"slider"}))}),Sg=function(e){return e.filter(Boolean).join(" ")},Ty=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=Sg(["react-colorful__pointer",e.className]);return H.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},H.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},dr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},uO=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:dr(e.h),s:dr(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:dr(o/2),a:dr(r,2)}},yx=function(e){var t=uO(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Hv=function(e){var t=uO(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},toe=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var s=Math.floor(t),i=r*(1-n),l=r*(1-(t-s)*n),f=r*(1-(1-t+s)*n),p=s%6;return{r:dr(255*[r,l,i,i,f,r][p]),g:dr(255*[f,r,r,l,i,i][p]),b:dr(255*[i,i,f,r,r,l][p]),a:dr(o,2)}},noe=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),i=s-Math.min(t,n,r),l=i?s===t?(n-r)/i:s===n?2+(r-t)/i:4+(t-n)/i:0;return{h:dr(60*(l<0?l+6:l)),s:dr(s?i/s*100:0),v:dr(s/255*100),a:o}},roe=H.memo(function(e){var t=e.hue,n=e.onChange,r=Sg(["react-colorful__hue",e.className]);return H.createElement("div",{className:r},H.createElement(Ny,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Ic(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":dr(t),"aria-valuemax":"360","aria-valuemin":"0"},H.createElement(Ty,{className:"react-colorful__hue-pointer",left:t/360,color:yx({h:t,s:100,v:100,a:1})})))}),ooe=H.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:yx({h:t.h,s:100,v:100,a:1})};return H.createElement("div",{className:"react-colorful__saturation",style:r},H.createElement(Ny,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Ic(t.s+100*o.left,0,100),v:Ic(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+dr(t.s)+"%, Brightness "+dr(t.v)+"%"},H.createElement(Ty,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:yx(t)})))}),dO=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function soe(e,t,n){var r=xx(n),o=d.useState(function(){return e.toHsva(t)}),s=o[0],i=o[1],l=d.useRef({color:t,hsva:s});d.useEffect(function(){if(!e.equal(t,l.current.color)){var p=e.toHsva(t);l.current={hsva:p,color:t},i(p)}},[t,e]),d.useEffect(function(){var p;dO(s,l.current.hsva)||e.equal(p=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:p},r(p))},[s,e,r]);var f=d.useCallback(function(p){i(function(h){return Object.assign({},h,p)})},[]);return[s,f]}var aoe=typeof window<"u"?d.useLayoutEffect:d.useEffect,ioe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},w_=new Map,loe=function(e){aoe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!w_.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}`,w_.set(t,n);var r=ioe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},coe=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+Hv(Object.assign({},n,{a:0}))+", "+Hv(Object.assign({},n,{a:1}))+")"},s=Sg(["react-colorful__alpha",t]),i=dr(100*n.a);return H.createElement("div",{className:s},H.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),H.createElement(Ny,{onMove:function(l){r({a:l.left})},onKey:function(l){r({a:Ic(n.a+l.left)})},"aria-label":"Alpha","aria-valuetext":i+"%","aria-valuenow":i,"aria-valuemin":"0","aria-valuemax":"100"},H.createElement(Ty,{className:"react-colorful__alpha-pointer",left:n.a,color:Hv(n)})))},uoe=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,i=cO(e,["className","colorModel","color","onChange"]),l=d.useRef(null);loe(l);var f=soe(n,o,s),p=f[0],h=f[1],m=Sg(["react-colorful",t]);return H.createElement("div",wg({},i,{ref:l,className:m}),H.createElement(ooe,{hsva:p,onChange:h}),H.createElement(roe,{hue:p.h,onChange:h}),H.createElement(coe,{hsva:p,onChange:h,className:"react-colorful__last-control"}))},doe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:noe,fromHsva:toe,equal:dO},fO=function(e){return H.createElement(uoe,wg({},e,{colorModel:doe}))};const foe=e=>{const{nodeId:t,field:n}=e,r=te(),o=d.useCallback(s=>{r(WD({nodeId:t,fieldName:n.name,value:s}))},[r,n.name,t]);return a.jsx(fO,{className:"nodrag",color:n.value,onChange:o})},poe=d.memo(foe),pO=e=>{const t=Dc("models"),[n,r,o]=e.split("/"),s=VD.safeParse({base_model:n,model_name:o});if(!s.success){t.error({controlNetModelId:e,errors:s.error.format()},"Failed to parse ControlNet model id");return}return s.data},hoe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Vx(),i=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/controlnet/${r==null?void 0:r.model_name}`])??null,[r==null?void 0:r.base_model,r==null?void 0:r.model_name,s==null?void 0:s.entities]),l=d.useMemo(()=>{if(!s)return[];const p=[];return Fn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:mn[h.base_model]})}),p},[s]),f=d.useCallback(p=>{if(!p)return;const h=pO(p);h&&o(UD({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx(Bn,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:l,onChange:f,sx:{width:"100%"}})},moe=d.memo(hoe),goe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),s=d.useCallback(i=>{o(GD({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return a.jsx(gP,{className:"nowheel nodrag",onChange:s,value:n.value,children:r.options.map(i=>a.jsx("option",{children:i},i))})},voe=d.memo(goe),xoe=e=>{var p;const{nodeId:t,field:n}=e,r=te(),{currentData:o}=po(((p=n.value)==null?void 0:p.image_name)??zr.skipToken),s=d.useCallback(()=>{r(KD({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),i=d.useMemo(()=>{if(o)return{id:`node-${t}-${n.name}`,payloadType:"IMAGE_DTO",payload:{imageDTO:o}}},[n.name,o,t]),l=d.useMemo(()=>({id:`node-${t}-${n.name}`,actionType:"SET_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}}),[n.name,t]),f=d.useMemo(()=>({type:"SET_NODES_IMAGE",nodeId:t,fieldName:n.name}),[t,n.name]);return a.jsx(T,{className:"nodrag",sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Ya,{imageDTO:o,droppableData:l,draggableData:i,postUploadAction:f,useThumbailFallback:!0,uploadElement:a.jsx(hO,{}),dropLabel:a.jsx(mO,{}),minSize:8,children:a.jsx(cc,{onClick:s,icon:o?a.jsx(tg,{}):void 0,tooltip:"Reset Image"})})})},boe=d.memo(xoe),hO=d.memo(()=>a.jsx(be,{fontSize:16,fontWeight:600,children:"Drop or Upload"}));hO.displayName="UploadElement";const mO=d.memo(()=>a.jsx(be,{fontSize:16,fontWeight:600,children:"Drop"}));mO.displayName="DropLabel";const yoe=e=>{const t=Dc("models"),[n,r,o]=e.split("/"),s=qD.safeParse({base_model:n,model_name:o});if(!s.success){t.error({loraModelId:e,errors:s.error.format()},"Failed to parse LoRA model id");return}return s.data},Coe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=vm(),i=d.useMemo(()=>{if(!s)return[];const p=[];return Fn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:mn[h.base_model]})}),p.sort((h,m)=>h.disabled&&!m.disabled?1:-1)},[s]),l=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/lora/${r==null?void 0:r.model_name}`])??null,[s==null?void 0:s.entities,r==null?void 0:r.base_model,r==null?void 0:r.model_name]),f=d.useCallback(p=>{if(!p)return;const h=yoe(p);h&&o(XD({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return(s==null?void 0:s.ids.length)===0?a.jsx(T,{sx:{justifyContent:"center",p:2},children:a.jsx(be,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(Gt,{className:"nowheel nodrag",value:(l==null?void 0:l.id)??null,placeholder:i.length>0?"Select a LoRA":"No LoRAs available",data:i,nothingFound:"No matching LoRAs",itemComponent:ri,disabled:i.length===0,filter:(p,h)=>{var m;return((m=h.label)==null?void 0:m.toLowerCase().includes(p.toLowerCase().trim()))||h.value.toLowerCase().includes(p.toLowerCase().trim())},error:!l,onChange:f,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},woe=d.memo(Coe),kg=e=>{const t=Dc("models"),[n,r,o]=e.split("/"),s=YD.safeParse({base_model:n,model_name:o,model_type:r});if(!s.success){t.error({mainModelId:e,errors:s.error.format()},"Failed to parse main model id");return}return s.data};function Vc(e){const{iconMode:t=!1,...n}=e,r=te(),{t:o}=we(),[s,{isLoading:i}]=QD(),l=()=>{s().unwrap().then(f=>{r(Nt(zt({title:`${o("modelManager.modelsSynced")}`,status:"success"})))}).catch(f=>{f&&r(Nt(zt({title:`${o("modelManager.modelSyncFailed")}`,status:"error"})))})};return t?a.jsx(Te,{icon:a.jsx(TE,{}),tooltip:o("modelManager.syncModels"),"aria-label":o("modelManager.syncModels"),isLoading:i,onClick:l,size:"sm",...n}):a.jsx(it,{isLoading:i,onClick:l,minW:"max-content",...n,children:"Sync Models"})}const Soe=e=>{var x,C;const{nodeId:t,field:n}=e,r=te(),o=qt("syncModels").isFeatureEnabled,{data:s,isLoading:i}=Xu(KC),{data:l,isLoading:f}=Bo(KC),p=d.useMemo(()=>i||f,[i,f]),h=d.useMemo(()=>{if(!l)return[];const b=[];return Fn(l.entities,(w,k)=>{w&&b.push({value:k,label:w.model_name,group:mn[w.base_model]})}),s&&Fn(s.entities,(w,k)=>{w&&b.push({value:k,label:w.model_name,group:mn[w.base_model]})}),b},[l,s]),m=d.useMemo(()=>{var b,w,k,_;return((l==null?void 0:l.entities[`${(b=n.value)==null?void 0:b.base_model}/main/${(w=n.value)==null?void 0:w.model_name}`])||(s==null?void 0:s.entities[`${(k=n.value)==null?void 0:k.base_model}/onnx/${(_=n.value)==null?void 0:_.model_name}`]))??null},[(x=n.value)==null?void 0:x.base_model,(C=n.value)==null?void 0:C.model_name,l==null?void 0:l.entities,s==null?void 0:s.entities]),v=d.useCallback(b=>{if(!b)return;const w=kg(b);w&&r(Gj({nodeId:t,fieldName:n.name,value:w}))},[r,n.name,t]);return a.jsxs(T,{sx:{w:"full",alignItems:"center",gap:2},children:[p?a.jsx(be,{variant:"subtext",children:"Loading..."}):a.jsx(Gt,{className:"nowheel nodrag",tooltip:m==null?void 0:m.description,value:m==null?void 0:m.id,placeholder:h.length>0?"Select a model":"No models available",data:h,error:!m,disabled:h.length===0,onChange:v,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),o&&a.jsx(Vc,{className:"nodrag",iconMode:!0})]})},koe=d.memo(Soe),sm=/^-?(0\.)?\.?$/,_oe=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:i,min:l,max:f,isInteger:p=!0,formControlProps:h,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:x,tooltipProps:C,...b}=e,w=te(),[k,_]=d.useState(String(s));d.useEffect(()=>{!k.match(sm)&&s!==Number(k)&&_(String(s))},[s,k]);const j=O=>{_(O),O.match(sm)||i(p?Math.floor(Number(O)):Number(O))},I=O=>{const D=Ri(p?Math.floor(Number(O.target.value)):Number(O.target.value),l,f);_(String(D)),i(D)},M=d.useCallback(O=>{O.shiftKey&&w(Ir(!0))},[w]),E=d.useCallback(O=>{O.shiftKey||w(Ir(!1))},[w]);return a.jsx(Dt,{...C,children:a.jsxs(un,{isDisabled:n,isInvalid:o,...h,children:[t&&a.jsx(Gn,{...m,children:t}),a.jsxs(Dm,{value:k,min:l,max:f,keepWithinRange:!0,clampValueOnBlur:!1,onChange:j,onBlur:I,...b,onPaste:Ry,children:[a.jsx(Am,{...v,onKeyDown:M,onKeyUp:E}),r&&a.jsxs(Rm,{children:[a.jsx(Tm,{...x}),a.jsx(Nm,{...x})]})]})]})})},Uc=d.memo(_oe),joe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),[s,i]=d.useState(String(n.value)),l=d.useMemo(()=>r.type==="integer",[r.type]),f=p=>{i(p),p.match(sm)||o(ZD({nodeId:t,fieldName:n.name,value:l?Math.floor(Number(p)):Number(p)}))};return d.useEffect(()=>{!s.match(sm)&&n.value!==Number(s)&&i(String(n.value))},[n.value,s]),a.jsxs(Dm,{onChange:f,value:s,step:l?1:.1,precision:l?0:3,children:[a.jsx(Am,{className:"nodrag"}),a.jsxs(Rm,{children:[a.jsx(Tm,{}),a.jsx(Nm,{})]})]})},Poe=d.memo(joe),Ioe=e=>{var m,v;const{nodeId:t,field:n}=e,r=te(),{t:o}=we(),s=qt("syncModels").isFeatureEnabled,{data:i,isLoading:l}=Bo(Ux),f=d.useMemo(()=>{if(!i)return[];const x=[];return Fn(i.entities,(C,b)=>{C&&x.push({value:b,label:C.model_name,group:mn[C.base_model]})}),x},[i]),p=d.useMemo(()=>{var x,C;return(i==null?void 0:i.entities[`${(x=n.value)==null?void 0:x.base_model}/main/${(C=n.value)==null?void 0:C.model_name}`])??null},[(m=n.value)==null?void 0:m.base_model,(v=n.value)==null?void 0:v.model_name,i==null?void 0:i.entities]),h=d.useCallback(x=>{if(!x)return;const C=kg(x);C&&r(JD({nodeId:t,fieldName:n.name,value:C}))},[r,n.name,t]);return l?a.jsx(Gt,{label:o("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs(T,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Gt,{className:"nowheel nodrag",tooltip:p==null?void 0:p.description,value:p==null?void 0:p.id,placeholder:f.length>0?"Select a model":"No models available",data:f,error:!p,disabled:f.length===0,onChange:h,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Vc,{className:"nodrag",iconMode:!0})]})},Eoe=d.memo(Ioe),Moe=e=>{var v,x;const{nodeId:t,field:n}=e,r=te(),{t:o}=we(),s=qt("syncModels").isFeatureEnabled,{data:i}=Xu(qC),{data:l,isLoading:f}=Bo(qC),p=d.useMemo(()=>{if(!l)return[];const C=[];return Fn(l.entities,(b,w)=>{!b||b.base_model!=="sdxl"||C.push({value:w,label:b.model_name,group:mn[b.base_model]})}),i&&Fn(i.entities,(b,w)=>{!b||b.base_model!=="sdxl"||C.push({value:w,label:b.model_name,group:mn[b.base_model]})}),C},[l,i]),h=d.useMemo(()=>{var C,b,w,k;return((l==null?void 0:l.entities[`${(C=n.value)==null?void 0:C.base_model}/main/${(b=n.value)==null?void 0:b.model_name}`])||(i==null?void 0:i.entities[`${(w=n.value)==null?void 0:w.base_model}/onnx/${(k=n.value)==null?void 0:k.model_name}`]))??null},[(v=n.value)==null?void 0:v.base_model,(x=n.value)==null?void 0:x.model_name,l==null?void 0:l.entities,i==null?void 0:i.entities]),m=d.useCallback(C=>{if(!C)return;const b=kg(C);b&&r(Gj({nodeId:t,fieldName:n.name,value:b}))},[r,n.name,t]);return f?a.jsx(Gt,{label:o("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs(T,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Gt,{className:"nowheel nodrag",tooltip:h==null?void 0:h.description,value:h==null?void 0:h.id,placeholder:p.length>0?"Select a model":"No models available",data:p,error:!h,disabled:p.length===0,onChange:m,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Vc,{className:"nodrag",iconMode:!0})]})},Ooe=d.memo(Moe),Doe=ae([xe],({ui:e})=>{const{favoriteSchedulers:t}=e;return{data:rr(dm,(r,o)=>({value:o,label:r,group:t.includes(o)?"Favorites":void 0})).sort((r,o)=>r.label.localeCompare(o.label))}},Ce),Roe=e=>{const{nodeId:t,field:n}=e,r=te(),{data:o}=F(Doe),s=d.useCallback(i=>{i&&r(eR({nodeId:t,fieldName:n.name,value:i}))},[r,n.name,t]);return a.jsx(Gt,{className:"nowheel nodrag",sx:{".mantine-Select-dropdown":{width:"14rem !important"}},value:n.value,data:o,onChange:s})},Aoe=d.memo(Roe),Noe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=te(),s=d.useCallback(i=>{o(tR({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return r.ui_component==="textarea"?a.jsx(oa,{className:"nodrag",onChange:s,value:n.value,rows:5,resize:"none"}):a.jsx(io,{onChange:s,value:n.value})},Toe=d.memo(Noe),gO=e=>{const t=Dc("models"),[n,r,o]=e.split("/"),s=nR.safeParse({base_model:n,model_name:o});if(!s.success){t.error({vaeModelId:e,errors:s.error.format()},"Failed to parse VAE model id");return}return s.data},$oe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=te(),{data:s}=Kj(),i=d.useMemo(()=>{if(!s)return[];const p=[{value:"default",label:"Default",group:"Default"}];return Fn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:mn[h.base_model]})}),p.sort((h,m)=>h.disabled&&!m.disabled?1:-1)},[s]),l=d.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/vae/${r==null?void 0:r.model_name}`])??null,[s==null?void 0:s.entities,r]),f=d.useCallback(p=>{if(!p)return;const h=gO(p);h&&o(rR({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx(Gt,{className:"nowheel nodrag",itemComponent:ri,tooltip:l==null?void 0:l.description,value:(l==null?void 0:l.id)??"default",placeholder:"Default",data:i,onChange:f,disabled:i.length===0,error:!l,clearable:!0,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},Loe=d.memo($oe),zoe=({nodeId:e,fieldName:t})=>{const n=aO(e,t),r=Cg(e,t,"input");return(r==null?void 0:r.fieldKind)==="output"?a.jsxs(Ie,{p:2,children:["Output field in input: ",n==null?void 0:n.type]}):(n==null?void 0:n.type)==="string"&&(r==null?void 0:r.type)==="string"?a.jsx(Toe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="boolean"&&(r==null?void 0:r.type)==="boolean"?a.jsx(eoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="integer"&&(r==null?void 0:r.type)==="integer"||(n==null?void 0:n.type)==="float"&&(r==null?void 0:r.type)==="float"?a.jsx(Poe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="enum"&&(r==null?void 0:r.type)==="enum"?a.jsx(voe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ImageField"&&(r==null?void 0:r.type)==="ImageField"?a.jsx(boe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="MainModelField"&&(r==null?void 0:r.type)==="MainModelField"?a.jsx(koe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLRefinerModelField"&&(r==null?void 0:r.type)==="SDXLRefinerModelField"?a.jsx(Eoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="VaeModelField"&&(r==null?void 0:r.type)==="VaeModelField"?a.jsx(Loe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="LoRAModelField"&&(r==null?void 0:r.type)==="LoRAModelField"?a.jsx(woe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ControlNetModelField"&&(r==null?void 0:r.type)==="ControlNetModelField"?a.jsx(moe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ColorField"&&(r==null?void 0:r.type)==="ColorField"?a.jsx(poe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLMainModelField"&&(r==null?void 0:r.type)==="SDXLMainModelField"?a.jsx(Ooe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="Scheduler"&&(r==null?void 0:r.type)==="Scheduler"?a.jsx(Aoe,{nodeId:e,field:n,fieldTemplate:r}):n&&r?null:a.jsx(Ie,{p:1,children:a.jsxs(be,{sx:{fontSize:"sm",fontWeight:600,color:"error.400",_dark:{color:"error.300"}},children:["Unknown field type: ",n==null?void 0:n.type]})})},vO=d.memo(zoe),Foe=({nodeId:e,fieldName:t})=>{const n=te(),{isMouseOverNode:r,handleMouseOut:o,handleMouseOver:s}=rO(e),i=d.useCallback(()=>{n(qj({nodeId:e,fieldName:t}))},[n,t,e]);return a.jsxs(T,{onMouseEnter:s,onMouseLeave:o,layerStyle:"second",sx:{position:"relative",borderRadius:"base",w:"full",p:2},children:[a.jsxs(un,{as:T,sx:{flexDir:"column",gap:1,flexShrink:1},children:[a.jsxs(Gn,{sx:{display:"flex",alignItems:"center",mb:0},children:[a.jsx(iO,{nodeId:e,fieldName:t,kind:"input"}),a.jsx(Za,{}),a.jsx(Dt,{label:a.jsx(Ay,{nodeId:e,fieldName:t,kind:"input"}),openDelay:gm,placement:"top",hasArrow:!0,children:a.jsx(T,{h:"full",alignItems:"center",children:a.jsx(An,{as:EE})})}),a.jsx(Te,{"aria-label":"Remove from Linear View",tooltip:"Remove from Linear View",variant:"ghost",size:"sm",onClick:i,icon:a.jsx(Wr,{})})]}),a.jsx(vO,{nodeId:e,fieldName:t})]}),a.jsx(nO,{isSelected:!1,isHovered:r})]})},Boe=d.memo(Foe),Hoe=ae(xe,({nodes:e})=>({fields:e.workflow.exposedFields}),Ce),Woe=()=>{const{fields:e}=F(Hoe);return a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Dy,{children:a.jsx(T,{sx:{position:"relative",flexDir:"column",alignItems:"flex-start",p:1,gap:2,h:"full",w:"full"},children:e.length?e.map(({nodeId:t,fieldName:n})=>a.jsx(Boe,{nodeId:t,fieldName:n},`${t}.${n}`)):a.jsx(tr,{label:"No fields added to Linear View",icon:null})})})})},Voe=d.memo(Woe),Uoe=()=>a.jsx(T,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(Yi,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(Qi,{children:[a.jsx(Pr,{children:"Linear"}),a.jsx(Pr,{children:"Details"}),a.jsx(Pr,{children:"JSON"})]}),a.jsxs(zc,{children:[a.jsx(fo,{children:a.jsx(Voe,{})}),a.jsx(fo,{children:a.jsx(Vre,{})}),a.jsx(fo,{children:a.jsx(Xre,{})})]})]})}),Goe=d.memo(Uoe),Koe=()=>{const[e,t]=d.useState(!1),[n,r]=d.useState(!1),o=d.useRef(null),s=Oy(),i=d.useCallback(()=>{o.current&&o.current.setLayout([50,50])},[]);return a.jsxs(T,{sx:{flexDir:"column",gap:2,height:"100%",width:"100%"},children:[a.jsx(HM,{}),a.jsxs(yg,{ref:o,id:"workflow-panel-group",direction:"vertical",style:{height:"100%",width:"100%"},storage:s,children:[a.jsx(Va,{id:"workflow",collapsible:!0,onCollapse:t,minSize:25,children:a.jsx(Goe,{})}),a.jsx(om,{direction:"vertical",onDoubleClick:i,collapsedDirection:e?"top":n?"bottom":void 0}),a.jsx(Va,{id:"inspector",collapsible:!0,onCollapse:r,minSize:25,children:a.jsx(Lre,{})})]})]})},qoe=d.memo(Koe),S_=(e,t)=>{const n=d.useRef(null),[r,o]=d.useState(()=>{var p;return!!((p=n.current)!=null&&p.getCollapsed())}),s=d.useCallback(()=>{var p;(p=n.current)!=null&&p.getCollapsed()?so.flushSync(()=>{var h;(h=n.current)==null||h.expand()}):so.flushSync(()=>{var h;(h=n.current)==null||h.collapse()})},[]),i=d.useCallback(()=>{so.flushSync(()=>{var p;(p=n.current)==null||p.expand()})},[]),l=d.useCallback(()=>{so.flushSync(()=>{var p;(p=n.current)==null||p.collapse()})},[]),f=d.useCallback(()=>{so.flushSync(()=>{var p;(p=n.current)==null||p.resize(e,t)})},[e,t]);return{ref:n,minSize:e,isCollapsed:r,setIsCollapsed:o,reset:f,toggle:s,expand:i,collapse:l}},Xoe=({isGalleryCollapsed:e,galleryPanelRef:t})=>{const{t:n}=we(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(wd,{children:a.jsx(T,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineEnd:"1.63rem",children:a.jsx(Te,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":n("common.showGalleryPanel"),onClick:r,icon:a.jsx(yne,{}),sx:{p:0,px:3,h:48,borderStartEndRadius:0,borderEndEndRadius:0,shadow:"2xl"}})})}):null},Yoe=d.memo(Xoe),Wv={borderStartStartRadius:0,borderEndStartRadius:0,shadow:"2xl"},Qoe=({isSidePanelCollapsed:e,sidePanelRef:t})=>{const{t:n}=we(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(wd,{children:a.jsxs(T,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"5.13rem",direction:"column",gap:2,children:[a.jsx(Te,{tooltip:"Show Side Panel (O, T)","aria-label":n("common.showOptionsPanel"),onClick:r,sx:Wv,icon:a.jsx(NE,{})}),a.jsx(BM,{asIconButton:!0,sx:Wv}),a.jsx(FM,{sx:Wv,asIconButton:!0})]})}):null},Zoe=d.memo(Qoe),Joe=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:i}=Er({defaultIsOpen:o}),{colorMode:l}=ia();return a.jsxs(Ie,{children:[a.jsxs(T,{onClick:i,sx:{alignItems:"center",p:2,px:4,gap:2,borderTopRadius:"base",borderBottomRadius:s?0:"base",bg:Ae("base.250","base.750")(l),color:Ae("base.900","base.100")(l),_hover:{bg:Ae("base.300","base.700")(l)},fontSize:"sm",fontWeight:600,cursor:"pointer",transitionProperty:"common",transitionDuration:"normal",userSelect:"none"},children:[t,a.jsx(nr,{children:n&&a.jsx(gn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(be,{sx:{color:"accent.500",_dark:{color:"accent.300"}},children:n})},"statusText")}),a.jsx(Za,{}),a.jsx(cg,{sx:{w:"1rem",h:"1rem",transform:s?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(ym,{in:s,animateOpacity:!0,style:{overflow:"unset"},children:a.jsx(Ie,{sx:{p:4,pb:4,borderBottomRadius:"base",bg:"base.150",_dark:{bg:"base.800"}},children:r})})]})},hr=d.memo(Joe),ese=ae(xe,e=>{const{combinatorial:t,isEnabled:n}=e.dynamicPrompts;return{combinatorial:t,isDisabled:!n}},Ce),tse=()=>{const{combinatorial:e,isDisabled:t}=F(ese),n=te(),r=d.useCallback(()=>{n(oR())},[n]);return a.jsx(Ut,{isDisabled:t,label:"Combinatorial Generation",isChecked:e,onChange:r})},nse=d.memo(tse),rse=ae(xe,e=>{const{isEnabled:t}=e.dynamicPrompts;return{isEnabled:t}},Ce),ose=()=>{const e=te(),{isEnabled:t}=F(rse),n=d.useCallback(()=>{e(sR())},[e]);return a.jsx(Ut,{label:"Enable Dynamic Prompts",isChecked:t,onChange:n})},sse=d.memo(ose),ase=ae(xe,e=>{const{maxPrompts:t,combinatorial:n,isEnabled:r}=e.dynamicPrompts,{min:o,sliderMax:s,inputMax:i}=e.config.sd.dynamicPrompts.maxPrompts;return{maxPrompts:t,min:o,sliderMax:s,inputMax:i,isDisabled:!r||!n}},Ce),ise=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=F(ase),s=te(),i=d.useCallback(f=>{s(aR(f))},[s]),l=d.useCallback(()=>{s(iR())},[s]);return a.jsx(Ze,{label:"Max Prompts",isDisabled:o,min:t,max:n,value:e,onChange:i,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:l})},lse=d.memo(ise),cse=ae(xe,e=>{const{isEnabled:t}=e.dynamicPrompts;return{activeLabel:t?"Enabled":void 0}},Ce),use=()=>{const{activeLabel:e}=F(cse);return qt("dynamicPrompting").isFeatureEnabled?a.jsx(hr,{label:"Dynamic Prompts",activeLabel:e,children:a.jsxs(T,{sx:{gap:2,flexDir:"column"},children:[a.jsx(sse,{}),a.jsx(nse,{}),a.jsx(lse,{})]})}):null},Gc=d.memo(use),dse=e=>{const t=te(),{lora:n}=e,r=d.useCallback(i=>{t(lR({id:n.id,weight:i}))},[t,n.id]),o=d.useCallback(()=>{t(cR(n.id))},[t,n.id]),s=d.useCallback(()=>{t(uR(n.id))},[t,n.id]);return a.jsxs(T,{sx:{gap:2.5,alignItems:"flex-end"},children:[a.jsx(Ze,{label:n.model_name,value:n.weight,onChange:r,min:-1,max:2,step:.01,withInput:!0,withReset:!0,handleReset:o,withSliderMarks:!0,sliderMarks:[-1,0,1,2],sliderNumberInputProps:{min:-50,max:50}}),a.jsx(Te,{size:"sm",onClick:s,tooltip:"Remove LoRA","aria-label":"Remove LoRA",icon:a.jsx(Wr,{}),colorScheme:"error"})]})},fse=d.memo(dse),pse=ae(xe,({lora:e})=>({lorasArray:rr(e.loras)}),Ce),hse=()=>{const{lorasArray:e}=F(pse);return a.jsx(a.Fragment,{children:e.map((t,n)=>a.jsxs(T,{sx:{flexDirection:"column",gap:2},children:[n>0&&a.jsx(Fr,{pt:1}),a.jsx(fse,{lora:t})]},t.model_name))})},mse=d.memo(hse),gse=ae(xe,({lora:e})=>({loras:e.loras}),Ce),vse=()=>{const e=te(),{loras:t}=F(gse),{data:n}=vm(),r=F(i=>i.generation.model),o=d.useMemo(()=>{if(!n)return[];const i=[];return Fn(n.entities,(l,f)=>{if(!l||f in t)return;const p=(r==null?void 0:r.base_model)!==l.base_model;i.push({value:f,label:l.model_name,disabled:p,group:mn[l.base_model],tooltip:p?`Incompatible base model: ${l.base_model}`:void 0})}),i.sort((l,f)=>l.label&&!f.label?1:-1),i.sort((l,f)=>l.disabled&&!f.disabled?1:-1)},[t,n,r==null?void 0:r.base_model]),s=d.useCallback(i=>{if(!i)return;const l=n==null?void 0:n.entities[i];l&&e(dR(l))},[e,n==null?void 0:n.entities]);return(n==null?void 0:n.ids.length)===0?a.jsx(T,{sx:{justifyContent:"center",p:2},children:a.jsx(be,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(Gt,{placeholder:o.length===0?"All LoRAs added":"Add LoRA",value:null,data:o,nothingFound:"No matching LoRAs",itemComponent:ri,disabled:o.length===0,filter:(i,l)=>{var f;return((f=l.label)==null?void 0:f.toLowerCase().includes(i.toLowerCase().trim()))||l.value.toLowerCase().includes(i.toLowerCase().trim())},onChange:s})},xse=d.memo(vse),bse=ae(xe,e=>{const t=Xj(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},Ce),yse=()=>{const{activeLabel:e}=F(bse);return qt("lora").isFeatureEnabled?a.jsx(hr,{label:"LoRA",activeLabel:e,children:a.jsxs(T,{sx:{flexDir:"column",gap:2},children:[a.jsx(xse,{}),a.jsx(mse,{})]})}):null},Kc=d.memo(yse),Cse=ae(xe,({generation:e})=>{const{model:t}=e;return{mainModel:t}},Ce),wse=e=>{const{controlNetId:t,model:n,isEnabled:r}=e.controlNet,o=te(),s=F(Pn),{mainModel:i}=F(Cse),{data:l}=Vx(),f=d.useMemo(()=>{if(!l)return[];const m=[];return Fn(l.entities,(v,x)=>{if(!v)return;const C=(v==null?void 0:v.base_model)!==(i==null?void 0:i.base_model);m.push({value:x,label:v.model_name,group:mn[v.base_model],disabled:C,tooltip:C?`Incompatible base model: ${v.base_model}`:void 0})}),m},[l,i==null?void 0:i.base_model]),p=d.useMemo(()=>(l==null?void 0:l.entities[`${n==null?void 0:n.base_model}/controlnet/${n==null?void 0:n.model_name}`])??null,[n==null?void 0:n.base_model,n==null?void 0:n.model_name,l==null?void 0:l.entities]),h=d.useCallback(m=>{if(!m)return;const v=pO(m);v&&o(Yj({controlNetId:t,model:v}))},[t,o]);return a.jsx(Gt,{itemComponent:ri,data:f,error:!p||(i==null?void 0:i.base_model)!==p.base_model,placeholder:"Select a model",value:(p==null?void 0:p.id)??null,onChange:h,disabled:s||!r,tooltip:p==null?void 0:p.description})},Sse=d.memo(wse),kse=e=>{const{weight:t,isEnabled:n,controlNetId:r}=e.controlNet,o=te(),s=d.useCallback(i=>{o(fR({controlNetId:r,weight:i}))},[r,o]);return a.jsx(Ze,{isDisabled:!n,label:"Weight",value:t,onChange:s,min:0,max:2,step:.01,withSliderMarks:!0,sliderMarks:[0,1,2]})},_se=d.memo(kse),jse=ae(xe,({controlNet:e,gallery:t})=>{const{pendingControlImages:n}=e,{autoAddBoardId:r}=t;return{pendingControlImages:n,autoAddBoardId:r}},Ce),Pse=({isSmall:e,controlNet:t})=>{const{controlImage:n,processedControlImage:r,processorType:o,isEnabled:s,controlNetId:i}=t,l=te(),{pendingControlImages:f,autoAddBoardId:p}=F(jse),h=F(wn),[m,v]=d.useState(!1),{currentData:x}=po(n??zr.skipToken),{currentData:C}=po(r??zr.skipToken),[b]=pR(),[w]=hR(),[k]=mR(),_=d.useCallback(()=>{l(gR({controlNetId:i,controlImage:null}))},[i,l]),j=d.useCallback(async()=>{C&&(await b({imageDTO:C,is_intermediate:!1}).unwrap(),p!=="none"?w({imageDTO:C,board_id:p}):k({imageDTO:C}))},[C,b,p,w,k]),I=d.useCallback(()=>{x&&(h==="unifiedCanvas"?l(Ao({width:x.width,height:x.height})):(l(Ai(x.width)),l(Ni(x.height))))},[x,h,l]),M=d.useCallback(()=>{v(!0)},[]),E=d.useCallback(()=>{v(!1)},[]),O=d.useMemo(()=>{if(x)return{id:i,payloadType:"IMAGE_DTO",payload:{imageDTO:x}}},[x,i]),D=d.useMemo(()=>({id:i,actionType:"SET_CONTROLNET_IMAGE",context:{controlNetId:i}}),[i]),A=d.useMemo(()=>({type:"SET_CONTROLNET_IMAGE",controlNetId:i}),[i]),R=x&&C&&!m&&!f.includes(i)&&o!=="none";return a.jsxs(T,{onMouseEnter:M,onMouseLeave:E,sx:{position:"relative",w:"full",h:e?28:366,alignItems:"center",justifyContent:"center",pointerEvents:s?"auto":"none",opacity:s?1:.5},children:[a.jsx(Ya,{draggableData:O,droppableData:D,imageDTO:x,isDropDisabled:R||!s,postUploadAction:A}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:R?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:a.jsx(Ya,{draggableData:O,droppableData:D,imageDTO:C,isUploadDisabled:!0,isDropDisabled:!s})}),a.jsxs(a.Fragment,{children:[a.jsx(cc,{onClick:_,icon:x?a.jsx(tg,{}):void 0,tooltip:"Reset Control Image"}),a.jsx(cc,{onClick:j,icon:x?a.jsx(eg,{size:16}):void 0,tooltip:"Save Control Image",styleOverrides:{marginTop:6}}),a.jsx(cc,{onClick:I,icon:x?a.jsx(OZ,{size:16}):void 0,tooltip:"Set Control Image Dimensions To W/H",styleOverrides:{marginTop:12}})]}),f.includes(i)&&a.jsx(T,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",alignItems:"center",justifyContent:"center",opacity:.8,borderRadius:"base",bg:"base.400",_dark:{bg:"base.900"}},children:a.jsx(Ki,{size:"xl",sx:{color:"base.100",_dark:{color:"base.400"}}})})]})},k_=d.memo(Pse),qo=()=>{const e=te();return d.useCallback((n,r)=>{e(vR({controlNetId:n,changes:r}))},[e])};function Xo(e){return a.jsx(T,{sx:{flexDirection:"column",gap:2},children:e.children})}const __=go.canny_image_processor.default,Ise=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{low_threshold:o,high_threshold:s}=n,i=F(Pn),l=qo(),f=d.useCallback(v=>{l(t,{low_threshold:v})},[t,l]),p=d.useCallback(()=>{l(t,{low_threshold:__.low_threshold})},[t,l]),h=d.useCallback(v=>{l(t,{high_threshold:v})},[t,l]),m=d.useCallback(()=>{l(t,{high_threshold:__.high_threshold})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Ze,{isDisabled:i||!r,label:"Low Threshold",value:o,onChange:f,handleReset:p,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),a.jsx(Ze,{isDisabled:i||!r,label:"High Threshold",value:s,onChange:h,handleReset:m,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},Ese=d.memo(Ise),_u=go.content_shuffle_image_processor.default,Mse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,w:i,h:l,f}=n,p=qo(),h=F(Pn),m=d.useCallback(M=>{p(t,{detect_resolution:M})},[t,p]),v=d.useCallback(()=>{p(t,{detect_resolution:_u.detect_resolution})},[t,p]),x=d.useCallback(M=>{p(t,{image_resolution:M})},[t,p]),C=d.useCallback(()=>{p(t,{image_resolution:_u.image_resolution})},[t,p]),b=d.useCallback(M=>{p(t,{w:M})},[t,p]),w=d.useCallback(()=>{p(t,{w:_u.w})},[t,p]),k=d.useCallback(M=>{p(t,{h:M})},[t,p]),_=d.useCallback(()=>{p(t,{h:_u.h})},[t,p]),j=d.useCallback(M=>{p(t,{f:M})},[t,p]),I=d.useCallback(()=>{p(t,{f:_u.f})},[t,p]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:"Detect Resolution",value:s,onChange:m,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Ze,{label:"Image Resolution",value:o,onChange:x,handleReset:C,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Ze,{label:"W",value:i,onChange:b,handleReset:w,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Ze,{label:"H",value:l,onChange:k,handleReset:_,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Ze,{label:"F",value:f,onChange:j,handleReset:I,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r})]})},Ose=d.memo(Mse),j_=go.hed_image_processor.default,Dse=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o},isEnabled:s}=e,i=F(Pn),l=qo(),f=d.useCallback(x=>{l(t,{detect_resolution:x})},[t,l]),p=d.useCallback(x=>{l(t,{image_resolution:x})},[t,l]),h=d.useCallback(x=>{l(t,{scribble:x.target.checked})},[t,l]),m=d.useCallback(()=>{l(t,{detect_resolution:j_.detect_resolution})},[t,l]),v=d.useCallback(()=>{l(t,{image_resolution:j_.image_resolution})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:"Detect Resolution",value:n,onChange:f,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:i||!s}),a.jsx(Ze,{label:"Image Resolution",value:r,onChange:p,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:i||!s}),a.jsx(Ut,{label:"Scribble",isChecked:o,onChange:h,isDisabled:i||!s})]})},Rse=d.memo(Dse),P_=go.lineart_anime_image_processor.default,Ase=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=qo(),l=F(Pn),f=d.useCallback(v=>{i(t,{detect_resolution:v})},[t,i]),p=d.useCallback(v=>{i(t,{image_resolution:v})},[t,i]),h=d.useCallback(()=>{i(t,{detect_resolution:P_.detect_resolution})},[t,i]),m=d.useCallback(()=>{i(t,{image_resolution:P_.image_resolution})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:"Detect Resolution",value:s,onChange:f,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Ze,{label:"Image Resolution",value:o,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},Nse=d.memo(Ase),I_=go.lineart_image_processor.default,Tse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,coarse:i}=n,l=qo(),f=F(Pn),p=d.useCallback(C=>{l(t,{detect_resolution:C})},[t,l]),h=d.useCallback(C=>{l(t,{image_resolution:C})},[t,l]),m=d.useCallback(()=>{l(t,{detect_resolution:I_.detect_resolution})},[t,l]),v=d.useCallback(()=>{l(t,{image_resolution:I_.image_resolution})},[t,l]),x=d.useCallback(C=>{l(t,{coarse:C.target.checked})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:"Detect Resolution",value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:f||!r}),a.jsx(Ze,{label:"Image Resolution",value:o,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:f||!r}),a.jsx(Ut,{label:"Coarse",isChecked:i,onChange:x,isDisabled:f||!r})]})},$se=d.memo(Tse),E_=go.mediapipe_face_processor.default,Lse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{max_faces:o,min_confidence:s}=n,i=qo(),l=F(Pn),f=d.useCallback(v=>{i(t,{max_faces:v})},[t,i]),p=d.useCallback(v=>{i(t,{min_confidence:v})},[t,i]),h=d.useCallback(()=>{i(t,{max_faces:E_.max_faces})},[t,i]),m=d.useCallback(()=>{i(t,{min_confidence:E_.min_confidence})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:"Max Faces",value:o,onChange:f,handleReset:h,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Ze,{label:"Min Confidence",value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},zse=d.memo(Lse),M_=go.midas_depth_image_processor.default,Fse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{a_mult:o,bg_th:s}=n,i=qo(),l=F(Pn),f=d.useCallback(v=>{i(t,{a_mult:v})},[t,i]),p=d.useCallback(v=>{i(t,{bg_th:v})},[t,i]),h=d.useCallback(()=>{i(t,{a_mult:M_.a_mult})},[t,i]),m=d.useCallback(()=>{i(t,{bg_th:M_.bg_th})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:"a_mult",value:o,onChange:f,handleReset:h,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Ze,{label:"bg_th",value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},Bse=d.memo(Fse),jp=go.mlsd_image_processor.default,Hse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,thr_d:i,thr_v:l}=n,f=qo(),p=F(Pn),h=d.useCallback(_=>{f(t,{detect_resolution:_})},[t,f]),m=d.useCallback(_=>{f(t,{image_resolution:_})},[t,f]),v=d.useCallback(_=>{f(t,{thr_d:_})},[t,f]),x=d.useCallback(_=>{f(t,{thr_v:_})},[t,f]),C=d.useCallback(()=>{f(t,{detect_resolution:jp.detect_resolution})},[t,f]),b=d.useCallback(()=>{f(t,{image_resolution:jp.image_resolution})},[t,f]),w=d.useCallback(()=>{f(t,{thr_d:jp.thr_d})},[t,f]),k=d.useCallback(()=>{f(t,{thr_v:jp.thr_v})},[t,f]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:"Detect Resolution",value:s,onChange:h,handleReset:C,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Ze,{label:"Image Resolution",value:o,onChange:m,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Ze,{label:"W",value:i,onChange:v,handleReset:w,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Ze,{label:"H",value:l,onChange:x,handleReset:k,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:p||!r})]})},Wse=d.memo(Hse),O_=go.normalbae_image_processor.default,Vse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=qo(),l=F(Pn),f=d.useCallback(v=>{i(t,{detect_resolution:v})},[t,i]),p=d.useCallback(v=>{i(t,{image_resolution:v})},[t,i]),h=d.useCallback(()=>{i(t,{detect_resolution:O_.detect_resolution})},[t,i]),m=d.useCallback(()=>{i(t,{image_resolution:O_.image_resolution})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:"Detect Resolution",value:s,onChange:f,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Ze,{label:"Image Resolution",value:o,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},Use=d.memo(Vse),D_=go.openpose_image_processor.default,Gse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,hand_and_face:i}=n,l=qo(),f=F(Pn),p=d.useCallback(C=>{l(t,{detect_resolution:C})},[t,l]),h=d.useCallback(C=>{l(t,{image_resolution:C})},[t,l]),m=d.useCallback(()=>{l(t,{detect_resolution:D_.detect_resolution})},[t,l]),v=d.useCallback(()=>{l(t,{image_resolution:D_.image_resolution})},[t,l]),x=d.useCallback(C=>{l(t,{hand_and_face:C.target.checked})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:"Detect Resolution",value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:f||!r}),a.jsx(Ze,{label:"Image Resolution",value:o,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:f||!r}),a.jsx(Ut,{label:"Hand and Face",isChecked:i,onChange:x,isDisabled:f||!r})]})},Kse=d.memo(Gse),R_=go.pidi_image_processor.default,qse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,scribble:i,safe:l}=n,f=qo(),p=F(Pn),h=d.useCallback(w=>{f(t,{detect_resolution:w})},[t,f]),m=d.useCallback(w=>{f(t,{image_resolution:w})},[t,f]),v=d.useCallback(()=>{f(t,{detect_resolution:R_.detect_resolution})},[t,f]),x=d.useCallback(()=>{f(t,{image_resolution:R_.image_resolution})},[t,f]),C=d.useCallback(w=>{f(t,{scribble:w.target.checked})},[t,f]),b=d.useCallback(w=>{f(t,{safe:w.target.checked})},[t,f]);return a.jsxs(Xo,{children:[a.jsx(Ze,{label:"Detect Resolution",value:s,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Ze,{label:"Image Resolution",value:o,onChange:m,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Ut,{label:"Scribble",isChecked:i,onChange:C}),a.jsx(Ut,{label:"Safe",isChecked:l,onChange:b,isDisabled:p||!r})]})},Xse=d.memo(qse),Yse=e=>null,Qse=d.memo(Yse),Zse=e=>{const{controlNetId:t,isEnabled:n,processorNode:r}=e.controlNet;return r.type==="canny_image_processor"?a.jsx(Ese,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="hed_image_processor"?a.jsx(Rse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_image_processor"?a.jsx($se,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="content_shuffle_image_processor"?a.jsx(Ose,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_anime_image_processor"?a.jsx(Nse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mediapipe_face_processor"?a.jsx(zse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="midas_depth_image_processor"?a.jsx(Bse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mlsd_image_processor"?a.jsx(Wse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="normalbae_image_processor"?a.jsx(Use,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="openpose_image_processor"?a.jsx(Kse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="pidi_image_processor"?a.jsx(Xse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="zoe_depth_image_processor"?a.jsx(Qse,{controlNetId:t,processorNode:r,isEnabled:n}):null},Jse=d.memo(Zse),eae=e=>{const{controlNetId:t,isEnabled:n,shouldAutoConfig:r}=e.controlNet,o=te(),s=F(Pn),i=d.useCallback(()=>{o(xR({controlNetId:t}))},[t,o]);return a.jsx(Ut,{label:"Auto configure processor","aria-label":"Auto configure processor",isChecked:r,onChange:i,isDisabled:s||!n})},tae=d.memo(eae),nae=e=>{const{controlNet:t}=e,n=te(),r=d.useCallback(()=>{n(bR({controlNet:t}))},[t,n]),o=d.useCallback(()=>{n(yR({controlNet:t}))},[t,n]);return a.jsxs(T,{sx:{gap:2},children:[a.jsx(Te,{size:"sm",icon:a.jsx(Wi,{}),tooltip:"Import Image From Canvas","aria-label":"Import Image From Canvas",onClick:r}),a.jsx(Te,{size:"sm",icon:a.jsx(DE,{}),tooltip:"Import Mask From Canvas","aria-label":"Import Mask From Canvas",onClick:o})]})},rae=d.memo(nae),A_=e=>`${Math.round(e*100)}%`,oae=e=>{const{beginStepPct:t,endStepPct:n,isEnabled:r,controlNetId:o}=e.controlNet,s=te(),i=d.useCallback(l=>{s(CR({controlNetId:o,beginStepPct:l[0]})),s(wR({controlNetId:o,endStepPct:l[1]}))},[o,s]);return a.jsxs(un,{isDisabled:!r,children:[a.jsx(Gn,{children:"Begin / End Step Percentage"}),a.jsx(xb,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(_P,{"aria-label":["Begin Step %","End Step %"],value:[t,n],onChange:i,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!r,children:[a.jsx(jP,{children:a.jsx(PP,{})}),a.jsx(Dt,{label:A_(t),placement:"top",hasArrow:!0,children:a.jsx(T1,{index:0})}),a.jsx(Dt,{label:A_(n),placement:"top",hasArrow:!0,children:a.jsx(T1,{index:1})}),a.jsx(Ap,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(Ap,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(Ap,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})},sae=d.memo(oae),aae=[{label:"Balanced",value:"balanced"},{label:"Prompt",value:"more_prompt"},{label:"Control",value:"more_control"},{label:"Mega Control",value:"unbalanced"}];function iae(e){const{controlMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=te(),s=d.useCallback(i=>{o(SR({controlNetId:r,controlMode:i}))},[r,o]);return a.jsx(Bn,{disabled:!n,label:"Control Mode",data:aae,value:String(t),onChange:s})}const lae=ae(Py,e=>rr(go,n=>({value:n.type,label:n.label})).sort((n,r)=>n.value==="none"?-1:r.value==="none"?1:n.label.localeCompare(r.label)).filter(n=>!e.sd.disabledControlNetProcessors.includes(n.value)),Ce),cae=e=>{const t=te(),{controlNetId:n,isEnabled:r,processorNode:o}=e.controlNet,s=F(Pn),i=F(lae),l=d.useCallback(f=>{t(kR({controlNetId:n,processorType:f}))},[n,t]);return a.jsx(Gt,{label:"Processor",value:o.type??"canny_image_processor",data:i,onChange:l,disabled:s||!r})},uae=d.memo(cae),dae=[{label:"Resize",value:"just_resize"},{label:"Crop",value:"crop_resize"},{label:"Fill",value:"fill_resize"}];function fae(e){const{resizeMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=te(),s=d.useCallback(i=>{o(_R({controlNetId:r,resizeMode:i}))},[r,o]);return a.jsx(Bn,{disabled:!n,label:"Resize Mode",data:dae,value:String(t),onChange:s})}const pae=e=>{const{controlNet:t}=e,{controlNetId:n}=t,r=te(),o=F(wn),s=ae(xe,({controlNet:x})=>{const C=x.controlNets[n];if(!C)return{isEnabled:!1,shouldAutoConfig:!1};const{isEnabled:b,shouldAutoConfig:w}=C;return{isEnabled:b,shouldAutoConfig:w}},Ce),{isEnabled:i,shouldAutoConfig:l}=F(s),[f,p]=HZ(!1),h=d.useCallback(()=>{r(jR({controlNetId:n}))},[n,r]),m=d.useCallback(()=>{r(PR({sourceControlNetId:n,newControlNetId:Fa()}))},[n,r]),v=d.useCallback(()=>{r(IR({controlNetId:n}))},[n,r]);return a.jsxs(T,{sx:{flexDir:"column",gap:3,p:2,borderRadius:"base",position:"relative",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsxs(T,{sx:{gap:2,alignItems:"center"},children:[a.jsx(Ut,{tooltip:"Toggle this ControlNet","aria-label":"Toggle this ControlNet",isChecked:i,onChange:v}),a.jsx(Ie,{sx:{w:"full",minW:0,opacity:i?1:.5,pointerEvents:i?"auto":"none",transitionProperty:"common",transitionDuration:"0.1s"},children:a.jsx(Sse,{controlNet:t})}),o==="unifiedCanvas"&&a.jsx(rae,{controlNet:t}),a.jsx(Te,{size:"sm",tooltip:"Duplicate","aria-label":"Duplicate",onClick:m,icon:a.jsx(Hc,{})}),a.jsx(Te,{size:"sm",tooltip:"Delete","aria-label":"Delete",colorScheme:"error",onClick:h,icon:a.jsx(Wr,{})}),a.jsx(Te,{size:"sm",tooltip:f?"Hide Advanced":"Show Advanced","aria-label":f?"Hide Advanced":"Show Advanced",onClick:p,variant:"ghost",sx:{_hover:{bg:"none"}},icon:a.jsx(cg,{sx:{boxSize:4,color:"base.700",transform:f?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal",_dark:{color:"base.300"}}})}),!l&&a.jsx(Ie,{sx:{position:"absolute",w:1.5,h:1.5,borderRadius:"full",top:4,insetInlineEnd:4,bg:"accent.700",_dark:{bg:"accent.400"}}})]}),a.jsxs(T,{sx:{w:"full",flexDirection:"column",gap:3},children:[a.jsxs(T,{sx:{gap:4,w:"full",alignItems:"center"},children:[a.jsxs(T,{sx:{flexDir:"column",gap:3,h:28,w:"full",paddingInlineStart:1,paddingInlineEnd:f?1:0,pb:2,justifyContent:"space-between"},children:[a.jsx(_se,{controlNet:t}),a.jsx(sae,{controlNet:t})]}),!f&&a.jsx(T,{sx:{alignItems:"center",justifyContent:"center",h:28,w:28,aspectRatio:"1/1"},children:a.jsx(k_,{controlNet:t,isSmall:!0})})]}),a.jsxs(T,{sx:{gap:2},children:[a.jsx(iae,{controlNet:t}),a.jsx(fae,{controlNet:t})]}),a.jsx(uae,{controlNet:t})]}),f&&a.jsxs(a.Fragment,{children:[a.jsx(k_,{controlNet:t}),a.jsx(tae,{controlNet:t}),a.jsx(Jse,{controlNet:t})]})]})},hae=d.memo(pae),mae=ae(xe,e=>{const{isEnabled:t}=e.controlNet;return{isEnabled:t}},Ce),gae=()=>{const{isEnabled:e}=F(mae),t=te(),n=d.useCallback(()=>{t(ER())},[t]);return a.jsx(Ut,{label:"Enable ControlNet",isChecked:e,onChange:n,formControlProps:{width:"100%"}})},vae=d.memo(gae),xae=ae([xe],({controlNet:e})=>{const{controlNets:t,isEnabled:n}=e,r=MR(t),o=n&&r.length>0?`${r.length} Active`:void 0;return{controlNetsArray:rr(t),activeLabel:o}},Ce),bae=()=>{const{controlNetsArray:e,activeLabel:t}=F(xae),n=qt("controlNet").isFeatureDisabled,r=te(),{firstModel:o}=Vx(void 0,{selectFromResult:i=>({firstModel:i.data?OR.getSelectors().selectAll(i.data)[0]:void 0})}),s=d.useCallback(()=>{if(!o)return;const i=Fa();r(DR({controlNetId:i})),r(Yj({controlNetId:i,model:o}))},[r,o]);return n?null:a.jsx(hr,{label:"Control Adapters",activeLabel:t,children:a.jsxs(T,{sx:{flexDir:"column",gap:2},children:[a.jsxs(T,{sx:{w:"100%",gap:2,p:2,ps:3,borderRadius:"base",alignItems:"center",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsx(vae,{}),a.jsx(Te,{tooltip:"Add ControlNet","aria-label":"Add ControlNet",icon:a.jsx(tl,{}),isDisabled:!o,flexGrow:1,size:"sm",onClick:s})]}),e.map((i,l)=>a.jsxs(d.Fragment,{children:[l>0&&a.jsx(Fr,{}),a.jsx(hae,{controlNet:i})]},i.controlNetId))]})})},qc=d.memo(bae),yae=ae(xe,e=>{const{shouldUseNoiseSettings:t,shouldUseCpuNoise:n}=e.generation;return{isDisabled:!t,shouldUseCpuNoise:n}},Ce),Cae=()=>{const e=te(),{isDisabled:t,shouldUseCpuNoise:n}=F(yae),r=o=>e(RR(o.target.checked));return a.jsx(Ut,{isDisabled:t,label:"Use CPU Noise",isChecked:n,onChange:r})},wae=ae(xe,e=>{const{shouldUseNoiseSettings:t,threshold:n}=e.generation;return{isDisabled:!t,threshold:n}},Ce);function Sae(){const e=te(),{threshold:t,isDisabled:n}=F(wae),{t:r}=we();return a.jsx(Ze,{isDisabled:n,label:r("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:o=>e(XC(o)),handleReset:()=>e(XC(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const kae=()=>{const e=te(),t=F(r=>r.generation.shouldUseNoiseSettings),n=r=>e(AR(r.target.checked));return a.jsx(Ut,{label:"Enable Noise Settings",isChecked:t,onChange:n})},_ae=ae(xe,e=>{const{shouldUseNoiseSettings:t,perlin:n}=e.generation;return{isDisabled:!t,perlin:n}},Ce);function jae(){const e=te(),{perlin:t,isDisabled:n}=F(_ae),{t:r}=we();return a.jsx(Ze,{isDisabled:n,label:r("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:o=>e(YC(o)),handleReset:()=>e(YC(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const Pae=ae(xe,e=>{const{shouldUseNoiseSettings:t}=e.generation;return{activeLabel:t?"Enabled":void 0}},Ce),Iae=()=>{const{t:e}=we(),t=qt("noise").isFeatureEnabled,n=qt("perlinNoise").isFeatureEnabled,r=qt("noiseThreshold").isFeatureEnabled,{activeLabel:o}=F(Pae);return t?a.jsx(hr,{label:e("parameters.noiseSettings"),activeLabel:o,children:a.jsxs(T,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(kae,{}),a.jsx(Cae,{}),n&&a.jsx(jae,{}),r&&a.jsx(Sae,{})]})}):null},Gd=d.memo(Iae),Vr=e=>e.generation,Eae=ae(Vr,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},Ce),Mae=()=>{const{t:e}=we(),{seamlessXAxis:t}=F(Eae),n=te(),r=d.useCallback(o=>{n(NR(o.target.checked))},[n]);return a.jsx(Ut,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},Oae=d.memo(Mae),Dae=ae(Vr,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},Ce),Rae=()=>{const{t:e}=we(),{seamlessYAxis:t}=F(Dae),n=te(),r=d.useCallback(o=>{n(TR(o.target.checked))},[n]);return a.jsx(Ut,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},Aae=d.memo(Rae),Nae=(e,t)=>{if(e&&t)return"X & Y";if(e)return"X";if(t)return"Y"},Tae=ae(Vr,e=>{const{seamlessXAxis:t,seamlessYAxis:n}=e;return{activeLabel:Nae(t,n)}},Ce),$ae=()=>{const{t:e}=we(),{activeLabel:t}=F(Tae);return qt("seamless").isFeatureEnabled?a.jsx(hr,{label:e("parameters.seamlessTiling"),activeLabel:t,children:a.jsxs(T,{sx:{gap:5},children:[a.jsx(Ie,{flexGrow:1,children:a.jsx(Oae,{})}),a.jsx(Ie,{flexGrow:1,children:a.jsx(Aae,{})})]})}):null},Xc=d.memo($ae),Lae=e=>{const{onClick:t}=e;return a.jsx(Te,{size:"sm","aria-label":"Add Embedding",tooltip:"Add Embedding",icon:a.jsx(_E,{}),sx:{p:2,color:"base.500",_hover:{color:"base.600"},_active:{color:"base.700"},_dark:{color:"base.500",_hover:{color:"base.400"},_active:{color:"base.300"}}},variant:"link",onClick:t})},_g=d.memo(Lae),zae="28rem",Fae=e=>{const{onSelect:t,isOpen:n,onClose:r,children:o}=e,{data:s}=$R(),i=d.useRef(null),l=F(h=>h.generation.model),f=d.useMemo(()=>{if(!s)return[];const h=[];return Fn(s.entities,(m,v)=>{if(!m)return;const x=(l==null?void 0:l.base_model)!==m.base_model;h.push({value:m.model_name,label:m.model_name,group:mn[m.base_model],disabled:x,tooltip:x?`Incompatible base model: ${m.base_model}`:void 0})}),h.sort((m,v)=>{var x;return m.label&&v.label?(x=m.label)!=null&&x.localeCompare(v.label)?-1:1:-1}),h.sort((m,v)=>m.disabled&&!v.disabled?1:-1)},[s,l==null?void 0:l.base_model]),p=d.useCallback(h=>{h&&t(h)},[t]);return a.jsxs($m,{initialFocusRef:i,isOpen:n,onClose:r,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(Db,{children:o}),a.jsx(Lm,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Rb,{sx:{p:0,w:`calc(${zae} - 2rem )`},children:f.length===0?a.jsx(T,{sx:{justifyContent:"center",p:2,fontSize:"sm",color:"base.500",_dark:{color:"base.700"}},children:a.jsx(be,{children:"No Embeddings Loaded"})}):a.jsx(Gt,{inputRef:i,autoFocus:!0,placeholder:"Add Embedding",value:null,data:f,nothingFound:"No matching Embeddings",itemComponent:ri,disabled:f.length===0,onDropdownClose:r,filter:(h,m)=>{var v;return((v=m.label)==null?void 0:v.toLowerCase().includes(h.toLowerCase().trim()))||m.value.toLowerCase().includes(h.toLowerCase().trim())},onChange:p})})})]})},jg=d.memo(Fae),Bae=()=>{const e=F(m=>m.generation.negativePrompt),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Er(),s=te(),{t:i}=we(),l=d.useCallback(m=>{s(Lu(m.target.value))},[s]),f=d.useCallback(m=>{m.key==="<"&&o()},[o]),p=d.useCallback(m=>{if(!t.current)return;const v=t.current.selectionStart;if(v===void 0)return;let x=e.slice(0,v);x[x.length-1]!=="<"&&(x+="<"),x+=`${m}>`;const C=x.length;x+=e.slice(v),so.flushSync(()=>{s(Lu(x))}),t.current.selectionEnd=C,r()},[s,r,e]),h=qt("embedding").isFeatureEnabled;return a.jsxs(un,{children:[a.jsx(jg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(oa,{id:"negativePrompt",name:"negativePrompt",ref:t,value:e,placeholder:i("parameters.negativePromptPlaceholder"),onChange:l,resize:"vertical",fontSize:"sm",minH:16,...h&&{onKeyDown:f}})}),!n&&h&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(_g,{onClick:o})})]})},xO=d.memo(Bae),Hae=ae([xe,wn],({generation:e},t)=>({prompt:e.positivePrompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:kt}}),Wae=()=>{const e=te(),{prompt:t,activeTabName:n}=F(Hae),r=Ud(),o=d.useRef(null),{isOpen:s,onClose:i,onOpen:l}=Er(),{t:f}=we(),p=d.useCallback(x=>{e($u(x.target.value))},[e]);Qe("alt+a",()=>{var x;(x=o.current)==null||x.focus()},[]);const h=d.useCallback(x=>{if(!o.current)return;const C=o.current.selectionStart;if(C===void 0)return;let b=t.slice(0,C);b[b.length-1]!=="<"&&(b+="<"),b+=`${x}>`;const w=b.length;b+=t.slice(C),so.flushSync(()=>{e($u(b))}),o.current.selectionStart=w,o.current.selectionEnd=w,i()},[e,i,t]),m=qt("embedding").isFeatureEnabled,v=d.useCallback(x=>{x.key==="Enter"&&x.shiftKey===!1&&r&&(x.preventDefault(),e(bd()),e(mm(n))),m&&x.key==="<"&&l()},[r,e,n,l,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(un,{children:a.jsx(jg,{isOpen:s,onClose:i,onSelect:h,children:a.jsx(oa,{id:"prompt",name:"prompt",ref:o,value:t,placeholder:f("parameters.positivePromptPlaceholder"),onChange:p,onKeyDown:v,resize:"vertical",minH:32})})}),!s&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(_g,{onClick:l})})]})},bO=d.memo(Wae);function Vae(){const e=F(r=>r.sdxl.shouldConcatSDXLStylePrompt),t=te(),n=()=>{t(LR(!e))};return a.jsx(Te,{"aria-label":"Concatenate Prompt & Style",tooltip:"Concatenate Prompt & Style",variant:"outline",isChecked:e,onClick:n,icon:a.jsx(ME,{}),size:"xs",sx:{position:"absolute",insetInlineEnd:1,top:6,border:"none",color:e?"accent.500":"base.500",_hover:{bg:"none"}}})}const N_={position:"absolute",bg:"none",w:"full",minH:2,borderRadius:0,borderLeft:"none",borderRight:"none",zIndex:2,maskImage:"radial-gradient(circle at center, black, black 65%, black 30%, black 15%, transparent)"};function yO(){return a.jsxs(T,{children:[a.jsx(Ie,{as:gn.div,initial:{scaleX:0,borderWidth:0,display:"none"},animate:{display:["block","block","block","none"],scaleX:[0,.25,.5,1],borderWidth:[0,3,3,0],transition:{duration:.37,times:[0,.25,.5,1]}},sx:{top:"1px",borderTop:"none",borderColor:"base.400",...N_,_dark:{borderColor:"accent.500"}}}),a.jsx(Ie,{as:gn.div,initial:{opacity:0,scale:0},animate:{opacity:[0,1,1,1],scale:[0,.75,1.5,1],transition:{duration:.42,times:[0,.25,.5,1]}},exit:{opacity:0,scale:0},sx:{zIndex:3,position:"absolute",left:"48%",top:"3px",p:1,borderRadius:4,bg:"accent.400",color:"base.50",_dark:{bg:"accent.500"}},children:a.jsx(ME,{size:12})}),a.jsx(Ie,{as:gn.div,initial:{scaleX:0,borderWidth:0,display:"none"},animate:{display:["block","block","block","none"],scaleX:[0,.25,.5,1],borderWidth:[0,3,3,0],transition:{duration:.37,times:[0,.25,.5,1]}},sx:{top:"17px",borderBottom:"none",borderColor:"base.400",...N_,_dark:{borderColor:"accent.500"}}})]})}const Uae=ae([xe,wn],({sdxl:e},t)=>{const{negativeStylePrompt:n,shouldConcatSDXLStylePrompt:r}=e;return{prompt:n,shouldConcatSDXLStylePrompt:r,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:kt}}),Gae=()=>{const e=te(),t=Ud(),n=d.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Er(),{prompt:i,activeTabName:l,shouldConcatSDXLStylePrompt:f}=F(Uae),p=d.useCallback(x=>{e(Fu(x.target.value))},[e]),h=d.useCallback(x=>{if(!n.current)return;const C=n.current.selectionStart;if(C===void 0)return;let b=i.slice(0,C);b[b.length-1]!=="<"&&(b+="<"),b+=`${x}>`;const w=b.length;b+=i.slice(C),so.flushSync(()=>{e(Fu(b))}),n.current.selectionStart=w,n.current.selectionEnd=w,o()},[e,o,i]),m=qt("embedding").isFeatureEnabled,v=d.useCallback(x=>{x.key==="Enter"&&x.shiftKey===!1&&t&&(x.preventDefault(),e(bd()),e(mm(l))),m&&x.key==="<"&&s()},[t,e,l,s,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(nr,{children:f&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(yO,{})})}),a.jsx(un,{children:a.jsx(jg,{isOpen:r,onClose:o,onSelect:h,children:a.jsx(oa,{id:"prompt",name:"prompt",ref:n,value:i,placeholder:"Negative Style Prompt",onChange:p,onKeyDown:v,resize:"vertical",fontSize:"sm",minH:16})})}),!r&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(_g,{onClick:s})})]})},Kae=d.memo(Gae),qae=ae([xe,wn],({sdxl:e},t)=>{const{positiveStylePrompt:n,shouldConcatSDXLStylePrompt:r}=e;return{prompt:n,shouldConcatSDXLStylePrompt:r,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:kt}}),Xae=()=>{const e=te(),t=Ud(),n=d.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Er(),{prompt:i,activeTabName:l,shouldConcatSDXLStylePrompt:f}=F(qae),p=d.useCallback(x=>{e(zu(x.target.value))},[e]),h=d.useCallback(x=>{if(!n.current)return;const C=n.current.selectionStart;if(C===void 0)return;let b=i.slice(0,C);b[b.length-1]!=="<"&&(b+="<"),b+=`${x}>`;const w=b.length;b+=i.slice(C),so.flushSync(()=>{e(zu(b))}),n.current.selectionStart=w,n.current.selectionEnd=w,o()},[e,o,i]),m=qt("embedding").isFeatureEnabled,v=d.useCallback(x=>{x.key==="Enter"&&x.shiftKey===!1&&t&&(x.preventDefault(),e(bd()),e(mm(l))),m&&x.key==="<"&&s()},[t,e,l,s,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(nr,{children:f&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(yO,{})})}),a.jsx(un,{children:a.jsx(jg,{isOpen:r,onClose:o,onSelect:h,children:a.jsx(oa,{id:"prompt",name:"prompt",ref:n,value:i,placeholder:"Positive Style Prompt",onChange:p,onKeyDown:v,resize:"vertical",minH:16})})}),!r&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(_g,{onClick:s})})]})},Yae=d.memo(Xae);function $y(){return a.jsxs(T,{sx:{flexDirection:"column",gap:2},children:[a.jsx(bO,{}),a.jsx(Vae,{}),a.jsx(Yae,{}),a.jsx(xO,{}),a.jsx(Kae,{})]})}const rl=()=>{const{isRefinerAvailable:e}=Bo(Ux,{selectFromResult:({data:t})=>({isRefinerAvailable:t?t.ids.length>0:!1})});return e},Qae=ae([xe],({sdxl:e,ui:t,hotkeys:n})=>{const{refinerCFGScale:r}=e,{shouldUseSliders:o}=t,{shift:s}=n;return{refinerCFGScale:r,shouldUseSliders:o,shift:s}},Ce),Zae=()=>{const{refinerCFGScale:e,shouldUseSliders:t,shift:n}=F(Qae),r=rl(),o=te(),{t:s}=we(),i=d.useCallback(f=>o(s1(f)),[o]),l=d.useCallback(()=>o(s1(7)),[o]);return t?a.jsx(Ze,{label:s("parameters.cfgScale"),step:n?.1:.5,min:1,max:20,onChange:i,handleReset:l,value:e,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!r}):a.jsx(Uc,{label:s("parameters.cfgScale"),step:.5,min:1,max:200,onChange:i,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"},isDisabled:!r})},Jae=d.memo(Zae),eie=e=>{const t=Dc("models"),[n,r,o]=e.split("/"),s=zR.safeParse({base_model:n,model_name:o,model_type:r});if(!s.success){t.error({mainModelId:e,errors:s.error.format()},"Failed to parse main model id");return}return s.data},tie=ae(xe,e=>({model:e.sdxl.refinerModel}),Ce),nie=()=>{const e=te(),t=qt("syncModels").isFeatureEnabled,{model:n}=F(tie),{data:r,isLoading:o}=Bo(Ux),s=d.useMemo(()=>{if(!r)return[];const f=[];return Fn(r.entities,(p,h)=>{p&&f.push({value:h,label:p.model_name,group:mn[p.base_model]})}),f},[r]),i=d.useMemo(()=>(r==null?void 0:r.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])??null,[r==null?void 0:r.entities,n]),l=d.useCallback(f=>{if(!f)return;const p=eie(f);p&&e(zj(p))},[e]);return o?a.jsx(Gt,{label:"Refiner Model",placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs(T,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Gt,{tooltip:i==null?void 0:i.description,label:"Refiner Model",value:i==null?void 0:i.id,placeholder:s.length>0?"Select a model":"No models available",data:s,error:s.length===0,disabled:s.length===0,onChange:l,w:"100%"}),t&&a.jsx(Ie,{mt:7,children:a.jsx(Vc,{iconMode:!0})})]})},rie=d.memo(nie),oie=ae([xe],({sdxl:e,hotkeys:t})=>{const{refinerNegativeAestheticScore:n}=e,{shift:r}=t;return{refinerNegativeAestheticScore:n,shift:r}},Ce),sie=()=>{const{refinerNegativeAestheticScore:e,shift:t}=F(oie),n=rl(),r=te(),o=d.useCallback(i=>r(i1(i)),[r]),s=d.useCallback(()=>r(i1(2.5)),[r]);return a.jsx(Ze,{label:"Negative Aesthetic Score",step:t?.1:.5,min:1,max:10,onChange:o,handleReset:s,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},aie=d.memo(sie),iie=ae([xe],({sdxl:e,hotkeys:t})=>{const{refinerPositiveAestheticScore:n}=e,{shift:r}=t;return{refinerPositiveAestheticScore:n,shift:r}},Ce),lie=()=>{const{refinerPositiveAestheticScore:e,shift:t}=F(iie),n=rl(),r=te(),o=d.useCallback(i=>r(a1(i)),[r]),s=d.useCallback(()=>r(a1(6)),[r]);return a.jsx(Ze,{label:"Positive Aesthetic Score",step:t?.1:.5,min:1,max:10,onChange:o,handleReset:s,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},cie=d.memo(lie),uie=ae(xe,({ui:e,sdxl:t})=>{const{refinerScheduler:n}=t,{favoriteSchedulers:r}=e,o=rr(dm,(s,i)=>({value:i,label:s,group:r.includes(i)?"Favorites":void 0})).sort((s,i)=>s.label.localeCompare(i.label));return{refinerScheduler:n,data:o}},Ce),die=()=>{const e=te(),{t}=we(),{refinerScheduler:n,data:r}=F(uie),o=rl(),s=d.useCallback(i=>{i&&e(Fj(i))},[e]);return a.jsx(Gt,{w:"100%",label:t("parameters.scheduler"),value:n,data:r,onChange:s,disabled:!o})},fie=d.memo(die),pie=ae([xe],({sdxl:e})=>{const{refinerStart:t}=e;return{refinerStart:t}},Ce),hie=()=>{const{refinerStart:e}=F(pie),t=te(),n=rl(),r=d.useCallback(s=>t(l1(s)),[t]),o=d.useCallback(()=>t(l1(.8)),[t]);return a.jsx(Ze,{label:"Refiner Start",step:.01,min:0,max:1,onChange:r,handleReset:o,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},mie=d.memo(hie),gie=ae([xe],({sdxl:e,ui:t})=>{const{refinerSteps:n}=e,{shouldUseSliders:r}=t;return{refinerSteps:n,shouldUseSliders:r}},Ce),vie=()=>{const{refinerSteps:e,shouldUseSliders:t}=F(gie),n=rl(),r=te(),{t:o}=we(),s=d.useCallback(l=>{r(o1(l))},[r]),i=d.useCallback(()=>{r(o1(20))},[r]);return t?a.jsx(Ze,{label:o("parameters.steps"),min:1,max:100,step:1,onChange:s,handleReset:i,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:500},isDisabled:!n}):a.jsx(Uc,{label:o("parameters.steps"),min:1,max:500,step:1,onChange:s,value:e,numberInputFieldProps:{textAlign:"center"},isDisabled:!n})},xie=d.memo(vie);function bie(){const e=F(o=>o.sdxl.shouldUseSDXLRefiner),t=rl(),n=te(),r=o=>{n(FR(o.target.checked))};return a.jsx(Ut,{label:"Use Refiner",isChecked:e,onChange:r,isDisabled:!t})}const yie=ae(xe,e=>{const{shouldUseSDXLRefiner:t}=e.sdxl,{shouldUseSliders:n}=e.ui;return{activeLabel:t?"Enabled":void 0,shouldUseSliders:n}},Ce),Cie=()=>{const{activeLabel:e,shouldUseSliders:t}=F(yie);return a.jsx(hr,{label:"Refiner",activeLabel:e,children:a.jsxs(T,{sx:{gap:2,flexDir:"column"},children:[a.jsx(bie,{}),a.jsx(rie,{}),a.jsxs(T,{gap:2,flexDirection:t?"column":"row",children:[a.jsx(xie,{}),a.jsx(Jae,{})]}),a.jsx(fie,{}),a.jsx(cie,{}),a.jsx(aie,{}),a.jsx(mie,{})]})})},Ly=d.memo(Cie),wie=ae([xe],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:l}=t.sd.guidance,{cfgScale:f}=e,{shouldUseSliders:p}=n,{shift:h}=r;return{cfgScale:f,initial:o,min:s,sliderMax:i,inputMax:l,shouldUseSliders:p,shift:h}},Ce),Sie=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:i}=F(wie),l=te(),{t:f}=we(),p=d.useCallback(m=>l(Wp(m)),[l]),h=d.useCallback(()=>l(Wp(t)),[l,t]);return s?a.jsx(Ze,{label:f("parameters.cfgScale"),step:i?.1:.5,min:n,max:r,onChange:p,handleReset:h,value:e,sliderNumberInputProps:{max:o},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1}):a.jsx(Uc,{label:f("parameters.cfgScale"),step:.5,min:n,max:o,onChange:p,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})},bs=d.memo(Sie),kie=ae([xe],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:i}=e.config.sd.iterations,{iterations:l}=e.generation,{shouldUseSliders:f}=e.ui,p=e.dynamicPrompts.isEnabled&&e.dynamicPrompts.combinatorial,h=e.hotkeys.shift?s:i;return{iterations:l,initial:t,min:n,sliderMax:r,inputMax:o,step:h,shouldUseSliders:f,isDisabled:p}},Ce),_ie=()=>{const{iterations:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i,isDisabled:l}=F(kie),f=te(),{t:p}=we(),h=d.useCallback(v=>{f(QC(v))},[f]),m=d.useCallback(()=>{f(QC(t))},[f,t]);return i?a.jsx(Ze,{isDisabled:l,label:p("parameters.images"),step:s,min:n,max:r,onChange:h,handleReset:m,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):a.jsx(Uc,{isDisabled:l,label:p("parameters.images"),step:s,min:n,max:o,onChange:h,value:e,numberInputFieldProps:{textAlign:"center"}})},ys=d.memo(_ie),jie=ae(xe,e=>({model:e.generation.model}),Ce),Pie=()=>{const e=te(),{t}=we(),{model:n}=F(jie),r=qt("syncModels").isFeatureEnabled,{data:o,isLoading:s}=Bo(ZC),{data:i,isLoading:l}=Xu(ZC),f=F(wn),p=d.useMemo(()=>{if(!o)return[];const v=[];return Fn(o.entities,(x,C)=>{x&&v.push({value:C,label:x.model_name,group:mn[x.base_model]})}),Fn(i==null?void 0:i.entities,(x,C)=>{!x||f==="unifiedCanvas"||f==="img2img"||v.push({value:C,label:x.model_name,group:mn[x.base_model]})}),v},[o,i,f]),h=d.useMemo(()=>((o==null?void 0:o.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])||(i==null?void 0:i.entities[`${n==null?void 0:n.base_model}/onnx/${n==null?void 0:n.model_name}`]))??null,[o==null?void 0:o.entities,n,i==null?void 0:i.entities]),m=d.useCallback(v=>{if(!v)return;const x=kg(v);x&&e(n1(x))},[e]);return s||l?a.jsx(Gt,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs(T,{w:"100%",alignItems:"center",gap:3,children:[a.jsx(Gt,{tooltip:h==null?void 0:h.description,label:t("modelManager.model"),value:h==null?void 0:h.id,placeholder:p.length>0?"Select a model":"No models available",data:p,error:p.length===0,disabled:p.length===0,onChange:m,w:"100%"}),r&&a.jsx(Ie,{mt:7,children:a.jsx(Vc,{iconMode:!0})})]})},Iie=d.memo(Pie),Eie=ae(xe,({generation:e})=>{const{model:t,vae:n}=e;return{model:t,vae:n}},Ce),Mie=()=>{const e=te(),{t}=we(),{model:n,vae:r}=F(Eie),{data:o}=Kj(),s=d.useMemo(()=>{if(!o)return[];const f=[{value:"default",label:"Default",group:"Default"}];return Fn(o.entities,(p,h)=>{if(!p)return;const m=(n==null?void 0:n.base_model)!==p.base_model;f.push({value:h,label:p.model_name,group:mn[p.base_model],disabled:m,tooltip:m?`Incompatible base model: ${p.base_model}`:void 0})}),f.sort((p,h)=>p.disabled&&!h.disabled?1:-1)},[o,n==null?void 0:n.base_model]),i=d.useMemo(()=>(o==null?void 0:o.entities[`${r==null?void 0:r.base_model}/vae/${r==null?void 0:r.model_name}`])??null,[o==null?void 0:o.entities,r]),l=d.useCallback(f=>{if(!f||f==="default"){e(JC(null));return}const p=gO(f);p&&e(JC(p))},[e]);return a.jsx(Gt,{itemComponent:ri,tooltip:i==null?void 0:i.description,label:t("modelManager.vae"),value:(i==null?void 0:i.id)??"default",placeholder:"Default",data:s,onChange:l,disabled:s.length===0,clearable:!0})},Oie=d.memo(Mie),Die=ae([Gx,Vr],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=rr(dm,(s,i)=>({value:i,label:s,group:r.includes(i)?"Favorites":void 0})).sort((s,i)=>s.label.localeCompare(i.label));return{scheduler:n,data:o}},Ce),Rie=()=>{const e=te(),{t}=we(),{scheduler:n,data:r}=F(Die),o=d.useCallback(s=>{s&&e(r1(s))},[e]);return a.jsx(Gt,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})},Aie=d.memo(Rie),Nie=ae(xe,({generation:e})=>{const{vaePrecision:t}=e;return{vaePrecision:t}},Ce),Tie=["fp16","fp32"],$ie=()=>{const e=te(),{vaePrecision:t}=F(Nie),n=d.useCallback(r=>{r&&e(BR(r))},[e]);return a.jsx(Bn,{label:"VAE Precision",value:t,data:Tie,onChange:n})},Lie=d.memo($ie),zie=()=>{const e=qt("vae").isFeatureEnabled;return a.jsxs(T,{gap:3,w:"full",flexWrap:e?"wrap":"nowrap",children:[a.jsx(Ie,{w:"full",children:a.jsx(Iie,{})}),a.jsx(Ie,{w:"full",children:a.jsx(Aie,{})}),e&&a.jsxs(T,{w:"full",gap:3,children:[a.jsx(Oie,{}),a.jsx(Lie,{})]})]})},Cs=d.memo(zie),CO=[{name:"Free",value:null},{name:"2:3",value:2/3},{name:"16:9",value:16/9},{name:"1:1",value:1/1}],wO=CO.map(e=>e.value);function SO(){const e=F(o=>o.generation.aspectRatio),t=te(),n=F(o=>o.generation.shouldFitToWidthHeight),r=F(wn);return a.jsx(T,{gap:2,flexGrow:1,children:a.jsx(pn,{isAttached:!0,children:CO.map(o=>a.jsx(it,{size:"sm",isChecked:e===o.value,isDisabled:r==="img2img"?!n:!1,onClick:()=>{t(Mo(o.value)),t(Yu(!1))},children:o.name},o.name))})})}const Fie=ae([xe],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:l}=n.sd.height,{model:f,height:p}=e,{aspectRatio:h}=e,m=t.shift?i:l;return{model:f,height:p,min:r,sliderMax:o,inputMax:s,step:m,aspectRatio:h}},Ce),Bie=e=>{const{model:t,height:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:l}=F(Fie),f=te(),{t:p}=we(),h=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,m=d.useCallback(x=>{if(f(Ni(x)),l){const C=fr(x*l,8);f(Ai(C))}},[f,l]),v=d.useCallback(()=>{if(f(Ni(h)),l){const x=fr(h*l,8);f(Ai(x))}},[f,h,l]);return a.jsx(Ze,{label:p("parameters.height"),value:n,min:r,step:i,max:o,onChange:m,handleReset:v,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},Hie=d.memo(Bie),Wie=ae([xe],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:l}=n.sd.width,{model:f,width:p,aspectRatio:h}=e,m=t.shift?i:l;return{model:f,width:p,min:r,sliderMax:o,inputMax:s,step:m,aspectRatio:h}},Ce),Vie=e=>{const{model:t,width:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:l}=F(Wie),f=te(),{t:p}=we(),h=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,m=d.useCallback(x=>{if(f(Ai(x)),l){const C=fr(x/l,8);f(Ni(C))}},[f,l]),v=d.useCallback(()=>{if(f(Ai(h)),l){const x=fr(h/l,8);f(Ni(x))}},[f,h,l]);return a.jsx(Ze,{label:p("parameters.width"),value:n,min:r,step:i,max:o,onChange:m,handleReset:v,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},Uie=d.memo(Vie),Gie=ae([Vr,wn],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}=e;return{activeTabName:t,shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}});function Ec(){const{t:e}=we(),t=te(),{activeTabName:n,shouldFitToWidthHeight:r,shouldLockAspectRatio:o,width:s,height:i}=F(Gie),l=d.useCallback(()=>{o?(t(Yu(!1)),wO.includes(s/i)?t(Mo(s/i)):t(Mo(null))):(t(Yu(!0)),t(Mo(s/i)))},[o,s,i,t]),f=d.useCallback(()=>{t(HR()),t(Mo(null)),o&&t(Mo(i/s))},[t,o,s,i]);return a.jsxs(T,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsxs(T,{alignItems:"center",gap:2,children:[a.jsx(be,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:e("parameters.aspectRatio")}),a.jsx(Za,{}),a.jsx(SO,{}),a.jsx(Te,{tooltip:e("ui.swapSizes"),"aria-label":e("ui.swapSizes"),size:"sm",icon:a.jsx($M,{}),fontSize:20,isDisabled:n==="img2img"?!r:!1,onClick:f}),a.jsx(Te,{tooltip:e("ui.lockRatio"),"aria-label":e("ui.lockRatio"),size:"sm",icon:a.jsx(OE,{}),isChecked:o,isDisabled:n==="img2img"?!r:!1,onClick:l})]}),a.jsx(T,{gap:2,alignItems:"center",children:a.jsxs(T,{gap:2,flexDirection:"column",width:"full",children:[a.jsx(Uie,{isDisabled:n==="img2img"?!r:!1}),a.jsx(Hie,{isDisabled:n==="img2img"?!r:!1})]})})]})}const Kie=ae([xe],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:l,fineStep:f,coarseStep:p}=t.sd.steps,{steps:h}=e,{shouldUseSliders:m}=n,v=r.shift?f:p;return{steps:h,initial:o,min:s,sliderMax:i,inputMax:l,step:v,shouldUseSliders:m}},Ce),qie=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i}=F(Kie),l=te(),{t:f}=we(),p=d.useCallback(v=>{l(Vp(v))},[l]),h=d.useCallback(()=>{l(Vp(t))},[l,t]),m=d.useCallback(()=>{l(bd())},[l]);return i?a.jsx(Ze,{label:f("parameters.steps"),min:n,max:r,step:s,onChange:p,handleReset:h,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):a.jsx(Uc,{label:f("parameters.steps"),min:n,max:o,step:s,onChange:p,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:m})},ws=d.memo(qie);function kO(){const e=te(),t=F(o=>o.generation.shouldFitToWidthHeight),n=o=>e(WR(o.target.checked)),{t:r}=we();return a.jsx(Ut,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function Xie(){const e=F(i=>i.generation.seed),t=F(i=>i.generation.shouldRandomizeSeed),n=F(i=>i.generation.shouldGenerateVariations),{t:r}=we(),o=te(),s=i=>o(Hp(i));return a.jsx(Uc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:Qj,max:Zj,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e})}const Yie=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function Qie(){const e=te(),t=F(o=>o.generation.shouldRandomizeSeed),{t:n}=we(),r=()=>e(Hp(Yie(Qj,Zj)));return a.jsx(Te,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:a.jsx(EZ,{})})}const Zie=()=>{const e=te(),{t}=we(),n=F(o=>o.generation.shouldRandomizeSeed),r=o=>e(VR(o.target.checked));return a.jsx(Ut,{label:t("common.random"),isChecked:n,onChange:r})},Jie=d.memo(Zie),ele=()=>a.jsxs(T,{sx:{gap:3,alignItems:"flex-end"},children:[a.jsx(Xie,{}),a.jsx(Qie,{}),a.jsx(Jie,{})]}),Ss=d.memo(ele),_O=e=>a.jsxs(T,{sx:{flexDir:"column",gap:2,bg:"base.100",px:4,pt:2,pb:4,borderRadius:"base",_dark:{bg:"base.750"}},children:[e.label&&a.jsx(be,{fontSize:"sm",fontWeight:"bold",sx:{color:"base.600",_dark:{color:"base.300"}},children:e.label}),e.children]});_O.displayName="SubSettingsWrapper";const Mc=d.memo(_O),tle=ae([xe],({sdxl:e})=>{const{sdxlImg2ImgDenoisingStrength:t}=e;return{sdxlImg2ImgDenoisingStrength:t}},Ce),nle=()=>{const{sdxlImg2ImgDenoisingStrength:e}=F(tle),t=te(),{t:n}=we(),r=d.useCallback(s=>t(ew(s)),[t]),o=d.useCallback(()=>{t(ew(.7))},[t]);return a.jsx(Mc,{children:a.jsx(Ze,{label:`${n("parameters.denoisingStrength")}`,step:.01,min:0,max:1,onChange:r,handleReset:o,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0})})},jO=d.memo(nle),rle=ae([Gx,Vr],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),ole=()=>{const{shouldUseSliders:e,activeLabel:t}=F(rle);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(T,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Ec,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(T,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Ec,{})]}),a.jsx(jO,{}),a.jsx(kO,{})]})})},sle=d.memo(ole),ale=()=>a.jsxs(a.Fragment,{children:[a.jsx($y,{}),a.jsx(sle,{}),a.jsx(Ly,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(Xc,{})]}),ile=d.memo(ale),lle=ae(xe,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),cle=()=>{const{shouldUseSliders:e,activeLabel:t}=F(lle);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsx(T,{sx:{flexDirection:"column",gap:3},children:e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Ec,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(T,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Ec,{})]})})})},PO=d.memo(cle),ule=()=>a.jsxs(a.Fragment,{children:[a.jsx($y,{}),a.jsx(PO,{}),a.jsx(Ly,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(Xc,{})]}),dle=d.memo(ule),fle=[{label:"Unmasked",value:"unmasked"},{label:"Mask",value:"mask"},{label:"Mask Edge",value:"edge"}],ple=()=>{const e=te(),t=F(o=>o.generation.canvasCoherenceMode),{t:n}=we(),r=o=>{o&&e(UR(o))};return a.jsx(Bn,{label:n("parameters.coherenceMode"),data:fle,value:t,onChange:r})},hle=d.memo(ple),mle=()=>{const e=te(),t=F(r=>r.generation.canvasCoherenceSteps),{t:n}=we();return a.jsx(Ze,{label:n("parameters.coherenceSteps"),min:1,max:100,step:1,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(tw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(tw(20))}})},gle=d.memo(mle),vle=()=>{const e=te(),t=F(r=>r.generation.canvasCoherenceStrength),{t:n}=we();return a.jsx(Ze,{label:n("parameters.coherenceStrength"),min:0,max:1,step:.01,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(nw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(nw(.3))}})},xle=d.memo(vle);function ble(){const e=te(),t=F(r=>r.generation.maskBlur),{t:n}=we();return a.jsx(Ze,{label:n("parameters.maskBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(rw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(rw(16))}})}const yle=[{label:"Box Blur",value:"box"},{label:"Gaussian Blur",value:"gaussian"}];function Cle(){const e=F(o=>o.generation.maskBlurMethod),t=te(),{t:n}=we(),r=o=>{o&&t(GR(o))};return a.jsx(Bn,{value:e,onChange:r,label:n("parameters.maskBlurMethod"),data:yle})}const wle=()=>{const{t:e}=we();return a.jsx(hr,{label:e("parameters.compositingSettingsHeader"),children:a.jsxs(T,{sx:{flexDirection:"column",gap:2},children:[a.jsxs(Mc,{label:e("parameters.coherencePassHeader"),children:[a.jsx(hle,{}),a.jsx(gle,{}),a.jsx(xle,{})]}),a.jsx(Fr,{}),a.jsxs(Mc,{label:e("parameters.maskAdjustmentsHeader"),children:[a.jsx(ble,{}),a.jsx(Cle,{})]})]})})},IO=d.memo(wle),Sle=ae([xe],({generation:e})=>{const{infillMethod:t}=e;return{infillMethod:t}},Ce),kle=()=>{const e=te(),{infillMethod:t}=F(Sle),{data:n,isLoading:r}=Aj(),o=n==null?void 0:n.infill_methods,{t:s}=we(),i=d.useCallback(l=>{e(KR(l))},[e]);return a.jsx(Bn,{disabled:(o==null?void 0:o.length)===0,placeholder:r?"Loading...":void 0,label:s("parameters.infillMethod"),value:t,data:o??[],onChange:i})},_le=d.memo(kle),jle=ae([Vr],e=>{const{infillPatchmatchDownscaleSize:t,infillMethod:n}=e;return{infillPatchmatchDownscaleSize:t,infillMethod:n}},Ce),Ple=()=>{const e=te(),{infillPatchmatchDownscaleSize:t,infillMethod:n}=F(jle),{t:r}=we(),o=d.useCallback(i=>{e(ow(i))},[e]),s=d.useCallback(()=>{e(ow(2))},[e]);return a.jsx(Ze,{isDisabled:n!=="patchmatch",label:r("parameters.patchmatchDownScaleSize"),min:1,max:10,value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},Ile=d.memo(Ple),Ele=ae([Vr],e=>{const{infillTileSize:t,infillMethod:n}=e;return{infillTileSize:t,infillMethod:n}},Ce),Mle=()=>{const e=te(),{infillTileSize:t,infillMethod:n}=F(Ele),{t:r}=we(),o=d.useCallback(i=>{e(sw(i))},[e]),s=d.useCallback(()=>{e(sw(32))},[e]);return a.jsx(Ze,{isDisabled:n!=="tile",label:r("parameters.tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},Ole=d.memo(Mle),Dle=ae([Vr],e=>{const{infillMethod:t}=e;return{infillMethod:t}},Ce);function Rle(){const{infillMethod:e}=F(Dle);return a.jsxs(T,{children:[e==="tile"&&a.jsx(Ole,{}),e==="patchmatch"&&a.jsx(Ile,{})]})}const $t=e=>e.canvas,bo=ae([$t,wn,vo],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Ale=ae([$t],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},Ce),Nle=()=>{const e=te(),{boundingBoxScale:t}=F(Ale),{t:n}=we(),r=o=>{e(XR(o))};return a.jsx(Gt,{label:n("parameters.scaleBeforeProcessing"),data:qR,value:t,onChange:r})},Tle=d.memo(Nle),$le=ae([Vr,$t],(e,t)=>{const{scaledBoundingBoxDimensions:n,boundingBoxScaleMethod:r}=t,{model:o,aspectRatio:s}=e;return{model:o,scaledBoundingBoxDimensions:n,isManual:r==="manual",aspectRatio:s}},Ce),Lle=()=>{const e=te(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=F($le),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=we(),l=p=>{let h=r.width;const m=Math.floor(p);o&&(h=fr(m*o,64)),e(Gp({width:h,height:m}))},f=()=>{let p=r.width;const h=Math.floor(s);o&&(p=fr(h*o,64)),e(Gp({width:p,height:h}))};return a.jsx(Ze,{isDisabled:!n,label:i("parameters.scaledHeight"),min:64,max:1536,step:64,value:r.height,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:f})},zle=d.memo(Lle),Fle=ae([$t,Vr],(e,t)=>{const{boundingBoxScaleMethod:n,scaledBoundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,scaledBoundingBoxDimensions:r,aspectRatio:s,isManual:n==="manual"}},Ce),Ble=()=>{const e=te(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=F(Fle),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=we(),l=p=>{const h=Math.floor(p);let m=r.height;o&&(m=fr(h/o,64)),e(Gp({width:h,height:m}))},f=()=>{const p=Math.floor(s);let h=r.height;o&&(h=fr(p/o,64)),e(Gp({width:p,height:h}))};return a.jsx(Ze,{isDisabled:!n,label:i("parameters.scaledWidth"),min:64,max:1536,step:64,value:r.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:f})},Hle=d.memo(Ble),Wle=()=>{const{t:e}=we();return a.jsx(hr,{label:e("parameters.infillScalingHeader"),children:a.jsxs(T,{sx:{gap:2,flexDirection:"column"},children:[a.jsxs(Mc,{children:[a.jsx(_le,{}),a.jsx(Rle,{})]}),a.jsx(Fr,{}),a.jsxs(Mc,{children:[a.jsx(Tle,{}),a.jsx(Hle,{}),a.jsx(zle,{})]})]})})},EO=d.memo(Wle),Vle=ae([xe,bo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Ce),Ule=()=>{const e=te(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=F(Vle),{t:s}=we(),i=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,l=p=>{if(e(Ao({...n,height:Math.floor(p)})),o){const h=fr(p*o,64);e(Ao({width:h,height:Math.floor(p)}))}},f=()=>{if(e(Ao({...n,height:Math.floor(i)})),o){const p=fr(i*o,64);e(Ao({width:p,height:Math.floor(i)}))}};return a.jsx(Ze,{label:s("parameters.boundingBoxHeight"),min:64,max:1536,step:64,value:n.height,onChange:l,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:f})},Gle=d.memo(Ule),Kle=ae([xe,bo],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Ce),qle=()=>{const e=te(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=F(Kle),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=we(),l=p=>{if(e(Ao({...n,width:Math.floor(p)})),o){const h=fr(p/o,64);e(Ao({width:Math.floor(p),height:h}))}},f=()=>{if(e(Ao({...n,width:Math.floor(s)})),o){const p=fr(s/o,64);e(Ao({width:Math.floor(s),height:p}))}};return a.jsx(Ze,{label:i("parameters.boundingBoxWidth"),min:64,max:1536,step:64,value:n.width,onChange:l,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:f})},Xle=d.memo(qle),Yle=ae([Vr,$t],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r}=e,{boundingBoxDimensions:o}=t;return{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,boundingBoxDimensions:o}});function am(){const e=te(),{t}=we(),{shouldLockAspectRatio:n,boundingBoxDimensions:r}=F(Yle),o=d.useCallback(()=>{n?(e(Yu(!1)),wO.includes(r.width/r.height)?e(Mo(r.width/r.height)):e(Mo(null))):(e(Yu(!0)),e(Mo(r.width/r.height)))},[n,r,e]),s=d.useCallback(()=>{e(YR()),e(Mo(null)),n&&e(Mo(r.height/r.width))},[e,n,r]);return a.jsxs(T,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.100",_dark:{bg:"base.750"}},children:[a.jsxs(T,{alignItems:"center",gap:2,children:[a.jsx(be,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:t("parameters.aspectRatio")}),a.jsx(Za,{}),a.jsx(SO,{}),a.jsx(Te,{tooltip:t("ui.swapSizes"),"aria-label":t("ui.swapSizes"),size:"sm",icon:a.jsx($M,{}),fontSize:20,onClick:s}),a.jsx(Te,{tooltip:t("ui.lockRatio"),"aria-label":t("ui.lockRatio"),size:"sm",icon:a.jsx(OE,{}),isChecked:n,onClick:o})]}),a.jsx(Xle,{}),a.jsx(Gle,{})]})}const Qle=ae(xe,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),Zle=()=>{const{shouldUseSliders:e,activeLabel:t}=F(Qle);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(T,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(T,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}),a.jsx(jO,{})]})})},Jle=d.memo(Zle);function ece(){return a.jsxs(a.Fragment,{children:[a.jsx($y,{}),a.jsx(Jle,{}),a.jsx(Ly,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(EO,{}),a.jsx(IO,{}),a.jsx(Xc,{})]})}function tce(){const e=F(f=>f.generation.clipSkip),{model:t}=F(f=>f.generation),n=te(),{t:r}=we(),o=d.useCallback(f=>{n(aw(f))},[n]),s=d.useCallback(()=>{n(aw(0))},[n]),i=d.useMemo(()=>t?Vf[t.base_model].maxClip:Vf["sd-1"].maxClip,[t]),l=d.useMemo(()=>t?Vf[t.base_model].markers:Vf["sd-1"].markers,[t]);return a.jsx(Ze,{label:r("parameters.clipSkip"),"aria-label":r("parameters.clipSkip"),min:0,max:i,step:1,value:e,onChange:o,withSliderMarks:!0,sliderMarks:l,withInput:!0,withReset:!0,handleReset:s})}const nce=ae(xe,e=>({activeLabel:e.generation.clipSkip>0?"Clip Skip":void 0}),Ce);function zy(){const{activeLabel:e}=F(nce);return F(n=>n.generation.shouldShowAdvancedOptions)?a.jsx(hr,{label:"Advanced",activeLabel:e,children:a.jsx(T,{sx:{flexDir:"column",gap:2},children:a.jsx(tce,{})})}):null}function Fy(){return a.jsxs(T,{sx:{flexDirection:"column",gap:2},children:[a.jsx(bO,{}),a.jsx(xO,{})]})}function rce(){const e=F(o=>o.generation.horizontalSymmetrySteps),t=F(o=>o.generation.steps),n=te(),{t:r}=we();return a.jsx(Ze,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(iw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(iw(0))})}function oce(){const e=F(o=>o.generation.verticalSymmetrySteps),t=F(o=>o.generation.steps),n=te(),{t:r}=we();return a.jsx(Ze,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(lw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(lw(0))})}function sce(){const e=F(n=>n.generation.shouldUseSymmetry),t=te();return a.jsx(Ut,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(QR(n.target.checked))})}const ace=ae(xe,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),Ce),ice=()=>{const{t:e}=we(),{activeLabel:t}=F(ace);return qt("symmetry").isFeatureEnabled?a.jsx(hr,{label:e("parameters.symmetry"),activeLabel:t,children:a.jsxs(T,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(sce,{}),a.jsx(rce,{}),a.jsx(oce,{})]})}):null},By=d.memo(ice),lce=ae([xe],({generation:e,hotkeys:t,config:n})=>{const{initial:r,min:o,sliderMax:s,inputMax:i,fineStep:l,coarseStep:f}=n.sd.img2imgStrength,{img2imgStrength:p}=e,h=t.shift?l:f;return{img2imgStrength:p,initial:r,min:o,sliderMax:s,inputMax:i,step:h}},Ce),cce=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=F(lce),i=te(),{t:l}=we(),f=d.useCallback(h=>i(Up(h)),[i]),p=d.useCallback(()=>{i(Up(t))},[i,t]);return a.jsx(Mc,{children:a.jsx(Ze,{label:`${l("parameters.denoisingStrength")}`,step:s,min:n,max:r,onChange:f,handleReset:p,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,sliderNumberInputProps:{max:o}})})},MO=d.memo(cce),uce=ae([Gx,Vr],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),dce=()=>{const{shouldUseSliders:e,activeLabel:t}=F(uce);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(T,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Ec,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(T,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Ec,{})]}),a.jsx(MO,{}),a.jsx(kO,{})]})})},fce=d.memo(dce),pce=()=>a.jsxs(a.Fragment,{children:[a.jsx(Fy,{}),a.jsx(fce,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(By,{}),a.jsx(Xc,{}),a.jsx(zy,{})]}),hce=d.memo(pce),mce=()=>a.jsxs(a.Fragment,{children:[a.jsx(Fy,{}),a.jsx(PO,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(By,{}),a.jsx(Xc,{}),a.jsx(zy,{})]}),gce=d.memo(mce),vce=ae(xe,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),xce=()=>{const{shouldUseSliders:e,activeLabel:t}=F(vce);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(T,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(T,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(bs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}),a.jsx(MO,{})]})})},bce=d.memo(xce),yce=()=>a.jsxs(a.Fragment,{children:[a.jsx(Fy,{}),a.jsx(bce,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(By,{}),a.jsx(EO,{}),a.jsx(IO,{}),a.jsx(Xc,{}),a.jsx(zy,{})]}),Cce=d.memo(yce),wce=()=>{const e=F(wn),t=F(n=>n.generation.model);return e==="txt2img"?a.jsx(zp,{children:t&&t.base_model==="sdxl"?a.jsx(dle,{}):a.jsx(gce,{})}):e==="img2img"?a.jsx(zp,{children:t&&t.base_model==="sdxl"?a.jsx(ile,{}):a.jsx(hce,{})}):e==="unifiedCanvas"?a.jsx(zp,{children:t&&t.base_model==="sdxl"?a.jsx(ece,{}):a.jsx(Cce,{})}):null},Sce=d.memo(wce),zp=d.memo(e=>a.jsxs(T,{sx:{w:"full",h:"full",flexDir:"column",gap:2},children:[a.jsx(HM,{}),a.jsx(T,{layerStyle:"first",sx:{w:"full",h:"full",position:"relative",borderRadius:"base",p:2},children:a.jsx(T,{sx:{w:"full",h:"full",position:"relative"},children:a.jsx(Ie,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx(lg,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:800,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:a.jsx(T,{sx:{gap:2,flexDirection:"column",h:"full",w:"full"},children:e.children})})})})})]}));zp.displayName="ParametersPanelWrapper";const kce=ae([xe],e=>{const{initialImage:t}=e.generation;return{initialImage:t,isResetButtonDisabled:!t}},Ce),_ce=()=>{const{initialImage:e}=F(kce),{currentData:t}=po((e==null?void 0:e.imageName)??zr.skipToken),n=d.useMemo(()=>{if(t)return{id:"initial-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t]),r=d.useMemo(()=>({id:"initial-image",actionType:"SET_INITIAL_IMAGE"}),[]);return a.jsx(Ya,{imageDTO:t,droppableData:r,draggableData:n,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Initial Image",noContentFallback:a.jsx(tr,{label:"No initial image selected"})})},jce=d.memo(_ce),Pce=ae([xe],e=>{const{initialImage:t}=e.generation;return{isResetButtonDisabled:!t}},Ce),Ice={type:"SET_INITIAL_IMAGE"},Ece=()=>{const{isResetButtonDisabled:e}=F(Pce),t=te(),{getUploadButtonProps:n,getUploadInputProps:r}=ky({postUploadAction:Ice}),o=d.useCallback(()=>{t(ZR())},[t]);return a.jsxs(T,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",p:2,gap:4},children:[a.jsxs(T,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(be,{sx:{ps:2,fontWeight:600,userSelect:"none",color:"base.700",_dark:{color:"base.200"}},children:"Initial Image"}),a.jsx(Za,{}),a.jsx(Te,{tooltip:"Upload Initial Image","aria-label":"Upload Initial Image",icon:a.jsx(ng,{}),...n()}),a.jsx(Te,{tooltip:"Reset Initial Image","aria-label":"Reset Initial Image",icon:a.jsx(tg,{}),onClick:o,isDisabled:e})]}),a.jsx(jce,{}),a.jsx("input",{...r()})]})},Mce=d.memo(Ece),Oce=ae([xe],({system:e})=>{const{isProcessing:t,isConnected:n}=e;return n&&!t}),Dce=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=we(),o=F(Oce);return a.jsx(Te,{onClick:t,icon:a.jsx(Wr,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})},Rce=[{label:"RealESRGAN x2 Plus",value:"RealESRGAN_x2plus.pth",tooltip:"Attempts to retain sharpness, low smoothing",group:"x2 Upscalers"},{label:"RealESRGAN x4 Plus",value:"RealESRGAN_x4plus.pth",tooltip:"Best for photos and highly detailed images, medium smoothing",group:"x4 Upscalers"},{label:"RealESRGAN x4 Plus (anime 6B)",value:"RealESRGAN_x4plus_anime_6B.pth",tooltip:"Best for anime/manga, high smoothing",group:"x4 Upscalers"},{label:"ESRGAN SRx4",value:"ESRGAN_SRx4_DF2KOST_official-ff704c30.pth",tooltip:"Retains sharpness, low smoothing",group:"x4 Upscalers"}];function Ace(){const e=F(r=>r.postprocessing.esrganModelName),t=te(),n=r=>t(JR(r));return a.jsx(Bn,{label:"ESRGAN Model",value:e,itemComponent:ri,onChange:n,data:Rce})}const Nce=e=>{const{imageDTO:t}=e,n=te(),r=F(Pn),{t:o}=we(),{isOpen:s,onOpen:i,onClose:l}=Er(),f=d.useCallback(()=>{l(),t&&n(Jj({image_name:t.image_name}))},[n,t,l]);return a.jsx(Vd,{isOpen:s,onClose:l,triggerComponent:a.jsx(Te,{onClick:i,icon:a.jsx(mZ,{}),"aria-label":o("parameters.upscale")}),children:a.jsxs(T,{sx:{flexDirection:"column",gap:4},children:[a.jsx(Ace,{}),a.jsx(it,{size:"sm",isDisabled:!t||r,onClick:f,children:o("parameters.upscaleImage")})]})})},Tce=d.memo(Nce),$ce=ae([xe,wn],({gallery:e,system:t,ui:n,config:r},o)=>{const{isProcessing:s,isConnected:i,shouldConfirmOnDelete:l,progressImage:f}=t,{shouldShowImageDetails:p,shouldHidePreview:h,shouldShowProgressInViewer:m}=n,{shouldFetchMetadataFromApi:v}=r,x=e.selection[e.selection.length-1];return{canDeleteImage:i&&!s,shouldConfirmOnDelete:l,isProcessing:s,isConnected:i,shouldDisableToolbarButtons:!!f||!x,shouldShowImageDetails:p,activeTabName:o,shouldHidePreview:h,shouldShowProgressInViewer:m,lastSelectedImage:x,shouldFetchMetadataFromApi:v}},{memoizeOptions:{resultEqualityCheck:kt}}),Lce=e=>{const t=te(),{isProcessing:n,isConnected:r,shouldDisableToolbarButtons:o,shouldShowImageDetails:s,lastSelectedImage:i,shouldShowProgressInViewer:l,shouldFetchMetadataFromApi:f}=F($ce),p=qt("upscaling").isFeatureEnabled,h=Zi(),{t:m}=we(),{recallBothPrompts:v,recallSeed:x,recallAllParameters:C}=gg(),{currentData:b}=po((i==null?void 0:i.image_name)??zr.skipToken),w=d.useMemo(()=>i?{image:i,shouldFetchMetadataFromApi:f}:zr.skipToken,[i,f]),{metadata:k,workflow:_,isLoading:j}=Lx(w,{selectFromResult:B=>{var U,Y;return{isLoading:B.isFetching,metadata:(U=B==null?void 0:B.currentData)==null?void 0:U.metadata,workflow:(Y=B==null?void 0:B.currentData)==null?void 0:Y.workflow}}}),I=d.useCallback(()=>{_&&t(Bx(_))},[t,_]),M=d.useCallback(()=>{C(k)},[k,C]);Qe("a",()=>{},[k,C]);const E=d.useCallback(()=>{x(k==null?void 0:k.seed)},[k==null?void 0:k.seed,x]);Qe("s",E,[b]);const O=d.useCallback(()=>{v(k==null?void 0:k.positive_prompt,k==null?void 0:k.negative_prompt,k==null?void 0:k.positive_style_prompt,k==null?void 0:k.negative_style_prompt)},[k==null?void 0:k.negative_prompt,k==null?void 0:k.positive_prompt,k==null?void 0:k.positive_style_prompt,k==null?void 0:k.negative_style_prompt,v]);Qe("p",O,[b]),Qe("w",I,[_]);const D=d.useCallback(()=>{t(LM()),t(pm(b))},[t,b]);Qe("shift+i",D,[b]);const A=d.useCallback(()=>{b&&t(Jj({image_name:b.image_name}))},[t,b]),R=d.useCallback(()=>{b&&t(hm([b]))},[t,b]);Qe("Shift+U",()=>{A()},{enabled:()=>!!(p&&!o&&r&&!n)},[p,b,o,r,n]);const $=d.useCallback(()=>t(eA(!s)),[t,s]);Qe("i",()=>{b?$():h({title:m("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[b,s,h]),Qe("delete",()=>{R()},[t,b]);const K=d.useCallback(()=>{t(Nj(!l))},[t,l]);return a.jsx(a.Fragment,{children:a.jsxs(T,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},...e,children:[a.jsx(pn,{isAttached:!0,isDisabled:o,children:a.jsxs(Dd,{children:[a.jsx(Rd,{as:Te,"aria-label":`${m("parameters.sendTo")}...`,tooltip:`${m("parameters.sendTo")}...`,isDisabled:!b,icon:a.jsx(AZ,{})}),a.jsx(Ga,{motionProps:mc,children:b&&a.jsx(zM,{imageDTO:b})})]})}),a.jsxs(pn,{isAttached:!0,isDisabled:o,children:[a.jsx(Te,{isLoading:j,icon:a.jsx(vg,{}),tooltip:`${m("nodes.loadWorkflow")} (W)`,"aria-label":`${m("nodes.loadWorkflow")} (W)`,isDisabled:!_,onClick:I}),a.jsx(Te,{isLoading:j,icon:a.jsx(RE,{}),tooltip:`${m("parameters.usePrompt")} (P)`,"aria-label":`${m("parameters.usePrompt")} (P)`,isDisabled:!(k!=null&&k.positive_prompt),onClick:O}),a.jsx(Te,{isLoading:j,icon:a.jsx(AE,{}),tooltip:`${m("parameters.useSeed")} (S)`,"aria-label":`${m("parameters.useSeed")} (S)`,isDisabled:!(k!=null&&k.seed),onClick:E}),a.jsx(Te,{isLoading:j,icon:a.jsx(SE,{}),tooltip:`${m("parameters.useAll")} (A)`,"aria-label":`${m("parameters.useAll")} (A)`,isDisabled:!k,onClick:M})]}),p&&a.jsx(pn,{isAttached:!0,isDisabled:o,children:p&&a.jsx(Tce,{imageDTO:b})}),a.jsx(pn,{isAttached:!0,isDisabled:o,children:a.jsx(Te,{icon:a.jsx(_E,{}),tooltip:`${m("parameters.info")} (I)`,"aria-label":`${m("parameters.info")} (I)`,isChecked:s,onClick:$})}),a.jsx(pn,{isAttached:!0,children:a.jsx(Te,{"aria-label":m("settings.displayInProgress"),tooltip:m("settings.displayInProgress"),icon:a.jsx(wZ,{}),isChecked:l,onClick:K})}),a.jsx(pn,{isAttached:!0,children:a.jsx(Dce,{onClick:R,isDisabled:o})})]})})},zce=d.memo(Lce),Fce=ae([xe,Hx],(e,t)=>{var _,j;const{data:n,status:r}=tA.endpoints.listImages.select(t)(e),{data:o}=e.gallery.galleryView==="images"?cw.endpoints.getBoardImagesTotal.select(t.board_id??"none")(e):cw.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(e),s=e.gallery.selection[e.gallery.selection.length-1],i=r==="pending";if(!n||!s||o===0)return{isFetching:i,queryArgs:t,isOnFirstImage:!0,isOnLastImage:!0};const l={...t,offset:n.ids.length,limit:Uj},f=nA.getSelectors(),p=f.selectAll(n),h=p.findIndex(I=>I.image_name===s.image_name),m=Ri(h+1,0,p.length-1),v=Ri(h-1,0,p.length-1),x=(_=p[m])==null?void 0:_.image_name,C=(j=p[v])==null?void 0:j.image_name,b=x?f.selectById(n,x):void 0,w=C?f.selectById(n,C):void 0,k=p.length;return{loadedImagesCount:p.length,currentImageIndex:h,areMoreImagesAvailable:(o??0)>k,isFetching:r==="pending",nextImage:b,prevImage:w,queryArgs:l}},{memoizeOptions:{resultEqualityCheck:kt}}),OO=()=>{const e=te(),{nextImage:t,prevImage:n,areMoreImagesAvailable:r,isFetching:o,queryArgs:s,loadedImagesCount:i,currentImageIndex:l}=F(Fce),f=d.useCallback(()=>{n&&e(uw(n))},[e,n]),p=d.useCallback(()=>{t&&e(uw(t))},[e,t]),[h]=Vj(),m=d.useCallback(()=>{h(s)},[h,s]);return{handlePrevImage:f,handleNextImage:p,isOnFirstImage:l===0,isOnLastImage:l!==void 0&&l===i-1,nextImage:t,prevImage:n,areMoreImagesAvailable:r,handleLoadMoreImages:m,isFetching:o}};function Bce(e){return Ne({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 Hce=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:i}=we();return t?a.jsxs(T,{gap:2,children:[n&&a.jsx(Dt,{label:`Recall ${e}`,children:a.jsx(ps,{"aria-label":i("accessibility.useThisParameter"),icon:a.jsx(Bce,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&a.jsx(Dt,{label:`Copy ${e}`,children:a.jsx(ps,{"aria-label":`Copy ${e}`,icon:a.jsx(Hc,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),a.jsxs(T,{direction:o?"column":"row",children:[a.jsxs(be,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?a.jsxs(Im,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",a.jsx(hM,{mx:"2px"})]}):a.jsx(be,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},eo=d.memo(Hce),Wce=e=>{const{metadata:t}=e,{recallPositivePrompt:n,recallNegativePrompt:r,recallSeed:o,recallCfgScale:s,recallModel:i,recallScheduler:l,recallSteps:f,recallWidth:p,recallHeight:h,recallStrength:m}=gg(),v=d.useCallback(()=>{n(t==null?void 0:t.positive_prompt)},[t==null?void 0:t.positive_prompt,n]),x=d.useCallback(()=>{r(t==null?void 0:t.negative_prompt)},[t==null?void 0:t.negative_prompt,r]),C=d.useCallback(()=>{o(t==null?void 0:t.seed)},[t==null?void 0:t.seed,o]),b=d.useCallback(()=>{i(t==null?void 0:t.model)},[t==null?void 0:t.model,i]),w=d.useCallback(()=>{p(t==null?void 0:t.width)},[t==null?void 0:t.width,p]),k=d.useCallback(()=>{h(t==null?void 0:t.height)},[t==null?void 0:t.height,h]),_=d.useCallback(()=>{l(t==null?void 0:t.scheduler)},[t==null?void 0:t.scheduler,l]),j=d.useCallback(()=>{f(t==null?void 0:t.steps)},[t==null?void 0:t.steps,f]),I=d.useCallback(()=>{s(t==null?void 0:t.cfg_scale)},[t==null?void 0:t.cfg_scale,s]),M=d.useCallback(()=>{m(t==null?void 0:t.strength)},[t==null?void 0:t.strength,m]);return!t||Object.keys(t).length===0?null:a.jsxs(a.Fragment,{children:[t.created_by&&a.jsx(eo,{label:"Created By",value:t.created_by}),t.generation_mode&&a.jsx(eo,{label:"Generation Mode",value:t.generation_mode}),t.positive_prompt&&a.jsx(eo,{label:"Positive Prompt",labelPosition:"top",value:t.positive_prompt,onClick:v}),t.negative_prompt&&a.jsx(eo,{label:"Negative Prompt",labelPosition:"top",value:t.negative_prompt,onClick:x}),t.seed!==void 0&&t.seed!==null&&a.jsx(eo,{label:"Seed",value:t.seed,onClick:C}),t.model!==void 0&&t.model!==null&&t.model.model_name&&a.jsx(eo,{label:"Model",value:t.model.model_name,onClick:b}),t.width&&a.jsx(eo,{label:"Width",value:t.width,onClick:w}),t.height&&a.jsx(eo,{label:"Height",value:t.height,onClick:k}),t.scheduler&&a.jsx(eo,{label:"Scheduler",value:t.scheduler,onClick:_}),t.steps&&a.jsx(eo,{label:"Steps",value:t.steps,onClick:j}),t.cfg_scale!==void 0&&t.cfg_scale!==null&&a.jsx(eo,{label:"CFG scale",value:t.cfg_scale,onClick:I}),t.strength&&a.jsx(eo,{label:"Image to image strength",value:t.strength,onClick:M})]})},Vce=d.memo(Wce),Uce=({image:e})=>{const{shouldFetchMetadataFromApi:t}=F(Py),{metadata:n,workflow:r}=Lx({image:e,shouldFetchMetadataFromApi:t},{selectFromResult:o=>{var s,i;return{metadata:(s=o==null?void 0:o.currentData)==null?void 0:s.metadata,workflow:(i=o==null?void 0:o.currentData)==null?void 0:i.workflow}}});return a.jsxs(T,{layerStyle:"first",sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",borderRadius:"base",position:"absolute",overflow:"hidden"},children:[a.jsxs(T,{gap:2,children:[a.jsx(be,{fontWeight:"semibold",children:"File:"}),a.jsxs(Im,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,a.jsx(hM,{mx:"2px"})]})]}),a.jsx(Vce,{metadata:n}),a.jsxs(Yi,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(Qi,{children:[a.jsx(Pr,{children:"Metadata"}),a.jsx(Pr,{children:"Image Details"}),a.jsx(Pr,{children:"Workflow"})]}),a.jsxs(zc,{children:[a.jsx(fo,{children:n?a.jsx(Oi,{data:n,label:"Metadata"}):a.jsx(tr,{label:"No metadata found"})}),a.jsx(fo,{children:e?a.jsx(Oi,{data:e,label:"Image Details"}):a.jsx(tr,{label:"No image details found"})}),a.jsx(fo,{children:r?a.jsx(Oi,{data:r,label:"Workflow"}):a.jsx(tr,{label:"No workflow found"})})]})]})]})},Gce=d.memo(Uce),Vv={color:"base.100",pointerEvents:"auto"},Kce=()=>{const{t:e}=we(),{handlePrevImage:t,handleNextImage:n,isOnFirstImage:r,isOnLastImage:o,handleLoadMoreImages:s,areMoreImagesAvailable:i,isFetching:l}=OO();return a.jsxs(Ie,{sx:{position:"relative",height:"100%",width:"100%"},children:[a.jsx(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineStart:0},children:!r&&a.jsx(ps,{"aria-label":e("accessibility.previousImage"),icon:a.jsx(tZ,{size:64}),variant:"unstyled",onClick:t,boxSize:16,sx:Vv})}),a.jsxs(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineEnd:0},children:[!o&&a.jsx(ps,{"aria-label":e("accessibility.nextImage"),icon:a.jsx(nZ,{size:64}),variant:"unstyled",onClick:n,boxSize:16,sx:Vv}),o&&i&&!l&&a.jsx(ps,{"aria-label":e("accessibility.loadMore"),icon:a.jsx(eZ,{size:64}),variant:"unstyled",onClick:s,boxSize:16,sx:Vv}),o&&i&&l&&a.jsx(T,{sx:{w:16,h:16,alignItems:"center",justifyContent:"center"},children:a.jsx(Ki,{opacity:.5,size:"xl"})})]})]})},DO=d.memo(Kce),qce=ae([xe,rA],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{progressImage:i,shouldAntialiasProgressImage:l}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n==null?void 0:n.image_name,progressImage:i,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:l}},{memoizeOptions:{resultEqualityCheck:kt}}),Xce=()=>{const{shouldShowImageDetails:e,imageName:t,progressImage:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=F(qce),{handlePrevImage:s,handleNextImage:i,isOnLastImage:l,handleLoadMoreImages:f,areMoreImagesAvailable:p,isFetching:h}=OO();Qe("left",()=>{s()},[s]),Qe("right",()=>{if(l&&p&&!h){f();return}l||i()},[l,p,f,h,i]);const{currentData:m}=po(t??zr.skipToken),v=d.useMemo(()=>{if(m)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:m}}},[m]),x=d.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]),[C,b]=d.useState(!1),w=d.useRef(0),k=d.useCallback(()=>{b(!0),window.clearTimeout(w.current)},[]),_=d.useCallback(()=>{w.current=window.setTimeout(()=>{b(!1)},500)},[]);return a.jsxs(T,{onMouseOver:k,onMouseOut:_,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n&&r?a.jsx(qi,{src:n.dataURL,width:n.width,height:n.height,draggable:!1,sx:{objectFit:"contain",maxWidth:"full",maxHeight:"full",height:"auto",position:"absolute",borderRadius:"base",imageRendering:o?"auto":"pixelated"}}):a.jsx(Ya,{imageDTO:m,droppableData:x,draggableData:v,isUploadDisabled:!0,fitContainer:!0,useThumbailFallback:!0,dropLabel:"Set as Current Image",noContentFallback:a.jsx(tr,{icon:Wi,label:"No image selected"})}),e&&m&&a.jsx(Ie,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base"},children:a.jsx(Gce,{image:m})}),a.jsx(nr,{children:!e&&m&&C&&a.jsx(gn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},style:{position:"absolute",top:"0",width:"100%",height:"100%",pointerEvents:"none"},children:a.jsx(DO,{})},"nextPrevButtons")})]})},Yce=d.memo(Xce),Qce=()=>a.jsxs(T,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[a.jsx(zce,{}),a.jsx(Yce,{})]}),Zce=d.memo(Qce),Jce=()=>a.jsx(Ie,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:2,borderRadius:"base"},children:a.jsx(T,{sx:{width:"100%",height:"100%"},children:a.jsx(Zce,{})})}),RO=d.memo(Jce),eue=()=>{const e=d.useRef(null),t=d.useCallback(()=>{e.current&&e.current.setLayout([50,50])},[]),n=Oy();return a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsxs(yg,{ref:e,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},storage:n,units:"percentages",children:[a.jsx(Va,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:a.jsx(Mce,{})}),a.jsx(om,{onDoubleClick:t}),a.jsx(Va,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,children:a.jsx(RO,{})})]})})},tue=d.memo(eue);var nue=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n};const T_=Oc(nue);function Cx(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,n)=>{const r=e[n];return r!=null&&r!==!1&&(t[n]=r),t},{})}var rue=Object.defineProperty,$_=Object.getOwnPropertySymbols,oue=Object.prototype.hasOwnProperty,sue=Object.prototype.propertyIsEnumerable,L_=(e,t,n)=>t in e?rue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aue=(e,t)=>{for(var n in t||(t={}))oue.call(t,n)&&L_(e,n,t[n]);if($_)for(var n of $_(t))sue.call(t,n)&&L_(e,n,t[n]);return e};function AO(e,t){if(t===null||typeof t!="object")return{};const n=aue({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const iue="__MANTINE_FORM_INDEX__";function z_(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${iue}`)):!1:!1}function F_(e,t,n){typeof n.value=="object"&&(n.value=Kl(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Kl(e){if(typeof e!="object")return e;var t=0,n,r,o,s=Object.prototype.toString.call(e);if(s==="[object Object]"?o=Object.create(e.__proto__||null):s==="[object Array]"?o=Array(e.length):s==="[object Set]"?(o=new Set,e.forEach(function(i){o.add(Kl(i))})):s==="[object Map]"?(o=new Map,e.forEach(function(i,l){o.set(Kl(l),Kl(i))})):s==="[object Date]"?o=new Date(+e):s==="[object RegExp]"?o=new RegExp(e.source,e.flags):s==="[object DataView]"?o=new e.constructor(Kl(e.buffer)):s==="[object ArrayBuffer]"?o=e.slice(0):s.slice(-6)==="Array]"&&(o=new e.constructor(e)),o){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)F_(o,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(o,n=r[t])&&o[n]===e[n]||F_(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function NO(e){return typeof e!="string"?[]:e.split(".")}function Pg(e,t,n){const r=NO(e);if(r.length===0)return n;const o=Kl(n);if(r.length===1)return o[r[0]]=t,o;let s=o[r[0]];for(let i=1;i<r.length-1;i+=1){if(s===void 0)return o;s=s[r[i]]}return s[r[r.length-1]]=t,o}function Vs(e,t){const n=NO(e);if(n.length===0||typeof t!="object"||t===null)return;let r=t[n[0]];for(let o=1;o<n.length&&r!==void 0;o+=1)r=r[n[o]];return r}function B_(e){const t=Cx(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function wx(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,s)=>{const i=e[s],l=`${n===""?"":`${n}.`}${s}`,f=Vs(l,t);let p=!1;return typeof i=="function"&&(o[l]=i(f,t,l)),typeof i=="object"&&Array.isArray(f)&&(p=!0,f.forEach((h,m)=>wx(i,t,`${l}.${m}`,o))),typeof i=="object"&&typeof f=="object"&&f!==null&&(p||wx(i,t,l,o)),o},r)}function Sx(e,t){return B_(typeof e=="function"?e(t):wx(e,t))}function Pp(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=Sx(t,n),o=Object.keys(r.errors).find(s=>e.split(".").every((i,l)=>i===s.split(".")[l]));return{hasError:!!o,error:o?r.errors[o]:null}}function lue(e,{from:t,to:n},r){const o=Vs(e,r);if(!Array.isArray(o))return r;const s=[...o],i=o[t];return s.splice(t,1),s.splice(n,0,i),Pg(e,s,r)}var cue=Object.defineProperty,H_=Object.getOwnPropertySymbols,uue=Object.prototype.hasOwnProperty,due=Object.prototype.propertyIsEnumerable,W_=(e,t,n)=>t in e?cue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fue=(e,t)=>{for(var n in t||(t={}))uue.call(t,n)&&W_(e,n,t[n]);if(H_)for(var n of H_(t))due.call(t,n)&&W_(e,n,t[n]);return e};function pue(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,i=fue({},r);return Object.keys(r).every(l=>{let f,p;if(l.startsWith(o)&&(f=l,p=l.replace(o,s)),l.startsWith(s)&&(f=l.replace(s,o),p=l),f&&p){const h=i[f],m=i[p];return m===void 0?delete i[f]:i[f]=m,h===void 0?delete i[p]:i[p]=h,!1}return!0}),i}function hue(e,t,n){const r=Vs(e,n);return Array.isArray(r)?Pg(e,r.filter((o,s)=>s!==t),n):n}var mue=Object.defineProperty,V_=Object.getOwnPropertySymbols,gue=Object.prototype.hasOwnProperty,vue=Object.prototype.propertyIsEnumerable,U_=(e,t,n)=>t in e?mue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xue=(e,t)=>{for(var n in t||(t={}))gue.call(t,n)&&U_(e,n,t[n]);if(V_)for(var n of V_(t))vue.call(t,n)&&U_(e,n,t[n]);return e};function G_(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function K_(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=AO(`${o}.${t}`,s));const i=xue({},s),l=new Set;return Object.entries(s).filter(([f])=>{if(!f.startsWith(`${o}.`))return!1;const p=G_(f,o);return Number.isNaN(p)?!1:p>=t}).forEach(([f,p])=>{const h=G_(f,o),m=f.replace(`${o}.${h}`,`${o}.${h+r}`);i[m]=p,l.add(m),l.has(f)||delete i[f]}),i}function bue(e,t,n,r){const o=Vs(e,r);if(!Array.isArray(o))return r;const s=[...o];return s.splice(typeof n=="number"?n:s.length,0,t),Pg(e,s,r)}function q_(e,t){const n=Object.keys(e);if(typeof t=="string"){const r=n.filter(o=>o.startsWith(`${t}.`));return e[t]||r.some(o=>e[o])||!1}return n.some(r=>e[r])}function yue(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:n}=t;n instanceof HTMLInputElement?n.type==="checkbox"?e(n.checked):e(n.value):(n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&e(n.value)}else e(t)}}var Cue=Object.defineProperty,wue=Object.defineProperties,Sue=Object.getOwnPropertyDescriptors,X_=Object.getOwnPropertySymbols,kue=Object.prototype.hasOwnProperty,_ue=Object.prototype.propertyIsEnumerable,Y_=(e,t,n)=>t in e?Cue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ia=(e,t)=>{for(var n in t||(t={}))kue.call(t,n)&&Y_(e,n,t[n]);if(X_)for(var n of X_(t))_ue.call(t,n)&&Y_(e,n,t[n]);return e},Uv=(e,t)=>wue(e,Sue(t));function ol({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:s=!1,validateInputOnBlur:i=!1,transformValues:l=p=>p,validate:f}={}){const[p,h]=d.useState(r),[m,v]=d.useState(n),[x,C]=d.useState(e),[b,w]=d.useState(Cx(t)),k=d.useRef(e),_=V=>{k.current=V},j=d.useCallback(()=>h({}),[]),I=V=>{const G=V?Ia(Ia({},x),V):x;_(G),v({})},M=d.useCallback(V=>w(G=>Cx(typeof V=="function"?V(G):V)),[]),E=d.useCallback(()=>w({}),[]),O=d.useCallback(()=>{C(e),E(),_(e),v({}),j()},[]),D=d.useCallback((V,G)=>M(J=>Uv(Ia({},J),{[V]:G})),[]),A=d.useCallback(V=>M(G=>{if(typeof V!="string")return G;const J=Ia({},G);return delete J[V],J}),[]),R=d.useCallback(V=>v(G=>{if(typeof V!="string")return G;const J=AO(V,G);return delete J[V],J}),[]),$=d.useCallback((V,G)=>{const J=z_(V,s);R(V),h(se=>Uv(Ia({},se),{[V]:!0})),C(se=>{const re=Pg(V,G,se);if(J){const fe=Pp(V,f,re);fe.hasError?D(V,fe.error):A(V)}return re}),!J&&o&&D(V,null)},[]),K=d.useCallback(V=>{C(G=>{const J=typeof V=="function"?V(G):V;return Ia(Ia({},G),J)}),o&&E()},[]),B=d.useCallback((V,G)=>{R(V),C(J=>lue(V,G,J)),w(J=>pue(V,G,J))},[]),U=d.useCallback((V,G)=>{R(V),C(J=>hue(V,G,J)),w(J=>K_(V,G,J,-1))},[]),Y=d.useCallback((V,G,J)=>{R(V),C(se=>bue(V,G,J,se)),w(se=>K_(V,J,se,1))},[]),W=d.useCallback(()=>{const V=Sx(f,x);return w(V.errors),V},[x,f]),L=d.useCallback(V=>{const G=Pp(V,f,x);return G.hasError?D(V,G.error):A(V),G},[x,f]),X=(V,{type:G="input",withError:J=!0,withFocus:se=!0}={})=>{const fe={onChange:yue(de=>$(V,de))};return J&&(fe.error=b[V]),G==="checkbox"?fe.checked=Vs(V,x):fe.value=Vs(V,x),se&&(fe.onFocus=()=>h(de=>Uv(Ia({},de),{[V]:!0})),fe.onBlur=()=>{if(z_(V,i)){const de=Pp(V,f,x);de.hasError?D(V,de.error):A(V)}}),fe},z=(V,G)=>J=>{J==null||J.preventDefault();const se=W();se.hasErrors?G==null||G(se.errors,x,J):V==null||V(l(x),J)},q=V=>l(V||x),ne=d.useCallback(V=>{V.preventDefault(),O()},[]),Q=V=>{if(V){const J=Vs(V,m);if(typeof J=="boolean")return J;const se=Vs(V,x),re=Vs(V,k.current);return!T_(se,re)}return Object.keys(m).length>0?q_(m):!T_(x,k.current)},ie=d.useCallback(V=>q_(p,V),[p]),oe=d.useCallback(V=>V?!Pp(V,f,x).hasError:!Sx(f,x).hasErrors,[x,f]);return{values:x,errors:b,setValues:K,setErrors:M,setFieldValue:$,setFieldError:D,clearFieldError:A,clearErrors:E,reset:O,validate:W,validateField:L,reorderListItem:B,removeListItem:U,insertListItem:Y,getInputProps:X,onSubmit:z,onReset:ne,isDirty:Q,isTouched:ie,setTouched:h,setDirty:v,resetTouched:j,resetDirty:I,isValid:oe,getTransformedValues:q}}function hn(e){const{...t}=e,{base50:n,base100:r,base200:o,base300:s,base800:i,base700:l,base900:f,accent500:p,accent300:h}=Bd(),{colorMode:m}=ia();return a.jsx(mE,{styles:()=>({input:{color:Ae(f,r)(m),backgroundColor:Ae(n,f)(m),borderColor:Ae(o,i)(m),borderWidth:2,outline:"none",":focus":{borderColor:Ae(h,p)(m)}},label:{color:Ae(l,s)(m),fontWeight:"normal",marginBottom:4}}),...t})}const jue=[{value:"sd-1",label:mn["sd-1"]},{value:"sd-2",label:mn["sd-2"]},{value:"sdxl",label:mn.sdxl},{value:"sdxl-refiner",label:mn["sdxl-refiner"]}];function Kd(e){const{...t}=e,{t:n}=we();return a.jsx(Bn,{label:n("modelManager.baseModel"),data:jue,...t})}function TO(e){const{data:t}=e3(),{...n}=e;return a.jsx(Bn,{label:"Config File",placeholder:"Select A Config File",data:t||[],...n})}const Pue=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function Ig(e){const{...t}=e,{t:n}=we();return a.jsx(Bn,{label:n("modelManager.variant"),data:Pue,...t})}function im(e,t=!0){let n;t?n=new RegExp("[^\\\\/]+(?=\\.)"):n=new RegExp("[^\\\\/]+(?=[\\\\/]?$)");const r=e.match(n);return r?r[0]:""}function $O(e){const{t}=we(),n=te(),{model_path:r}=e,o=ol({initialValues:{model_name:r?im(r):"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"checkpoint",error:void 0,vae:"",variant:"normal",config:"configs\\stable-diffusion\\v1-inference.yaml"}}),[s]=t3(),[i,l]=d.useState(!1),f=p=>{s({body:p}).unwrap().then(h=>{n(Nt(zt({title:`Model Added: ${p.model_name}`,status:"success"}))),o.reset(),r&&n(Cd(null))}).catch(h=>{h&&n(Nt(zt({title:"Model Add Failed",status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(p=>f(p)),style:{width:"100%"},children:a.jsxs(T,{flexDirection:"column",gap:2,children:[a.jsx(hn,{label:"Model Name",required:!0,...o.getInputProps("model_name")}),a.jsx(Kd,{...o.getInputProps("base_model")}),a.jsx(hn,{label:"Model Location",required:!0,...o.getInputProps("path"),onBlur:p=>{if(o.values.model_name===""){const h=im(p.currentTarget.value);h&&o.setFieldValue("model_name",h)}}}),a.jsx(hn,{label:"Description",...o.getInputProps("description")}),a.jsx(hn,{label:"VAE Location",...o.getInputProps("vae")}),a.jsx(Ig,{...o.getInputProps("variant")}),a.jsxs(T,{flexDirection:"column",width:"100%",gap:2,children:[i?a.jsx(hn,{required:!0,label:"Custom Config File Location",...o.getInputProps("config")}):a.jsx(TO,{required:!0,width:"100%",...o.getInputProps("config")}),a.jsx(ur,{isChecked:i,onChange:()=>l(!i),label:"Use Custom Config"}),a.jsx(it,{mt:2,type:"submit",children:t("modelManager.addModel")})]})]})})}function LO(e){const{t}=we(),n=te(),{model_path:r}=e,[o]=t3(),s=ol({initialValues:{model_name:r?im(r,!1):"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"diffusers",error:void 0,vae:"",variant:"normal"}}),i=l=>{o({body:l}).unwrap().then(f=>{n(Nt(zt({title:`Model Added: ${l.model_name}`,status:"success"}))),s.reset(),r&&n(Cd(null))}).catch(f=>{f&&n(Nt(zt({title:"Model Add Failed",status:"error"})))})};return a.jsx("form",{onSubmit:s.onSubmit(l=>i(l)),style:{width:"100%"},children:a.jsxs(T,{flexDirection:"column",gap:2,children:[a.jsx(hn,{required:!0,label:"Model Name",...s.getInputProps("model_name")}),a.jsx(Kd,{...s.getInputProps("base_model")}),a.jsx(hn,{required:!0,label:"Model Location",placeholder:"Provide the path to a local folder where your Diffusers Model is stored",...s.getInputProps("path"),onBlur:l=>{if(s.values.model_name===""){const f=im(l.currentTarget.value,!1);f&&s.setFieldValue("model_name",f)}}}),a.jsx(hn,{label:"Description",...s.getInputProps("description")}),a.jsx(hn,{label:"VAE Location",...s.getInputProps("vae")}),a.jsx(Ig,{...s.getInputProps("variant")}),a.jsx(it,{mt:2,type:"submit",children:t("modelManager.addModel")})]})})}const zO=[{label:"Diffusers",value:"diffusers"},{label:"Checkpoint / Safetensors",value:"checkpoint"}];function Iue(){const[e,t]=d.useState("diffusers");return a.jsxs(T,{flexDirection:"column",gap:4,width:"100%",children:[a.jsx(Bn,{label:"Model Type",value:e,data:zO,onChange:n=>{n&&t(n)}}),a.jsxs(T,{sx:{p:4,borderRadius:4,bg:"base.300",_dark:{bg:"base.850"}},children:[e==="diffusers"&&a.jsx(LO,{}),e==="checkpoint"&&a.jsx($O,{})]})]})}const Eue=[{label:"None",value:"none"},{label:"v_prediction",value:"v_prediction"},{label:"epsilon",value:"epsilon"},{label:"sample",value:"sample"}];function Mue(){const e=te(),{t}=we(),n=F(l=>l.system.isProcessing),[r,{isLoading:o}]=n3(),s=ol({initialValues:{location:"",prediction_type:void 0}}),i=l=>{const f={location:l.location,prediction_type:l.prediction_type==="none"?void 0:l.prediction_type};r({body:f}).unwrap().then(p=>{e(Nt(zt({title:"Model Added",status:"success"}))),s.reset()}).catch(p=>{p&&(console.log(p),e(Nt(zt({title:`${p.data.detail} `,status:"error"}))))})};return a.jsx("form",{onSubmit:s.onSubmit(l=>i(l)),style:{width:"100%"},children:a.jsxs(T,{flexDirection:"column",width:"100%",gap:4,children:[a.jsx(hn,{label:"Model Location",placeholder:"Provide a path to a local Diffusers model, local checkpoint / safetensors model a HuggingFace Repo ID, or a checkpoint/diffusers model URL.",w:"100%",...s.getInputProps("location")}),a.jsx(Bn,{label:"Prediction Type (for Stable Diffusion 2.x Models only)",data:Eue,defaultValue:"none",...s.getInputProps("prediction_type")}),a.jsx(it,{type:"submit",isLoading:o,isDisabled:o||n,children:t("modelManager.addModel")})]})})}function Oue(){const[e,t]=d.useState("simple");return a.jsxs(T,{flexDirection:"column",width:"100%",overflow:"scroll",maxHeight:window.innerHeight-250,gap:4,children:[a.jsxs(pn,{isAttached:!0,children:[a.jsx(it,{size:"sm",isChecked:e=="simple",onClick:()=>t("simple"),children:"Simple"}),a.jsx(it,{size:"sm",isChecked:e=="advanced",onClick:()=>t("advanced"),children:"Advanced"})]}),a.jsxs(T,{sx:{p:4,borderRadius:4,background:"base.200",_dark:{background:"base.800"}},children:[e==="simple"&&a.jsx(Mue,{}),e==="advanced"&&a.jsx(Iue,{})]})]})}function Due(e){const{...t}=e;return a.jsx(lI,{w:"100%",...t,children:e.children})}function Rue(){const e=F(b=>b.modelmanager.searchFolder),[t,n]=d.useState(""),{data:r}=Bo(Ci),{foundModels:o,alreadyInstalled:s,filteredModels:i}=r3({search_path:e||""},{selectFromResult:({data:b})=>{const w=vN(r==null?void 0:r.entities),k=rr(w,"path"),_=mN(b,k),j=wN(b,k);return{foundModels:b,alreadyInstalled:Q_(j,t),filteredModels:Q_(_,t)}}}),[l,{isLoading:f}]=n3(),p=te(),{t:h}=we(),m=d.useCallback(b=>{const w=b.currentTarget.id.split("\\").splice(-1)[0];l({body:{location:b.currentTarget.id}}).unwrap().then(k=>{p(Nt(zt({title:`Added Model: ${w}`,status:"success"})))}).catch(k=>{k&&p(Nt(zt({title:"Failed To Add Model",status:"error"})))})},[p,l]),v=d.useCallback(b=>{n(b.target.value)},[]),x=({models:b,showActions:w=!0})=>b.map(k=>a.jsxs(T,{sx:{p:4,gap:4,alignItems:"center",borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(T,{w:"100%",sx:{flexDirection:"column",minW:"25%"},children:[a.jsx(be,{sx:{fontWeight:600},children:k.split("\\").slice(-1)[0]}),a.jsx(be,{sx:{fontSize:"sm",color:"base.600",_dark:{color:"base.400"}},children:k})]}),w?a.jsxs(T,{gap:2,children:[a.jsx(it,{id:k,onClick:m,isLoading:f,children:"Quick Add"}),a.jsx(it,{onClick:()=>p(Cd(k)),isLoading:f,children:"Advanced"})]}):a.jsx(be,{sx:{fontWeight:600,p:2,borderRadius:4,color:"accent.50",bg:"accent.400",_dark:{color:"accent.100",bg:"accent.600"}},children:"Installed"})]},k));return(()=>e?!o||o.length===0?a.jsx(T,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",height:96,userSelect:"none",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(be,{variant:"subtext",children:"No Models Found"})}):a.jsxs(T,{sx:{flexDirection:"column",gap:2,w:"100%",minW:"50%"},children:[a.jsx(io,{onChange:v,label:h("modelManager.search"),labelPos:"side"}),a.jsxs(T,{p:2,gap:2,children:[a.jsxs(be,{sx:{fontWeight:600},children:["Models Found: ",o.length]}),a.jsxs(be,{sx:{fontWeight:600,color:"accent.500",_dark:{color:"accent.200"}},children:["Not Installed: ",i.length]})]}),a.jsx(Due,{offsetScrollbars:!0,children:a.jsxs(T,{gap:2,flexDirection:"column",children:[x({models:i}),x({models:s,showActions:!1})]})})]}):null)()}const Q_=(e,t)=>{const n=[];return Fn(e,r=>{if(!r)return null;r.includes(t)&&n.push(r)}),n};function Aue(){const e=F(i=>i.modelmanager.advancedAddScanModel),[t,n]=d.useState("diffusers"),[r,o]=d.useState(!0);d.useEffect(()=>{e&&[".ckpt",".safetensors",".pth",".pt"].some(i=>e.endsWith(i))?n("checkpoint"):n("diffusers")},[e,n,r]);const s=te();return e?a.jsxs(Ie,{as:gn.div,initial:{x:-100,opacity:0},animate:{x:0,opacity:1,transition:{duration:.2}},sx:{display:"flex",flexDirection:"column",minWidth:"40%",maxHeight:window.innerHeight-300,overflow:"scroll",p:4,gap:4,borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(T,{justifyContent:"space-between",alignItems:"center",children:[a.jsx(be,{size:"xl",fontWeight:600,children:r||t==="checkpoint"?"Add Checkpoint Model":"Add Diffusers Model"}),a.jsx(Te,{icon:a.jsx(TZ,{}),"aria-label":"Close Advanced",onClick:()=>s(Cd(null)),size:"sm"})]}),a.jsx(Bn,{label:"Model Type",value:t,data:zO,onChange:i=>{i&&(n(i),o(i==="checkpoint"))}}),r?a.jsx($O,{model_path:e},e):a.jsx(LO,{model_path:e},e)]}):null}function Nue(){const e=te(),{t}=we(),n=F(l=>l.modelmanager.searchFolder),{refetch:r}=r3({search_path:n||""}),o=ol({initialValues:{folder:""}}),s=d.useCallback(l=>{e(dw(l.folder))},[e]),i=()=>{r()};return a.jsx("form",{onSubmit:o.onSubmit(l=>s(l)),style:{width:"100%"},children:a.jsxs(T,{sx:{w:"100%",gap:2,borderRadius:4,alignItems:"center"},children:[a.jsxs(T,{w:"100%",alignItems:"center",gap:4,minH:12,children:[a.jsx(be,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",minW:"max-content",_dark:{color:"base.300"}},children:"Folder"}),n?a.jsx(T,{sx:{w:"100%",p:2,px:4,bg:"base.300",borderRadius:4,fontSize:"sm",fontWeight:"bold",_dark:{bg:"base.700"}},children:n}):a.jsx(io,{w:"100%",size:"md",...o.getInputProps("folder")})]}),a.jsxs(T,{gap:2,children:[n?a.jsx(Te,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:a.jsx(TE,{}),onClick:i,fontSize:18,size:"sm"}):a.jsx(Te,{"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),icon:a.jsx(DZ,{}),fontSize:18,size:"sm",type:"submit"}),a.jsx(Te,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:a.jsx(Wr,{}),size:"sm",onClick:()=>{e(dw(null)),e(Cd(null))},isDisabled:!n,colorScheme:"red"})]})]})})}const Tue=d.memo(Nue);function $ue(){return a.jsxs(T,{flexDirection:"column",w:"100%",gap:4,children:[a.jsx(Tue,{}),a.jsxs(T,{gap:4,children:[a.jsx(T,{sx:{maxHeight:window.innerHeight-300,overflow:"scroll",gap:4,w:"100%"},children:a.jsx(Rue,{})}),a.jsx(Aue,{})]})]})}function Lue(){const[e,t]=d.useState("add"),{t:n}=we();return a.jsxs(T,{flexDirection:"column",gap:4,children:[a.jsxs(pn,{isAttached:!0,children:[a.jsx(it,{onClick:()=>t("add"),isChecked:e=="add",size:"sm",width:"100%",children:n("modelManager.addModel")}),a.jsx(it,{onClick:()=>t("scan"),isChecked:e=="scan",size:"sm",width:"100%",children:n("modelManager.scanForModels")})]}),e=="add"&&a.jsx(Oue,{}),e=="scan"&&a.jsx($ue,{})]})}const zue=[{label:"Stable Diffusion 1",value:"sd-1"},{label:"Stable Diffusion 2",value:"sd-2"}];function Fue(){var L,X;const{t:e}=we(),t=te(),{data:n}=Bo(Ci),[r,{isLoading:o}]=oA(),[s,i]=d.useState("sd-1"),l=yw(n==null?void 0:n.entities,(z,q)=>(z==null?void 0:z.model_format)==="diffusers"&&(z==null?void 0:z.base_model)==="sd-1"),f=yw(n==null?void 0:n.entities,(z,q)=>(z==null?void 0:z.model_format)==="diffusers"&&(z==null?void 0:z.base_model)==="sd-2"),p=d.useMemo(()=>({"sd-1":l,"sd-2":f}),[l,f]),[h,m]=d.useState(((L=Object.keys(p[s]))==null?void 0:L[0])??null),[v,x]=d.useState(((X=Object.keys(p[s]))==null?void 0:X[1])??null),[C,b]=d.useState(null),[w,k]=d.useState(""),[_,j]=d.useState(.5),[I,M]=d.useState("weighted_sum"),[E,O]=d.useState("root"),[D,A]=d.useState(""),[R,$]=d.useState(!1),K=Object.keys(p[s]).filter(z=>z!==v&&z!==C),B=Object.keys(p[s]).filter(z=>z!==h&&z!==C),U=Object.keys(p[s]).filter(z=>z!==h&&z!==v),Y=z=>{i(z),m(null),x(null)},W=()=>{const z=[];let q=[h,v,C];q=q.filter(Q=>Q!==null),q.forEach(Q=>{var oe;const ie=(oe=Q==null?void 0:Q.split("/"))==null?void 0:oe[2];ie&&z.push(ie)});const ne={model_names:z,merged_model_name:w!==""?w:z.join("-"),alpha:_,interp:I,force:R,merge_dest_directory:E==="root"?void 0:D};r({base_model:s,body:ne}).unwrap().then(Q=>{t(Nt(zt({title:e("modelManager.modelsMerged"),status:"success"})))}).catch(Q=>{Q&&t(Nt(zt({title:e("modelManager.modelsMergeFailed"),status:"error"})))})};return a.jsxs(T,{flexDirection:"column",rowGap:4,children:[a.jsxs(T,{sx:{flexDirection:"column",rowGap:1},children:[a.jsx(be,{children:e("modelManager.modelMergeHeaderHelp1")}),a.jsx(be,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),a.jsxs(T,{columnGap:4,children:[a.jsx(Bn,{label:"Model Type",w:"100%",data:zue,value:s,onChange:Y}),a.jsx(Gt,{label:e("modelManager.modelOne"),w:"100%",value:h,placeholder:e("modelManager.selectModel"),data:K,onChange:z=>m(z)}),a.jsx(Gt,{label:e("modelManager.modelTwo"),w:"100%",placeholder:e("modelManager.selectModel"),value:v,data:B,onChange:z=>x(z)}),a.jsx(Gt,{label:e("modelManager.modelThree"),data:U,w:"100%",placeholder:e("modelManager.selectModel"),clearable:!0,onChange:z=>{z?(b(z),M("weighted_sum")):(b(null),M("add_difference"))}})]}),a.jsx(io,{label:e("modelManager.mergedModelName"),value:w,onChange:z=>k(z.target.value)}),a.jsxs(T,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(Ze,{label:e("modelManager.alpha"),min:.01,max:.99,step:.01,value:_,onChange:z=>j(z),withInput:!0,withReset:!0,handleReset:()=>j(.5),withSliderMarks:!0}),a.jsx(be,{variant:"subtext",fontSize:"sm",children:e("modelManager.modelMergeAlphaHelp")})]}),a.jsxs(T,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(be,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),a.jsx(oh,{value:I,onChange:z=>M(z),children:a.jsx(T,{columnGap:4,children:C===null?a.jsxs(a.Fragment,{children:[a.jsx(zs,{value:"weighted_sum",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.weightedSum")})}),a.jsx(zs,{value:"sigmoid",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.sigmoid")})}),a.jsx(zs,{value:"inv_sigmoid",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):a.jsx(zs,{value:"add_difference",children:a.jsx(Dt,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:a.jsx(be,{fontSize:"sm",children:e("modelManager.addDifference")})})})})})]}),a.jsxs(T,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.900"}},children:[a.jsxs(T,{columnGap:4,children:[a.jsx(be,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:e("modelManager.mergedModelSaveLocation")}),a.jsx(oh,{value:E,onChange:z=>O(z),children:a.jsxs(T,{columnGap:4,children:[a.jsx(zs,{value:"root",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.invokeAIFolder")})}),a.jsx(zs,{value:"custom",children:a.jsx(be,{fontSize:"sm",children:e("modelManager.custom")})})]})})]}),E==="custom"&&a.jsx(io,{label:e("modelManager.mergedModelCustomSaveLocation"),value:D,onChange:z=>A(z.target.value)})]}),a.jsx(ur,{label:e("modelManager.ignoreMismatch"),isChecked:R,onChange:z=>$(z.target.checked),fontWeight:"500"}),a.jsx(it,{onClick:W,isLoading:o,isDisabled:h===null||v===null,children:e("modelManager.merge")})]})}const Bue=Pe((e,t)=>{const{t:n}=we(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:i,children:l,title:f,triggerComponent:p}=e,{isOpen:h,onOpen:m,onClose:v}=Er(),x=d.useRef(null),C=()=>{o(),v()},b=()=>{i&&i(),v()};return a.jsxs(a.Fragment,{children:[d.cloneElement(p,{onClick:m,ref:t}),a.jsx(Ad,{isOpen:h,leastDestructiveRef:x,onClose:v,isCentered:!0,children:a.jsx(Wo,{children:a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:f}),a.jsx(Vo,{children:l}),a.jsxs(gs,{children:[a.jsx(it,{ref:x,onClick:b,children:s}),a.jsx(it,{colorScheme:"error",onClick:C,ml:3,children:r})]})]})})})]})}),Hy=d.memo(Bue);function Hue(e){const{model:t}=e,n=te(),{t:r}=we(),[o,{isLoading:s}]=sA(),[i,l]=d.useState("InvokeAIRoot"),[f,p]=d.useState("");d.useEffect(()=>{l("InvokeAIRoot")},[t]);const h=()=>{l("InvokeAIRoot")},m=()=>{const v={base_model:t.base_model,model_name:t.model_name,convert_dest_directory:i==="Custom"?f:void 0};if(i==="Custom"&&f===""){n(Nt(zt({title:r("modelManager.noCustomLocationProvided"),status:"error"})));return}n(Nt(zt({title:`${r("modelManager.convertingModelBegin")}: ${t.model_name}`,status:"info"}))),o(v).unwrap().then(()=>{n(Nt(zt({title:`${r("modelManager.modelConverted")}: ${t.model_name}`,status:"success"})))}).catch(()=>{n(Nt(zt({title:`${r("modelManager.modelConversionFailed")}: ${t.model_name}`,status:"error"})))})};return a.jsxs(Hy,{title:`${r("modelManager.convert")} ${t.model_name}`,acceptCallback:m,cancelCallback:h,acceptButtonText:`${r("modelManager.convert")}`,triggerComponent:a.jsxs(it,{size:"sm","aria-label":r("modelManager.convertToDiffusers"),className:" modal-close-btn",isLoading:s,children:["🧨 ",r("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[a.jsxs(T,{flexDirection:"column",rowGap:4,children:[a.jsx(be,{children:r("modelManager.convertToDiffusersHelpText1")}),a.jsxs(Id,{children:[a.jsx(No,{children:r("modelManager.convertToDiffusersHelpText2")}),a.jsx(No,{children:r("modelManager.convertToDiffusersHelpText3")}),a.jsx(No,{children:r("modelManager.convertToDiffusersHelpText4")}),a.jsx(No,{children:r("modelManager.convertToDiffusersHelpText5")})]}),a.jsx(be,{children:r("modelManager.convertToDiffusersHelpText6")})]}),a.jsxs(T,{flexDir:"column",gap:2,children:[a.jsxs(T,{marginTop:4,flexDir:"column",gap:2,children:[a.jsx(be,{fontWeight:"600",children:r("modelManager.convertToDiffusersSaveLocation")}),a.jsx(oh,{value:i,onChange:v=>l(v),children:a.jsxs(T,{gap:4,children:[a.jsx(zs,{value:"InvokeAIRoot",children:a.jsx(Dt,{label:"Save converted model in the InvokeAI root folder",children:r("modelManager.invokeRoot")})}),a.jsx(zs,{value:"Custom",children:a.jsx(Dt,{label:"Save converted model in a custom folder",children:r("modelManager.custom")})})]})})]}),i==="Custom"&&a.jsxs(T,{flexDirection:"column",rowGap:2,children:[a.jsx(be,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:r("modelManager.customSaveLocation")}),a.jsx(io,{value:f,onChange:v=>{p(v.target.value)},width:"full"})]})]})]})}function Wue(e){const t=F(Pn),{model:n}=e,[r,{isLoading:o}]=o3(),{data:s}=e3(),[i,l]=d.useState(!1);d.useEffect(()=>{s!=null&&s.includes(n.config)||l(!0)},[s,n.config]);const f=te(),{t:p}=we(),h=ol({initialValues:{model_name:n.model_name?n.model_name:"",base_model:n.base_model,model_type:"main",path:n.path?n.path:"",description:n.description?n.description:"",model_format:"checkpoint",vae:n.vae?n.vae:"",config:n.config?n.config:"",variant:n.variant},validate:{path:v=>v.trim().length===0?"Must provide a path":null}}),m=d.useCallback(v=>{const x={base_model:n.base_model,model_name:n.model_name,body:v};r(x).unwrap().then(C=>{h.setValues(C),f(Nt(zt({title:p("modelManager.modelUpdated"),status:"success"})))}).catch(C=>{h.reset(),f(Nt(zt({title:p("modelManager.modelUpdateFailed"),status:"error"})))})},[h,f,n.base_model,n.model_name,p,r]);return a.jsxs(T,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(T,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs(T,{flexDirection:"column",children:[a.jsx(be,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(be,{fontSize:"sm",color:"base.400",children:[mn[n.base_model]," Model"]})]}),[""].includes(n.base_model)?a.jsx(ua,{sx:{p:2,borderRadius:4,bg:"error.200",_dark:{bg:"error.400"}},children:"Conversion Not Supported"}):a.jsx(Hue,{model:n})]}),a.jsx(Fr,{}),a.jsx(T,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",children:a.jsx("form",{onSubmit:h.onSubmit(v=>m(v)),children:a.jsxs(T,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(hn,{label:p("modelManager.name"),...h.getInputProps("model_name")}),a.jsx(hn,{label:p("modelManager.description"),...h.getInputProps("description")}),a.jsx(Kd,{required:!0,...h.getInputProps("base_model")}),a.jsx(Ig,{required:!0,...h.getInputProps("variant")}),a.jsx(hn,{required:!0,label:p("modelManager.modelLocation"),...h.getInputProps("path")}),a.jsx(hn,{label:p("modelManager.vaeLocation"),...h.getInputProps("vae")}),a.jsxs(T,{flexDirection:"column",gap:2,children:[i?a.jsx(hn,{required:!0,label:p("modelManager.config"),...h.getInputProps("config")}):a.jsx(TO,{required:!0,...h.getInputProps("config")}),a.jsx(ur,{isChecked:i,onChange:()=>l(!i),label:"Use Custom Config"})]}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:p("modelManager.updateModel")})]})})})]})}function Vue(e){const t=F(Pn),{model:n}=e,[r,{isLoading:o}]=o3(),s=te(),{t:i}=we(),l=ol({initialValues:{model_name:n.model_name?n.model_name:"",base_model:n.base_model,model_type:"main",path:n.path?n.path:"",description:n.description?n.description:"",model_format:"diffusers",vae:n.vae?n.vae:"",variant:n.variant},validate:{path:p=>p.trim().length===0?"Must provide a path":null}}),f=d.useCallback(p=>{const h={base_model:n.base_model,model_name:n.model_name,body:p};r(h).unwrap().then(m=>{l.setValues(m),s(Nt(zt({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{l.reset(),s(Nt(zt({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[l,s,n.base_model,n.model_name,i,r]);return a.jsxs(T,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(T,{flexDirection:"column",children:[a.jsx(be,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(be,{fontSize:"sm",color:"base.400",children:[mn[n.base_model]," Model"]})]}),a.jsx(Fr,{}),a.jsx("form",{onSubmit:l.onSubmit(p=>f(p)),children:a.jsxs(T,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(hn,{label:i("modelManager.name"),...l.getInputProps("model_name")}),a.jsx(hn,{label:i("modelManager.description"),...l.getInputProps("description")}),a.jsx(Kd,{required:!0,...l.getInputProps("base_model")}),a.jsx(Ig,{required:!0,...l.getInputProps("variant")}),a.jsx(hn,{required:!0,label:i("modelManager.modelLocation"),...l.getInputProps("path")}),a.jsx(hn,{label:i("modelManager.vaeLocation"),...l.getInputProps("vae")}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})]})}function Uue(e){const t=F(Pn),{model:n}=e,[r,{isLoading:o}]=aA(),s=te(),{t:i}=we(),l=ol({initialValues:{model_name:n.model_name?n.model_name:"",base_model:n.base_model,model_type:"lora",path:n.path?n.path:"",description:n.description?n.description:"",model_format:n.model_format},validate:{path:p=>p.trim().length===0?"Must provide a path":null}}),f=d.useCallback(p=>{const h={base_model:n.base_model,model_name:n.model_name,body:p};r(h).unwrap().then(m=>{l.setValues(m),s(Nt(zt({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{l.reset(),s(Nt(zt({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[s,l,n.base_model,n.model_name,i,r]);return a.jsxs(T,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(T,{flexDirection:"column",children:[a.jsx(be,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(be,{fontSize:"sm",color:"base.400",children:[mn[n.base_model]," Model ⋅"," ",iA[n.model_format]," format"]})]}),a.jsx(Fr,{}),a.jsx("form",{onSubmit:l.onSubmit(p=>f(p)),children:a.jsxs(T,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(hn,{label:i("modelManager.name"),...l.getInputProps("model_name")}),a.jsx(hn,{label:i("modelManager.description"),...l.getInputProps("description")}),a.jsx(Kd,{...l.getInputProps("base_model")}),a.jsx(hn,{label:i("modelManager.modelLocation"),...l.getInputProps("path")}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})]})}function Gue(e){const t=F(Pn),{t:n}=we(),r=te(),[o]=lA(),[s]=cA(),{model:i,isSelected:l,setSelectedModelId:f}=e,p=d.useCallback(()=>{f(i.id)},[i.id,f]),h=d.useCallback(()=>{const m={main:o,lora:s,onnx:o}[i.model_type];m(i).unwrap().then(v=>{r(Nt(zt({title:`${n("modelManager.modelDeleted")}: ${i.model_name}`,status:"success"})))}).catch(v=>{v&&r(Nt(zt({title:`${n("modelManager.modelDeleteFailed")}: ${i.model_name}`,status:"error"})))}),f(void 0)},[o,s,i,f,r,n]);return a.jsxs(T,{sx:{gap:2,alignItems:"center",w:"full"},children:[a.jsx(T,{as:it,isChecked:l,sx:{justifyContent:"start",p:2,borderRadius:"base",w:"full",alignItems:"center",bg:l?"accent.400":"base.100",color:l?"base.50":"base.800",_hover:{bg:l?"accent.500":"base.300",color:l?"base.50":"base.800"},_dark:{color:l?"base.50":"base.100",bg:l?"accent.600":"base.850",_hover:{color:l?"base.50":"base.100",bg:l?"accent.550":"base.700"}}},onClick:p,children:a.jsxs(T,{gap:4,alignItems:"center",children:[a.jsx(ua,{minWidth:14,p:.5,fontSize:"sm",variant:"solid",children:uA[i.base_model]}),a.jsx(Dt,{label:i.description,hasArrow:!0,placement:"bottom",children:a.jsx(be,{sx:{fontWeight:500},children:i.model_name})})]})}),a.jsx(Hy,{title:n("modelManager.deleteModel"),acceptCallback:h,acceptButtonText:n("modelManager.delete"),triggerComponent:a.jsx(Te,{icon:a.jsx(Fee,{}),"aria-label":n("modelManager.deleteConfig"),isDisabled:t,colorScheme:"error"}),children:a.jsxs(T,{rowGap:4,flexDirection:"column",children:[a.jsx("p",{style:{fontWeight:"bold"},children:n("modelManager.deleteMsg1")}),a.jsx("p",{children:n("modelManager.deleteMsg2")})]})})]})}const Kue=e=>{const{selectedModelId:t,setSelectedModelId:n}=e,{t:r}=we(),[o,s]=d.useState(""),[i,l]=d.useState("all"),{filteredDiffusersModels:f,isLoadingDiffusersModels:p}=Bo(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredDiffusersModels:ju(j,"main","diffusers",o),isLoadingDiffusersModels:I})}),{filteredCheckpointModels:h,isLoadingCheckpointModels:m}=Bo(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredCheckpointModels:ju(j,"main","checkpoint",o),isLoadingCheckpointModels:I})}),{filteredLoraModels:v,isLoadingLoraModels:x}=vm(void 0,{selectFromResult:({data:j,isLoading:I})=>({filteredLoraModels:ju(j,"lora",void 0,o),isLoadingLoraModels:I})}),{filteredOnnxModels:C,isLoadingOnnxModels:b}=Xu(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredOnnxModels:ju(j,"onnx","onnx",o),isLoadingOnnxModels:I})}),{filteredOliveModels:w,isLoadingOliveModels:k}=Xu(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredOliveModels:ju(j,"onnx","olive",o),isLoadingOliveModels:I})}),_=d.useCallback(j=>{s(j.target.value)},[]);return a.jsx(T,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:a.jsxs(T,{flexDirection:"column",gap:4,paddingInlineEnd:4,children:[a.jsxs(pn,{isAttached:!0,children:[a.jsx(it,{onClick:()=>l("all"),isChecked:i==="all",size:"sm",children:r("modelManager.allModels")}),a.jsx(it,{size:"sm",onClick:()=>l("diffusers"),isChecked:i==="diffusers",children:r("modelManager.diffusersModels")}),a.jsx(it,{size:"sm",onClick:()=>l("checkpoint"),isChecked:i==="checkpoint",children:r("modelManager.checkpointModels")}),a.jsx(it,{size:"sm",onClick:()=>l("onnx"),isChecked:i==="onnx",children:r("modelManager.onnxModels")}),a.jsx(it,{size:"sm",onClick:()=>l("olive"),isChecked:i==="olive",children:r("modelManager.oliveModels")}),a.jsx(it,{size:"sm",onClick:()=>l("lora"),isChecked:i==="lora",children:r("modelManager.loraModels")})]}),a.jsx(io,{onChange:_,label:r("modelManager.search"),labelPos:"side"}),a.jsxs(T,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-280,overflow:"scroll",children:[p&&a.jsx(Bl,{loadingMessage:"Loading Diffusers..."}),["all","diffusers"].includes(i)&&!p&&f.length>0&&a.jsx(Fl,{title:"Diffusers",modelList:f,selected:{selectedModelId:t,setSelectedModelId:n}},"diffusers"),m&&a.jsx(Bl,{loadingMessage:"Loading Checkpoints..."}),["all","checkpoint"].includes(i)&&!m&&h.length>0&&a.jsx(Fl,{title:"Checkpoints",modelList:h,selected:{selectedModelId:t,setSelectedModelId:n}},"checkpoints"),x&&a.jsx(Bl,{loadingMessage:"Loading LoRAs..."}),["all","lora"].includes(i)&&!x&&v.length>0&&a.jsx(Fl,{title:"LoRAs",modelList:v,selected:{selectedModelId:t,setSelectedModelId:n}},"loras"),k&&a.jsx(Bl,{loadingMessage:"Loading Olives..."}),["all","olive"].includes(i)&&!k&&w.length>0&&a.jsx(Fl,{title:"Olives",modelList:w,selected:{selectedModelId:t,setSelectedModelId:n}},"olive"),b&&a.jsx(Bl,{loadingMessage:"Loading ONNX..."}),["all","onnx"].includes(i)&&!b&&C.length>0&&a.jsx(Fl,{title:"ONNX",modelList:C,selected:{selectedModelId:t,setSelectedModelId:n}},"onnx")]})]})})},que=d.memo(Kue),ju=(e,t,n,r)=>{const o=[];return Fn(e==null?void 0:e.entities,s=>{if(!s)return;const i=s.model_name.toLowerCase().includes(r.toLowerCase()),l=n===void 0||s.model_format===n,f=s.model_type===t;i&&l&&f&&o.push(s)}),o},Wy=d.memo(e=>a.jsx(T,{flexDirection:"column",gap:4,borderRadius:4,p:4,sx:{bg:"base.200",_dark:{bg:"base.800"}},children:e.children}));Wy.displayName="StyledModelContainer";const Fl=d.memo(e=>{const{title:t,modelList:n,selected:r}=e;return a.jsx(Wy,{children:a.jsxs(T,{sx:{gap:2,flexDir:"column"},children:[a.jsx(be,{variant:"subtext",fontSize:"sm",children:t}),n.map(o=>a.jsx(Gue,{model:o,isSelected:r.selectedModelId===o.id,setSelectedModelId:r.setSelectedModelId},o.id))]})})});Fl.displayName="ModelListWrapper";const Bl=d.memo(({loadingMessage:e})=>a.jsx(Wy,{children:a.jsxs(T,{justifyContent:"center",alignItems:"center",flexDirection:"column",p:4,gap:8,children:[a.jsx(Ki,{}),a.jsx(be,{variant:"subtext",children:e||"Fetching..."})]})}));Bl.displayName="FetchingModelsLoader";function Xue(){const[e,t]=d.useState(),{mainModel:n}=Bo(Ci,{selectFromResult:({data:s})=>({mainModel:e?s==null?void 0:s.entities[e]:void 0})}),{loraModel:r}=vm(void 0,{selectFromResult:({data:s})=>({loraModel:e?s==null?void 0:s.entities[e]:void 0})}),o=n||r;return a.jsxs(T,{sx:{gap:8,w:"full",h:"full"},children:[a.jsx(que,{selectedModelId:e,setSelectedModelId:t}),a.jsx(Yue,{model:o})]})}const Yue=e=>{const{model:t}=e;return(t==null?void 0:t.model_format)==="checkpoint"?a.jsx(Wue,{model:t},t.id):(t==null?void 0:t.model_format)==="diffusers"?a.jsx(Vue,{model:t},t.id):(t==null?void 0:t.model_type)==="lora"?a.jsx(Uue,{model:t},t.id):a.jsx(T,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",maxH:96,userSelect:"none"},children:a.jsx(be,{variant:"subtext",children:"No Model Selected"})})};function Que(){const{t:e}=we();return a.jsxs(T,{sx:{w:"full",p:4,borderRadius:4,gap:4,justifyContent:"space-between",alignItems:"center",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs(T,{sx:{flexDirection:"column",gap:2},children:[a.jsx(be,{sx:{fontWeight:600},children:e("modelManager.syncModels")}),a.jsx(be,{fontSize:"sm",sx:{_dark:{color:"base.400"}},children:e("modelManager.syncModelsDesc")})]}),a.jsx(Vc,{})]})}function Zue(){return a.jsx(T,{children:a.jsx(Que,{})})}const Z_=[{id:"modelManager",label:bn.t("modelManager.modelManager"),content:a.jsx(Xue,{})},{id:"importModels",label:bn.t("modelManager.importModels"),content:a.jsx(Lue,{})},{id:"mergeModels",label:bn.t("modelManager.mergeModels"),content:a.jsx(Fue,{})},{id:"settings",label:bn.t("modelManager.settings"),content:a.jsx(Zue,{})}],Jue=()=>a.jsxs(Yi,{isLazy:!0,variant:"line",layerStyle:"first",sx:{w:"full",h:"full",p:4,gap:4,borderRadius:"base"},children:[a.jsx(Qi,{children:Z_.map(e=>a.jsx(Pr,{sx:{borderTopRadius:"base"},children:e.label},e.id))}),a.jsx(zc,{sx:{w:"full",h:"full"},children:Z_.map(e=>a.jsx(fo,{sx:{w:"full",h:"full"},children:e.content},e.id))})]}),ede=d.memo(Jue),Gv={"enum.number":0,"enum.string":"",boolean:!1,BooleanCollection:[],BooleanPolymorphic:!1,ClipField:void 0,Collection:[],CollectionItem:void 0,ColorCollection:[],ColorField:void 0,ColorPolymorphic:void 0,ConditioningCollection:[],ConditioningField:void 0,ConditioningPolymorphic:void 0,ControlCollection:[],ControlField:void 0,ControlNetModelField:void 0,ControlPolymorphic:void 0,DenoiseMaskField:void 0,float:0,FloatCollection:[],FloatPolymorphic:0,ImageCollection:[],ImageField:void 0,ImagePolymorphic:void 0,integer:0,IntegerCollection:[],IntegerPolymorphic:0,LatentsCollection:[],LatentsField:void 0,LatentsPolymorphic:void 0,LoRAModelField:void 0,MainModelField:void 0,ONNXModelField:void 0,Scheduler:"euler",SDXLMainModelField:void 0,SDXLRefinerModelField:void 0,string:"",StringCollection:[],StringPolymorphic:"",UNetField:void 0,VaeField:void 0,VaeModelField:void 0},tde=(e,t)=>{const n={id:e,name:t.name,type:t.type,label:"",fieldKind:"input"};return t.type==="enum"?(t.enumType==="number"&&(n.value=t.default??Gv["enum.number"]),t.enumType==="string"&&(n.value=t.default??Gv["enum.string"])):n.value=t.default??Gv[t.type],n},nde=ae([e=>e.nodes],e=>e.nodeTemplates),Kv={dragHandle:`.${Xi}`},rde=()=>{const e=F(nde),t=Kx();return d.useCallback(n=>{var x;const r=Fa();let o=window.innerWidth/2,s=window.innerHeight/2;const i=(x=document.querySelector("#workflow-editor"))==null?void 0:x.getBoundingClientRect();i&&(o=i.width/2-c1/2,s=i.height/2-c1/2);const{x:l,y:f}=t.project({x:o,y:s});if(n==="current_image")return{...Kv,id:r,type:"current_image",position:{x:l,y:f},data:{id:r,type:"current_image",isOpen:!0,label:"Current Image"}};if(n==="notes")return{...Kv,id:r,type:"notes",position:{x:l,y:f},data:{id:r,isOpen:!0,label:"Notes",notes:"",type:"notes"}};const p=e[n];if(p===void 0){console.error(`Unable to find template ${n}.`);return}const h=fw(p.inputs,(C,b,w)=>{const k=Fa(),_=tde(k,b);return C[w]=_,C},{}),m=fw(p.outputs,(C,b,w)=>{const _={id:Fa(),name:w,type:b.type,fieldKind:"output"};return C[w]=_,C},{});return{...Kv,id:r,type:"invocation",position:{x:l,y:f},data:{id:r,type:n,version:p.version,label:"",notes:"",isOpen:!0,embedWorkflow:!1,isIntermediate:!0,inputs:h,outputs:m}}},[e,t])},FO=d.forwardRef(({label:e,description:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs("div",{children:[a.jsx(be,{fontWeight:600,children:e}),a.jsx(be,{size:"xs",sx:{color:"base.600",_dark:{color:"base.500"}},children:t})]})}));FO.displayName="AddNodePopoverSelectItem";const ode=(e,t)=>{const n=new RegExp(e.trim().replace(/[-[\]{}()*+!<=:?./\\^$|#,]/g,"").split(" ").join(".*"),"gi");return n.test(t.label)||n.test(t.description)||t.tags.some(r=>n.test(r))},sde=ae([xe],({nodes:e})=>{const t=rr(e.nodeTemplates,n=>({label:n.title,value:n.type,description:n.description,tags:n.tags}));return t.push({label:"Progress Image",value:"current_image",description:"Displays the current image in the Node Editor",tags:["progress"]}),t.push({label:"Notes",value:"notes",description:"Add notes about your workflow",tags:["notes"]}),t.sort((n,r)=>n.label.localeCompare(r.label)),{data:t}},Ce),ade=()=>{const e=te(),t=rde(),n=Zi(),{data:r}=F(sde),o=F(v=>v.nodes.isAddNodePopoverOpen),s=d.useRef(null),i=d.useCallback(v=>{const x=t(v);if(!x){n({status:"error",title:`Unknown Invocation type ${v}`});return}e(dA(x))},[e,t,n]),l=d.useCallback(v=>{v&&i(v)},[i]),f=d.useCallback(()=>{e(fA())},[e]),p=d.useCallback(()=>{e(s3())},[e]),h=d.useCallback(v=>{v.preventDefault(),p(),setTimeout(()=>{var x;(x=s.current)==null||x.focus()},0)},[p]),m=d.useCallback(()=>{f()},[f]);return Qe(["shift+a","space"],h),Qe(["escape"],m),a.jsxs($m,{initialFocusRef:s,isOpen:o,onClose:f,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(lP,{children:a.jsx(T,{sx:{position:"absolute",top:"15%",insetInlineStart:"50%",pointerEvents:"none"}})}),a.jsx(Lm,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Rb,{sx:{p:0},children:a.jsx(Gt,{inputRef:s,selectOnBlur:!1,placeholder:"Search for nodes",value:null,data:r,maxDropdownHeight:400,nothingFound:"No matching nodes",itemComponent:FO,filter:ode,onChange:l,hoverOnSearchChange:!0,onDropdownClose:f,sx:{width:"32rem",input:{padding:"0.5rem"}}})})})]})},ide=d.memo(ade);var lde="\0",gi="\0",J_="",wr,Si,Tr,fd,uc,dc,no,as,Na,is,Ta,Fs,Bs,fc,pc,Hs,Eo,pd,kx,vj;let cde=(vj=class{constructor(t){Jt(this,pd);Jt(this,wr,!0);Jt(this,Si,!1);Jt(this,Tr,!1);Jt(this,fd,void 0);Jt(this,uc,()=>{});Jt(this,dc,()=>{});Jt(this,no,{});Jt(this,as,{});Jt(this,Na,{});Jt(this,is,{});Jt(this,Ta,{});Jt(this,Fs,{});Jt(this,Bs,{});Jt(this,fc,0);Jt(this,pc,0);Jt(this,Hs,void 0);Jt(this,Eo,void 0);t&&(Jr(this,wr,t.hasOwnProperty("directed")?t.directed:!0),Jr(this,Si,t.hasOwnProperty("multigraph")?t.multigraph:!1),Jr(this,Tr,t.hasOwnProperty("compound")?t.compound:!1)),Se(this,Tr)&&(Jr(this,Hs,{}),Jr(this,Eo,{}),Se(this,Eo)[gi]={})}isDirected(){return Se(this,wr)}isMultigraph(){return Se(this,Si)}isCompound(){return Se(this,Tr)}setGraph(t){return Jr(this,fd,t),this}graph(){return Se(this,fd)}setDefaultNodeLabel(t){return Jr(this,uc,t),typeof t!="function"&&Jr(this,uc,()=>t),this}nodeCount(){return Se(this,fc)}nodes(){return Object.keys(Se(this,no))}sources(){var t=this;return this.nodes().filter(n=>Object.keys(Se(t,as)[n]).length===0)}sinks(){var t=this;return this.nodes().filter(n=>Object.keys(Se(t,is)[n]).length===0)}setNodes(t,n){var r=arguments,o=this;return t.forEach(function(s){r.length>1?o.setNode(s,n):o.setNode(s)}),this}setNode(t,n){return Se(this,no).hasOwnProperty(t)?(arguments.length>1&&(Se(this,no)[t]=n),this):(Se(this,no)[t]=arguments.length>1?n:Se(this,uc).call(this,t),Se(this,Tr)&&(Se(this,Hs)[t]=gi,Se(this,Eo)[t]={},Se(this,Eo)[gi][t]=!0),Se(this,as)[t]={},Se(this,Na)[t]={},Se(this,is)[t]={},Se(this,Ta)[t]={},++vu(this,fc)._,this)}node(t){return Se(this,no)[t]}hasNode(t){return Se(this,no).hasOwnProperty(t)}removeNode(t){var n=this;if(Se(this,no).hasOwnProperty(t)){var r=o=>n.removeEdge(Se(n,Fs)[o]);delete Se(this,no)[t],Se(this,Tr)&&(os(this,pd,kx).call(this,t),delete Se(this,Hs)[t],this.children(t).forEach(function(o){n.setParent(o)}),delete Se(this,Eo)[t]),Object.keys(Se(this,as)[t]).forEach(r),delete Se(this,as)[t],delete Se(this,Na)[t],Object.keys(Se(this,is)[t]).forEach(r),delete Se(this,is)[t],delete Se(this,Ta)[t],--vu(this,fc)._}return this}setParent(t,n){if(!Se(this,Tr))throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=gi;else{n+="";for(var r=n;r!==void 0;r=this.parent(r))if(r===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),os(this,pd,kx).call(this,t),Se(this,Hs)[t]=n,Se(this,Eo)[n][t]=!0,this}parent(t){if(Se(this,Tr)){var n=Se(this,Hs)[t];if(n!==gi)return n}}children(t=gi){if(Se(this,Tr)){var n=Se(this,Eo)[t];if(n)return Object.keys(n)}else{if(t===gi)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=Se(this,Na)[t];if(n)return Object.keys(n)}successors(t){var n=Se(this,Ta)[t];if(n)return Object.keys(n)}neighbors(t){var n=this.predecessors(t);if(n){const o=new Set(n);for(var r of this.successors(t))o.add(r);return Array.from(o.values())}}isLeaf(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){var n=new this.constructor({directed:Se(this,wr),multigraph:Se(this,Si),compound:Se(this,Tr)});n.setGraph(this.graph());var r=this;Object.entries(Se(this,no)).forEach(function([i,l]){t(i)&&n.setNode(i,l)}),Object.values(Se(this,Fs)).forEach(function(i){n.hasNode(i.v)&&n.hasNode(i.w)&&n.setEdge(i,r.edge(i))});var o={};function s(i){var l=r.parent(i);return l===void 0||n.hasNode(l)?(o[i]=l,l):l in o?o[l]:s(l)}return Se(this,Tr)&&n.nodes().forEach(i=>n.setParent(i,s(i))),n}setDefaultEdgeLabel(t){return Jr(this,dc,t),typeof t!="function"&&Jr(this,dc,()=>t),this}edgeCount(){return Se(this,pc)}edges(){return Object.values(Se(this,Fs))}setPath(t,n){var r=this,o=arguments;return t.reduce(function(s,i){return o.length>1?r.setEdge(s,i,n):r.setEdge(s,i),i}),this}setEdge(){var t,n,r,o,s=!1,i=arguments[0];typeof i=="object"&&i!==null&&"v"in i?(t=i.v,n=i.w,r=i.name,arguments.length===2&&(o=arguments[1],s=!0)):(t=i,n=arguments[1],r=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),t=""+t,n=""+n,r!==void 0&&(r=""+r);var l=Nu(Se(this,wr),t,n,r);if(Se(this,Bs).hasOwnProperty(l))return s&&(Se(this,Bs)[l]=o),this;if(r!==void 0&&!Se(this,Si))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),Se(this,Bs)[l]=s?o:Se(this,dc).call(this,t,n,r);var f=ude(Se(this,wr),t,n,r);return t=f.v,n=f.w,Object.freeze(f),Se(this,Fs)[l]=f,ej(Se(this,Na)[n],t),ej(Se(this,Ta)[t],n),Se(this,as)[n][l]=f,Se(this,is)[t][l]=f,vu(this,pc)._++,this}edge(t,n,r){var o=arguments.length===1?qv(Se(this,wr),arguments[0]):Nu(Se(this,wr),t,n,r);return Se(this,Bs)[o]}edgeAsObj(){const t=this.edge(...arguments);return typeof t!="object"?{label:t}:t}hasEdge(t,n,r){var o=arguments.length===1?qv(Se(this,wr),arguments[0]):Nu(Se(this,wr),t,n,r);return Se(this,Bs).hasOwnProperty(o)}removeEdge(t,n,r){var o=arguments.length===1?qv(Se(this,wr),arguments[0]):Nu(Se(this,wr),t,n,r),s=Se(this,Fs)[o];return s&&(t=s.v,n=s.w,delete Se(this,Bs)[o],delete Se(this,Fs)[o],tj(Se(this,Na)[n],t),tj(Se(this,Ta)[t],n),delete Se(this,as)[n][o],delete Se(this,is)[t][o],vu(this,pc)._--),this}inEdges(t,n){var r=Se(this,as)[t];if(r){var o=Object.values(r);return n?o.filter(s=>s.v===n):o}}outEdges(t,n){var r=Se(this,is)[t];if(r){var o=Object.values(r);return n?o.filter(s=>s.w===n):o}}nodeEdges(t,n){var r=this.inEdges(t,n);if(r)return r.concat(this.outEdges(t,n))}},wr=new WeakMap,Si=new WeakMap,Tr=new WeakMap,fd=new WeakMap,uc=new WeakMap,dc=new WeakMap,no=new WeakMap,as=new WeakMap,Na=new WeakMap,is=new WeakMap,Ta=new WeakMap,Fs=new WeakMap,Bs=new WeakMap,fc=new WeakMap,pc=new WeakMap,Hs=new WeakMap,Eo=new WeakMap,pd=new WeakSet,kx=function(t){delete Se(this,Eo)[Se(this,Hs)[t]][t]},vj);function ej(e,t){e[t]?e[t]++:e[t]=1}function tj(e,t){--e[t]||delete e[t]}function Nu(e,t,n,r){var o=""+t,s=""+n;if(!e&&o>s){var i=o;o=s,s=i}return o+J_+s+J_+(r===void 0?lde:r)}function ude(e,t,n,r){var o=""+t,s=""+n;if(!e&&o>s){var i=o;o=s,s=i}var l={v:o,w:s};return r&&(l.name=r),l}function qv(e,t){return Nu(e,t.v,t.w,t.name)}var Vy=cde,dde="2.1.13",fde={Graph:Vy,version:dde},pde=Vy,hde={write:mde,read:xde};function mde(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:gde(e),edges:vde(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function gde(e){return e.nodes().map(function(t){var n=e.node(t),r=e.parent(t),o={v:t};return n!==void 0&&(o.value=n),r!==void 0&&(o.parent=r),o})}function vde(e){return e.edges().map(function(t){var n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function xde(e){var t=new pde(e.options).setGraph(e.value);return e.nodes.forEach(function(n){t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(function(n){t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var bde=yde;function yde(e){var t={},n=[],r;function o(s){t.hasOwnProperty(s)||(t[s]=!0,r.push(s),e.successors(s).forEach(o),e.predecessors(s).forEach(o))}return e.nodes().forEach(function(s){r=[],o(s),r.length&&n.push(r)}),n}var Zn,Ws,hd,_x,md,jx,hc,Fp,xj;let Cde=(xj=class{constructor(){Jt(this,hd);Jt(this,md);Jt(this,hc);Jt(this,Zn,[]);Jt(this,Ws,{})}size(){return Se(this,Zn).length}keys(){return Se(this,Zn).map(function(t){return t.key})}has(t){return Se(this,Ws).hasOwnProperty(t)}priority(t){var n=Se(this,Ws)[t];if(n!==void 0)return Se(this,Zn)[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return Se(this,Zn)[0].key}add(t,n){var r=Se(this,Ws);if(t=String(t),!r.hasOwnProperty(t)){var o=Se(this,Zn),s=o.length;return r[t]=s,o.push({key:t,priority:n}),os(this,md,jx).call(this,s),!0}return!1}removeMin(){os(this,hc,Fp).call(this,0,Se(this,Zn).length-1);var t=Se(this,Zn).pop();return delete Se(this,Ws)[t.key],os(this,hd,_x).call(this,0),t.key}decrease(t,n){var r=Se(this,Ws)[t];if(n>Se(this,Zn)[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+Se(this,Zn)[r].priority+" New: "+n);Se(this,Zn)[r].priority=n,os(this,md,jx).call(this,r)}},Zn=new WeakMap,Ws=new WeakMap,hd=new WeakSet,_x=function(t){var n=Se(this,Zn),r=2*t,o=r+1,s=t;r<n.length&&(s=n[r].priority<n[s].priority?r:s,o<n.length&&(s=n[o].priority<n[s].priority?o:s),s!==t&&(os(this,hc,Fp).call(this,t,s),os(this,hd,_x).call(this,s)))},md=new WeakSet,jx=function(t){for(var n=Se(this,Zn),r=n[t].priority,o;t!==0&&(o=t>>1,!(n[o].priority<r));)os(this,hc,Fp).call(this,t,o),t=o},hc=new WeakSet,Fp=function(t,n){var r=Se(this,Zn),o=Se(this,Ws),s=r[t],i=r[n];r[t]=i,r[n]=s,o[i.key]=t,o[s.key]=n},xj);var BO=Cde,wde=BO,HO=kde,Sde=()=>1;function kde(e,t,n,r){return _de(e,String(t),n||Sde,r||function(o){return e.outEdges(o)})}function _de(e,t,n,r){var o={},s=new wde,i,l,f=function(p){var h=p.v!==i?p.v:p.w,m=o[h],v=n(p),x=l.distance+v;if(v<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+v);x<m.distance&&(m.distance=x,m.predecessor=i,s.decrease(h,x))};for(e.nodes().forEach(function(p){var h=p===t?0:Number.POSITIVE_INFINITY;o[p]={distance:h},s.add(p,h)});s.size()>0&&(i=s.removeMin(),l=o[i],l.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(f);return o}var jde=HO,Pde=Ide;function Ide(e,t,n){return e.nodes().reduce(function(r,o){return r[o]=jde(e,o,t,n),r},{})}var WO=Ede;function Ede(e){var t=0,n=[],r={},o=[];function s(i){var l=r[i]={onStack:!0,lowlink:t,index:t++};if(n.push(i),e.successors(i).forEach(function(h){r.hasOwnProperty(h)?r[h].onStack&&(l.lowlink=Math.min(l.lowlink,r[h].index)):(s(h),l.lowlink=Math.min(l.lowlink,r[h].lowlink))}),l.lowlink===l.index){var f=[],p;do p=n.pop(),r[p].onStack=!1,f.push(p);while(i!==p);o.push(f)}}return e.nodes().forEach(function(i){r.hasOwnProperty(i)||s(i)}),o}var Mde=WO,Ode=Dde;function Dde(e){return Mde(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var Rde=Nde,Ade=()=>1;function Nde(e,t,n){return Tde(e,t||Ade,n||function(r){return e.outEdges(r)})}function Tde(e,t,n){var r={},o=e.nodes();return o.forEach(function(s){r[s]={},r[s][s]={distance:0},o.forEach(function(i){s!==i&&(r[s][i]={distance:Number.POSITIVE_INFINITY})}),n(s).forEach(function(i){var l=i.v===s?i.w:i.v,f=t(i);r[s][l]={distance:f,predecessor:s}})}),o.forEach(function(s){var i=r[s];o.forEach(function(l){var f=r[l];o.forEach(function(p){var h=f[s],m=i[p],v=f[p],x=h.distance+m.distance;x<v.distance&&(v.distance=x,v.predecessor=m.predecessor)})})}),r}function VO(e){var t={},n={},r=[];function o(s){if(n.hasOwnProperty(s))throw new Px;t.hasOwnProperty(s)||(n[s]=!0,t[s]=!0,e.predecessors(s).forEach(o),delete n[s],r.push(s))}if(e.sinks().forEach(o),Object.keys(t).length!==e.nodeCount())throw new Px;return r}class Px extends Error{constructor(){super(...arguments)}}var UO=VO;VO.CycleException=Px;var nj=UO,$de=Lde;function Lde(e){try{nj(e)}catch(t){if(t instanceof nj.CycleException)return!1;throw t}return!0}var GO=zde;function zde(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?l=>e.successors(l):l=>e.neighbors(l),o=n==="post"?Fde:Bde,s=[],i={};return t.forEach(l=>{if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);o(l,r,i,s)}),s}function Fde(e,t,n,r){for(var o=[[e,!1]];o.length>0;){var s=o.pop();s[1]?r.push(s[0]):n.hasOwnProperty(s[0])||(n[s[0]]=!0,o.push([s[0],!0]),KO(t(s[0]),i=>o.push([i,!1])))}}function Bde(e,t,n,r){for(var o=[e];o.length>0;){var s=o.pop();n.hasOwnProperty(s)||(n[s]=!0,r.push(s),KO(t(s),i=>o.push(i)))}}function KO(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var Hde=GO,Wde=Vde;function Vde(e,t){return Hde(e,t,"post")}var Ude=GO,Gde=Kde;function Kde(e,t){return Ude(e,t,"pre")}var qde=Vy,Xde=BO,Yde=Qde;function Qde(e,t){var n=new qde,r={},o=new Xde,s;function i(f){var p=f.v===s?f.w:f.v,h=o.priority(p);if(h!==void 0){var m=t(f);m<h&&(r[p]=s,o.decrease(p,m))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(f){o.add(f,Number.POSITIVE_INFINITY),n.setNode(f)}),o.decrease(e.nodes()[0],0);for(var l=!1;o.size()>0;){if(s=o.removeMin(),r.hasOwnProperty(s))n.setEdge(s,r[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(i)}return n}var Zde={components:bde,dijkstra:HO,dijkstraAll:Pde,findCycles:Ode,floydWarshall:Rde,isAcyclic:$de,postorder:Wde,preorder:Gde,prim:Yde,tarjan:WO,topsort:UO},rj=fde,Jde={Graph:rj.Graph,json:hde,alg:Zde,version:rj.version};const oj=Oc(Jde),efe=()=>{const e=Kx(),t=F(r=>r.nodes.shouldValidateGraph);return d.useCallback(({source:r,sourceHandle:o,target:s,targetHandle:i})=>{var x,C;if(!t)return!0;const l=e.getEdges(),f=e.getNodes();if(!(r&&o&&s&&i))return!1;const p=e.getNode(r),h=e.getNode(s);if(!(p&&h&&p.data&&h.data))return!1;const m=(x=p.data.outputs[o])==null?void 0:x.type,v=(C=h.data.inputs[i])==null?void 0:C.type;if(!m||!v||l.filter(b=>b.target===s&&b.targetHandle===i).find(b=>{b.source===r&&b.sourceHandle})||l.find(b=>b.target===s&&b.targetHandle===i)&&v!=="CollectionItem")return!1;if(m!==v){const b=m==="CollectionItem"&&!Us.includes(v),w=v==="CollectionItem"&&!Us.includes(m)&&!Gs.includes(m),k=Gs.includes(v)&&(()=>{if(!Gs.includes(v))return!1;const M=a3[v],E=i3[M];return m===M||m===E})(),_=m==="Collection"&&(Us.includes(v)||Gs.includes(v)),j=v==="Collection"&&Us.includes(m);return b||w||k||_||j||m==="integer"&&v==="float"}return qO(r,s,f,l)},[e,t])},qO=(e,t,n,r)=>{const o=new oj.Graph;return n.forEach(s=>{o.setNode(s.id)}),r.forEach(s=>{o.setEdge(s.source,s.target)}),o.setEdge(e,t),oj.alg.isAcyclic(o)},ud=e=>`var(--invokeai-colors-${e.split(".").join("-")})`,tfe=ae(xe,({nodes:e})=>{const{shouldAnimateEdges:t,currentConnectionFieldType:n,shouldColorEdges:r}=e,o=ud(n&&r?yd[n].color:"base.500");let s="react-flow__custom_connection-path";return t&&(s=s.concat(" animated")),{stroke:o,className:s}}),nfe=({fromX:e,fromY:t,fromPosition:n,toX:r,toY:o,toPosition:s})=>{const{stroke:i,className:l}=F(tfe),f={sourceX:e,sourceY:t,sourcePosition:n,targetX:r,targetY:o,targetPosition:s},[p]=qx(f);return a.jsx("g",{children:a.jsx("path",{fill:"none",stroke:i,strokeWidth:2,className:l,d:p,style:{opacity:.8}})})},rfe=d.memo(nfe),XO=(e,t,n,r,o)=>ae(xe,({nodes:s})=>{var v,x;const i=s.nodes.find(C=>C.id===e),l=s.nodes.find(C=>C.id===n),f=Cn(i)&&Cn(l),p=(i==null?void 0:i.selected)||(l==null?void 0:l.selected)||o,h=f?(x=(v=i==null?void 0:i.data)==null?void 0:v.outputs[t||""])==null?void 0:x.type:void 0,m=h&&s.shouldColorEdges?ud(yd[h].color):ud("base.500");return{isSelected:p,shouldAnimate:s.shouldAnimateEdges&&p,stroke:m}},Ce),ofe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,data:l,selected:f,source:p,target:h,sourceHandleId:m,targetHandleId:v})=>{const x=d.useMemo(()=>XO(p,m,h,v,f),[f,p,m,h,v]),{isSelected:C,shouldAnimate:b}=F(x),[w,k,_]=qx({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s}),{base500:j}=Bd();return a.jsxs(a.Fragment,{children:[a.jsx(l3,{path:w,markerEnd:i,style:{strokeWidth:C?3:2,stroke:j,opacity:C?.8:.5,animation:b?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:b?5:"none"}}),(l==null?void 0:l.count)&&l.count>1&&a.jsx(pA,{children:a.jsx(T,{sx:{position:"absolute",transform:`translate(-50%, -50%) translate(${k}px,${_}px)`},className:"nodrag nopan",children:a.jsx(ua,{variant:"solid",sx:{bg:"base.500",opacity:C?.8:.5,boxShadow:"base"},children:l.count})})})]})},sfe=d.memo(ofe),afe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,selected:l,source:f,target:p,sourceHandleId:h,targetHandleId:m})=>{const v=d.useMemo(()=>XO(f,h,p,m,l),[f,h,p,m,l]),{isSelected:x,shouldAnimate:C,stroke:b}=F(v),[w]=qx({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s});return a.jsx(l3,{path:w,markerEnd:i,style:{strokeWidth:x?3:2,stroke:b,opacity:x?.8:.5,animation:C?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:C?5:"none"}})},ife=d.memo(afe),lfe=e=>{const{nodeId:t,width:n,children:r,selected:o}=e,{isMouseOverNode:s,handleMouseOut:i,handleMouseOver:l}=rO(t),f=d.useMemo(()=>ae(xe,({nodes:_})=>{var j;return((j=_.nodeExecutionStates[t])==null?void 0:j.status)===Ks.IN_PROGRESS}),[t]),p=F(f),[h,m,v,x]=ds("shadows",["nodeInProgress.light","nodeInProgress.dark","shadows.xl","shadows.base"]),C=te(),b=Ti(h,m),w=F(_=>_.nodes.nodeOpacity),k=d.useCallback(_=>{!_.ctrlKey&&!_.altKey&&!_.metaKey&&!_.shiftKey&&C(hA(t)),C(c3())},[C,t]);return a.jsxs(Ie,{onClick:k,onMouseEnter:l,onMouseLeave:i,className:Xi,sx:{h:"full",position:"relative",borderRadius:"base",w:n??c1,transitionProperty:"common",transitionDuration:"0.1s",cursor:"grab",opacity:w},children:[a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",pointerEvents:"none",shadow:`${v}, ${x}, ${x}`,zIndex:-1}}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"md",pointerEvents:"none",transitionProperty:"common",transitionDuration:"normal",opacity:.7,shadow:p?b:void 0,zIndex:-1}}),r,a.jsx(nO,{isSelected:o,isHovered:s})]})},Eg=d.memo(lfe),cfe=ae(xe,({system:e,gallery:t})=>({imageDTO:t.selection[t.selection.length-1],progressImage:e.progressImage})),ufe=e=>{const{progressImage:t,imageDTO:n}=mA(cfe);return t?a.jsx(Xv,{nodeProps:e,children:a.jsx(qi,{src:t.dataURL,sx:{w:"full",h:"full",objectFit:"contain",borderRadius:"base"}})}):n?a.jsx(Xv,{nodeProps:e,children:a.jsx(Ya,{imageDTO:n,isDragDisabled:!0,useThumbailFallback:!0})}):a.jsx(Xv,{nodeProps:e,children:a.jsx(tr,{})})},dfe=d.memo(ufe),Xv=e=>{const[t,n]=d.useState(!1),r=()=>{n(!0)},o=()=>{n(!1)};return a.jsx(Eg,{nodeId:e.nodeProps.id,selected:e.nodeProps.selected,width:384,children:a.jsxs(T,{onMouseEnter:r,onMouseLeave:o,className:Xi,sx:{position:"relative",flexDirection:"column"},children:[a.jsx(T,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",alignItems:"center",justifyContent:"center",h:8},children:a.jsx(be,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",_dark:{color:"base.200"}},children:"Current Image"})}),a.jsxs(T,{layerStyle:"nodeBody",sx:{w:"full",h:"full",borderBottomRadius:"base",p:2},children:[e.children,t&&a.jsx(gn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},style:{position:"absolute",top:40,left:-2,right:-2,bottom:0,pointerEvents:"none"},children:a.jsx(DO,{})},"nextPrevButtons")]})]})})},ffe=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.embedWorkflow:!1},Ce),[e]);return F(t)},YO=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?Ro(o.data.outputs,s=>gA.includes(s.type)):!1},Ce),[e]);return F(t)},pfe=({nodeId:e})=>{const t=te(),n=YO(e),r=ffe(e),o=d.useCallback(s=>{t(vA({nodeId:e,embedWorkflow:s.target.checked}))},[t,e]);return n?a.jsxs(un,{as:T,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(Gn,{sx:{fontSize:"xs",mb:"1px"},children:"Embed Workflow"}),a.jsx(Cm,{className:"nopan",size:"sm",onChange:o,isChecked:r})]}):null},hfe=d.memo(pfe),mfe=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.isIntermediate:!1},Ce),[e]);return F(t)},gfe=({nodeId:e})=>{const t=te(),n=YO(e),r=mfe(e),o=d.useCallback(s=>{t(xA({nodeId:e,isIntermediate:!s.target.checked}))},[t,e]);return n?a.jsxs(un,{as:T,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(Gn,{sx:{fontSize:"xs",mb:"1px"},children:"Save to Gallery"}),a.jsx(Cm,{className:"nopan",size:"sm",onChange:o,isChecked:!r})]}):null},vfe=d.memo(gfe),xfe=({nodeId:e})=>a.jsxs(T,{className:Xi,layerStyle:"nodeFooter",sx:{w:"full",borderBottomRadius:"base",px:2,py:0,h:6,justifyContent:"space-between"},children:[a.jsx(hfe,{nodeId:e}),a.jsx(vfe,{nodeId:e})]}),bfe=d.memo(xfe),yfe=({nodeId:e,isOpen:t})=>{const n=te(),r=bA(),o=d.useCallback(()=>{n(yA({nodeId:e,isOpen:!t})),r(e)},[n,t,e,r]);return a.jsx(Te,{className:"nodrag",onClick:o,"aria-label":"Minimize",sx:{minW:8,w:8,h:8,color:"base.500",_dark:{color:"base.500"},_hover:{color:"base.700",_dark:{color:"base.300"}}},variant:"link",icon:a.jsx(cg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})})},Uy=d.memo(yfe),QO=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.label:!1},Ce),[e]);return F(t)},ZO=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return!1;const s=o?r.nodeTemplates[o.data.type]:void 0;return s==null?void 0:s.title},Ce),[e]);return F(t)},Cfe=({nodeId:e,title:t})=>{const n=te(),r=QO(e),o=ZO(e),[s,i]=d.useState(""),l=d.useCallback(async p=>{n(CA({nodeId:e,label:p})),i(p||t||o||"Problem Setting Title")},[n,e,t,o]),f=d.useCallback(p=>{i(p)},[]);return d.useEffect(()=>{i(r||t||o||"Problem Setting Title")},[r,o,t]),a.jsx(T,{sx:{overflow:"hidden",w:"full",h:"full",alignItems:"center",justifyContent:"center",cursor:"text"},children:a.jsxs(km,{as:T,value:s,onChange:f,onSubmit:l,sx:{alignItems:"center",position:"relative",w:"full",h:"full"},children:[a.jsx(Sm,{fontSize:"sm",sx:{p:0,w:"full"},noOfLines:1}),a.jsx(wm,{className:"nodrag",fontSize:"sm",sx:{p:0,fontWeight:700,_focusVisible:{p:0,boxShadow:"none"}}}),a.jsx(wfe,{})]})})},JO=d.memo(Cfe);function wfe(){const{isEditing:e,getEditButtonProps:t}=B3(),n=d.useCallback(r=>{const{onClick:o}=t();o&&o(r)},[t]);return e?null:a.jsx(Ie,{className:Xi,onDoubleClick:n,sx:{position:"absolute",w:"full",h:"full",top:0,cursor:"grab"}})}const Gy=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return o==null?void 0:o.data},Ce),[e]);return F(t)},Sfe=({nodeId:e})=>{const t=Gy(e),{base400:n,base600:r}=Bd(),o=Ti(n,r),s=d.useMemo(()=>({borderWidth:0,borderRadius:"3px",width:"1rem",height:"1rem",backgroundColor:o,zIndex:-1}),[o]);return Kp(t)?a.jsxs(a.Fragment,{children:[a.jsx(Mu,{type:"target",id:`${t.id}-collapsed-target`,isConnectable:!1,position:Hl.Left,style:{...s,left:"-0.5rem"}}),rr(t.inputs,i=>a.jsx(Mu,{type:"target",id:i.name,isConnectable:!1,position:Hl.Left,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-input-handle`)),a.jsx(Mu,{type:"source",id:`${t.id}-collapsed-source`,isConnectable:!1,position:Hl.Right,style:{...s,right:"-0.5rem"}}),rr(t.outputs,i=>a.jsx(Mu,{type:"source",id:i.name,isConnectable:!1,position:Hl.Right,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-output-handle`))]}):null},kfe=d.memo(Sfe),_fe=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);return r.nodeTemplates[(o==null?void 0:o.data.type)??""]},Ce),[e]);return F(t)},jfe=({nodeId:e})=>{const t=te(),n=Gy(e),r=d.useCallback(o=>{t(wA({nodeId:e,notes:o.target.value}))},[t,e]);return Kp(n)?a.jsxs(un,{children:[a.jsx(Gn,{children:"Notes"}),a.jsx(oa,{value:n==null?void 0:n.notes,onChange:r,rows:10})]}):null},Pfe=d.memo(jfe),Ife=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{var i;const o=r.nodes.find(l=>l.id===e);if(!Cn(o))return!1;const s=r.nodeTemplates[(o==null?void 0:o.data.type)??""];return!(s!=null&&s.version)||!((i=o.data)!=null&&i.version)?!1:_j(s.version,o.data.version)===0},Ce),[e]);return F(t)},Efe=({nodeId:e})=>{const{isOpen:t,onOpen:n,onClose:r}=Er(),o=QO(e),s=ZO(e),i=Ife(e);return a.jsxs(a.Fragment,{children:[a.jsx(Dt,{label:a.jsx(e8,{nodeId:e}),placement:"top",shouldWrapChildren:!0,children:a.jsx(T,{className:"nodrag",onClick:n,sx:{alignItems:"center",justifyContent:"center",w:8,h:8,cursor:"pointer"},children:a.jsx(An,{as:EE,sx:{boxSize:4,w:8,color:i?"base.400":"error.400"}})})}),a.jsxs(Fi,{isOpen:t,onClose:r,isCentered:!0,children:[a.jsx(Wo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{children:o||s||"Unknown Node"}),a.jsx(Td,{}),a.jsx(Vo,{children:a.jsx(Pfe,{nodeId:e})}),a.jsx(gs,{})]})]})]})},Mfe=d.memo(Efe),e8=d.memo(({nodeId:e})=>{const t=Gy(e),n=_fe(e),r=d.useMemo(()=>t!=null&&t.label&&(n!=null&&n.title)?`${t.label} (${n.title})`:t!=null&&t.label&&!n?t.label:!(t!=null&&t.label)&&n?n.title:"Unknown Node",[t,n]),o=d.useMemo(()=>!Kp(t)||!n?null:t.version?n.version?Sw(t.version,n.version,"<")?a.jsxs(be,{as:"span",sx:{color:"error.500"},children:["Version ",t.version," (update node)"]}):Sw(t.version,n.version,">")?a.jsxs(be,{as:"span",sx:{color:"error.500"},children:["Version ",t.version," (update app)"]}):a.jsxs(be,{as:"span",children:["Version ",t.version]}):a.jsxs(be,{as:"span",sx:{color:"error.500"},children:["Version ",t.version," (unknown template)"]}):a.jsx(be,{as:"span",sx:{color:"error.500"},children:"Version unknown"}),[t,n]);return Kp(t)?a.jsxs(T,{sx:{flexDir:"column"},children:[a.jsx(be,{as:"span",sx:{fontWeight:600},children:r}),a.jsx(be,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:n==null?void 0:n.description}),o,(t==null?void 0:t.notes)&&a.jsx(be,{children:t.notes})]}):a.jsx(be,{sx:{fontWeight:600},children:"Unknown Node"})});e8.displayName="TooltipContent";const Yv=3,sj={circle:{transitionProperty:"none",transitionDuration:"0s"},".chakra-progress__track":{stroke:"transparent"}},Ofe=({nodeId:e})=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>r.nodeExecutionStates[e]),[e]),n=F(t);return n?a.jsx(Dt,{label:a.jsx(t8,{nodeExecutionState:n}),placement:"top",children:a.jsx(T,{className:Xi,sx:{w:5,h:"full",alignItems:"center",justifyContent:"flex-end"},children:a.jsx(n8,{nodeExecutionState:n})})}):null},Dfe=d.memo(Ofe),t8=d.memo(({nodeExecutionState:e})=>{const{status:t,progress:n,progressImage:r}=e;return t===Ks.PENDING?a.jsx(be,{children:"Pending"}):t===Ks.IN_PROGRESS?r?a.jsxs(T,{sx:{pos:"relative",pt:1.5,pb:.5},children:[a.jsx(qi,{src:r.dataURL,sx:{w:32,h:32,borderRadius:"base",objectFit:"contain"}}),n!==null&&a.jsxs(ua,{variant:"solid",sx:{pos:"absolute",top:2.5,insetInlineEnd:1},children:[Math.round(n*100),"%"]})]}):n!==null?a.jsxs(be,{children:["In Progress (",Math.round(n*100),"%)"]}):a.jsx(be,{children:"In Progress"}):t===Ks.COMPLETED?a.jsx(be,{children:"Completed"}):t===Ks.FAILED?a.jsx(be,{children:"nodeExecutionState.error"}):null});t8.displayName="TooltipLabel";const n8=d.memo(e=>{const{progress:t,status:n}=e.nodeExecutionState;return n===Ks.PENDING?a.jsx(An,{as:dZ,sx:{boxSize:Yv,color:"base.600",_dark:{color:"base.300"}}}):n===Ks.IN_PROGRESS?t===null?a.jsx(R1,{isIndeterminate:!0,size:"14px",color:"base.500",thickness:14,sx:sj}):a.jsx(R1,{value:Math.round(t*100),size:"14px",color:"base.500",thickness:14,sx:sj}):n===Ks.COMPLETED?a.jsx(An,{as:kE,sx:{boxSize:Yv,color:"ok.600",_dark:{color:"ok.300"}}}):n===Ks.FAILED?a.jsx(An,{as:hZ,sx:{boxSize:Yv,color:"error.600",_dark:{color:"error.300"}}}):null});n8.displayName="StatusIcon";const Rfe=({nodeId:e,isOpen:t})=>a.jsxs(T,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",justifyContent:"space-between",h:8,textAlign:"center",fontWeight:500,color:"base.700",_dark:{color:"base.200"}},children:[a.jsx(Uy,{nodeId:e,isOpen:t}),a.jsx(JO,{nodeId:e}),a.jsxs(T,{alignItems:"center",children:[a.jsx(Dfe,{nodeId:e}),a.jsx(Mfe,{nodeId:e})]}),!t&&a.jsx(kfe,{nodeId:e})]}),Afe=d.memo(Rfe),Nfe=(e,t,n,r)=>ae(xe,o=>{if(!r)return"No field type";const{currentConnectionFieldType:s,connectionStartParams:i,nodes:l,edges:f}=o.nodes;if(!i||!s)return"No connection in progress";const{handleType:p,nodeId:h,handleId:m}=i;if(!p||!h||!m)return"No connection data";const v=n==="target"?r:s,x=n==="source"?r:s;if(e===h)return"Cannot connect to self";if(n===p)return n==="source"?"Cannot connect output to output":"Cannot connect input to input";if(f.find(b=>b.target===e&&b.targetHandle===t)&&v!=="CollectionItem")return"Input may only have one connection";if(x!==v){const b=x==="CollectionItem"&&!Us.includes(v),w=v==="CollectionItem"&&!Us.includes(x)&&!Gs.includes(x),k=Gs.includes(v)&&(()=>{if(!Gs.includes(v))return!1;const M=a3[v],E=i3[M];return x===M||x===E})(),_=x==="Collection"&&(Us.includes(v)||Gs.includes(v)),j=v==="Collection"&&Us.includes(x);if(!(b||w||k||_||j||x==="integer"&&v==="float"))return"Field types must match"}return qO(p==="source"?h:e,p==="source"?e:h,l,f)?null:"Connection would create a cycle"}),Tfe=(e,t,n)=>{const r=d.useMemo(()=>ae(xe,({nodes:s})=>{var l;const i=s.nodes.find(f=>f.id===e);if(Cn(i))return(l=i==null?void 0:i.data[Wx[n]][t])==null?void 0:l.type},Ce),[t,n,e]);return F(r)},$fe=ae(xe,({nodes:e})=>e.currentConnectionFieldType!==null&&e.connectionStartParams!==null),r8=({nodeId:e,fieldName:t,kind:n})=>{const r=Tfe(e,t,n),o=d.useMemo(()=>ae(xe,({nodes:v})=>!!v.edges.filter(x=>(n==="input"?x.target:x.source)===e&&(n==="input"?x.targetHandle:x.sourceHandle)===t).length),[t,n,e]),s=d.useMemo(()=>Nfe(e,t,n==="input"?"target":"source",r),[e,t,n,r]),i=d.useMemo(()=>ae(xe,({nodes:v})=>{var x,C,b;return((x=v.connectionStartParams)==null?void 0:x.nodeId)===e&&((C=v.connectionStartParams)==null?void 0:C.handleId)===t&&((b=v.connectionStartParams)==null?void 0:b.handleType)==={input:"target",output:"source"}[n]}),[t,n,e]),l=F(o),f=F($fe),p=F(i),h=F(s),m=d.useMemo(()=>!!(f&&h&&!p),[h,f,p]);return{isConnected:l,isConnectionInProgress:f,isConnectionStartField:p,connectionError:h,shouldDim:m}},Lfe=e=>{const{fieldTemplate:t,handleType:n,isConnectionInProgress:r,isConnectionStartField:o,connectionError:s}=e,{name:i,type:l}=t,{color:f,title:p}=yd[l],h=d.useMemo(()=>{const v=Us.includes(l),x=Gs.includes(l),C=SA.includes(l),b=ud(f),w={backgroundColor:v||x?"var(--invokeai-colors-base-900)":b,position:"absolute",width:"1rem",height:"1rem",borderWidth:v||x?4:0,borderStyle:"solid",borderColor:b,borderRadius:C?4:"100%",zIndex:1};return n==="target"?w.insetInlineStart="-1rem":w.insetInlineEnd="-1rem",r&&!o&&s&&(w.filter="opacity(0.4) grayscale(0.7)"),r&&s?o?w.cursor="grab":w.cursor="not-allowed":w.cursor="crosshair",w},[s,n,r,o,l,f]),m=d.useMemo(()=>r&&o?p:r&&s?s??p:p,[s,r,o,p]);return a.jsx(Dt,{label:m,placement:n==="target"?"start":"end",hasArrow:!0,openDelay:gm,children:a.jsx(Mu,{type:n,id:i,position:n==="target"?Hl.Left:Hl.Right,style:h})})},o8=d.memo(Lfe),zfe=({nodeId:e,fieldName:t})=>{const n=Cg(e,t,"output"),{isConnected:r,isConnectionInProgress:o,isConnectionStartField:s,connectionError:i,shouldDim:l}=r8({nodeId:e,fieldName:t,kind:"output"});return(n==null?void 0:n.fieldKind)!=="output"?a.jsx(Ix,{shouldDim:l,children:a.jsxs(un,{sx:{color:"error.400",textAlign:"right",fontSize:"sm"},children:["Unknown output: ",t]})}):a.jsxs(Ix,{shouldDim:l,children:[a.jsx(Dt,{label:a.jsx(Ay,{nodeId:e,fieldName:t,kind:"output"}),openDelay:gm,placement:"top",shouldWrapChildren:!0,hasArrow:!0,children:a.jsx(un,{isDisabled:r,pe:2,children:a.jsx(Gn,{sx:{mb:0,fontWeight:500},children:n==null?void 0:n.title})})}),a.jsx(o8,{fieldTemplate:n,handleType:"source",isConnectionInProgress:o,isConnectionStartField:s,connectionError:i})]})},Ffe=d.memo(zfe),Ix=d.memo(({shouldDim:e,children:t})=>a.jsx(T,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",justifyContent:"flex-end"},children:t}));Ix.displayName="OutputFieldWrapper";const Bfe=(e,t)=>{const n=d.useMemo(()=>ae(xe,({nodes:o})=>{var i;const s=o.nodes.find(l=>l.id===e);if(Cn(s))return((i=s==null?void 0:s.data.inputs[t])==null?void 0:i.value)!==void 0},Ce),[t,e]);return F(n)},Hfe=(e,t)=>{const n=d.useMemo(()=>ae(xe,({nodes:o})=>{const s=o.nodes.find(f=>f.id===e);if(!Cn(s))return;const i=o.nodeTemplates[(s==null?void 0:s.data.type)??""],l=i==null?void 0:i.inputs[t];return l==null?void 0:l.input},Ce),[t,e]);return F(n)},Wfe=({nodeId:e,fieldName:t,kind:n,children:r})=>{const o=te(),s=oO(e,t),i=sO(e,t,n),l=Hfe(e,t),f=d.useCallback(b=>{b.preventDefault()},[]),p=d.useMemo(()=>ae(xe,({nodes:b})=>({isExposed:!!b.workflow.exposedFields.find(k=>k.nodeId===e&&k.fieldName===t)}),Ce),[t,e]),h=d.useMemo(()=>["any","direct"].includes(l??"__UNKNOWN_INPUT__"),[l]),{isExposed:m}=F(p),v=d.useCallback(()=>{o(kA({nodeId:e,fieldName:t}))},[o,t,e]),x=d.useCallback(()=>{o(qj({nodeId:e,fieldName:t}))},[o,t,e]),C=d.useMemo(()=>{const b=[];return h&&!m&&b.push(a.jsx(Ht,{icon:a.jsx(tl,{}),onClick:v,children:"Add to Linear View"},`${e}.${t}.expose-field`)),h&&m&&b.push(a.jsx(Ht,{icon:a.jsx(PZ,{}),onClick:x,children:"Remove from Linear View"},`${e}.${t}.unexpose-field`)),b},[t,v,x,m,h,e]);return a.jsx(yy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>C.length?a.jsx(Ga,{sx:{visibility:"visible !important"},motionProps:mc,onContextMenu:f,children:a.jsx(Cc,{title:s||i||"Unknown Field",children:C})}):null,children:r})},Vfe=d.memo(Wfe),Ufe=({nodeId:e,fieldName:t})=>{const n=Cg(e,t,"input"),r=Bfe(e,t),{isConnected:o,isConnectionInProgress:s,isConnectionStartField:i,connectionError:l,shouldDim:f}=r8({nodeId:e,fieldName:t,kind:"input"}),p=d.useMemo(()=>{if((n==null?void 0:n.fieldKind)!=="input"||!n.required)return!1;if(!o&&n.input==="connection"||!r&&!o&&n.input==="any")return!0},[n,o,r]);return(n==null?void 0:n.fieldKind)!=="input"?a.jsx(Ex,{shouldDim:f,children:a.jsxs(un,{sx:{color:"error.400",textAlign:"left",fontSize:"sm"},children:["Unknown input: ",t]})}):a.jsxs(Ex,{shouldDim:f,children:[a.jsxs(un,{isInvalid:p,isDisabled:o,sx:{alignItems:"stretch",justifyContent:"space-between",ps:n.input==="direct"?0:2,gap:2,h:"full",w:"full"},children:[a.jsx(Vfe,{nodeId:e,fieldName:t,kind:"input",children:h=>a.jsx(Gn,{sx:{display:"flex",alignItems:"center",h:"full",mb:0,px:1,gap:2},children:a.jsx(iO,{ref:h,nodeId:e,fieldName:t,kind:"input",isMissingInput:p,withTooltip:!0})})}),a.jsx(Ie,{children:a.jsx(vO,{nodeId:e,fieldName:t})})]}),n.input!=="direct"&&a.jsx(o8,{fieldTemplate:n,handleType:"target",isConnectionInProgress:s,isConnectionStartField:i,connectionError:l})]})},aj=d.memo(Ufe),Ex=d.memo(({shouldDim:e,children:t})=>a.jsx(T,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",w:"full",h:"full"},children:t}));Ex.displayName="InputFieldWrapper";const Gfe=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return[];const s=r.nodeTemplates[o.data.type];return s?rr(s.outputs).filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Ce),[e]);return F(t)},Kfe=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?Ro(o.data.outputs,s=>_A.includes(s.type)):!1},Ce),[e]);return F(t)},qfe=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return[];const s=r.nodeTemplates[o.data.type];return s?rr(s.inputs).filter(i=>i.input==="connection").filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Ce),[e]);return F(t)},Xfe=e=>{const t=d.useMemo(()=>ae(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return[];const s=r.nodeTemplates[o.data.type];return s?rr(s.inputs).filter(i=>["any","direct"].includes(i.input)).filter(i=>!i.ui_hidden).sort((i,l)=>(i.ui_order??0)-(l.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Ce),[e]);return F(t)},Yfe=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>{const s=qfe(e),i=Xfe(e),l=Gfe(e),f=Kfe(e);return a.jsxs(Eg,{nodeId:e,selected:o,children:[a.jsx(Afe,{nodeId:e,isOpen:t,label:n,selected:o,type:r}),t&&a.jsxs(a.Fragment,{children:[a.jsx(T,{layerStyle:"nodeBody",sx:{flexDirection:"column",w:"full",h:"full",py:2,gap:1,borderBottomRadius:f?0:"base"},children:a.jsxs(T,{sx:{flexDir:"column",px:2,w:"full",h:"full"},children:[a.jsxs(Ua,{gridTemplateColumns:"1fr auto",gridAutoRows:"1fr",children:[s.map((p,h)=>a.jsx(ed,{gridColumnStart:1,gridRowStart:h+1,children:a.jsx(aj,{nodeId:e,fieldName:p})},`${e}.${p}.input-field`)),l.map((p,h)=>a.jsx(ed,{gridColumnStart:2,gridRowStart:h+1,children:a.jsx(Ffe,{nodeId:e,fieldName:p})},`${e}.${p}.output-field`))]}),i.map(p=>a.jsx(aj,{nodeId:e,fieldName:p},`${e}.${p}.input-field`))]})}),f&&a.jsx(bfe,{nodeId:e})]})]})},Qfe=d.memo(Yfe),Zfe=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>a.jsxs(Eg,{nodeId:e,selected:o,children:[a.jsxs(T,{className:Xi,layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",h:8,fontWeight:600,fontSize:"sm"},children:[a.jsx(Uy,{nodeId:e,isOpen:t}),a.jsx(be,{sx:{w:"full",textAlign:"center",pe:8,color:"error.500",_dark:{color:"error.300"}},children:n?`${n} (${r})`:r})]}),t&&a.jsx(T,{layerStyle:"nodeBody",sx:{userSelect:"auto",flexDirection:"column",w:"full",h:"full",p:4,gap:1,borderBottomRadius:"base",fontSize:"sm"},children:a.jsxs(Ie,{children:[a.jsx(be,{as:"span",children:"Unknown node type: "}),a.jsx(be,{as:"span",fontWeight:600,children:r})]})})]}),Jfe=d.memo(Zfe),epe=e=>{const{data:t,selected:n}=e,{id:r,type:o,isOpen:s,label:i}=t,l=d.useMemo(()=>ae(xe,({nodes:p})=>!!p.nodeTemplates[o]),[o]);return F(l)?a.jsx(Qfe,{nodeId:r,isOpen:s,label:i,type:o,selected:n}):a.jsx(Jfe,{nodeId:r,isOpen:s,label:i,type:o,selected:n})},tpe=d.memo(epe),npe=e=>{const{id:t,data:n,selected:r}=e,{notes:o,isOpen:s}=n,i=te(),l=d.useCallback(f=>{i(jA({nodeId:t,value:f.target.value}))},[i,t]);return a.jsxs(Eg,{nodeId:t,selected:r,children:[a.jsxs(T,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:s?0:"base",alignItems:"center",justifyContent:"space-between",h:8},children:[a.jsx(Uy,{nodeId:t,isOpen:s}),a.jsx(JO,{nodeId:t,title:"Notes"}),a.jsx(Ie,{minW:8})]}),s&&a.jsx(a.Fragment,{children:a.jsx(T,{layerStyle:"nodeBody",className:"nopan",sx:{cursor:"auto",flexDirection:"column",borderBottomRadius:"base",w:"full",h:"full",p:2,gap:1},children:a.jsx(T,{className:"nopan",sx:{flexDir:"column",w:"full",h:"full"},children:a.jsx(oa,{value:o,onChange:l,rows:8,resize:"none",sx:{fontSize:"xs"}})})})})]})},rpe=d.memo(npe),ope=["Delete","Backspace"],spe={collapsed:sfe,default:ife},ape={invocation:tpe,current_image:dfe,notes:rpe},ipe={hideAttribution:!0},lpe=ae(xe,({nodes:e})=>{const{shouldSnapToGrid:t,selectionMode:n}=e;return{shouldSnapToGrid:t,selectionMode:n}},Ce),cpe=()=>{const e=te(),t=F(j=>j.nodes.nodes),n=F(j=>j.nodes.edges),r=F(j=>j.nodes.viewport),{shouldSnapToGrid:o,selectionMode:s}=F(lpe),i=efe(),[l]=ds("radii",["base"]),f=d.useCallback(j=>{e(PA(j))},[e]),p=d.useCallback(j=>{e(IA(j))},[e]),h=d.useCallback((j,I)=>{e(EA(I))},[e]),m=d.useCallback(j=>{e(MA(j))},[e]),v=d.useCallback(()=>{e(OA())},[e]),x=d.useCallback(j=>{e(DA(j))},[e]),C=d.useCallback(j=>{e(RA(j))},[e]),b=d.useCallback(({nodes:j,edges:I})=>{e(AA(j?j.map(M=>M.id):[])),e(NA(I?I.map(M=>M.id):[]))},[e]),w=d.useCallback((j,I)=>{e(TA(I))},[e]),k=d.useCallback(()=>{e(c3())},[e]),_=d.useCallback(j=>{$A.set(j),j.fitView()},[]);return Qe(["Ctrl+c","Meta+c"],j=>{j.preventDefault(),e(LA())}),Qe(["Ctrl+a","Meta+a"],j=>{j.preventDefault(),e(zA())}),Qe(["Ctrl+v","Meta+v"],j=>{j.preventDefault(),e(FA())}),a.jsx(BA,{id:"workflow-editor",defaultViewport:r,nodeTypes:ape,edgeTypes:spe,nodes:t,edges:n,onInit:_,onNodesChange:f,onEdgesChange:p,onEdgesDelete:x,onNodesDelete:C,onConnectStart:h,onConnect:m,onConnectEnd:v,onMoveEnd:w,connectionLineComponent:rfe,onSelectionChange:b,isValidConnection:i,minZoom:.1,snapToGrid:o,snapGrid:[25,25],connectionRadius:30,proOptions:ipe,style:{borderRadius:l},onPaneClick:k,deleteKeyCode:ope,selectionMode:s,children:a.jsx(GN,{})})},upe=()=>{const e=te(),t=d.useCallback(()=>{e(s3())},[e]);return a.jsx(T,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:2},children:a.jsx(Te,{tooltip:"Add Node (Shift+A, Space)","aria-label":"Add Node",icon:a.jsx(tl,{}),onClick:t})})},dpe=d.memo(upe),fpe=()=>{const e=te(),t=DP("nodes");return d.useCallback(r=>{if(!r)return;const o=new FileReader;o.onload=async()=>{const s=o.result;try{const i=JSON.parse(String(s)),l=HA.safeParse(i);if(!l.success){const{message:f}=WA(l.error,{prefix:"Workflow Validation Error"});t.error({error:VA(l.error)},f),e(Nt(zt({title:"Unable to Validate Workflow",status:"error",duration:5e3}))),o.abort();return}e(Bx(l.data)),o.abort()}catch{e(Nt(zt({title:"Unable to Load Workflow",status:"error"})))}},o.readAsText(r)},[e,t])},ppe=d.memo(e=>e.error.issues[0]?a.jsx(be,{children:pw(e.error.issues[0],{prefix:null}).toString()}):a.jsx(Id,{children:e.error.issues.map((t,n)=>a.jsx(No,{children:a.jsx(be,{children:pw(t,{prefix:null}).toString()})},n))}));ppe.displayName="WorkflowValidationErrorContent";const hpe=()=>{const{t:e}=we(),t=d.useRef(null),n=fpe();return a.jsx(JI,{resetRef:t,accept:"application/json",onChange:n,children:r=>a.jsx(Te,{icon:a.jsx(ng,{}),tooltip:e("nodes.loadWorkflow"),"aria-label":e("nodes.loadWorkflow"),...r})})},mpe=d.memo(hpe),gpe=()=>{const{t:e}=we(),t=te(),{isOpen:n,onOpen:r,onClose:o}=Er(),s=d.useRef(null),i=F(f=>f.nodes.nodes.length),l=d.useCallback(()=>{t(UA()),t(Nt(zt({title:e("toast.nodesCleared"),status:"success"}))),o()},[t,e,o]);return a.jsxs(a.Fragment,{children:[a.jsx(Te,{icon:a.jsx(Wr,{}),tooltip:e("nodes.resetWorkflow"),"aria-label":e("nodes.resetWorkflow"),onClick:r,isDisabled:!i,colorScheme:"error"}),a.jsxs(Ad,{isOpen:n,onClose:o,leastDestructiveRef:s,isCentered:!0,children:[a.jsx(Wo,{}),a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:e("nodes.resetWorkflow")}),a.jsx(Vo,{py:4,children:a.jsxs(T,{flexDir:"column",gap:2,children:[a.jsx(be,{children:e("nodes.resetWorkflowDesc")}),a.jsx(be,{variant:"subtext",children:e("nodes.resetWorkflowDesc2")})]})}),a.jsxs(gs,{children:[a.jsx(gc,{ref:s,onClick:o,children:e("common.cancel")}),a.jsx(gc,{colorScheme:"error",ml:3,onClick:l,children:e("common.accept")})]})]})]})]})},vpe=d.memo(gpe),xpe=()=>{const{t:e}=we(),t=tO(),n=d.useCallback(()=>{const r=new Blob([JSON.stringify(t,null,2)]),o=document.createElement("a");o.href=URL.createObjectURL(r),o.download=`${t.name||"My Workflow"}.json`,document.body.appendChild(o),o.click(),o.remove()},[t]);return a.jsx(Te,{icon:a.jsx(Jm,{}),tooltip:e("nodes.downloadWorkflow"),"aria-label":e("nodes.downloadWorkflow"),onClick:n})},bpe=d.memo(xpe),ype=()=>a.jsxs(T,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:"50%",transform:"translate(-50%)"},children:[a.jsx(bpe,{}),a.jsx(mpe,{}),a.jsx(vpe,{})]}),Cpe=d.memo(ype),wpe=()=>a.jsx(T,{sx:{gap:2,flexDir:"column"},children:rr(yd,({title:e,description:t,color:n},r)=>a.jsx(Dt,{label:t,children:a.jsx(ua,{sx:{userSelect:"none",color:parseInt(n.split(".")[1]??"0",10)<500?"base.800":"base.50",bg:n},textAlign:"center",children:e})},r))}),Spe=d.memo(wpe),kpe=()=>{const{t:e}=we(),t=te(),n=d.useCallback(()=>{t(GA())},[t]);return a.jsx(it,{leftIcon:a.jsx(NZ,{}),tooltip:e("nodes.reloadNodeTemplates"),"aria-label":e("nodes.reloadNodeTemplates"),onClick:n,children:e("nodes.reloadNodeTemplates")})},_pe=d.memo(kpe),Pu={fontWeight:600},jpe=ae(xe,({nodes:e})=>{const{shouldAnimateEdges:t,shouldValidateGraph:n,shouldSnapToGrid:r,shouldColorEdges:o,selectionMode:s}=e;return{shouldAnimateEdges:t,shouldValidateGraph:n,shouldSnapToGrid:r,shouldColorEdges:o,selectionModeIsChecked:s===KA.Full}},Ce),Ppe=Pe((e,t)=>{const{isOpen:n,onOpen:r,onClose:o}=Er(),s=te(),{shouldAnimateEdges:i,shouldValidateGraph:l,shouldSnapToGrid:f,shouldColorEdges:p,selectionModeIsChecked:h}=F(jpe),m=d.useCallback(w=>{s(qA(w.target.checked))},[s]),v=d.useCallback(w=>{s(XA(w.target.checked))},[s]),x=d.useCallback(w=>{s(YA(w.target.checked))},[s]),C=d.useCallback(w=>{s(QA(w.target.checked))},[s]),b=d.useCallback(w=>{s(ZA(w.target.checked))},[s]);return a.jsxs(a.Fragment,{children:[a.jsx(Te,{ref:t,"aria-label":"Workflow Editor Settings",tooltip:"Workflow Editor Settings",icon:a.jsx(jE,{}),onClick:r}),a.jsxs(Fi,{isOpen:n,onClose:o,size:"2xl",isCentered:!0,children:[a.jsx(Wo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{children:"Workflow Editor Settings"}),a.jsx(Td,{}),a.jsx(Vo,{children:a.jsxs(T,{sx:{flexDirection:"column",gap:4,py:4},children:[a.jsx(oo,{size:"sm",children:"General"}),a.jsx(Ut,{formLabelProps:Pu,onChange:v,isChecked:i,label:"Animated Edges",helperText:"Animate selected edges and edges connected to selected nodes"}),a.jsx(Fr,{}),a.jsx(Ut,{formLabelProps:Pu,isChecked:f,onChange:x,label:"Snap to Grid",helperText:"Snap nodes to grid when moved"}),a.jsx(Fr,{}),a.jsx(Ut,{formLabelProps:Pu,isChecked:p,onChange:C,label:"Color-Code Edges",helperText:"Color-code edges according to their connected fields"}),a.jsx(Ut,{formLabelProps:Pu,isChecked:h,onChange:b,label:"Fully Contain Nodes to Select",helperText:"Nodes must be fully inside the selection box to be selected"}),a.jsx(oo,{size:"sm",pt:4,children:"Advanced"}),a.jsx(Ut,{formLabelProps:Pu,isChecked:l,onChange:m,label:"Validate Connections and Graph",helperText:"Prevent invalid connections from being made, and invalid graphs from being invoked"}),a.jsx(_pe,{})]})})]})]})]})}),Ipe=d.memo(Ppe),Epe=()=>{const e=F(t=>t.nodes.shouldShowFieldTypeLegend);return a.jsxs(T,{sx:{gap:2,position:"absolute",top:2,insetInlineEnd:2},children:[a.jsx(Ipe,{}),e&&a.jsx(Spe,{})]})},Mpe=d.memo(Epe);function Ope(){const e=te(),t=F(r=>r.nodes.nodeOpacity),n=d.useCallback(r=>{e(JA(r))},[e]);return a.jsx(T,{alignItems:"center",children:a.jsxs(Ab,{"aria-label":"Node Opacity",value:t,min:.5,max:1,step:.01,onChange:n,orientation:"vertical",defaultValue:30,h:"calc(100% - 0.5rem)",children:[a.jsx(Tb,{children:a.jsx($b,{})}),a.jsx(Nb,{})]})})}function Dpe(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M125.7 160H176c17.7 0 32 14.3 32 32s-14.3 32-32 32H48c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32s32 14.3 32 32v51.2L97.6 97.6c87.5-87.5 229.3-87.5 316.8 0s87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3s-163.8-62.5-226.3 0L125.7 160z"}}]})(e)}function Rpe(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24H280c13.3 0 24-10.7 24-24s-10.7-24-24-24H136z"}}]})(e)}function Ape(e){return Ne({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM184 296c0 13.3 10.7 24 24 24s24-10.7 24-24V232h64c13.3 0 24-10.7 24-24s-10.7-24-24-24H232V120c0-13.3-10.7-24-24-24s-24 10.7-24 24v64H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h64v64z"}}]})(e)}const Npe=()=>{const{t:e}=we(),{zoomIn:t,zoomOut:n,fitView:r}=Kx(),o=te(),s=F(h=>h.nodes.shouldShowMinimapPanel),i=d.useCallback(()=>{t()},[t]),l=d.useCallback(()=>{n()},[n]),f=d.useCallback(()=>{r()},[r]),p=d.useCallback(()=>{o(e9(!s))},[s,o]);return a.jsxs(pn,{isAttached:!0,orientation:"vertical",children:[a.jsx(Te,{tooltip:e("nodes.zoomInNodes"),"aria-label":e("nodes.zoomInNodes"),onClick:i,icon:a.jsx(Ape,{})}),a.jsx(Te,{tooltip:e("nodes.zoomOutNodes"),"aria-label":e("nodes.zoomOutNodes"),onClick:l,icon:a.jsx(Rpe,{})}),a.jsx(Te,{tooltip:e("nodes.fitViewportNodes"),"aria-label":e("nodes.fitViewportNodes"),onClick:f,icon:a.jsx(gZ,{})}),a.jsx(Te,{tooltip:e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),"aria-label":e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),isChecked:s,onClick:p,icon:a.jsx(jZ,{})})]})},Tpe=d.memo(Npe),$pe=()=>a.jsxs(T,{sx:{gap:2,position:"absolute",bottom:2,insetInlineStart:2},children:[a.jsx(Tpe,{}),a.jsx(Ope,{})]}),Lpe=d.memo($pe),zpe=_e(FN),Fpe=()=>{const e=F(r=>r.nodes.shouldShowMinimapPanel),t=Ti("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-600)"),n=Ti("var(--invokeai-colors-blackAlpha-300)","var(--invokeai-colors-blackAlpha-600)");return a.jsx(T,{sx:{gap:2,position:"absolute",bottom:2,insetInlineEnd:2},children:e&&a.jsx(zpe,{pannable:!0,zoomable:!0,nodeBorderRadius:15,sx:{m:"0 !important",backgroundColor:"base.200 !important",borderRadius:"base",_dark:{backgroundColor:"base.500 !important"},svg:{borderRadius:"inherit"}},nodeColor:t,maskColor:n})})},Bpe=d.memo(Fpe),Hpe=()=>{const e=F(t=>t.nodes.isReady);return a.jsxs(T,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center"},children:[a.jsx(nr,{children:e&&a.jsxs(gn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.2}},style:{position:"relative",width:"100%",height:"100%"},children:[a.jsx(cpe,{}),a.jsx(ide,{}),a.jsx(dpe,{}),a.jsx(Cpe,{}),a.jsx(Mpe,{}),a.jsx(Lpe,{}),a.jsx(Bpe,{})]})}),a.jsx(nr,{children:!e&&a.jsx(gn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.2}},style:{position:"absolute",width:"100%",height:"100%"},children:a.jsx(T,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:a.jsx(tr,{label:"Loading Nodes...",icon:vg})})})})]})},Wpe=d.memo(Hpe),Vpe=()=>a.jsx(t9,{children:a.jsx(Wpe,{})}),Upe=d.memo(Vpe),Gpe=()=>a.jsx(RO,{}),Kpe=d.memo(Gpe);var Mx={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=hw;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=hw;e.exports=r.Konva})(Mx,Mx.exports);var qpe=Mx.exports;const dd=Oc(qpe);var s8={exports:{}};/**
* @license React
* react-reconciler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Xpe=function(t){var n={},r=d,o=Ip,s=Object.assign;function i(c){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+c,g=1;g<arguments.length;g++)u+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=Symbol.for("react.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),C=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),M=Symbol.iterator;function E(c){return c===null||typeof c!="object"?null:(c=M&&c[M]||c["@@iterator"],typeof c=="function"?c:null)}function O(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case h:return"Fragment";case p:return"Portal";case v:return"Profiler";case m:return"StrictMode";case w:return"Suspense";case k:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case C:return(c.displayName||"Context")+".Consumer";case x:return(c._context.displayName||"Context")+".Provider";case b:var u=c.render;return c=c.displayName,c||(c=u.displayName||u.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case _:return u=c.displayName||null,u!==null?u:O(c.type)||"Memo";case j:u=c._payload,c=c._init;try{return O(c(u))}catch{}}return null}function D(c){var u=c.type;switch(c.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=u.render,c=c.displayName||c.name||"",u.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return O(u);case 8:return u===m?"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 u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function A(c){var u=c,g=c;if(c.alternate)for(;u.return;)u=u.return;else{c=u;do u=c,u.flags&4098&&(g=u.return),c=u.return;while(c)}return u.tag===3?g:null}function R(c){if(A(c)!==c)throw Error(i(188))}function $(c){var u=c.alternate;if(!u){if(u=A(c),u===null)throw Error(i(188));return u!==c?null:c}for(var g=c,y=u;;){var S=g.return;if(S===null)break;var P=S.alternate;if(P===null){if(y=S.return,y!==null){g=y;continue}break}if(S.child===P.child){for(P=S.child;P;){if(P===g)return R(S),c;if(P===y)return R(S),u;P=P.sibling}throw Error(i(188))}if(g.return!==y.return)g=S,y=P;else{for(var N=!1,Z=S.child;Z;){if(Z===g){N=!0,g=S,y=P;break}if(Z===y){N=!0,y=S,g=P;break}Z=Z.sibling}if(!N){for(Z=P.child;Z;){if(Z===g){N=!0,g=P,y=S;break}if(Z===y){N=!0,y=P,g=S;break}Z=Z.sibling}if(!N)throw Error(i(189))}}if(g.alternate!==y)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?c:u}function K(c){return c=$(c),c!==null?B(c):null}function B(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var u=B(c);if(u!==null)return u;c=c.sibling}return null}function U(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){if(c.tag!==4){var u=U(c);if(u!==null)return u}c=c.sibling}return null}var Y=Array.isArray,W=t.getPublicInstance,L=t.getRootHostContext,X=t.getChildHostContext,z=t.prepareForCommit,q=t.resetAfterCommit,ne=t.createInstance,Q=t.appendInitialChild,ie=t.finalizeInitialChildren,oe=t.prepareUpdate,V=t.shouldSetTextContent,G=t.createTextInstance,J=t.scheduleTimeout,se=t.cancelTimeout,re=t.noTimeout,fe=t.isPrimaryRenderer,de=t.supportsMutation,me=t.supportsPersistence,ye=t.supportsHydration,he=t.getInstanceFromNode,ue=t.preparePortalMount,De=t.getCurrentEventPriority,je=t.detachDeletedInstance,Be=t.supportsMicrotasks,rt=t.scheduleMicrotask,Ue=t.supportsTestSelectors,Ct=t.findFiberRoot,Xe=t.getBoundingRect,tt=t.getTextContent,ve=t.isHiddenSubtree,Re=t.matchAccessibilityRole,st=t.setFocusIfFocusable,mt=t.setupIntersectionObserver,ge=t.appendChild,Ye=t.appendChildToContainer,ot=t.commitTextUpdate,lt=t.commitMount,Me=t.commitUpdate,$e=t.insertBefore,Rt=t.insertInContainerBefore,ke=t.removeChild,ze=t.removeChildFromContainer,Le=t.resetTextContent,Ve=t.hideInstance,ct=t.hideTextInstance,vn=t.unhideInstance,_t=t.unhideTextInstance,jt=t.clearContainer,sr=t.cloneInstance,In=t.createContainerChildSet,dn=t.appendChildToContainerChildSet,rn=t.finalizeContainerChildren,Yt=t.replaceContainerChildren,mr=t.cloneHiddenInstance,yo=t.cloneHiddenTextInstance,ar=t.canHydrateInstance,ir=t.canHydrateTextInstance,Is=t.canHydrateSuspenseInstance,Es=t.isSuspenseInstancePending,pa=t.isSuspenseInstanceFallback,ha=t.getSuspenseInstanceFallbackErrorDetails,al=t.registerSuspenseInstanceRetry,ma=t.getNextHydratableSibling,il=t.getFirstHydratableChild,qe=t.getFirstHydratableChildWithinContainer,At=t.getFirstHydratableChildWithinSuspenseInstance,En=t.hydrateInstance,vt=t.hydrateTextInstance,ga=t.hydrateSuspenseInstance,Rr=t.getNextHydratableInstanceAfterSuspenseInstance,qd=t.commitHydratedContainer,Og=t.commitHydratedSuspenseInstance,Dg=t.clearSuspenseBoundary,Mn=t.clearSuspenseBoundaryFromContainer,Ms=t.shouldDeleteUnhydratedTailInstances,Xd=t.didNotMatchHydratedContainerTextInstance,ll=t.didNotMatchHydratedTextInstance,Yc;function ai(c){if(Yc===void 0)try{throw Error()}catch(g){var u=g.stack.trim().match(/\n( *(at )?)/);Yc=u&&u[1]||""}return`
`+Yc+c}var Qc=!1;function Zc(c,u){if(!c||Qc)return"";Qc=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(Ee){var y=Ee}Reflect.construct(c,[],u)}else{try{u.call()}catch(Ee){y=Ee}c.call(u.prototype)}else{try{throw Error()}catch(Ee){y=Ee}c()}}catch(Ee){if(Ee&&y&&typeof Ee.stack=="string"){for(var S=Ee.stack.split(`
`),P=y.stack.split(`
`),N=S.length-1,Z=P.length-1;1<=N&&0<=Z&&S[N]!==P[Z];)Z--;for(;1<=N&&0<=Z;N--,Z--)if(S[N]!==P[Z]){if(N!==1||Z!==1)do if(N--,Z--,0>Z||S[N]!==P[Z]){var ce=`
`+S[N].replace(" at new "," at ");return c.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",c.displayName)),ce}while(1<=N&&0<=Z);break}}}finally{Qc=!1,Error.prepareStackTrace=g}return(c=c?c.displayName||c.name:"")?ai(c):""}var Rg=Object.prototype.hasOwnProperty,va=[],Je=-1;function wt(c){return{current:c}}function xt(c){0>Je||(c.current=va[Je],va[Je]=null,Je--)}function St(c,u){Je++,va[Je]=c.current,c.current=u}var Kn={},Wt=wt(Kn),kn=wt(!1),lr=Kn;function cl(c,u){var g=c.type.contextTypes;if(!g)return Kn;var y=c.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===u)return y.__reactInternalMemoizedMaskedChildContext;var S={},P;for(P in g)S[P]=u[P];return y&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=u,c.__reactInternalMemoizedMaskedChildContext=S),S}function gr(c){return c=c.childContextTypes,c!=null}function Yd(){xt(kn),xt(Wt)}function Yy(c,u,g){if(Wt.current!==Kn)throw Error(i(168));St(Wt,u),St(kn,g)}function Qy(c,u,g){var y=c.stateNode;if(u=u.childContextTypes,typeof y.getChildContext!="function")return g;y=y.getChildContext();for(var S in y)if(!(S in u))throw Error(i(108,D(c)||"Unknown",S));return s({},g,y)}function Qd(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Kn,lr=Wt.current,St(Wt,c),St(kn,kn.current),!0}function Zy(c,u,g){var y=c.stateNode;if(!y)throw Error(i(169));g?(c=Qy(c,u,lr),y.__reactInternalMemoizedMergedChildContext=c,xt(kn),xt(Wt),St(Wt,c)):xt(kn),St(kn,g)}var Co=Math.clz32?Math.clz32:b8,v8=Math.log,x8=Math.LN2;function b8(c){return c>>>=0,c===0?32:31-(v8(c)/x8|0)|0}var Zd=64,Jd=4194304;function Jc(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function ef(c,u){var g=c.pendingLanes;if(g===0)return 0;var y=0,S=c.suspendedLanes,P=c.pingedLanes,N=g&268435455;if(N!==0){var Z=N&~S;Z!==0?y=Jc(Z):(P&=N,P!==0&&(y=Jc(P)))}else N=g&~S,N!==0?y=Jc(N):P!==0&&(y=Jc(P));if(y===0)return 0;if(u!==0&&u!==y&&!(u&S)&&(S=y&-y,P=u&-u,S>=P||S===16&&(P&4194240)!==0))return u;if(y&4&&(y|=g&16),u=c.entangledLanes,u!==0)for(c=c.entanglements,u&=y;0<u;)g=31-Co(u),S=1<<g,y|=c[g],u&=~S;return y}function y8(c,u){switch(c){case 1:case 2:case 4:return u+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 u+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 C8(c,u){for(var g=c.suspendedLanes,y=c.pingedLanes,S=c.expirationTimes,P=c.pendingLanes;0<P;){var N=31-Co(P),Z=1<<N,ce=S[N];ce===-1?(!(Z&g)||Z&y)&&(S[N]=y8(Z,u)):ce<=u&&(c.expiredLanes|=Z),P&=~Z}}function Ag(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function Jy(){var c=Zd;return Zd<<=1,!(Zd&4194240)&&(Zd=64),c}function Ng(c){for(var u=[],g=0;31>g;g++)u.push(c);return u}function eu(c,u,g){c.pendingLanes|=u,u!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,u=31-Co(u),c[u]=g}function w8(c,u){var g=c.pendingLanes&~u;c.pendingLanes=u,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=u,c.mutableReadLanes&=u,c.entangledLanes&=u,u=c.entanglements;var y=c.eventTimes;for(c=c.expirationTimes;0<g;){var S=31-Co(g),P=1<<S;u[S]=0,y[S]=-1,c[S]=-1,g&=~P}}function Tg(c,u){var g=c.entangledLanes|=u;for(c=c.entanglements;g;){var y=31-Co(g),S=1<<y;S&u|c[y]&u&&(c[y]|=u),g&=~S}}var It=0;function e2(c){return c&=-c,1<c?4<c?c&268435455?16:536870912:4:1}var $g=o.unstable_scheduleCallback,t2=o.unstable_cancelCallback,S8=o.unstable_shouldYield,k8=o.unstable_requestPaint,Tn=o.unstable_now,Lg=o.unstable_ImmediatePriority,_8=o.unstable_UserBlockingPriority,zg=o.unstable_NormalPriority,j8=o.unstable_IdlePriority,tf=null,Yo=null;function P8(c){if(Yo&&typeof Yo.onCommitFiberRoot=="function")try{Yo.onCommitFiberRoot(tf,c,void 0,(c.current.flags&128)===128)}catch{}}function I8(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var wo=typeof Object.is=="function"?Object.is:I8,Os=null,nf=!1,Fg=!1;function n2(c){Os===null?Os=[c]:Os.push(c)}function E8(c){nf=!0,n2(c)}function Qo(){if(!Fg&&Os!==null){Fg=!0;var c=0,u=It;try{var g=Os;for(It=1;c<g.length;c++){var y=g[c];do y=y(!0);while(y!==null)}Os=null,nf=!1}catch(S){throw Os!==null&&(Os=Os.slice(c+1)),$g(Lg,Qo),S}finally{It=u,Fg=!1}}return null}var ul=[],dl=0,rf=null,of=0,Ur=[],Gr=0,ii=null,Ds=1,Rs="";function li(c,u){ul[dl++]=of,ul[dl++]=rf,rf=c,of=u}function r2(c,u,g){Ur[Gr++]=Ds,Ur[Gr++]=Rs,Ur[Gr++]=ii,ii=c;var y=Ds;c=Rs;var S=32-Co(y)-1;y&=~(1<<S),g+=1;var P=32-Co(u)+S;if(30<P){var N=S-S%5;P=(y&(1<<N)-1).toString(32),y>>=N,S-=N,Ds=1<<32-Co(u)+S|g<<S|y,Rs=P+c}else Ds=1<<P|g<<S|y,Rs=c}function Bg(c){c.return!==null&&(li(c,1),r2(c,1,0))}function Hg(c){for(;c===rf;)rf=ul[--dl],ul[dl]=null,of=ul[--dl],ul[dl]=null;for(;c===ii;)ii=Ur[--Gr],Ur[Gr]=null,Rs=Ur[--Gr],Ur[Gr]=null,Ds=Ur[--Gr],Ur[Gr]=null}var Ar=null,Kr=null,Qt=!1,tu=!1,So=null;function o2(c,u){var g=Zr(5,null,null,0);g.elementType="DELETED",g.stateNode=u,g.return=c,u=c.deletions,u===null?(c.deletions=[g],c.flags|=16):u.push(g)}function s2(c,u){switch(c.tag){case 5:return u=ar(u,c.type,c.pendingProps),u!==null?(c.stateNode=u,Ar=c,Kr=il(u),!0):!1;case 6:return u=ir(u,c.pendingProps),u!==null?(c.stateNode=u,Ar=c,Kr=null,!0):!1;case 13:if(u=Is(u),u!==null){var g=ii!==null?{id:Ds,overflow:Rs}:null;return c.memoizedState={dehydrated:u,treeContext:g,retryLane:1073741824},g=Zr(18,null,null,0),g.stateNode=u,g.return=c,c.child=g,Ar=c,Kr=null,!0}return!1;default:return!1}}function Wg(c){return(c.mode&1)!==0&&(c.flags&128)===0}function Vg(c){if(Qt){var u=Kr;if(u){var g=u;if(!s2(c,u)){if(Wg(c))throw Error(i(418));u=ma(g);var y=Ar;u&&s2(c,u)?o2(y,g):(c.flags=c.flags&-4097|2,Qt=!1,Ar=c)}}else{if(Wg(c))throw Error(i(418));c.flags=c.flags&-4097|2,Qt=!1,Ar=c}}}function a2(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Ar=c}function sf(c){if(!ye||c!==Ar)return!1;if(!Qt)return a2(c),Qt=!0,!1;if(c.tag!==3&&(c.tag!==5||Ms(c.type)&&!V(c.type,c.memoizedProps))){var u=Kr;if(u){if(Wg(c))throw i2(),Error(i(418));for(;u;)o2(c,u),u=ma(u)}}if(a2(c),c.tag===13){if(!ye)throw Error(i(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));Kr=Rr(c)}else Kr=Ar?ma(c.stateNode):null;return!0}function i2(){for(var c=Kr;c;)c=ma(c)}function fl(){ye&&(Kr=Ar=null,tu=Qt=!1)}function Ug(c){So===null?So=[c]:So.push(c)}var M8=l.ReactCurrentBatchConfig;function af(c,u){if(wo(c,u))return!0;if(typeof c!="object"||c===null||typeof u!="object"||u===null)return!1;var g=Object.keys(c),y=Object.keys(u);if(g.length!==y.length)return!1;for(y=0;y<g.length;y++){var S=g[y];if(!Rg.call(u,S)||!wo(c[S],u[S]))return!1}return!0}function O8(c){switch(c.tag){case 5:return ai(c.type);case 16:return ai("Lazy");case 13:return ai("Suspense");case 19:return ai("SuspenseList");case 0:case 2:case 15:return c=Zc(c.type,!1),c;case 11:return c=Zc(c.type.render,!1),c;case 1:return c=Zc(c.type,!0),c;default:return""}}function ko(c,u){if(c&&c.defaultProps){u=s({},u),c=c.defaultProps;for(var g in c)u[g]===void 0&&(u[g]=c[g]);return u}return u}var lf=wt(null),cf=null,pl=null,Gg=null;function Kg(){Gg=pl=cf=null}function l2(c,u,g){fe?(St(lf,u._currentValue),u._currentValue=g):(St(lf,u._currentValue2),u._currentValue2=g)}function qg(c){var u=lf.current;xt(lf),fe?c._currentValue=u:c._currentValue2=u}function Xg(c,u,g){for(;c!==null;){var y=c.alternate;if((c.childLanes&u)!==u?(c.childLanes|=u,y!==null&&(y.childLanes|=u)):y!==null&&(y.childLanes&u)!==u&&(y.childLanes|=u),c===g)break;c=c.return}}function hl(c,u){cf=c,Gg=pl=null,c=c.dependencies,c!==null&&c.firstContext!==null&&(c.lanes&u&&(vr=!0),c.firstContext=null)}function qr(c){var u=fe?c._currentValue:c._currentValue2;if(Gg!==c)if(c={context:c,memoizedValue:u,next:null},pl===null){if(cf===null)throw Error(i(308));pl=c,cf.dependencies={lanes:0,firstContext:c}}else pl=pl.next=c;return u}var ci=null;function Yg(c){ci===null?ci=[c]:ci.push(c)}function c2(c,u,g,y){var S=u.interleaved;return S===null?(g.next=g,Yg(u)):(g.next=S.next,S.next=g),u.interleaved=g,Zo(c,y)}function Zo(c,u){c.lanes|=u;var g=c.alternate;for(g!==null&&(g.lanes|=u),g=c,c=c.return;c!==null;)c.childLanes|=u,g=c.alternate,g!==null&&(g.childLanes|=u),g=c,c=c.return;return g.tag===3?g.stateNode:null}var xa=!1;function Qg(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function u2(c,u){c=c.updateQueue,u.updateQueue===c&&(u.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function As(c,u){return{eventTime:c,lane:u,tag:0,payload:null,callback:null,next:null}}function ba(c,u,g){var y=c.updateQueue;if(y===null)return null;if(y=y.shared,bt&2){var S=y.pending;return S===null?u.next=u:(u.next=S.next,S.next=u),y.pending=u,Zo(c,g)}return S=y.interleaved,S===null?(u.next=u,Yg(y)):(u.next=S.next,S.next=u),y.interleaved=u,Zo(c,g)}function uf(c,u,g){if(u=u.updateQueue,u!==null&&(u=u.shared,(g&4194240)!==0)){var y=u.lanes;y&=c.pendingLanes,g|=y,u.lanes=g,Tg(c,g)}}function d2(c,u){var g=c.updateQueue,y=c.alternate;if(y!==null&&(y=y.updateQueue,g===y)){var S=null,P=null;if(g=g.firstBaseUpdate,g!==null){do{var N={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};P===null?S=P=N:P=P.next=N,g=g.next}while(g!==null);P===null?S=P=u:P=P.next=u}else S=P=u;g={baseState:y.baseState,firstBaseUpdate:S,lastBaseUpdate:P,shared:y.shared,effects:y.effects},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=u:c.next=u,g.lastBaseUpdate=u}function df(c,u,g,y){var S=c.updateQueue;xa=!1;var P=S.firstBaseUpdate,N=S.lastBaseUpdate,Z=S.shared.pending;if(Z!==null){S.shared.pending=null;var ce=Z,Ee=ce.next;ce.next=null,N===null?P=Ee:N.next=Ee,N=ce;var Ke=c.alternate;Ke!==null&&(Ke=Ke.updateQueue,Z=Ke.lastBaseUpdate,Z!==N&&(Z===null?Ke.firstBaseUpdate=Ee:Z.next=Ee,Ke.lastBaseUpdate=ce))}if(P!==null){var pt=S.baseState;N=0,Ke=Ee=ce=null,Z=P;do{var He=Z.lane,Kt=Z.eventTime;if((y&He)===He){Ke!==null&&(Ke=Ke.next={eventTime:Kt,lane:0,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null});e:{var Ft=c,yr=Z;switch(He=u,Kt=g,yr.tag){case 1:if(Ft=yr.payload,typeof Ft=="function"){pt=Ft.call(Kt,pt,He);break e}pt=Ft;break e;case 3:Ft.flags=Ft.flags&-65537|128;case 0:if(Ft=yr.payload,He=typeof Ft=="function"?Ft.call(Kt,pt,He):Ft,He==null)break e;pt=s({},pt,He);break e;case 2:xa=!0}}Z.callback!==null&&Z.lane!==0&&(c.flags|=64,He=S.effects,He===null?S.effects=[Z]:He.push(Z))}else Kt={eventTime:Kt,lane:He,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Ke===null?(Ee=Ke=Kt,ce=pt):Ke=Ke.next=Kt,N|=He;if(Z=Z.next,Z===null){if(Z=S.shared.pending,Z===null)break;He=Z,Z=He.next,He.next=null,S.lastBaseUpdate=He,S.shared.pending=null}}while(1);if(Ke===null&&(ce=pt),S.baseState=ce,S.firstBaseUpdate=Ee,S.lastBaseUpdate=Ke,u=S.shared.interleaved,u!==null){S=u;do N|=S.lane,S=S.next;while(S!==u)}else P===null&&(S.shared.lanes=0);di|=N,c.lanes=N,c.memoizedState=pt}}function f2(c,u,g){if(c=u.effects,u.effects=null,c!==null)for(u=0;u<c.length;u++){var y=c[u],S=y.callback;if(S!==null){if(y.callback=null,y=g,typeof S!="function")throw Error(i(191,S));S.call(y)}}}var p2=new r.Component().refs;function Zg(c,u,g,y){u=c.memoizedState,g=g(y,u),g=g==null?u:s({},u,g),c.memoizedState=g,c.lanes===0&&(c.updateQueue.baseState=g)}var ff={isMounted:function(c){return(c=c._reactInternals)?A(c)===c:!1},enqueueSetState:function(c,u,g){c=c._reactInternals;var y=Qn(),S=wa(c),P=As(y,S);P.payload=u,g!=null&&(P.callback=g),u=ba(c,P,S),u!==null&&(Qr(u,c,S,y),uf(u,c,S))},enqueueReplaceState:function(c,u,g){c=c._reactInternals;var y=Qn(),S=wa(c),P=As(y,S);P.tag=1,P.payload=u,g!=null&&(P.callback=g),u=ba(c,P,S),u!==null&&(Qr(u,c,S,y),uf(u,c,S))},enqueueForceUpdate:function(c,u){c=c._reactInternals;var g=Qn(),y=wa(c),S=As(g,y);S.tag=2,u!=null&&(S.callback=u),u=ba(c,S,y),u!==null&&(Qr(u,c,y,g),uf(u,c,y))}};function h2(c,u,g,y,S,P,N){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(y,P,N):u.prototype&&u.prototype.isPureReactComponent?!af(g,y)||!af(S,P):!0}function m2(c,u,g){var y=!1,S=Kn,P=u.contextType;return typeof P=="object"&&P!==null?P=qr(P):(S=gr(u)?lr:Wt.current,y=u.contextTypes,P=(y=y!=null)?cl(c,S):Kn),u=new u(g,P),c.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=ff,c.stateNode=u,u._reactInternals=c,y&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=S,c.__reactInternalMemoizedMaskedChildContext=P),u}function g2(c,u,g,y){c=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(g,y),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(g,y),u.state!==c&&ff.enqueueReplaceState(u,u.state,null)}function Jg(c,u,g,y){var S=c.stateNode;S.props=g,S.state=c.memoizedState,S.refs=p2,Qg(c);var P=u.contextType;typeof P=="object"&&P!==null?S.context=qr(P):(P=gr(u)?lr:Wt.current,S.context=cl(c,P)),S.state=c.memoizedState,P=u.getDerivedStateFromProps,typeof P=="function"&&(Zg(c,u,P,g),S.state=c.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(u=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),u!==S.state&&ff.enqueueReplaceState(S,S.state,null),df(c,g,S,y),S.state=c.memoizedState),typeof S.componentDidMount=="function"&&(c.flags|=4194308)}function nu(c,u,g){if(c=g.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(i(309));var y=g.stateNode}if(!y)throw Error(i(147,c));var S=y,P=""+c;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===P?u.ref:(u=function(N){var Z=S.refs;Z===p2&&(Z=S.refs={}),N===null?delete Z[P]:Z[P]=N},u._stringRef=P,u)}if(typeof c!="string")throw Error(i(284));if(!g._owner)throw Error(i(290,c))}return c}function pf(c,u){throw c=Object.prototype.toString.call(u),Error(i(31,c==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":c))}function v2(c){var u=c._init;return u(c._payload)}function x2(c){function u(le,ee){if(c){var pe=le.deletions;pe===null?(le.deletions=[ee],le.flags|=16):pe.push(ee)}}function g(le,ee){if(!c)return null;for(;ee!==null;)u(le,ee),ee=ee.sibling;return null}function y(le,ee){for(le=new Map;ee!==null;)ee.key!==null?le.set(ee.key,ee):le.set(ee.index,ee),ee=ee.sibling;return le}function S(le,ee){return le=ka(le,ee),le.index=0,le.sibling=null,le}function P(le,ee,pe){return le.index=pe,c?(pe=le.alternate,pe!==null?(pe=pe.index,pe<ee?(le.flags|=2,ee):pe):(le.flags|=2,ee)):(le.flags|=1048576,ee)}function N(le){return c&&le.alternate===null&&(le.flags|=2),le}function Z(le,ee,pe,We){return ee===null||ee.tag!==6?(ee=F0(pe,le.mode,We),ee.return=le,ee):(ee=S(ee,pe),ee.return=le,ee)}function ce(le,ee,pe,We){var nt=pe.type;return nt===h?Ke(le,ee,pe.props.children,We,pe.key):ee!==null&&(ee.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===j&&v2(nt)===ee.type)?(We=S(ee,pe.props),We.ref=nu(le,ee,pe),We.return=le,We):(We=zf(pe.type,pe.key,pe.props,null,le.mode,We),We.ref=nu(le,ee,pe),We.return=le,We)}function Ee(le,ee,pe,We){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==pe.containerInfo||ee.stateNode.implementation!==pe.implementation?(ee=B0(pe,le.mode,We),ee.return=le,ee):(ee=S(ee,pe.children||[]),ee.return=le,ee)}function Ke(le,ee,pe,We,nt){return ee===null||ee.tag!==7?(ee=mi(pe,le.mode,We,nt),ee.return=le,ee):(ee=S(ee,pe),ee.return=le,ee)}function pt(le,ee,pe){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=F0(""+ee,le.mode,pe),ee.return=le,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case f:return pe=zf(ee.type,ee.key,ee.props,null,le.mode,pe),pe.ref=nu(le,null,ee),pe.return=le,pe;case p:return ee=B0(ee,le.mode,pe),ee.return=le,ee;case j:var We=ee._init;return pt(le,We(ee._payload),pe)}if(Y(ee)||E(ee))return ee=mi(ee,le.mode,pe,null),ee.return=le,ee;pf(le,ee)}return null}function He(le,ee,pe,We){var nt=ee!==null?ee.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number")return nt!==null?null:Z(le,ee,""+pe,We);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case f:return pe.key===nt?ce(le,ee,pe,We):null;case p:return pe.key===nt?Ee(le,ee,pe,We):null;case j:return nt=pe._init,He(le,ee,nt(pe._payload),We)}if(Y(pe)||E(pe))return nt!==null?null:Ke(le,ee,pe,We,null);pf(le,pe)}return null}function Kt(le,ee,pe,We,nt){if(typeof We=="string"&&We!==""||typeof We=="number")return le=le.get(pe)||null,Z(ee,le,""+We,nt);if(typeof We=="object"&&We!==null){switch(We.$$typeof){case f:return le=le.get(We.key===null?pe:We.key)||null,ce(ee,le,We,nt);case p:return le=le.get(We.key===null?pe:We.key)||null,Ee(ee,le,We,nt);case j:var gt=We._init;return Kt(le,ee,pe,gt(We._payload),nt)}if(Y(We)||E(We))return le=le.get(pe)||null,Ke(ee,le,We,nt,null);pf(ee,We)}return null}function Ft(le,ee,pe,We){for(var nt=null,gt=null,ht=ee,Et=ee=0,zn=null;ht!==null&&Et<pe.length;Et++){ht.index>Et?(zn=ht,ht=null):zn=ht.sibling;var Mt=He(le,ht,pe[Et],We);if(Mt===null){ht===null&&(ht=zn);break}c&&ht&&Mt.alternate===null&&u(le,ht),ee=P(Mt,ee,Et),gt===null?nt=Mt:gt.sibling=Mt,gt=Mt,ht=zn}if(Et===pe.length)return g(le,ht),Qt&&li(le,Et),nt;if(ht===null){for(;Et<pe.length;Et++)ht=pt(le,pe[Et],We),ht!==null&&(ee=P(ht,ee,Et),gt===null?nt=ht:gt.sibling=ht,gt=ht);return Qt&&li(le,Et),nt}for(ht=y(le,ht);Et<pe.length;Et++)zn=Kt(ht,le,Et,pe[Et],We),zn!==null&&(c&&zn.alternate!==null&&ht.delete(zn.key===null?Et:zn.key),ee=P(zn,ee,Et),gt===null?nt=zn:gt.sibling=zn,gt=zn);return c&&ht.forEach(function(_a){return u(le,_a)}),Qt&&li(le,Et),nt}function yr(le,ee,pe,We){var nt=E(pe);if(typeof nt!="function")throw Error(i(150));if(pe=nt.call(pe),pe==null)throw Error(i(151));for(var gt=nt=null,ht=ee,Et=ee=0,zn=null,Mt=pe.next();ht!==null&&!Mt.done;Et++,Mt=pe.next()){ht.index>Et?(zn=ht,ht=null):zn=ht.sibling;var _a=He(le,ht,Mt.value,We);if(_a===null){ht===null&&(ht=zn);break}c&&ht&&_a.alternate===null&&u(le,ht),ee=P(_a,ee,Et),gt===null?nt=_a:gt.sibling=_a,gt=_a,ht=zn}if(Mt.done)return g(le,ht),Qt&&li(le,Et),nt;if(ht===null){for(;!Mt.done;Et++,Mt=pe.next())Mt=pt(le,Mt.value,We),Mt!==null&&(ee=P(Mt,ee,Et),gt===null?nt=Mt:gt.sibling=Mt,gt=Mt);return Qt&&li(le,Et),nt}for(ht=y(le,ht);!Mt.done;Et++,Mt=pe.next())Mt=Kt(ht,le,Et,Mt.value,We),Mt!==null&&(c&&Mt.alternate!==null&&ht.delete(Mt.key===null?Et:Mt.key),ee=P(Mt,ee,Et),gt===null?nt=Mt:gt.sibling=Mt,gt=Mt);return c&&ht.forEach(function(i7){return u(le,i7)}),Qt&&li(le,Et),nt}function $s(le,ee,pe,We){if(typeof pe=="object"&&pe!==null&&pe.type===h&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case f:e:{for(var nt=pe.key,gt=ee;gt!==null;){if(gt.key===nt){if(nt=pe.type,nt===h){if(gt.tag===7){g(le,gt.sibling),ee=S(gt,pe.props.children),ee.return=le,le=ee;break e}}else if(gt.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===j&&v2(nt)===gt.type){g(le,gt.sibling),ee=S(gt,pe.props),ee.ref=nu(le,gt,pe),ee.return=le,le=ee;break e}g(le,gt);break}else u(le,gt);gt=gt.sibling}pe.type===h?(ee=mi(pe.props.children,le.mode,We,pe.key),ee.return=le,le=ee):(We=zf(pe.type,pe.key,pe.props,null,le.mode,We),We.ref=nu(le,ee,pe),We.return=le,le=We)}return N(le);case p:e:{for(gt=pe.key;ee!==null;){if(ee.key===gt)if(ee.tag===4&&ee.stateNode.containerInfo===pe.containerInfo&&ee.stateNode.implementation===pe.implementation){g(le,ee.sibling),ee=S(ee,pe.children||[]),ee.return=le,le=ee;break e}else{g(le,ee);break}else u(le,ee);ee=ee.sibling}ee=B0(pe,le.mode,We),ee.return=le,le=ee}return N(le);case j:return gt=pe._init,$s(le,ee,gt(pe._payload),We)}if(Y(pe))return Ft(le,ee,pe,We);if(E(pe))return yr(le,ee,pe,We);pf(le,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"?(pe=""+pe,ee!==null&&ee.tag===6?(g(le,ee.sibling),ee=S(ee,pe),ee.return=le,le=ee):(g(le,ee),ee=F0(pe,le.mode,We),ee.return=le,le=ee),N(le)):g(le,ee)}return $s}var ml=x2(!0),b2=x2(!1),ru={},Xr=wt(ru),ou=wt(ru),gl=wt(ru);function Jo(c){if(c===ru)throw Error(i(174));return c}function e0(c,u){St(gl,u),St(ou,c),St(Xr,ru),c=L(u),xt(Xr),St(Xr,c)}function vl(){xt(Xr),xt(ou),xt(gl)}function y2(c){var u=Jo(gl.current),g=Jo(Xr.current);u=X(g,c.type,u),g!==u&&(St(ou,c),St(Xr,u))}function t0(c){ou.current===c&&(xt(Xr),xt(ou))}var on=wt(0);function hf(c){for(var u=c;u!==null;){if(u.tag===13){var g=u.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Es(g)||pa(g)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if(u.flags&128)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var n0=[];function r0(){for(var c=0;c<n0.length;c++){var u=n0[c];fe?u._workInProgressVersionPrimary=null:u._workInProgressVersionSecondary=null}n0.length=0}var mf=l.ReactCurrentDispatcher,o0=l.ReactCurrentBatchConfig,ui=0,sn=null,On=null,$n=null,gf=!1,su=!1,au=0,D8=0;function qn(){throw Error(i(321))}function s0(c,u){if(u===null)return!1;for(var g=0;g<u.length&&g<c.length;g++)if(!wo(c[g],u[g]))return!1;return!0}function a0(c,u,g,y,S,P){if(ui=P,sn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,mf.current=c===null||c.memoizedState===null?T8:$8,c=g(y,S),su){P=0;do{if(su=!1,au=0,25<=P)throw Error(i(301));P+=1,$n=On=null,u.updateQueue=null,mf.current=L8,c=g(y,S)}while(su)}if(mf.current=bf,u=On!==null&&On.next!==null,ui=0,$n=On=sn=null,gf=!1,u)throw Error(i(300));return c}function i0(){var c=au!==0;return au=0,c}function es(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $n===null?sn.memoizedState=$n=c:$n=$n.next=c,$n}function Yr(){if(On===null){var c=sn.alternate;c=c!==null?c.memoizedState:null}else c=On.next;var u=$n===null?sn.memoizedState:$n.next;if(u!==null)$n=u,On=c;else{if(c===null)throw Error(i(310));On=c,c={memoizedState:On.memoizedState,baseState:On.baseState,baseQueue:On.baseQueue,queue:On.queue,next:null},$n===null?sn.memoizedState=$n=c:$n=$n.next=c}return $n}function iu(c,u){return typeof u=="function"?u(c):u}function l0(c){var u=Yr(),g=u.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=c;var y=On,S=y.baseQueue,P=g.pending;if(P!==null){if(S!==null){var N=S.next;S.next=P.next,P.next=N}y.baseQueue=S=P,g.pending=null}if(S!==null){P=S.next,y=y.baseState;var Z=N=null,ce=null,Ee=P;do{var Ke=Ee.lane;if((ui&Ke)===Ke)ce!==null&&(ce=ce.next={lane:0,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null}),y=Ee.hasEagerState?Ee.eagerState:c(y,Ee.action);else{var pt={lane:Ke,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null};ce===null?(Z=ce=pt,N=y):ce=ce.next=pt,sn.lanes|=Ke,di|=Ke}Ee=Ee.next}while(Ee!==null&&Ee!==P);ce===null?N=y:ce.next=Z,wo(y,u.memoizedState)||(vr=!0),u.memoizedState=y,u.baseState=N,u.baseQueue=ce,g.lastRenderedState=y}if(c=g.interleaved,c!==null){S=c;do P=S.lane,sn.lanes|=P,di|=P,S=S.next;while(S!==c)}else S===null&&(g.lanes=0);return[u.memoizedState,g.dispatch]}function c0(c){var u=Yr(),g=u.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=c;var y=g.dispatch,S=g.pending,P=u.memoizedState;if(S!==null){g.pending=null;var N=S=S.next;do P=c(P,N.action),N=N.next;while(N!==S);wo(P,u.memoizedState)||(vr=!0),u.memoizedState=P,u.baseQueue===null&&(u.baseState=P),g.lastRenderedState=P}return[P,y]}function C2(){}function w2(c,u){var g=sn,y=Yr(),S=u(),P=!wo(y.memoizedState,S);if(P&&(y.memoizedState=S,vr=!0),y=y.queue,u0(_2.bind(null,g,y,c),[c]),y.getSnapshot!==u||P||$n!==null&&$n.memoizedState.tag&1){if(g.flags|=2048,lu(9,k2.bind(null,g,y,S,u),void 0,null),Ln===null)throw Error(i(349));ui&30||S2(g,u,S)}return S}function S2(c,u,g){c.flags|=16384,c={getSnapshot:u,value:g},u=sn.updateQueue,u===null?(u={lastEffect:null,stores:null},sn.updateQueue=u,u.stores=[c]):(g=u.stores,g===null?u.stores=[c]:g.push(c))}function k2(c,u,g,y){u.value=g,u.getSnapshot=y,j2(u)&&P2(c)}function _2(c,u,g){return g(function(){j2(u)&&P2(c)})}function j2(c){var u=c.getSnapshot;c=c.value;try{var g=u();return!wo(c,g)}catch{return!0}}function P2(c){var u=Zo(c,1);u!==null&&Qr(u,c,1,-1)}function I2(c){var u=es();return typeof c=="function"&&(c=c()),u.memoizedState=u.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:iu,lastRenderedState:c},u.queue=c,c=c.dispatch=N8.bind(null,sn,c),[u.memoizedState,c]}function lu(c,u,g,y){return c={tag:c,create:u,destroy:g,deps:y,next:null},u=sn.updateQueue,u===null?(u={lastEffect:null,stores:null},sn.updateQueue=u,u.lastEffect=c.next=c):(g=u.lastEffect,g===null?u.lastEffect=c.next=c:(y=g.next,g.next=c,c.next=y,u.lastEffect=c)),c}function E2(){return Yr().memoizedState}function vf(c,u,g,y){var S=es();sn.flags|=c,S.memoizedState=lu(1|u,g,void 0,y===void 0?null:y)}function xf(c,u,g,y){var S=Yr();y=y===void 0?null:y;var P=void 0;if(On!==null){var N=On.memoizedState;if(P=N.destroy,y!==null&&s0(y,N.deps)){S.memoizedState=lu(u,g,P,y);return}}sn.flags|=c,S.memoizedState=lu(1|u,g,P,y)}function M2(c,u){return vf(8390656,8,c,u)}function u0(c,u){return xf(2048,8,c,u)}function O2(c,u){return xf(4,2,c,u)}function D2(c,u){return xf(4,4,c,u)}function R2(c,u){if(typeof u=="function")return c=c(),u(c),function(){u(null)};if(u!=null)return c=c(),u.current=c,function(){u.current=null}}function A2(c,u,g){return g=g!=null?g.concat([c]):null,xf(4,4,R2.bind(null,u,c),g)}function d0(){}function N2(c,u){var g=Yr();u=u===void 0?null:u;var y=g.memoizedState;return y!==null&&u!==null&&s0(u,y[1])?y[0]:(g.memoizedState=[c,u],c)}function T2(c,u){var g=Yr();u=u===void 0?null:u;var y=g.memoizedState;return y!==null&&u!==null&&s0(u,y[1])?y[0]:(c=c(),g.memoizedState=[c,u],c)}function $2(c,u,g){return ui&21?(wo(g,u)||(g=Jy(),sn.lanes|=g,di|=g,c.baseState=!0),u):(c.baseState&&(c.baseState=!1,vr=!0),c.memoizedState=g)}function R8(c,u){var g=It;It=g!==0&&4>g?g:4,c(!0);var y=o0.transition;o0.transition={};try{c(!1),u()}finally{It=g,o0.transition=y}}function L2(){return Yr().memoizedState}function A8(c,u,g){var y=wa(c);if(g={lane:y,action:g,hasEagerState:!1,eagerState:null,next:null},z2(c))F2(u,g);else if(g=c2(c,u,g,y),g!==null){var S=Qn();Qr(g,c,y,S),B2(g,u,y)}}function N8(c,u,g){var y=wa(c),S={lane:y,action:g,hasEagerState:!1,eagerState:null,next:null};if(z2(c))F2(u,S);else{var P=c.alternate;if(c.lanes===0&&(P===null||P.lanes===0)&&(P=u.lastRenderedReducer,P!==null))try{var N=u.lastRenderedState,Z=P(N,g);if(S.hasEagerState=!0,S.eagerState=Z,wo(Z,N)){var ce=u.interleaved;ce===null?(S.next=S,Yg(u)):(S.next=ce.next,ce.next=S),u.interleaved=S;return}}catch{}finally{}g=c2(c,u,S,y),g!==null&&(S=Qn(),Qr(g,c,y,S),B2(g,u,y))}}function z2(c){var u=c.alternate;return c===sn||u!==null&&u===sn}function F2(c,u){su=gf=!0;var g=c.pending;g===null?u.next=u:(u.next=g.next,g.next=u),c.pending=u}function B2(c,u,g){if(g&4194240){var y=u.lanes;y&=c.pendingLanes,g|=y,u.lanes=g,Tg(c,g)}}var bf={readContext:qr,useCallback:qn,useContext:qn,useEffect:qn,useImperativeHandle:qn,useInsertionEffect:qn,useLayoutEffect:qn,useMemo:qn,useReducer:qn,useRef:qn,useState:qn,useDebugValue:qn,useDeferredValue:qn,useTransition:qn,useMutableSource:qn,useSyncExternalStore:qn,useId:qn,unstable_isNewReconciler:!1},T8={readContext:qr,useCallback:function(c,u){return es().memoizedState=[c,u===void 0?null:u],c},useContext:qr,useEffect:M2,useImperativeHandle:function(c,u,g){return g=g!=null?g.concat([c]):null,vf(4194308,4,R2.bind(null,u,c),g)},useLayoutEffect:function(c,u){return vf(4194308,4,c,u)},useInsertionEffect:function(c,u){return vf(4,2,c,u)},useMemo:function(c,u){var g=es();return u=u===void 0?null:u,c=c(),g.memoizedState=[c,u],c},useReducer:function(c,u,g){var y=es();return u=g!==void 0?g(u):u,y.memoizedState=y.baseState=u,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:u},y.queue=c,c=c.dispatch=A8.bind(null,sn,c),[y.memoizedState,c]},useRef:function(c){var u=es();return c={current:c},u.memoizedState=c},useState:I2,useDebugValue:d0,useDeferredValue:function(c){return es().memoizedState=c},useTransition:function(){var c=I2(!1),u=c[0];return c=R8.bind(null,c[1]),es().memoizedState=c,[u,c]},useMutableSource:function(){},useSyncExternalStore:function(c,u,g){var y=sn,S=es();if(Qt){if(g===void 0)throw Error(i(407));g=g()}else{if(g=u(),Ln===null)throw Error(i(349));ui&30||S2(y,u,g)}S.memoizedState=g;var P={value:g,getSnapshot:u};return S.queue=P,M2(_2.bind(null,y,P,c),[c]),y.flags|=2048,lu(9,k2.bind(null,y,P,g,u),void 0,null),g},useId:function(){var c=es(),u=Ln.identifierPrefix;if(Qt){var g=Rs,y=Ds;g=(y&~(1<<32-Co(y)-1)).toString(32)+g,u=":"+u+"R"+g,g=au++,0<g&&(u+="H"+g.toString(32)),u+=":"}else g=D8++,u=":"+u+"r"+g.toString(32)+":";return c.memoizedState=u},unstable_isNewReconciler:!1},$8={readContext:qr,useCallback:N2,useContext:qr,useEffect:u0,useImperativeHandle:A2,useInsertionEffect:O2,useLayoutEffect:D2,useMemo:T2,useReducer:l0,useRef:E2,useState:function(){return l0(iu)},useDebugValue:d0,useDeferredValue:function(c){var u=Yr();return $2(u,On.memoizedState,c)},useTransition:function(){var c=l0(iu)[0],u=Yr().memoizedState;return[c,u]},useMutableSource:C2,useSyncExternalStore:w2,useId:L2,unstable_isNewReconciler:!1},L8={readContext:qr,useCallback:N2,useContext:qr,useEffect:u0,useImperativeHandle:A2,useInsertionEffect:O2,useLayoutEffect:D2,useMemo:T2,useReducer:c0,useRef:E2,useState:function(){return c0(iu)},useDebugValue:d0,useDeferredValue:function(c){var u=Yr();return On===null?u.memoizedState=c:$2(u,On.memoizedState,c)},useTransition:function(){var c=c0(iu)[0],u=Yr().memoizedState;return[c,u]},useMutableSource:C2,useSyncExternalStore:w2,useId:L2,unstable_isNewReconciler:!1};function xl(c,u){try{var g="",y=u;do g+=O8(y),y=y.return;while(y);var S=g}catch(P){S=`
Error generating stack: `+P.message+`
`+P.stack}return{value:c,source:u,stack:S,digest:null}}function f0(c,u,g){return{value:c,source:null,stack:g??null,digest:u??null}}function p0(c,u){try{console.error(u.value)}catch(g){setTimeout(function(){throw g})}}var z8=typeof WeakMap=="function"?WeakMap:Map;function H2(c,u,g){g=As(-1,g),g.tag=3,g.payload={element:null};var y=u.value;return g.callback=function(){Rf||(Rf=!0,R0=y),p0(c,u)},g}function W2(c,u,g){g=As(-1,g),g.tag=3;var y=c.type.getDerivedStateFromError;if(typeof y=="function"){var S=u.value;g.payload=function(){return y(S)},g.callback=function(){p0(c,u)}}var P=c.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(g.callback=function(){p0(c,u),typeof y!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var N=u.stack;this.componentDidCatch(u.value,{componentStack:N!==null?N:""})}),g}function V2(c,u,g){var y=c.pingCache;if(y===null){y=c.pingCache=new z8;var S=new Set;y.set(u,S)}else S=y.get(u),S===void 0&&(S=new Set,y.set(u,S));S.has(g)||(S.add(g),c=J8.bind(null,c,u,g),u.then(c,c))}function U2(c){do{var u;if((u=c.tag===13)&&(u=c.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return c;c=c.return}while(c!==null);return null}function G2(c,u,g,y,S){return c.mode&1?(c.flags|=65536,c.lanes=S,c):(c===u?c.flags|=65536:(c.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(u=As(-1,1),u.tag=2,ba(g,u,1))),g.lanes|=1),c)}var F8=l.ReactCurrentOwner,vr=!1;function cr(c,u,g,y){u.child=c===null?b2(u,null,g,y):ml(u,c.child,g,y)}function K2(c,u,g,y,S){g=g.render;var P=u.ref;return hl(u,S),y=a0(c,u,g,y,P,S),g=i0(),c!==null&&!vr?(u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~S,Ns(c,u,S)):(Qt&&g&&Bg(u),u.flags|=1,cr(c,u,y,S),u.child)}function q2(c,u,g,y,S){if(c===null){var P=g.type;return typeof P=="function"&&!z0(P)&&P.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(u.tag=15,u.type=P,X2(c,u,P,y,S)):(c=zf(g.type,null,y,u,u.mode,S),c.ref=u.ref,c.return=u,u.child=c)}if(P=c.child,!(c.lanes&S)){var N=P.memoizedProps;if(g=g.compare,g=g!==null?g:af,g(N,y)&&c.ref===u.ref)return Ns(c,u,S)}return u.flags|=1,c=ka(P,y),c.ref=u.ref,c.return=u,u.child=c}function X2(c,u,g,y,S){if(c!==null){var P=c.memoizedProps;if(af(P,y)&&c.ref===u.ref)if(vr=!1,u.pendingProps=y=P,(c.lanes&S)!==0)c.flags&131072&&(vr=!0);else return u.lanes=c.lanes,Ns(c,u,S)}return h0(c,u,g,y,S)}function Y2(c,u,g){var y=u.pendingProps,S=y.children,P=c!==null?c.memoizedState:null;if(y.mode==="hidden")if(!(u.mode&1))u.memoizedState={baseLanes:0,cachePool:null,transitions:null},St(yl,Nr),Nr|=g;else{if(!(g&1073741824))return c=P!==null?P.baseLanes|g:g,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:c,cachePool:null,transitions:null},u.updateQueue=null,St(yl,Nr),Nr|=c,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=P!==null?P.baseLanes:g,St(yl,Nr),Nr|=y}else P!==null?(y=P.baseLanes|g,u.memoizedState=null):y=g,St(yl,Nr),Nr|=y;return cr(c,u,S,g),u.child}function Q2(c,u){var g=u.ref;(c===null&&g!==null||c!==null&&c.ref!==g)&&(u.flags|=512,u.flags|=2097152)}function h0(c,u,g,y,S){var P=gr(g)?lr:Wt.current;return P=cl(u,P),hl(u,S),g=a0(c,u,g,y,P,S),y=i0(),c!==null&&!vr?(u.updateQueue=c.updateQueue,u.flags&=-2053,c.lanes&=~S,Ns(c,u,S)):(Qt&&y&&Bg(u),u.flags|=1,cr(c,u,g,S),u.child)}function Z2(c,u,g,y,S){if(gr(g)){var P=!0;Qd(u)}else P=!1;if(hl(u,S),u.stateNode===null)Cf(c,u),m2(u,g,y),Jg(u,g,y,S),y=!0;else if(c===null){var N=u.stateNode,Z=u.memoizedProps;N.props=Z;var ce=N.context,Ee=g.contextType;typeof Ee=="object"&&Ee!==null?Ee=qr(Ee):(Ee=gr(g)?lr:Wt.current,Ee=cl(u,Ee));var Ke=g.getDerivedStateFromProps,pt=typeof Ke=="function"||typeof N.getSnapshotBeforeUpdate=="function";pt||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==y||ce!==Ee)&&g2(u,N,y,Ee),xa=!1;var He=u.memoizedState;N.state=He,df(u,y,N,S),ce=u.memoizedState,Z!==y||He!==ce||kn.current||xa?(typeof Ke=="function"&&(Zg(u,g,Ke,y),ce=u.memoizedState),(Z=xa||h2(u,g,Z,y,He,ce,Ee))?(pt||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(u.flags|=4194308)):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=y,u.memoizedState=ce),N.props=y,N.state=ce,N.context=Ee,y=Z):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),y=!1)}else{N=u.stateNode,u2(c,u),Z=u.memoizedProps,Ee=u.type===u.elementType?Z:ko(u.type,Z),N.props=Ee,pt=u.pendingProps,He=N.context,ce=g.contextType,typeof ce=="object"&&ce!==null?ce=qr(ce):(ce=gr(g)?lr:Wt.current,ce=cl(u,ce));var Kt=g.getDerivedStateFromProps;(Ke=typeof Kt=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==pt||He!==ce)&&g2(u,N,y,ce),xa=!1,He=u.memoizedState,N.state=He,df(u,y,N,S);var Ft=u.memoizedState;Z!==pt||He!==Ft||kn.current||xa?(typeof Kt=="function"&&(Zg(u,g,Kt,y),Ft=u.memoizedState),(Ee=xa||h2(u,g,Ee,y,He,Ft,ce)||!1)?(Ke||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,Ft,ce),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,Ft,ce)),typeof N.componentDidUpdate=="function"&&(u.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof N.componentDidUpdate!="function"||Z===c.memoizedProps&&He===c.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&He===c.memoizedState||(u.flags|=1024),u.memoizedProps=y,u.memoizedState=Ft),N.props=y,N.state=Ft,N.context=ce,y=Ee):(typeof N.componentDidUpdate!="function"||Z===c.memoizedProps&&He===c.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&He===c.memoizedState||(u.flags|=1024),y=!1)}return m0(c,u,g,y,P,S)}function m0(c,u,g,y,S,P){Q2(c,u);var N=(u.flags&128)!==0;if(!y&&!N)return S&&Zy(u,g,!1),Ns(c,u,P);y=u.stateNode,F8.current=u;var Z=N&&typeof g.getDerivedStateFromError!="function"?null:y.render();return u.flags|=1,c!==null&&N?(u.child=ml(u,c.child,null,P),u.child=ml(u,null,Z,P)):cr(c,u,Z,P),u.memoizedState=y.state,S&&Zy(u,g,!0),u.child}function J2(c){var u=c.stateNode;u.pendingContext?Yy(c,u.pendingContext,u.pendingContext!==u.context):u.context&&Yy(c,u.context,!1),e0(c,u.containerInfo)}function eC(c,u,g,y,S){return fl(),Ug(S),u.flags|=256,cr(c,u,g,y),u.child}var g0={dehydrated:null,treeContext:null,retryLane:0};function v0(c){return{baseLanes:c,cachePool:null,transitions:null}}function tC(c,u,g){var y=u.pendingProps,S=on.current,P=!1,N=(u.flags&128)!==0,Z;if((Z=N)||(Z=c!==null&&c.memoizedState===null?!1:(S&2)!==0),Z?(P=!0,u.flags&=-129):(c===null||c.memoizedState!==null)&&(S|=1),St(on,S&1),c===null)return Vg(u),c=u.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(u.mode&1?pa(c)?u.lanes=8:u.lanes=1073741824:u.lanes=1,null):(N=y.children,c=y.fallback,P?(y=u.mode,P=u.child,N={mode:"hidden",children:N},!(y&1)&&P!==null?(P.childLanes=0,P.pendingProps=N):P=Ff(N,y,0,null),c=mi(c,y,g,null),P.return=u,c.return=u,P.sibling=c,u.child=P,u.child.memoizedState=v0(g),u.memoizedState=g0,c):x0(u,N));if(S=c.memoizedState,S!==null&&(Z=S.dehydrated,Z!==null))return B8(c,u,N,y,Z,S,g);if(P){P=y.fallback,N=u.mode,S=c.child,Z=S.sibling;var ce={mode:"hidden",children:y.children};return!(N&1)&&u.child!==S?(y=u.child,y.childLanes=0,y.pendingProps=ce,u.deletions=null):(y=ka(S,ce),y.subtreeFlags=S.subtreeFlags&14680064),Z!==null?P=ka(Z,P):(P=mi(P,N,g,null),P.flags|=2),P.return=u,y.return=u,y.sibling=P,u.child=y,y=P,P=u.child,N=c.child.memoizedState,N=N===null?v0(g):{baseLanes:N.baseLanes|g,cachePool:null,transitions:N.transitions},P.memoizedState=N,P.childLanes=c.childLanes&~g,u.memoizedState=g0,y}return P=c.child,c=P.sibling,y=ka(P,{mode:"visible",children:y.children}),!(u.mode&1)&&(y.lanes=g),y.return=u,y.sibling=null,c!==null&&(g=u.deletions,g===null?(u.deletions=[c],u.flags|=16):g.push(c)),u.child=y,u.memoizedState=null,y}function x0(c,u){return u=Ff({mode:"visible",children:u},c.mode,0,null),u.return=c,c.child=u}function yf(c,u,g,y){return y!==null&&Ug(y),ml(u,c.child,null,g),c=x0(u,u.pendingProps.children),c.flags|=2,u.memoizedState=null,c}function B8(c,u,g,y,S,P,N){if(g)return u.flags&256?(u.flags&=-257,y=f0(Error(i(422))),yf(c,u,N,y)):u.memoizedState!==null?(u.child=c.child,u.flags|=128,null):(P=y.fallback,S=u.mode,y=Ff({mode:"visible",children:y.children},S,0,null),P=mi(P,S,N,null),P.flags|=2,y.return=u,P.return=u,y.sibling=P,u.child=y,u.mode&1&&ml(u,c.child,null,N),u.child.memoizedState=v0(N),u.memoizedState=g0,P);if(!(u.mode&1))return yf(c,u,N,null);if(pa(S))return y=ha(S).digest,P=Error(i(419)),y=f0(P,y,void 0),yf(c,u,N,y);if(g=(N&c.childLanes)!==0,vr||g){if(y=Ln,y!==null){switch(N&-N){case 4:S=2;break;case 16:S=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:S=32;break;case 536870912:S=268435456;break;default:S=0}S=S&(y.suspendedLanes|N)?0:S,S!==0&&S!==P.retryLane&&(P.retryLane=S,Zo(c,S),Qr(y,c,S,-1))}return L0(),y=f0(Error(i(421))),yf(c,u,N,y)}return Es(S)?(u.flags|=128,u.child=c.child,u=e7.bind(null,c),al(S,u),null):(c=P.treeContext,ye&&(Kr=At(S),Ar=u,Qt=!0,So=null,tu=!1,c!==null&&(Ur[Gr++]=Ds,Ur[Gr++]=Rs,Ur[Gr++]=ii,Ds=c.id,Rs=c.overflow,ii=u)),u=x0(u,y.children),u.flags|=4096,u)}function nC(c,u,g){c.lanes|=u;var y=c.alternate;y!==null&&(y.lanes|=u),Xg(c.return,u,g)}function b0(c,u,g,y,S){var P=c.memoizedState;P===null?c.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:y,tail:g,tailMode:S}:(P.isBackwards=u,P.rendering=null,P.renderingStartTime=0,P.last=y,P.tail=g,P.tailMode=S)}function rC(c,u,g){var y=u.pendingProps,S=y.revealOrder,P=y.tail;if(cr(c,u,y.children,g),y=on.current,y&2)y=y&1|2,u.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=u.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&nC(c,g,u);else if(c.tag===19)nC(c,g,u);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===u)break e;for(;c.sibling===null;){if(c.return===null||c.return===u)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}y&=1}if(St(on,y),!(u.mode&1))u.memoizedState=null;else switch(S){case"forwards":for(g=u.child,S=null;g!==null;)c=g.alternate,c!==null&&hf(c)===null&&(S=g),g=g.sibling;g=S,g===null?(S=u.child,u.child=null):(S=g.sibling,g.sibling=null),b0(u,!1,S,g,P);break;case"backwards":for(g=null,S=u.child,u.child=null;S!==null;){if(c=S.alternate,c!==null&&hf(c)===null){u.child=S;break}c=S.sibling,S.sibling=g,g=S,S=c}b0(u,!0,g,null,P);break;case"together":b0(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Cf(c,u){!(u.mode&1)&&c!==null&&(c.alternate=null,u.alternate=null,u.flags|=2)}function Ns(c,u,g){if(c!==null&&(u.dependencies=c.dependencies),di|=u.lanes,!(g&u.childLanes))return null;if(c!==null&&u.child!==c.child)throw Error(i(153));if(u.child!==null){for(c=u.child,g=ka(c,c.pendingProps),u.child=g,g.return=u;c.sibling!==null;)c=c.sibling,g=g.sibling=ka(c,c.pendingProps),g.return=u;g.sibling=null}return u.child}function H8(c,u,g){switch(u.tag){case 3:J2(u),fl();break;case 5:y2(u);break;case 1:gr(u.type)&&Qd(u);break;case 4:e0(u,u.stateNode.containerInfo);break;case 10:l2(u,u.type._context,u.memoizedProps.value);break;case 13:var y=u.memoizedState;if(y!==null)return y.dehydrated!==null?(St(on,on.current&1),u.flags|=128,null):g&u.child.childLanes?tC(c,u,g):(St(on,on.current&1),c=Ns(c,u,g),c!==null?c.sibling:null);St(on,on.current&1);break;case 19:if(y=(g&u.childLanes)!==0,c.flags&128){if(y)return rC(c,u,g);u.flags|=128}var S=u.memoizedState;if(S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),St(on,on.current),y)break;return null;case 22:case 23:return u.lanes=0,Y2(c,u,g)}return Ns(c,u,g)}function ts(c){c.flags|=4}function oC(c,u){if(c!==null&&c.child===u.child)return!0;if(u.flags&16)return!1;for(c=u.child;c!==null;){if(c.flags&12854||c.subtreeFlags&12854)return!1;c=c.sibling}return!0}var cu,uu,wf,Sf;if(de)cu=function(c,u){for(var g=u.child;g!==null;){if(g.tag===5||g.tag===6)Q(c,g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===u)break;for(;g.sibling===null;){if(g.return===null||g.return===u)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},uu=function(){},wf=function(c,u,g,y,S){if(c=c.memoizedProps,c!==y){var P=u.stateNode,N=Jo(Xr.current);g=oe(P,g,c,y,S,N),(u.updateQueue=g)&&ts(u)}},Sf=function(c,u,g,y){g!==y&&ts(u)};else if(me){cu=function(c,u,g,y){for(var S=u.child;S!==null;){if(S.tag===5){var P=S.stateNode;g&&y&&(P=mr(P,S.type,S.memoizedProps,S)),Q(c,P)}else if(S.tag===6)P=S.stateNode,g&&y&&(P=yo(P,S.memoizedProps,S)),Q(c,P);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)P=S.child,P!==null&&(P.return=S),cu(c,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===u)break;for(;S.sibling===null;){if(S.return===null||S.return===u)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};var sC=function(c,u,g,y){for(var S=u.child;S!==null;){if(S.tag===5){var P=S.stateNode;g&&y&&(P=mr(P,S.type,S.memoizedProps,S)),dn(c,P)}else if(S.tag===6)P=S.stateNode,g&&y&&(P=yo(P,S.memoizedProps,S)),dn(c,P);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)P=S.child,P!==null&&(P.return=S),sC(c,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===u)break;for(;S.sibling===null;){if(S.return===null||S.return===u)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};uu=function(c,u){var g=u.stateNode;if(!oC(c,u)){c=g.containerInfo;var y=In(c);sC(y,u,!1,!1),g.pendingChildren=y,ts(u),rn(c,y)}},wf=function(c,u,g,y,S){var P=c.stateNode,N=c.memoizedProps;if((c=oC(c,u))&&N===y)u.stateNode=P;else{var Z=u.stateNode,ce=Jo(Xr.current),Ee=null;N!==y&&(Ee=oe(Z,g,N,y,S,ce)),c&&Ee===null?u.stateNode=P:(P=sr(P,Ee,g,N,y,u,c,Z),ie(P,g,y,S,ce)&&ts(u),u.stateNode=P,c?ts(u):cu(P,u,!1,!1))}},Sf=function(c,u,g,y){g!==y?(c=Jo(gl.current),g=Jo(Xr.current),u.stateNode=G(y,c,g,u),ts(u)):u.stateNode=c.stateNode}}else uu=function(){},wf=function(){},Sf=function(){};function du(c,u){if(!Qt)switch(c.tailMode){case"hidden":u=c.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?c.tail=null:g.sibling=null;break;case"collapsed":g=c.tail;for(var y=null;g!==null;)g.alternate!==null&&(y=g),g=g.sibling;y===null?u||c.tail===null?c.tail=null:c.tail.sibling=null:y.sibling=null}}function Xn(c){var u=c.alternate!==null&&c.alternate.child===c.child,g=0,y=0;if(u)for(var S=c.child;S!==null;)g|=S.lanes|S.childLanes,y|=S.subtreeFlags&14680064,y|=S.flags&14680064,S.return=c,S=S.sibling;else for(S=c.child;S!==null;)g|=S.lanes|S.childLanes,y|=S.subtreeFlags,y|=S.flags,S.return=c,S=S.sibling;return c.subtreeFlags|=y,c.childLanes=g,u}function W8(c,u,g){var y=u.pendingProps;switch(Hg(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xn(u),null;case 1:return gr(u.type)&&Yd(),Xn(u),null;case 3:return g=u.stateNode,vl(),xt(kn),xt(Wt),r0(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(c===null||c.child===null)&&(sf(u)?ts(u):c===null||c.memoizedState.isDehydrated&&!(u.flags&256)||(u.flags|=1024,So!==null&&(T0(So),So=null))),uu(c,u),Xn(u),null;case 5:t0(u),g=Jo(gl.current);var S=u.type;if(c!==null&&u.stateNode!=null)wf(c,u,S,y,g),c.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!y){if(u.stateNode===null)throw Error(i(166));return Xn(u),null}if(c=Jo(Xr.current),sf(u)){if(!ye)throw Error(i(175));c=En(u.stateNode,u.type,u.memoizedProps,g,c,u,!tu),u.updateQueue=c,c!==null&&ts(u)}else{var P=ne(S,y,g,c,u);cu(P,u,!1,!1),u.stateNode=P,ie(P,S,y,g,c)&&ts(u)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return Xn(u),null;case 6:if(c&&u.stateNode!=null)Sf(c,u,c.memoizedProps,y);else{if(typeof y!="string"&&u.stateNode===null)throw Error(i(166));if(c=Jo(gl.current),g=Jo(Xr.current),sf(u)){if(!ye)throw Error(i(176));if(c=u.stateNode,g=u.memoizedProps,(y=vt(c,g,u,!tu))&&(S=Ar,S!==null))switch(S.tag){case 3:Xd(S.stateNode.containerInfo,c,g,(S.mode&1)!==0);break;case 5:ll(S.type,S.memoizedProps,S.stateNode,c,g,(S.mode&1)!==0)}y&&ts(u)}else u.stateNode=G(y,c,g,u)}return Xn(u),null;case 13:if(xt(on),y=u.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(Qt&&Kr!==null&&u.mode&1&&!(u.flags&128))i2(),fl(),u.flags|=98560,S=!1;else if(S=sf(u),y!==null&&y.dehydrated!==null){if(c===null){if(!S)throw Error(i(318));if(!ye)throw Error(i(344));if(S=u.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(i(317));ga(S,u)}else fl(),!(u.flags&128)&&(u.memoizedState=null),u.flags|=4;Xn(u),S=!1}else So!==null&&(T0(So),So=null),S=!0;if(!S)return u.flags&65536?u:null}return u.flags&128?(u.lanes=g,u):(g=y!==null,g!==(c!==null&&c.memoizedState!==null)&&g&&(u.child.flags|=8192,u.mode&1&&(c===null||on.current&1?Dn===0&&(Dn=3):L0())),u.updateQueue!==null&&(u.flags|=4),Xn(u),null);case 4:return vl(),uu(c,u),c===null&&ue(u.stateNode.containerInfo),Xn(u),null;case 10:return qg(u.type._context),Xn(u),null;case 17:return gr(u.type)&&Yd(),Xn(u),null;case 19:if(xt(on),S=u.memoizedState,S===null)return Xn(u),null;if(y=(u.flags&128)!==0,P=S.rendering,P===null)if(y)du(S,!1);else{if(Dn!==0||c!==null&&c.flags&128)for(c=u.child;c!==null;){if(P=hf(c),P!==null){for(u.flags|=128,du(S,!1),c=P.updateQueue,c!==null&&(u.updateQueue=c,u.flags|=4),u.subtreeFlags=0,c=g,g=u.child;g!==null;)y=g,S=c,y.flags&=14680066,P=y.alternate,P===null?(y.childLanes=0,y.lanes=S,y.child=null,y.subtreeFlags=0,y.memoizedProps=null,y.memoizedState=null,y.updateQueue=null,y.dependencies=null,y.stateNode=null):(y.childLanes=P.childLanes,y.lanes=P.lanes,y.child=P.child,y.subtreeFlags=0,y.deletions=null,y.memoizedProps=P.memoizedProps,y.memoizedState=P.memoizedState,y.updateQueue=P.updateQueue,y.type=P.type,S=P.dependencies,y.dependencies=S===null?null:{lanes:S.lanes,firstContext:S.firstContext}),g=g.sibling;return St(on,on.current&1|2),u.child}c=c.sibling}S.tail!==null&&Tn()>D0&&(u.flags|=128,y=!0,du(S,!1),u.lanes=4194304)}else{if(!y)if(c=hf(P),c!==null){if(u.flags|=128,y=!0,c=c.updateQueue,c!==null&&(u.updateQueue=c,u.flags|=4),du(S,!0),S.tail===null&&S.tailMode==="hidden"&&!P.alternate&&!Qt)return Xn(u),null}else 2*Tn()-S.renderingStartTime>D0&&g!==1073741824&&(u.flags|=128,y=!0,du(S,!1),u.lanes=4194304);S.isBackwards?(P.sibling=u.child,u.child=P):(c=S.last,c!==null?c.sibling=P:u.child=P,S.last=P)}return S.tail!==null?(u=S.tail,S.rendering=u,S.tail=u.sibling,S.renderingStartTime=Tn(),u.sibling=null,c=on.current,St(on,y?c&1|2:c&1),u):(Xn(u),null);case 22:case 23:return $0(),g=u.memoizedState!==null,c!==null&&c.memoizedState!==null!==g&&(u.flags|=8192),g&&u.mode&1?Nr&1073741824&&(Xn(u),de&&u.subtreeFlags&6&&(u.flags|=8192)):Xn(u),null;case 24:return null;case 25:return null}throw Error(i(156,u.tag))}function V8(c,u){switch(Hg(u),u.tag){case 1:return gr(u.type)&&Yd(),c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 3:return vl(),xt(kn),xt(Wt),r0(),c=u.flags,c&65536&&!(c&128)?(u.flags=c&-65537|128,u):null;case 5:return t0(u),null;case 13:if(xt(on),c=u.memoizedState,c!==null&&c.dehydrated!==null){if(u.alternate===null)throw Error(i(340));fl()}return c=u.flags,c&65536?(u.flags=c&-65537|128,u):null;case 19:return xt(on),null;case 4:return vl(),null;case 10:return qg(u.type._context),null;case 22:case 23:return $0(),null;case 24:return null;default:return null}}var kf=!1,Yn=!1,U8=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function bl(c,u){var g=c.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(y){Zt(c,u,y)}else g.current=null}function y0(c,u,g){try{g()}catch(y){Zt(c,u,y)}}var aC=!1;function G8(c,u){for(z(c.containerInfo),Ge=u;Ge!==null;)if(c=Ge,u=c.child,(c.subtreeFlags&1028)!==0&&u!==null)u.return=c,Ge=u;else for(;Ge!==null;){c=Ge;try{var g=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,S=g.memoizedState,P=c.stateNode,N=P.getSnapshotBeforeUpdate(c.elementType===c.type?y:ko(c.type,y),S);P.__reactInternalSnapshotBeforeUpdate=N}break;case 3:de&&jt(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Z){Zt(c,c.return,Z)}if(u=c.sibling,u!==null){u.return=c.return,Ge=u;break}Ge=c.return}return g=aC,aC=!1,g}function fu(c,u,g){var y=u.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var S=y=y.next;do{if((S.tag&c)===c){var P=S.destroy;S.destroy=void 0,P!==void 0&&y0(u,g,P)}S=S.next}while(S!==y)}}function _f(c,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var g=u=u.next;do{if((g.tag&c)===c){var y=g.create;g.destroy=y()}g=g.next}while(g!==u)}}function C0(c){var u=c.ref;if(u!==null){var g=c.stateNode;switch(c.tag){case 5:c=W(g);break;default:c=g}typeof u=="function"?u(c):u.current=c}}function iC(c){var u=c.alternate;u!==null&&(c.alternate=null,iC(u)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(u=c.stateNode,u!==null&&je(u)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function lC(c){return c.tag===5||c.tag===3||c.tag===4}function cC(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||lC(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function w0(c,u,g){var y=c.tag;if(y===5||y===6)c=c.stateNode,u?Rt(g,c,u):Ye(g,c);else if(y!==4&&(c=c.child,c!==null))for(w0(c,u,g),c=c.sibling;c!==null;)w0(c,u,g),c=c.sibling}function S0(c,u,g){var y=c.tag;if(y===5||y===6)c=c.stateNode,u?$e(g,c,u):ge(g,c);else if(y!==4&&(c=c.child,c!==null))for(S0(c,u,g),c=c.sibling;c!==null;)S0(c,u,g),c=c.sibling}var Wn=null,_o=!1;function ns(c,u,g){for(g=g.child;g!==null;)k0(c,u,g),g=g.sibling}function k0(c,u,g){if(Yo&&typeof Yo.onCommitFiberUnmount=="function")try{Yo.onCommitFiberUnmount(tf,g)}catch{}switch(g.tag){case 5:Yn||bl(g,u);case 6:if(de){var y=Wn,S=_o;Wn=null,ns(c,u,g),Wn=y,_o=S,Wn!==null&&(_o?ze(Wn,g.stateNode):ke(Wn,g.stateNode))}else ns(c,u,g);break;case 18:de&&Wn!==null&&(_o?Mn(Wn,g.stateNode):Dg(Wn,g.stateNode));break;case 4:de?(y=Wn,S=_o,Wn=g.stateNode.containerInfo,_o=!0,ns(c,u,g),Wn=y,_o=S):(me&&(y=g.stateNode.containerInfo,S=In(y),Yt(y,S)),ns(c,u,g));break;case 0:case 11:case 14:case 15:if(!Yn&&(y=g.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){S=y=y.next;do{var P=S,N=P.destroy;P=P.tag,N!==void 0&&(P&2||P&4)&&y0(g,u,N),S=S.next}while(S!==y)}ns(c,u,g);break;case 1:if(!Yn&&(bl(g,u),y=g.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=g.memoizedProps,y.state=g.memoizedState,y.componentWillUnmount()}catch(Z){Zt(g,u,Z)}ns(c,u,g);break;case 21:ns(c,u,g);break;case 22:g.mode&1?(Yn=(y=Yn)||g.memoizedState!==null,ns(c,u,g),Yn=y):ns(c,u,g);break;default:ns(c,u,g)}}function uC(c){var u=c.updateQueue;if(u!==null){c.updateQueue=null;var g=c.stateNode;g===null&&(g=c.stateNode=new U8),u.forEach(function(y){var S=t7.bind(null,c,y);g.has(y)||(g.add(y),y.then(S,S))})}}function jo(c,u){var g=u.deletions;if(g!==null)for(var y=0;y<g.length;y++){var S=g[y];try{var P=c,N=u;if(de){var Z=N;e:for(;Z!==null;){switch(Z.tag){case 5:Wn=Z.stateNode,_o=!1;break e;case 3:Wn=Z.stateNode.containerInfo,_o=!0;break e;case 4:Wn=Z.stateNode.containerInfo,_o=!0;break e}Z=Z.return}if(Wn===null)throw Error(i(160));k0(P,N,S),Wn=null,_o=!1}else k0(P,N,S);var ce=S.alternate;ce!==null&&(ce.return=null),S.return=null}catch(Ee){Zt(S,u,Ee)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)dC(u,c),u=u.sibling}function dC(c,u){var g=c.alternate,y=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(jo(u,c),rs(c),y&4){try{fu(3,c,c.return),_f(3,c)}catch(He){Zt(c,c.return,He)}try{fu(5,c,c.return)}catch(He){Zt(c,c.return,He)}}break;case 1:jo(u,c),rs(c),y&512&&g!==null&&bl(g,g.return);break;case 5:if(jo(u,c),rs(c),y&512&&g!==null&&bl(g,g.return),de){if(c.flags&32){var S=c.stateNode;try{Le(S)}catch(He){Zt(c,c.return,He)}}if(y&4&&(S=c.stateNode,S!=null)){var P=c.memoizedProps;if(g=g!==null?g.memoizedProps:P,y=c.type,u=c.updateQueue,c.updateQueue=null,u!==null)try{Me(S,u,y,g,P,c)}catch(He){Zt(c,c.return,He)}}}break;case 6:if(jo(u,c),rs(c),y&4&&de){if(c.stateNode===null)throw Error(i(162));S=c.stateNode,P=c.memoizedProps,g=g!==null?g.memoizedProps:P;try{ot(S,g,P)}catch(He){Zt(c,c.return,He)}}break;case 3:if(jo(u,c),rs(c),y&4){if(de&&ye&&g!==null&&g.memoizedState.isDehydrated)try{qd(u.containerInfo)}catch(He){Zt(c,c.return,He)}if(me){S=u.containerInfo,P=u.pendingChildren;try{Yt(S,P)}catch(He){Zt(c,c.return,He)}}}break;case 4:if(jo(u,c),rs(c),y&4&&me){P=c.stateNode,S=P.containerInfo,P=P.pendingChildren;try{Yt(S,P)}catch(He){Zt(c,c.return,He)}}break;case 13:jo(u,c),rs(c),S=c.child,S.flags&8192&&(P=S.memoizedState!==null,S.stateNode.isHidden=P,!P||S.alternate!==null&&S.alternate.memoizedState!==null||(O0=Tn())),y&4&&uC(c);break;case 22:var N=g!==null&&g.memoizedState!==null;if(c.mode&1?(Yn=(g=Yn)||N,jo(u,c),Yn=g):jo(u,c),rs(c),y&8192){if(g=c.memoizedState!==null,(c.stateNode.isHidden=g)&&!N&&c.mode&1)for(Ge=c,y=c.child;y!==null;){for(u=Ge=y;Ge!==null;){N=Ge;var Z=N.child;switch(N.tag){case 0:case 11:case 14:case 15:fu(4,N,N.return);break;case 1:bl(N,N.return);var ce=N.stateNode;if(typeof ce.componentWillUnmount=="function"){var Ee=N,Ke=N.return;try{var pt=Ee;ce.props=pt.memoizedProps,ce.state=pt.memoizedState,ce.componentWillUnmount()}catch(He){Zt(Ee,Ke,He)}}break;case 5:bl(N,N.return);break;case 22:if(N.memoizedState!==null){hC(u);continue}}Z!==null?(Z.return=N,Ge=Z):hC(u)}y=y.sibling}if(de){e:if(y=null,de)for(u=c;;){if(u.tag===5){if(y===null){y=u;try{S=u.stateNode,g?Ve(S):vn(u.stateNode,u.memoizedProps)}catch(He){Zt(c,c.return,He)}}}else if(u.tag===6){if(y===null)try{P=u.stateNode,g?ct(P):_t(P,u.memoizedProps)}catch(He){Zt(c,c.return,He)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===c)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===c)break e;for(;u.sibling===null;){if(u.return===null||u.return===c)break e;y===u&&(y=null),u=u.return}y===u&&(y=null),u.sibling.return=u.return,u=u.sibling}}}break;case 19:jo(u,c),rs(c),y&4&&uC(c);break;case 21:break;default:jo(u,c),rs(c)}}function rs(c){var u=c.flags;if(u&2){try{if(de){e:{for(var g=c.return;g!==null;){if(lC(g)){var y=g;break e}g=g.return}throw Error(i(160))}switch(y.tag){case 5:var S=y.stateNode;y.flags&32&&(Le(S),y.flags&=-33);var P=cC(c);S0(c,P,S);break;case 3:case 4:var N=y.stateNode.containerInfo,Z=cC(c);w0(c,Z,N);break;default:throw Error(i(161))}}}catch(ce){Zt(c,c.return,ce)}c.flags&=-3}u&4096&&(c.flags&=-4097)}function K8(c,u,g){Ge=c,fC(c)}function fC(c,u,g){for(var y=(c.mode&1)!==0;Ge!==null;){var S=Ge,P=S.child;if(S.tag===22&&y){var N=S.memoizedState!==null||kf;if(!N){var Z=S.alternate,ce=Z!==null&&Z.memoizedState!==null||Yn;Z=kf;var Ee=Yn;if(kf=N,(Yn=ce)&&!Ee)for(Ge=S;Ge!==null;)N=Ge,ce=N.child,N.tag===22&&N.memoizedState!==null?mC(S):ce!==null?(ce.return=N,Ge=ce):mC(S);for(;P!==null;)Ge=P,fC(P),P=P.sibling;Ge=S,kf=Z,Yn=Ee}pC(c)}else S.subtreeFlags&8772&&P!==null?(P.return=S,Ge=P):pC(c)}}function pC(c){for(;Ge!==null;){var u=Ge;if(u.flags&8772){var g=u.alternate;try{if(u.flags&8772)switch(u.tag){case 0:case 11:case 15:Yn||_f(5,u);break;case 1:var y=u.stateNode;if(u.flags&4&&!Yn)if(g===null)y.componentDidMount();else{var S=u.elementType===u.type?g.memoizedProps:ko(u.type,g.memoizedProps);y.componentDidUpdate(S,g.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var P=u.updateQueue;P!==null&&f2(u,P,y);break;case 3:var N=u.updateQueue;if(N!==null){if(g=null,u.child!==null)switch(u.child.tag){case 5:g=W(u.child.stateNode);break;case 1:g=u.child.stateNode}f2(u,N,g)}break;case 5:var Z=u.stateNode;g===null&&u.flags&4&&lt(Z,u.type,u.memoizedProps,u);break;case 6:break;case 4:break;case 12:break;case 13:if(ye&&u.memoizedState===null){var ce=u.alternate;if(ce!==null){var Ee=ce.memoizedState;if(Ee!==null){var Ke=Ee.dehydrated;Ke!==null&&Og(Ke)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}Yn||u.flags&512&&C0(u)}catch(pt){Zt(u,u.return,pt)}}if(u===c){Ge=null;break}if(g=u.sibling,g!==null){g.return=u.return,Ge=g;break}Ge=u.return}}function hC(c){for(;Ge!==null;){var u=Ge;if(u===c){Ge=null;break}var g=u.sibling;if(g!==null){g.return=u.return,Ge=g;break}Ge=u.return}}function mC(c){for(;Ge!==null;){var u=Ge;try{switch(u.tag){case 0:case 11:case 15:var g=u.return;try{_f(4,u)}catch(ce){Zt(u,g,ce)}break;case 1:var y=u.stateNode;if(typeof y.componentDidMount=="function"){var S=u.return;try{y.componentDidMount()}catch(ce){Zt(u,S,ce)}}var P=u.return;try{C0(u)}catch(ce){Zt(u,P,ce)}break;case 5:var N=u.return;try{C0(u)}catch(ce){Zt(u,N,ce)}}}catch(ce){Zt(u,u.return,ce)}if(u===c){Ge=null;break}var Z=u.sibling;if(Z!==null){Z.return=u.return,Ge=Z;break}Ge=u.return}}var jf=0,Pf=1,If=2,Ef=3,Mf=4;if(typeof Symbol=="function"&&Symbol.for){var pu=Symbol.for;jf=pu("selector.component"),Pf=pu("selector.has_pseudo_class"),If=pu("selector.role"),Ef=pu("selector.test_id"),Mf=pu("selector.text")}function _0(c){var u=he(c);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(i(364));return u}if(c=Ct(c),c===null)throw Error(i(362));return c.stateNode.current}function j0(c,u){switch(u.$$typeof){case jf:if(c.type===u.value)return!0;break;case Pf:e:{u=u.value,c=[c,0];for(var g=0;g<c.length;){var y=c[g++],S=c[g++],P=u[S];if(y.tag!==5||!ve(y)){for(;P!=null&&j0(y,P);)S++,P=u[S];if(S===u.length){u=!0;break e}else for(y=y.child;y!==null;)c.push(y,S),y=y.sibling}}u=!1}return u;case If:if(c.tag===5&&Re(c.stateNode,u.value))return!0;break;case Mf:if((c.tag===5||c.tag===6)&&(c=tt(c),c!==null&&0<=c.indexOf(u.value)))return!0;break;case Ef:if(c.tag===5&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===u.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function P0(c){switch(c.$$typeof){case jf:return"<"+(O(c.value)||"Unknown")+">";case Pf:return":has("+(P0(c)||"")+")";case If:return'[role="'+c.value+'"]';case Mf:return'"'+c.value+'"';case Ef:return'[data-testname="'+c.value+'"]';default:throw Error(i(365))}}function gC(c,u){var g=[];c=[c,0];for(var y=0;y<c.length;){var S=c[y++],P=c[y++],N=u[P];if(S.tag!==5||!ve(S)){for(;N!=null&&j0(S,N);)P++,N=u[P];if(P===u.length)g.push(S);else for(S=S.child;S!==null;)c.push(S,P),S=S.sibling}}return g}function I0(c,u){if(!Ue)throw Error(i(363));c=_0(c),c=gC(c,u),u=[],c=Array.from(c);for(var g=0;g<c.length;){var y=c[g++];if(y.tag===5)ve(y)||u.push(y.stateNode);else for(y=y.child;y!==null;)c.push(y),y=y.sibling}return u}var q8=Math.ceil,Of=l.ReactCurrentDispatcher,E0=l.ReactCurrentOwner,xn=l.ReactCurrentBatchConfig,bt=0,Ln=null,_n=null,Vn=0,Nr=0,yl=wt(0),Dn=0,hu=null,di=0,Df=0,M0=0,mu=null,xr=null,O0=0,D0=1/0,Ts=null;function Cl(){D0=Tn()+500}var Rf=!1,R0=null,ya=null,Af=!1,Ca=null,Nf=0,gu=0,A0=null,Tf=-1,$f=0;function Qn(){return bt&6?Tn():Tf!==-1?Tf:Tf=Tn()}function wa(c){return c.mode&1?bt&2&&Vn!==0?Vn&-Vn:M8.transition!==null?($f===0&&($f=Jy()),$f):(c=It,c!==0?c:De()):1}function Qr(c,u,g,y){if(50<gu)throw gu=0,A0=null,Error(i(185));eu(c,g,y),(!(bt&2)||c!==Ln)&&(c===Ln&&(!(bt&2)&&(Df|=g),Dn===4&&Sa(c,Vn)),br(c,y),g===1&&bt===0&&!(u.mode&1)&&(Cl(),nf&&Qo()))}function br(c,u){var g=c.callbackNode;C8(c,u);var y=ef(c,c===Ln?Vn:0);if(y===0)g!==null&&t2(g),c.callbackNode=null,c.callbackPriority=0;else if(u=y&-y,c.callbackPriority!==u){if(g!=null&&t2(g),u===1)c.tag===0?E8(xC.bind(null,c)):n2(xC.bind(null,c)),Be?rt(function(){!(bt&6)&&Qo()}):$g(Lg,Qo),g=null;else{switch(e2(y)){case 1:g=Lg;break;case 4:g=_8;break;case 16:g=zg;break;case 536870912:g=j8;break;default:g=zg}g=PC(g,vC.bind(null,c))}c.callbackPriority=u,c.callbackNode=g}}function vC(c,u){if(Tf=-1,$f=0,bt&6)throw Error(i(327));var g=c.callbackNode;if(hi()&&c.callbackNode!==g)return null;var y=ef(c,c===Ln?Vn:0);if(y===0)return null;if(y&30||y&c.expiredLanes||u)u=Lf(c,y);else{u=y;var S=bt;bt|=2;var P=CC();(Ln!==c||Vn!==u)&&(Ts=null,Cl(),fi(c,u));do try{Q8();break}catch(Z){yC(c,Z)}while(1);Kg(),Of.current=P,bt=S,_n!==null?u=0:(Ln=null,Vn=0,u=Dn)}if(u!==0){if(u===2&&(S=Ag(c),S!==0&&(y=S,u=N0(c,S))),u===1)throw g=hu,fi(c,0),Sa(c,y),br(c,Tn()),g;if(u===6)Sa(c,y);else{if(S=c.current.alternate,!(y&30)&&!X8(S)&&(u=Lf(c,y),u===2&&(P=Ag(c),P!==0&&(y=P,u=N0(c,P))),u===1))throw g=hu,fi(c,0),Sa(c,y),br(c,Tn()),g;switch(c.finishedWork=S,c.finishedLanes=y,u){case 0:case 1:throw Error(i(345));case 2:pi(c,xr,Ts);break;case 3:if(Sa(c,y),(y&130023424)===y&&(u=O0+500-Tn(),10<u)){if(ef(c,0)!==0)break;if(S=c.suspendedLanes,(S&y)!==y){Qn(),c.pingedLanes|=c.suspendedLanes&S;break}c.timeoutHandle=J(pi.bind(null,c,xr,Ts),u);break}pi(c,xr,Ts);break;case 4:if(Sa(c,y),(y&4194240)===y)break;for(u=c.eventTimes,S=-1;0<y;){var N=31-Co(y);P=1<<N,N=u[N],N>S&&(S=N),y&=~P}if(y=S,y=Tn()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*q8(y/1960))-y,10<y){c.timeoutHandle=J(pi.bind(null,c,xr,Ts),y);break}pi(c,xr,Ts);break;case 5:pi(c,xr,Ts);break;default:throw Error(i(329))}}}return br(c,Tn()),c.callbackNode===g?vC.bind(null,c):null}function N0(c,u){var g=mu;return c.current.memoizedState.isDehydrated&&(fi(c,u).flags|=256),c=Lf(c,u),c!==2&&(u=xr,xr=g,u!==null&&T0(u)),c}function T0(c){xr===null?xr=c:xr.push.apply(xr,c)}function X8(c){for(var u=c;;){if(u.flags&16384){var g=u.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var y=0;y<g.length;y++){var S=g[y],P=S.getSnapshot;S=S.value;try{if(!wo(P(),S))return!1}catch{return!1}}}if(g=u.child,u.subtreeFlags&16384&&g!==null)g.return=u,u=g;else{if(u===c)break;for(;u.sibling===null;){if(u.return===null||u.return===c)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function Sa(c,u){for(u&=~M0,u&=~Df,c.suspendedLanes|=u,c.pingedLanes&=~u,c=c.expirationTimes;0<u;){var g=31-Co(u),y=1<<g;c[g]=-1,u&=~y}}function xC(c){if(bt&6)throw Error(i(327));hi();var u=ef(c,0);if(!(u&1))return br(c,Tn()),null;var g=Lf(c,u);if(c.tag!==0&&g===2){var y=Ag(c);y!==0&&(u=y,g=N0(c,y))}if(g===1)throw g=hu,fi(c,0),Sa(c,u),br(c,Tn()),g;if(g===6)throw Error(i(345));return c.finishedWork=c.current.alternate,c.finishedLanes=u,pi(c,xr,Ts),br(c,Tn()),null}function bC(c){Ca!==null&&Ca.tag===0&&!(bt&6)&&hi();var u=bt;bt|=1;var g=xn.transition,y=It;try{if(xn.transition=null,It=1,c)return c()}finally{It=y,xn.transition=g,bt=u,!(bt&6)&&Qo()}}function $0(){Nr=yl.current,xt(yl)}function fi(c,u){c.finishedWork=null,c.finishedLanes=0;var g=c.timeoutHandle;if(g!==re&&(c.timeoutHandle=re,se(g)),_n!==null)for(g=_n.return;g!==null;){var y=g;switch(Hg(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Yd();break;case 3:vl(),xt(kn),xt(Wt),r0();break;case 5:t0(y);break;case 4:vl();break;case 13:xt(on);break;case 19:xt(on);break;case 10:qg(y.type._context);break;case 22:case 23:$0()}g=g.return}if(Ln=c,_n=c=ka(c.current,null),Vn=Nr=u,Dn=0,hu=null,M0=Df=di=0,xr=mu=null,ci!==null){for(u=0;u<ci.length;u++)if(g=ci[u],y=g.interleaved,y!==null){g.interleaved=null;var S=y.next,P=g.pending;if(P!==null){var N=P.next;P.next=S,y.next=N}g.pending=y}ci=null}return c}function yC(c,u){do{var g=_n;try{if(Kg(),mf.current=bf,gf){for(var y=sn.memoizedState;y!==null;){var S=y.queue;S!==null&&(S.pending=null),y=y.next}gf=!1}if(ui=0,$n=On=sn=null,su=!1,au=0,E0.current=null,g===null||g.return===null){Dn=1,hu=u,_n=null;break}e:{var P=c,N=g.return,Z=g,ce=u;if(u=Vn,Z.flags|=32768,ce!==null&&typeof ce=="object"&&typeof ce.then=="function"){var Ee=ce,Ke=Z,pt=Ke.tag;if(!(Ke.mode&1)&&(pt===0||pt===11||pt===15)){var He=Ke.alternate;He?(Ke.updateQueue=He.updateQueue,Ke.memoizedState=He.memoizedState,Ke.lanes=He.lanes):(Ke.updateQueue=null,Ke.memoizedState=null)}var Kt=U2(N);if(Kt!==null){Kt.flags&=-257,G2(Kt,N,Z,P,u),Kt.mode&1&&V2(P,Ee,u),u=Kt,ce=Ee;var Ft=u.updateQueue;if(Ft===null){var yr=new Set;yr.add(ce),u.updateQueue=yr}else Ft.add(ce);break e}else{if(!(u&1)){V2(P,Ee,u),L0();break e}ce=Error(i(426))}}else if(Qt&&Z.mode&1){var $s=U2(N);if($s!==null){!($s.flags&65536)&&($s.flags|=256),G2($s,N,Z,P,u),Ug(xl(ce,Z));break e}}P=ce=xl(ce,Z),Dn!==4&&(Dn=2),mu===null?mu=[P]:mu.push(P),P=N;do{switch(P.tag){case 3:P.flags|=65536,u&=-u,P.lanes|=u;var le=H2(P,ce,u);d2(P,le);break e;case 1:Z=ce;var ee=P.type,pe=P.stateNode;if(!(P.flags&128)&&(typeof ee.getDerivedStateFromError=="function"||pe!==null&&typeof pe.componentDidCatch=="function"&&(ya===null||!ya.has(pe)))){P.flags|=65536,u&=-u,P.lanes|=u;var We=W2(P,Z,u);d2(P,We);break e}}P=P.return}while(P!==null)}SC(g)}catch(nt){u=nt,_n===g&&g!==null&&(_n=g=g.return);continue}break}while(1)}function CC(){var c=Of.current;return Of.current=bf,c===null?bf:c}function L0(){(Dn===0||Dn===3||Dn===2)&&(Dn=4),Ln===null||!(di&268435455)&&!(Df&268435455)||Sa(Ln,Vn)}function Lf(c,u){var g=bt;bt|=2;var y=CC();(Ln!==c||Vn!==u)&&(Ts=null,fi(c,u));do try{Y8();break}catch(S){yC(c,S)}while(1);if(Kg(),bt=g,Of.current=y,_n!==null)throw Error(i(261));return Ln=null,Vn=0,Dn}function Y8(){for(;_n!==null;)wC(_n)}function Q8(){for(;_n!==null&&!S8();)wC(_n)}function wC(c){var u=jC(c.alternate,c,Nr);c.memoizedProps=c.pendingProps,u===null?SC(c):_n=u,E0.current=null}function SC(c){var u=c;do{var g=u.alternate;if(c=u.return,u.flags&32768){if(g=V8(g,u),g!==null){g.flags&=32767,_n=g;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Dn=6,_n=null;return}}else if(g=W8(g,u,Nr),g!==null){_n=g;return}if(u=u.sibling,u!==null){_n=u;return}_n=u=c}while(u!==null);Dn===0&&(Dn=5)}function pi(c,u,g){var y=It,S=xn.transition;try{xn.transition=null,It=1,Z8(c,u,g,y)}finally{xn.transition=S,It=y}return null}function Z8(c,u,g,y){do hi();while(Ca!==null);if(bt&6)throw Error(i(327));g=c.finishedWork;var S=c.finishedLanes;if(g===null)return null;if(c.finishedWork=null,c.finishedLanes=0,g===c.current)throw Error(i(177));c.callbackNode=null,c.callbackPriority=0;var P=g.lanes|g.childLanes;if(w8(c,P),c===Ln&&(_n=Ln=null,Vn=0),!(g.subtreeFlags&2064)&&!(g.flags&2064)||Af||(Af=!0,PC(zg,function(){return hi(),null})),P=(g.flags&15990)!==0,g.subtreeFlags&15990||P){P=xn.transition,xn.transition=null;var N=It;It=1;var Z=bt;bt|=4,E0.current=null,G8(c,g),dC(g,c),q(c.containerInfo),c.current=g,K8(g),k8(),bt=Z,It=N,xn.transition=P}else c.current=g;if(Af&&(Af=!1,Ca=c,Nf=S),P=c.pendingLanes,P===0&&(ya=null),P8(g.stateNode),br(c,Tn()),u!==null)for(y=c.onRecoverableError,g=0;g<u.length;g++)S=u[g],y(S.value,{componentStack:S.stack,digest:S.digest});if(Rf)throw Rf=!1,c=R0,R0=null,c;return Nf&1&&c.tag!==0&&hi(),P=c.pendingLanes,P&1?c===A0?gu++:(gu=0,A0=c):gu=0,Qo(),null}function hi(){if(Ca!==null){var c=e2(Nf),u=xn.transition,g=It;try{if(xn.transition=null,It=16>c?16:c,Ca===null)var y=!1;else{if(c=Ca,Ca=null,Nf=0,bt&6)throw Error(i(331));var S=bt;for(bt|=4,Ge=c.current;Ge!==null;){var P=Ge,N=P.child;if(Ge.flags&16){var Z=P.deletions;if(Z!==null){for(var ce=0;ce<Z.length;ce++){var Ee=Z[ce];for(Ge=Ee;Ge!==null;){var Ke=Ge;switch(Ke.tag){case 0:case 11:case 15:fu(8,Ke,P)}var pt=Ke.child;if(pt!==null)pt.return=Ke,Ge=pt;else for(;Ge!==null;){Ke=Ge;var He=Ke.sibling,Kt=Ke.return;if(iC(Ke),Ke===Ee){Ge=null;break}if(He!==null){He.return=Kt,Ge=He;break}Ge=Kt}}}var Ft=P.alternate;if(Ft!==null){var yr=Ft.child;if(yr!==null){Ft.child=null;do{var $s=yr.sibling;yr.sibling=null,yr=$s}while(yr!==null)}}Ge=P}}if(P.subtreeFlags&2064&&N!==null)N.return=P,Ge=N;else e:for(;Ge!==null;){if(P=Ge,P.flags&2048)switch(P.tag){case 0:case 11:case 15:fu(9,P,P.return)}var le=P.sibling;if(le!==null){le.return=P.return,Ge=le;break e}Ge=P.return}}var ee=c.current;for(Ge=ee;Ge!==null;){N=Ge;var pe=N.child;if(N.subtreeFlags&2064&&pe!==null)pe.return=N,Ge=pe;else e:for(N=ee;Ge!==null;){if(Z=Ge,Z.flags&2048)try{switch(Z.tag){case 0:case 11:case 15:_f(9,Z)}}catch(nt){Zt(Z,Z.return,nt)}if(Z===N){Ge=null;break e}var We=Z.sibling;if(We!==null){We.return=Z.return,Ge=We;break e}Ge=Z.return}}if(bt=S,Qo(),Yo&&typeof Yo.onPostCommitFiberRoot=="function")try{Yo.onPostCommitFiberRoot(tf,c)}catch{}y=!0}return y}finally{It=g,xn.transition=u}}return!1}function kC(c,u,g){u=xl(g,u),u=H2(c,u,1),c=ba(c,u,1),u=Qn(),c!==null&&(eu(c,1,u),br(c,u))}function Zt(c,u,g){if(c.tag===3)kC(c,c,g);else for(;u!==null;){if(u.tag===3){kC(u,c,g);break}else if(u.tag===1){var y=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ya===null||!ya.has(y))){c=xl(g,c),c=W2(u,c,1),u=ba(u,c,1),c=Qn(),u!==null&&(eu(u,1,c),br(u,c));break}}u=u.return}}function J8(c,u,g){var y=c.pingCache;y!==null&&y.delete(u),u=Qn(),c.pingedLanes|=c.suspendedLanes&g,Ln===c&&(Vn&g)===g&&(Dn===4||Dn===3&&(Vn&130023424)===Vn&&500>Tn()-O0?fi(c,0):M0|=g),br(c,u)}function _C(c,u){u===0&&(c.mode&1?(u=Jd,Jd<<=1,!(Jd&130023424)&&(Jd=4194304)):u=1);var g=Qn();c=Zo(c,u),c!==null&&(eu(c,u,g),br(c,g))}function e7(c){var u=c.memoizedState,g=0;u!==null&&(g=u.retryLane),_C(c,g)}function t7(c,u){var g=0;switch(c.tag){case 13:var y=c.stateNode,S=c.memoizedState;S!==null&&(g=S.retryLane);break;case 19:y=c.stateNode;break;default:throw Error(i(314))}y!==null&&y.delete(u),_C(c,g)}var jC;jC=function(c,u,g){if(c!==null)if(c.memoizedProps!==u.pendingProps||kn.current)vr=!0;else{if(!(c.lanes&g)&&!(u.flags&128))return vr=!1,H8(c,u,g);vr=!!(c.flags&131072)}else vr=!1,Qt&&u.flags&1048576&&r2(u,of,u.index);switch(u.lanes=0,u.tag){case 2:var y=u.type;Cf(c,u),c=u.pendingProps;var S=cl(u,Wt.current);hl(u,g),S=a0(null,u,y,c,S,g);var P=i0();return u.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,gr(y)?(P=!0,Qd(u)):P=!1,u.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Qg(u),S.updater=ff,u.stateNode=S,S._reactInternals=u,Jg(u,y,c,g),u=m0(null,u,y,!0,P,g)):(u.tag=0,Qt&&P&&Bg(u),cr(null,u,S,g),u=u.child),u;case 16:y=u.elementType;e:{switch(Cf(c,u),c=u.pendingProps,S=y._init,y=S(y._payload),u.type=y,S=u.tag=r7(y),c=ko(y,c),S){case 0:u=h0(null,u,y,c,g);break e;case 1:u=Z2(null,u,y,c,g);break e;case 11:u=K2(null,u,y,c,g);break e;case 14:u=q2(null,u,y,ko(y.type,c),g);break e}throw Error(i(306,y,""))}return u;case 0:return y=u.type,S=u.pendingProps,S=u.elementType===y?S:ko(y,S),h0(c,u,y,S,g);case 1:return y=u.type,S=u.pendingProps,S=u.elementType===y?S:ko(y,S),Z2(c,u,y,S,g);case 3:e:{if(J2(u),c===null)throw Error(i(387));y=u.pendingProps,P=u.memoizedState,S=P.element,u2(c,u),df(u,y,null,g);var N=u.memoizedState;if(y=N.element,ye&&P.isDehydrated)if(P={element:y,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},u.updateQueue.baseState=P,u.memoizedState=P,u.flags&256){S=xl(Error(i(423)),u),u=eC(c,u,y,g,S);break e}else if(y!==S){S=xl(Error(i(424)),u),u=eC(c,u,y,g,S);break e}else for(ye&&(Kr=qe(u.stateNode.containerInfo),Ar=u,Qt=!0,So=null,tu=!1),g=b2(u,null,y,g),u.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(fl(),y===S){u=Ns(c,u,g);break e}cr(c,u,y,g)}u=u.child}return u;case 5:return y2(u),c===null&&Vg(u),y=u.type,S=u.pendingProps,P=c!==null?c.memoizedProps:null,N=S.children,V(y,S)?N=null:P!==null&&V(y,P)&&(u.flags|=32),Q2(c,u),cr(c,u,N,g),u.child;case 6:return c===null&&Vg(u),null;case 13:return tC(c,u,g);case 4:return e0(u,u.stateNode.containerInfo),y=u.pendingProps,c===null?u.child=ml(u,null,y,g):cr(c,u,y,g),u.child;case 11:return y=u.type,S=u.pendingProps,S=u.elementType===y?S:ko(y,S),K2(c,u,y,S,g);case 7:return cr(c,u,u.pendingProps,g),u.child;case 8:return cr(c,u,u.pendingProps.children,g),u.child;case 12:return cr(c,u,u.pendingProps.children,g),u.child;case 10:e:{if(y=u.type._context,S=u.pendingProps,P=u.memoizedProps,N=S.value,l2(u,y,N),P!==null)if(wo(P.value,N)){if(P.children===S.children&&!kn.current){u=Ns(c,u,g);break e}}else for(P=u.child,P!==null&&(P.return=u);P!==null;){var Z=P.dependencies;if(Z!==null){N=P.child;for(var ce=Z.firstContext;ce!==null;){if(ce.context===y){if(P.tag===1){ce=As(-1,g&-g),ce.tag=2;var Ee=P.updateQueue;if(Ee!==null){Ee=Ee.shared;var Ke=Ee.pending;Ke===null?ce.next=ce:(ce.next=Ke.next,Ke.next=ce),Ee.pending=ce}}P.lanes|=g,ce=P.alternate,ce!==null&&(ce.lanes|=g),Xg(P.return,g,u),Z.lanes|=g;break}ce=ce.next}}else if(P.tag===10)N=P.type===u.type?null:P.child;else if(P.tag===18){if(N=P.return,N===null)throw Error(i(341));N.lanes|=g,Z=N.alternate,Z!==null&&(Z.lanes|=g),Xg(N,g,u),N=P.sibling}else N=P.child;if(N!==null)N.return=P;else for(N=P;N!==null;){if(N===u){N=null;break}if(P=N.sibling,P!==null){P.return=N.return,N=P;break}N=N.return}P=N}cr(c,u,S.children,g),u=u.child}return u;case 9:return S=u.type,y=u.pendingProps.children,hl(u,g),S=qr(S),y=y(S),u.flags|=1,cr(c,u,y,g),u.child;case 14:return y=u.type,S=ko(y,u.pendingProps),S=ko(y.type,S),q2(c,u,y,S,g);case 15:return X2(c,u,u.type,u.pendingProps,g);case 17:return y=u.type,S=u.pendingProps,S=u.elementType===y?S:ko(y,S),Cf(c,u),u.tag=1,gr(y)?(c=!0,Qd(u)):c=!1,hl(u,g),m2(u,y,S),Jg(u,y,S,g),m0(null,u,y,!0,c,g);case 19:return rC(c,u,g);case 22:return Y2(c,u,g)}throw Error(i(156,u.tag))};function PC(c,u){return $g(c,u)}function n7(c,u,g,y){this.tag=c,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(c,u,g,y){return new n7(c,u,g,y)}function z0(c){return c=c.prototype,!(!c||!c.isReactComponent)}function r7(c){if(typeof c=="function")return z0(c)?1:0;if(c!=null){if(c=c.$$typeof,c===b)return 11;if(c===_)return 14}return 2}function ka(c,u){var g=c.alternate;return g===null?(g=Zr(c.tag,u,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=u,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&14680064,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,u=c.dependencies,g.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g}function zf(c,u,g,y,S,P){var N=2;if(y=c,typeof c=="function")z0(c)&&(N=1);else if(typeof c=="string")N=5;else e:switch(c){case h:return mi(g.children,S,P,u);case m:N=8,S|=8;break;case v:return c=Zr(12,g,u,S|2),c.elementType=v,c.lanes=P,c;case w:return c=Zr(13,g,u,S),c.elementType=w,c.lanes=P,c;case k:return c=Zr(19,g,u,S),c.elementType=k,c.lanes=P,c;case I:return Ff(g,S,P,u);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case x:N=10;break e;case C:N=9;break e;case b:N=11;break e;case _:N=14;break e;case j:N=16,y=null;break e}throw Error(i(130,c==null?c:typeof c,""))}return u=Zr(N,g,u,S),u.elementType=c,u.type=y,u.lanes=P,u}function mi(c,u,g,y){return c=Zr(7,c,y,u),c.lanes=g,c}function Ff(c,u,g,y){return c=Zr(22,c,y,u),c.elementType=I,c.lanes=g,c.stateNode={isHidden:!1},c}function F0(c,u,g){return c=Zr(6,c,null,u),c.lanes=g,c}function B0(c,u,g){return u=Zr(4,c.children!==null?c.children:[],c.key,u),u.lanes=g,u.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},u}function o7(c,u,g,y,S){this.tag=u,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=re,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ng(0),this.expirationTimes=Ng(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ng(0),this.identifierPrefix=y,this.onRecoverableError=S,ye&&(this.mutableSourceEagerHydrationData=null)}function IC(c,u,g,y,S,P,N,Z,ce){return c=new o7(c,u,g,Z,ce),u===1?(u=1,P===!0&&(u|=8)):u=0,P=Zr(3,null,null,u),c.current=P,P.stateNode=c,P.memoizedState={element:y,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qg(P),c}function EC(c){if(!c)return Kn;c=c._reactInternals;e:{if(A(c)!==c||c.tag!==1)throw Error(i(170));var u=c;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(gr(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(i(171))}if(c.tag===1){var g=c.type;if(gr(g))return Qy(c,g,u)}return u}function MC(c){var u=c._reactInternals;if(u===void 0)throw typeof c.render=="function"?Error(i(188)):(c=Object.keys(c).join(","),Error(i(268,c)));return c=K(u),c===null?null:c.stateNode}function OC(c,u){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g<u?g:u}}function Bf(c,u){OC(c,u),(c=c.alternate)&&OC(c,u)}function s7(c){return c=K(c),c===null?null:c.stateNode}function a7(){return null}return n.attemptContinuousHydration=function(c){if(c.tag===13){var u=Zo(c,134217728);if(u!==null){var g=Qn();Qr(u,c,134217728,g)}Bf(c,134217728)}},n.attemptDiscreteHydration=function(c){if(c.tag===13){var u=Zo(c,1);if(u!==null){var g=Qn();Qr(u,c,1,g)}Bf(c,1)}},n.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var u=wa(c),g=Zo(c,u);if(g!==null){var y=Qn();Qr(g,c,u,y)}Bf(c,u)}},n.attemptSynchronousHydration=function(c){switch(c.tag){case 3:var u=c.stateNode;if(u.current.memoizedState.isDehydrated){var g=Jc(u.pendingLanes);g!==0&&(Tg(u,g|1),br(u,Tn()),!(bt&6)&&(Cl(),Qo()))}break;case 13:bC(function(){var y=Zo(c,1);if(y!==null){var S=Qn();Qr(y,c,1,S)}}),Bf(c,1)}},n.batchedUpdates=function(c,u){var g=bt;bt|=1;try{return c(u)}finally{bt=g,bt===0&&(Cl(),nf&&Qo())}},n.createComponentSelector=function(c){return{$$typeof:jf,value:c}},n.createContainer=function(c,u,g,y,S,P,N){return IC(c,u,!1,null,g,y,S,P,N)},n.createHasPseudoClassSelector=function(c){return{$$typeof:Pf,value:c}},n.createHydrationContainer=function(c,u,g,y,S,P,N,Z,ce){return c=IC(g,y,!0,c,S,P,N,Z,ce),c.context=EC(null),g=c.current,y=Qn(),S=wa(g),P=As(y,S),P.callback=u??null,ba(g,P,S),c.current.lanes=S,eu(c,S,y),br(c,y),c},n.createPortal=function(c,u,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:y==null?null:""+y,children:c,containerInfo:u,implementation:g}},n.createRoleSelector=function(c){return{$$typeof:If,value:c}},n.createTestNameSelector=function(c){return{$$typeof:Ef,value:c}},n.createTextSelector=function(c){return{$$typeof:Mf,value:c}},n.deferredUpdates=function(c){var u=It,g=xn.transition;try{return xn.transition=null,It=16,c()}finally{It=u,xn.transition=g}},n.discreteUpdates=function(c,u,g,y,S){var P=It,N=xn.transition;try{return xn.transition=null,It=1,c(u,g,y,S)}finally{It=P,xn.transition=N,bt===0&&Cl()}},n.findAllNodes=I0,n.findBoundingRects=function(c,u){if(!Ue)throw Error(i(363));u=I0(c,u),c=[];for(var g=0;g<u.length;g++)c.push(Xe(u[g]));for(u=c.length-1;0<u;u--){g=c[u];for(var y=g.x,S=y+g.width,P=g.y,N=P+g.height,Z=u-1;0<=Z;Z--)if(u!==Z){var ce=c[Z],Ee=ce.x,Ke=Ee+ce.width,pt=ce.y,He=pt+ce.height;if(y>=Ee&&P>=pt&&S<=Ke&&N<=He){c.splice(u,1);break}else if(y!==Ee||g.width!==ce.width||He<P||pt>N){if(!(P!==pt||g.height!==ce.height||Ke<y||Ee>S)){Ee>y&&(ce.width+=Ee-y,ce.x=y),Ke<S&&(ce.width=S-Ee),c.splice(u,1);break}}else{pt>P&&(ce.height+=pt-P,ce.y=P),He<N&&(ce.height=N-pt),c.splice(u,1);break}}}return c},n.findHostInstance=MC,n.findHostInstanceWithNoPortals=function(c){return c=$(c),c=c!==null?U(c):null,c===null?null:c.stateNode},n.findHostInstanceWithWarning=function(c){return MC(c)},n.flushControlled=function(c){var u=bt;bt|=1;var g=xn.transition,y=It;try{xn.transition=null,It=1,c()}finally{It=y,xn.transition=g,bt=u,bt===0&&(Cl(),Qo())}},n.flushPassiveEffects=hi,n.flushSync=bC,n.focusWithin=function(c,u){if(!Ue)throw Error(i(363));for(c=_0(c),u=gC(c,u),u=Array.from(u),c=0;c<u.length;){var g=u[c++];if(!ve(g)){if(g.tag===5&&st(g.stateNode))return!0;for(g=g.child;g!==null;)u.push(g),g=g.sibling}}return!1},n.getCurrentUpdatePriority=function(){return It},n.getFindAllNodesFailureDescription=function(c,u){if(!Ue)throw Error(i(363));var g=0,y=[];c=[_0(c),0];for(var S=0;S<c.length;){var P=c[S++],N=c[S++],Z=u[N];if((P.tag!==5||!ve(P))&&(j0(P,Z)&&(y.push(P0(Z)),N++,N>g&&(g=N)),N<u.length))for(P=P.child;P!==null;)c.push(P,N),P=P.sibling}if(g<u.length){for(c=[];g<u.length;g++)c.push(P0(u[g]));return`findAllNodes was able to match part of the selector:
`+(y.join(" > ")+`
No matching component was found for:
`)+c.join(" > ")}return null},n.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return W(c.child.stateNode);default:return c.child.stateNode}},n.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:s7,findFiberByHostInstance:c.findFiberByHostInstance||a7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)c=!0;else{try{tf=u.inject(c),Yo=u}catch{}c=!!u.checkDCE}}return c},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(c,u,g,y){if(!Ue)throw Error(i(363));c=I0(c,u);var S=mt(c,g,y).disconnect;return{disconnect:function(){S()}}},n.registerMutableSourceForHydration=function(c,u){var g=u._getVersion;g=g(u._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[u,g]:c.mutableSourceEagerHydrationData.push(u,g)},n.runWithPriority=function(c,u){var g=It;try{return It=c,u()}finally{It=g}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(c,u,g,y){var S=u.current,P=Qn(),N=wa(S);return g=EC(g),u.context===null?u.context=g:u.pendingContext=g,u=As(P,N),u.payload={element:c},y=y===void 0?null:y,y!==null&&(u.callback=y),c=ba(S,u,N),c!==null&&(Qr(c,S,N,P),uf(c,S,N)),N},n};s8.exports=Xpe;var Ype=s8.exports;const Qpe=Oc(Ype);var a8={exports:{}},sl={};/**
* @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.
*/sl.ConcurrentRoot=1;sl.ContinuousEventPriority=4;sl.DefaultEventPriority=16;sl.DiscreteEventPriority=1;sl.IdleEventPriority=536870912;sl.LegacyRoot=0;a8.exports=sl;var i8=a8.exports;const ij={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let lj=!1,cj=!1;const Ky=".react-konva-event",Zpe=`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
`,Jpe=`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
`,ehe={};function Mg(e,t,n=ehe){if(!lj&&"zIndex"in t&&(console.warn(Jpe),lj=!0),!cj&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(Zpe),cj=!0)}for(var s in n)if(!ij[s]){var i=s.slice(0,2)==="on",l=n[s]!==t[s];if(i&&l){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e.off(f,n[s])}var p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var h=t._useStrictMode,m={},v=!1;const x={};for(var s in t)if(!ij[s]){var i=s.slice(0,2)==="on",C=n[s]!==t[s];if(i&&C){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[s]&&(x[f]=t[s])}!i&&(t[s]!==n[s]||h&&t[s]!==e.getAttr(s))&&(v=!0,m[s]=t[s])}v&&(e.setAttrs(m),si(e));for(var f in x)e.on(f+Ky,x[f])}function si(e){if(!n9.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const l8={},the={};dd.Node.prototype._applyProps=Mg;function nhe(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),si(e)}function rhe(e,t,n){let r=dd[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=dd.Group);const o={},s={};for(var i in t){var l=i.slice(0,2)==="on";l?s[i]=t[i]:o[i]=t[i]}const f=new r(o);return Mg(f,s),f}function ohe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function she(e,t,n){return!1}function ahe(e){return e}function ihe(){return null}function lhe(){return null}function che(e,t,n,r){return the}function uhe(){}function dhe(e){}function fhe(e,t){return!1}function phe(){return l8}function hhe(){return l8}const mhe=setTimeout,ghe=clearTimeout,vhe=-1;function xhe(e,t){return!1}const bhe=!1,yhe=!0,Che=!0;function whe(e,t){t.parent===e?t.moveToTop():e.add(t),si(e)}function She(e,t){t.parent===e?t.moveToTop():e.add(t),si(e)}function c8(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),si(e)}function khe(e,t,n){c8(e,t,n)}function _he(e,t){t.destroy(),t.off(Ky),si(e)}function jhe(e,t){t.destroy(),t.off(Ky),si(e)}function Phe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function Ihe(e,t,n){}function Ehe(e,t,n,r,o){Mg(e,o,r)}function Mhe(e){e.hide(),si(e)}function Ohe(e){}function Dhe(e,t){(t.visible==null||t.visible)&&e.show()}function Rhe(e,t){}function Ahe(e){}function Nhe(){}const The=()=>i8.DefaultEventPriority,$he=Object.freeze(Object.defineProperty({__proto__:null,appendChild:whe,appendChildToContainer:She,appendInitialChild:nhe,cancelTimeout:ghe,clearContainer:Ahe,commitMount:Ihe,commitTextUpdate:Phe,commitUpdate:Ehe,createInstance:rhe,createTextInstance:ohe,detachDeletedInstance:Nhe,finalizeInitialChildren:she,getChildHostContext:hhe,getCurrentEventPriority:The,getPublicInstance:ahe,getRootHostContext:phe,hideInstance:Mhe,hideTextInstance:Ohe,idlePriority:Ip.unstable_IdlePriority,insertBefore:c8,insertInContainerBefore:khe,isPrimaryRenderer:bhe,noTimeout:vhe,now:Ip.unstable_now,prepareForCommit:ihe,preparePortalMount:lhe,prepareUpdate:che,removeChild:_he,removeChildFromContainer:jhe,resetAfterCommit:uhe,resetTextContent:dhe,run:Ip.unstable_runWithPriority,scheduleTimeout:mhe,shouldDeprioritizeSubtree:fhe,shouldSetTextContent:xhe,supportsMutation:Che,unhideInstance:Dhe,unhideTextInstance:Rhe,warnsIfNotActing:yhe},Symbol.toStringTag,{value:"Module"}));var Lhe=Object.defineProperty,zhe=Object.defineProperties,Fhe=Object.getOwnPropertyDescriptors,uj=Object.getOwnPropertySymbols,Bhe=Object.prototype.hasOwnProperty,Hhe=Object.prototype.propertyIsEnumerable,dj=(e,t,n)=>t in e?Lhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fj=(e,t)=>{for(var n in t||(t={}))Bhe.call(t,n)&&dj(e,n,t[n]);if(uj)for(var n of uj(t))Hhe.call(t,n)&&dj(e,n,t[n]);return e},Whe=(e,t)=>zhe(e,Fhe(t));function u8(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=u8(r,t,n);if(o)return o;r=t?null:r.sibling}}function d8(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const qy=d8(d.createContext(null));class f8 extends d.Component{render(){return d.createElement(qy.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:pj,ReactCurrentDispatcher:hj}=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Vhe(){const e=d.useContext(qy);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=d.useId();return d.useMemo(()=>{for(const r of[pj==null?void 0:pj.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=u8(r,!1,s=>{let i=s.memoizedState;for(;i;){if(i.memoizedState===t)return!0;i=i.next}});if(o)return o}},[e,t])}function Uhe(){var e,t;const n=Vhe(),[r]=d.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==qy&&!r.has(s)&&r.set(s,(t=hj==null?void 0:hj.current)==null?void 0:t.readContext(d8(s))),o=o.return}return r}function Ghe(){const e=Uhe();return d.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>d.createElement(t,null,d.createElement(n.Provider,Whe(fj({},r),{value:e.get(n)}))),t=>d.createElement(f8,fj({},t))),[e])}function Khe(e){const t=H.useRef({});return H.useLayoutEffect(()=>{t.current=e}),H.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const qhe=e=>{const t=H.useRef(),n=H.useRef(),r=H.useRef(),o=Khe(e),s=Ghe(),i=l=>{const{forwardedRef:f}=e;f&&(typeof f=="function"?f(l):f.current=l)};return H.useLayoutEffect(()=>(n.current=new dd.Stage({width:e.width,height:e.height,container:t.current}),i(n.current),r.current=Tu.createContainer(n.current,i8.LegacyRoot,!1,null),Tu.updateContainer(H.createElement(s,{},e.children),r.current),()=>{dd.isBrowser&&(i(null),Tu.updateContainer(null,r.current,null),n.current.destroy())}),[]),H.useLayoutEffect(()=>{i(n.current),Mg(n.current,e,o),Tu.updateContainer(H.createElement(s,{},e.children),r.current,null)}),H.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},Iu="Layer",sa="Group",ks="Rect",vi="Circle",lm="Line",p8="Image",Xhe="Transformer",Tu=Qpe($he);Tu.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:H.version,rendererPackageName:"react-konva"});const Yhe=H.forwardRef((e,t)=>H.createElement(f8,{},H.createElement(qhe,{...e,forwardedRef:t}))),Qhe=ae([$t,bo],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:kt}}),Zhe=()=>{const e=te(),{tool:t,isStaging:n,isMovingBoundingBox:r}=F(Qhe);return{handleDragStart:d.useCallback(()=>{(t==="move"||n)&&!r&&e(qp(!0))},[e,r,n,t]),handleDragMove:d.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(u3(s))},[e,r,n,t]),handleDragEnd:d.useCallback(()=>{(t==="move"||n)&&!r&&e(qp(!1))},[e,r,n,t])}},Jhe=ae([$t,wn,bo],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isMaskEnabled:l,shouldSnapToGrid:f}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isStaging:n,isMaskEnabled:l,shouldSnapToGrid:f}},{memoizeOptions:{resultEqualityCheck:kt}}),eme=()=>{const e=te(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:i}=F(Jhe),l=d.useRef(null),f=d3(),p=()=>e(f3());Qe(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const h=()=>e(Xx(!s));Qe(["h"],()=>{h()},{enabled:()=>!o,preventDefault:!0},[s]),Qe(["n"],()=>{e(Xp(!i))},{enabled:!0,preventDefault:!0},[i]),Qe("esc",()=>{e(r9())},{enabled:()=>!0,preventDefault:!0}),Qe("shift+h",()=>{e(o9(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),Qe(["space"],m=>{m.repeat||(f==null||f.container().focus(),r!=="move"&&(l.current=r,e(Yl("move"))),r==="move"&&l.current&&l.current!=="move"&&(e(Yl(l.current)),l.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,l])},Xy=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}},h8=()=>{const e=te(),t=u1(),n=d3();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=s9.pixelRatio,[s,i,l,f]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;f&&s&&i&&l&&e(a9({r:s,g:i,b:l,a:f}))},commitColorUnderCursor:()=>{e(i9())}}},tme=ae([wn,$t,bo],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:kt}}),nme=e=>{const t=te(),{tool:n,isStaging:r}=F(tme),{commitColorUnderCursor:o}=h8();return d.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(qp(!0));return}if(n==="colorPicker"){o();return}const i=Xy(e.current);i&&(s.evt.preventDefault(),t(p3(!0)),t(l9([i.x,i.y])))},[e,n,r,t,o])},rme=ae([wn,$t,bo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:kt}}),ome=(e,t,n)=>{const r=te(),{isDrawing:o,tool:s,isStaging:i}=F(rme),{updateColorUnderCursor:l}=h8();return d.useCallback(()=>{if(!e.current)return;const f=Xy(e.current);if(f){if(r(c9(f)),n.current=f,s==="colorPicker"){l();return}!o||s==="move"||i||(t.current=!0,r(h3([f.x,f.y])))}},[t,r,o,i,n,e,s,l])},sme=()=>{const e=te();return d.useCallback(()=>{e(u9())},[e])},ame=ae([wn,$t,bo],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:kt}}),ime=(e,t)=>{const n=te(),{tool:r,isDrawing:o,isStaging:s}=F(ame);return d.useCallback(()=>{if(r==="move"||s){n(qp(!1));return}if(!t.current&&o&&e.current){const i=Xy(e.current);if(!i)return;n(h3([i.x,i.y]))}else t.current=!1;n(p3(!1))},[t,n,o,s,e,r])},lme=ae([$t],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:kt}}),cme=e=>{const t=te(),{isMoveStageKeyHeld:n,stageScale:r}=F(lme);return d.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const i={x:(s.x-e.current.x())/r,y:(s.y-e.current.y())/r};let l=o.evt.deltaY;o.evt.ctrlKey&&(l=-l);const f=Ri(r*p9**l,f9,d9),p={x:s.x-i.x*f,y:s.y-i.y*f};t(h9(f)),t(u3(p))},[e,n,r,t])},ume=ae($t,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:kt}}),dme=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=F(ume);return a.jsxs(sa,{children:[a.jsx(ks,{offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),a.jsx(ks,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},fme=d.memo(dme),pme=ae([$t],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:kt}}),hme=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=F(pme),{colorMode:r}=ia(),[o,s]=d.useState([]),[i,l]=ds("colors",["base.800","base.200"]),f=d.useCallback(p=>p/e,[e]);return d.useLayoutEffect(()=>{const{width:p,height:h}=n,{x:m,y:v}=t,x={x1:0,y1:0,x2:p,y2:h,offset:{x:f(m),y:f(v)}},C={x:Math.ceil(f(m)/64)*64,y:Math.ceil(f(v)/64)*64},b={x1:-C.x,y1:-C.y,x2:f(p)-C.x+64,y2:f(h)-C.y+64},k={x1:Math.min(x.x1,b.x1),y1:Math.min(x.y1,b.y1),x2:Math.max(x.x2,b.x2),y2:Math.max(x.y2,b.y2)},_=k.x2-k.x1,j=k.y2-k.y1,I=Math.round(_/64)+1,M=Math.round(j/64)+1,E=Cw(0,I).map(D=>a.jsx(lm,{x:k.x1+D*64,y:k.y1,points:[0,0,0,j],stroke:r==="dark"?i:l,strokeWidth:1},`x_${D}`)),O=Cw(0,M).map(D=>a.jsx(lm,{x:k.x1,y:k.y1+D*64,points:[0,0,_,0],stroke:r==="dark"?i:l,strokeWidth:1},`y_${D}`));s(E.concat(O))},[e,t,n,f,r,i,l]),a.jsx(sa,{children:o})},mme=d.memo(hme),gme=ae([vo,$t],(e,t)=>{const{progressImage:n,sessionId:r}=e,{sessionId:o,boundingBox:s}=t.layerState.stagingArea;return{boundingBox:s,progressImage:r===o?n:void 0}},{memoizeOptions:{resultEqualityCheck:kt}}),vme=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=F(gme),[o,s]=d.useState(null);return d.useEffect(()=>{if(!n)return;const i=new Image;i.onload=()=>{s(i)},i.src=n.dataURL},[n]),n&&r&&o?a.jsx(p8,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},xme=d.memo(vme),Di=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},bme=ae($t,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Di(t)}}),mj=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),yme=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=F(bme),[i,l]=d.useState(null),[f,p]=d.useState(0),h=d.useRef(null),m=d.useCallback(()=>{p(f+1),setTimeout(m,500)},[f]);return d.useEffect(()=>{if(i)return;const v=new Image;v.onload=()=>{l(v)},v.src=mj(n)},[i,n]),d.useEffect(()=>{i&&(i.src=mj(n))},[i,n]),d.useEffect(()=>{const v=setInterval(()=>p(x=>(x+1)%5),50);return()=>clearInterval(v)},[]),!i||!wl(r.x)||!wl(r.y)||!wl(s)||!wl(o.width)||!wl(o.height)?null:a.jsx(ks,{ref:h,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:i,fillPatternOffsetY:wl(f)?f:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Cme=d.memo(yme),wme=ae([$t],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:kt}}),Sme=e=>{const{...t}=e,{objects:n}=F(wme);return a.jsx(sa,{listening:!1,...t,children:n.filter(m9).map((r,o)=>a.jsx(lm,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},o))})},kme=d.memo(Sme);var xi=d,_me=function(t,n,r){const o=xi.useRef("loading"),s=xi.useRef(),[i,l]=xi.useState(0),f=xi.useRef(),p=xi.useRef(),h=xi.useRef();return(f.current!==t||p.current!==n||h.current!==r)&&(o.current="loading",s.current=void 0,f.current=t,p.current=n,h.current=r),xi.useLayoutEffect(function(){if(!t)return;var m=document.createElement("img");function v(){o.current="loaded",s.current=m,l(Math.random())}function x(){o.current="failed",s.current=void 0,l(Math.random())}return m.addEventListener("load",v),m.addEventListener("error",x),n&&(m.crossOrigin=n),r&&(m.referrerPolicy=r),m.src=t,function(){m.removeEventListener("load",v),m.removeEventListener("error",x)}},[t,n,r]),[s.current,o.current]};const jme=Oc(_me),Pme=e=>{const{width:t,height:n,x:r,y:o,imageName:s}=e.canvasImage,{currentData:i,isError:l}=po(s??zr.skipToken),[f]=jme((i==null?void 0:i.image_url)??"",g9.get()?"use-credentials":"anonymous");return l?a.jsx(ks,{x:r,y:o,width:t,height:n,fill:"red"}):a.jsx(p8,{x:r,y:o,image:f,listening:!1})},m8=d.memo(Pme),Ime=ae([$t],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:kt}}),Eme=()=>{const{objects:e}=F(Ime);return e?a.jsx(sa,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(v9(t))return a.jsx(m8,{canvasImage:t},n);if(x9(t)){const r=a.jsx(lm,{points:t.points,stroke:t.color?Di(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?a.jsx(sa,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(b9(t))return a.jsx(ks,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Di(t.color)},n);if(y9(t))return a.jsx(ks,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Mme=d.memo(Eme),Ome=ae([$t],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:{x:o,y:s},boundingBoxDimensions:{width:i,height:l}}=e,{selectedImageIndex:f,images:p}=t.stagingArea;return{currentStagingAreaImage:p.length>0&&f!==void 0?p[f]:void 0,isOnFirstImage:f===0,isOnLastImage:f===p.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:o,y:s,width:i,height:l}},{memoizeOptions:{resultEqualityCheck:kt}}),Dme=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:i,width:l,height:f}=F(Ome);return a.jsxs(sa,{...t,children:[r&&n&&a.jsx(m8,{canvasImage:n}),o&&a.jsxs(sa,{children:[a.jsx(ks,{x:s,y:i,width:l,height:f,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(ks,{x:s,y:i,width:l,height:f,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},Rme=d.memo(Dme),Ame=ae([$t],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n,sessionId:r}},shouldShowStagingOutline:o,shouldShowStagingImage:s}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:s,shouldShowStagingOutline:o,sessionId:r}},{memoizeOptions:{resultEqualityCheck:kt}}),Nme=()=>{const e=te(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o,sessionId:s}=F(Ame),{t:i}=we(),l=d.useCallback(()=>{e(mw(!0))},[e]),f=d.useCallback(()=>{e(mw(!1))},[e]);Qe(["left"],()=>{p()},{enabled:()=>!0,preventDefault:!0}),Qe(["right"],()=>{h()},{enabled:()=>!0,preventDefault:!0}),Qe(["enter"],()=>{m()},{enabled:()=>!0,preventDefault:!0});const p=d.useCallback(()=>e(C9()),[e]),h=d.useCallback(()=>e(w9()),[e]),m=d.useCallback(()=>e(S9(s)),[e,s]),{data:v}=po((r==null?void 0:r.imageName)??zr.skipToken);return r?a.jsx(T,{pos:"absolute",bottom:4,w:"100%",align:"center",justify:"center",onMouseOver:l,onMouseOut:f,children:a.jsxs(pn,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(Te,{tooltip:`${i("unifiedCanvas.previous")} (Left)`,"aria-label":`${i("unifiedCanvas.previous")} (Left)`,icon:a.jsx(rZ,{}),onClick:p,colorScheme:"accent",isDisabled:t}),a.jsx(Te,{tooltip:`${i("unifiedCanvas.next")} (Right)`,"aria-label":`${i("unifiedCanvas.next")} (Right)`,icon:a.jsx(oZ,{}),onClick:h,colorScheme:"accent",isDisabled:n}),a.jsx(Te,{tooltip:`${i("unifiedCanvas.accept")} (Enter)`,"aria-label":`${i("unifiedCanvas.accept")} (Enter)`,icon:a.jsx(kE,{}),onClick:m,colorScheme:"accent"}),a.jsx(Te,{tooltip:i("unifiedCanvas.showHide"),"aria-label":i("unifiedCanvas.showHide"),"data-alert":!o,icon:o?a.jsx(bZ,{}):a.jsx(xZ,{}),onClick:()=>e(k9(!o)),colorScheme:"accent"}),a.jsx(Te,{tooltip:i("unifiedCanvas.saveToGallery"),"aria-label":i("unifiedCanvas.saveToGallery"),isDisabled:!v||!v.is_intermediate,icon:a.jsx(eg,{}),onClick:()=>{v&&e(_9({imageDTO:v}))},colorScheme:"accent"}),a.jsx(Te,{tooltip:i("unifiedCanvas.discardAll"),"aria-label":i("unifiedCanvas.discardAll"),icon:a.jsx(tl,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(j9()),colorScheme:"error",fontSize:20})]})}):null},Tme=d.memo(Nme),$me=()=>{const e=F(l=>l.canvas.layerState),t=F(l=>l.canvas.boundingBoxCoordinates),n=F(l=>l.canvas.boundingBoxDimensions),r=F(l=>l.canvas.isMaskEnabled),o=F(l=>l.canvas.shouldPreserveMaskedArea),[s,i]=d.useState();return d.useEffect(()=>{i(void 0)},[e,t,n,r,o]),VZ(async()=>{const l=await P9(e,t,n,r,o);if(!l)return;const{baseImageData:f,maskImageData:p}=l,h=I9(f,p);i(h)},1e3,[e,t,n,r,o]),s},Lme={txt2img:"Text to Image",img2img:"Image to Image",inpaint:"Inpaint",outpaint:"Inpaint"},zme=()=>{const e=$me();return a.jsxs(Ie,{children:["Mode: ",e?Lme[e]:"..."]})},Fme=d.memo(zme),ql=e=>Math.round(e*100)/100,Bme=ae([$t],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${ql(n)}, ${ql(r)})`}},{memoizeOptions:{resultEqualityCheck:kt}});function Hme(){const{cursorCoordinatesString:e}=F(Bme),{t}=we();return a.jsx(Ie,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Ox="var(--invokeai-colors-warning-500)",Wme=ae([$t],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:i},scaledBoundingBoxDimensions:{width:l,height:f},boundingBoxCoordinates:{x:p,y:h},stageScale:m,shouldShowCanvasDebugInfo:v,layer:x,boundingBoxScaleMethod:C,shouldPreserveMaskedArea:b}=e;let w="inherit";return(C==="none"&&(s<512||i<512)||C==="manual"&&l*f<512*512)&&(w=Ox),{activeLayerColor:x==="mask"?Ox:"inherit",activeLayerString:x.charAt(0).toUpperCase()+x.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${ql(p)}, ${ql(h)})`,boundingBoxDimensionsString:`${s}×${i}`,scaledBoundingBoxDimensionsString:`${l}×${f}`,canvasCoordinatesString:`${ql(r)}×${ql(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(m*100),shouldShowCanvasDebugInfo:v,shouldShowBoundingBox:C!=="auto",shouldShowScaledBoundingBox:C!=="none",shouldPreserveMaskedArea:b}},{memoizeOptions:{resultEqualityCheck:kt}}),Vme=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:i,canvasCoordinatesString:l,canvasDimensionsString:f,canvasScaleString:p,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:m,shouldPreserveMaskedArea:v}=F(Wme),{t:x}=we();return a.jsxs(T,{sx:{flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,opacity:.65,display:"flex",fontSize:"sm",padding:1,px:2,minWidth:48,margin:1,borderRadius:"base",pointerEvents:"none",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(Fme,{}),a.jsx(Ie,{style:{color:e},children:`${x("unifiedCanvas.activeLayer")}: ${t}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasScale")}: ${p}%`}),v&&a.jsx(Ie,{style:{color:Ox},children:"Preserve Masked Area: On"}),m&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.boundingBox")}: ${o}`}),i&&a.jsx(Ie,{style:{color:n},children:`${x("unifiedCanvas.scaledBoundingBox")}: ${s}`}),h&&a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:`${x("unifiedCanvas.boundingBoxPosition")}: ${r}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasDimensions")}: ${f}`}),a.jsx(Ie,{children:`${x("unifiedCanvas.canvasPosition")}: ${l}`}),a.jsx(Hme,{})]})]})},Ume=d.memo(Vme),Gme=ae([xe],({canvas:e,generation:t})=>{const{boundingBoxCoordinates:n,boundingBoxDimensions:r,stageScale:o,isDrawing:s,isTransformingBoundingBox:i,isMovingBoundingBox:l,tool:f,shouldSnapToGrid:p}=e,{aspectRatio:h}=t;return{boundingBoxCoordinates:n,boundingBoxDimensions:r,isDrawing:s,isMovingBoundingBox:l,isTransformingBoundingBox:i,stageScale:o,shouldSnapToGrid:p,tool:f,hitStrokeWidth:20/o,aspectRatio:h}},{memoizeOptions:{resultEqualityCheck:kt}}),Kme=e=>{const{...t}=e,n=te(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:i,isTransformingBoundingBox:l,stageScale:f,shouldSnapToGrid:p,tool:h,hitStrokeWidth:m,aspectRatio:v}=F(Gme),x=d.useRef(null),C=d.useRef(null),[b,w]=d.useState(!1);d.useEffect(()=>{var B;!x.current||!C.current||(x.current.nodes([C.current]),(B=x.current.getLayer())==null||B.batchDraw())},[]);const k=64*f;Qe("N",()=>{n(Xp(!p))});const _=d.useCallback(B=>{if(!p){n(q0({x:Math.floor(B.target.x()),y:Math.floor(B.target.y())}));return}const U=B.target.x(),Y=B.target.y(),W=fr(U,64),L=fr(Y,64);B.target.x(W),B.target.y(L),n(q0({x:W,y:L}))},[n,p]),j=d.useCallback(()=>{if(!C.current)return;const B=C.current,U=B.scaleX(),Y=B.scaleY(),W=Math.round(B.width()*U),L=Math.round(B.height()*Y),X=Math.round(B.x()),z=Math.round(B.y());if(v){const q=fr(W/v,64);n(Ao({width:W,height:q}))}else n(Ao({width:W,height:L}));n(q0({x:p?Eu(X,64):X,y:p?Eu(z,64):z})),B.scaleX(1),B.scaleY(1)},[n,p,v]),I=d.useCallback((B,U,Y)=>{const W=B.x%k,L=B.y%k;return{x:Eu(U.x,k)+W,y:Eu(U.y,k)+L}},[k]),M=()=>{n(X0(!0))},E=()=>{n(X0(!1)),n(Y0(!1)),n(Uf(!1)),w(!1)},O=()=>{n(Y0(!0))},D=()=>{n(X0(!1)),n(Y0(!1)),n(Uf(!1)),w(!1)},A=()=>{w(!0)},R=()=>{!l&&!i&&w(!1)},$=()=>{n(Uf(!0))},K=()=>{n(Uf(!1))};return a.jsxs(sa,{...t,children:[a.jsx(ks,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:$,onMouseOver:$,onMouseLeave:K,onMouseOut:K}),a.jsx(ks,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:m,listening:!s&&h==="move",onDragStart:O,onDragEnd:D,onDragMove:_,onMouseDown:O,onMouseOut:R,onMouseOver:A,onMouseEnter:A,onMouseUp:D,onTransform:j,onTransformEnd:E,ref:C,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/f,width:o.width,x:r.x,y:r.y}),a.jsx(Xhe,{anchorCornerRadius:3,anchorDragBoundFunc:I,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:h==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&h==="move",onDragStart:O,onDragEnd:D,onMouseDown:M,onMouseUp:E,onTransformEnd:E,ref:x,rotateEnabled:!1})]})},qme=d.memo(Kme),Xme=ae($t,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:i,layer:l,shouldShowBrush:f,isMovingBoundingBox:p,isTransformingBoundingBox:h,stageScale:m,stageDimensions:v,boundingBoxCoordinates:x,boundingBoxDimensions:C,shouldRestrictStrokesToBox:b}=e,w=b?{clipX:x.x,clipY:x.y,clipWidth:C.width,clipHeight:C.height}:{};return{cursorPosition:t,brushX:t?t.x:v.width/2,brushY:t?t.y:v.height/2,radius:n/2,colorPickerOuterRadius:gw/m,colorPickerInnerRadius:(gw-d1+1)/m,maskColorString:Di({...o,a:.5}),brushColorString:Di(s),colorPickerColorString:Di(r),tool:i,layer:l,shouldShowBrush:f,shouldDrawBrushPreview:!(p||h||!t)&&f,strokeWidth:1.5/m,dotRadius:1.5/m,clip:w}},{memoizeOptions:{resultEqualityCheck:kt}}),Yme=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:i,layer:l,shouldDrawBrushPreview:f,dotRadius:p,strokeWidth:h,brushColorString:m,colorPickerColorString:v,colorPickerInnerRadius:x,colorPickerOuterRadius:C,clip:b}=F(Xme);return f?a.jsxs(sa,{listening:!1,...b,...t,children:[i==="colorPicker"?a.jsxs(a.Fragment,{children:[a.jsx(vi,{x:n,y:r,radius:C,stroke:m,strokeWidth:d1,strokeScaleEnabled:!1}),a.jsx(vi,{x:n,y:r,radius:x,stroke:v,strokeWidth:d1,strokeScaleEnabled:!1})]}):a.jsxs(a.Fragment,{children:[a.jsx(vi,{x:n,y:r,radius:o,fill:l==="mask"?s:m,globalCompositeOperation:i==="eraser"?"destination-out":"source-out"}),a.jsx(vi,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:h*2,strokeEnabled:!0,listening:!1}),a.jsx(vi,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:h,strokeEnabled:!0,listening:!1})]}),a.jsx(vi,{x:n,y:r,radius:p*2,fill:"rgba(255,255,255,0.4)",listening:!1}),a.jsx(vi,{x:n,y:r,radius:p,fill:"rgba(0,0,0,1)",listening:!1})]}):null},Qme=d.memo(Yme),Zme=ae([$t,bo],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:i,isMovingBoundingBox:l,stageDimensions:f,stageCoordinates:p,tool:h,isMovingStage:m,shouldShowIntermediates:v,shouldShowGrid:x,shouldRestrictStrokesToBox:C,shouldAntialias:b}=e;let w="none";return h==="move"||t?m?w="grabbing":w="grab":s?w=void 0:C&&!i&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||l,shouldShowBoundingBox:o,shouldShowGrid:x,stageCoordinates:p,stageCursor:w,stageDimensions:f,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:v,shouldAntialias:b}},Ce),Jme=_e(Yhe,{shouldForwardProp:e=>!["sx"].includes(e)}),ege=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:i,stageScale:l,tool:f,isStaging:p,shouldShowIntermediates:h,shouldAntialias:m}=F(Zme);eme();const v=te(),x=d.useRef(null),C=d.useRef(null),b=d.useRef(null),w=d.useCallback(K=>{M9(K),C.current=K},[]),k=d.useCallback(K=>{O9(K),b.current=K},[]),_=d.useRef({x:0,y:0}),j=d.useRef(!1),I=cme(C),M=nme(C),E=ime(C,j),O=ome(C,j,_),D=sme(),{handleDragStart:A,handleDragMove:R,handleDragEnd:$}=Zhe();return d.useEffect(()=>{if(!x.current)return;const K=new ResizeObserver(B=>{for(const U of B)if(U.contentBoxSize){const{width:Y,height:W}=U.contentRect;v(E9({width:Y,height:W}))}});return K.observe(x.current),()=>{K.disconnect()}},[v]),a.jsxs(T,{id:"canvas-container",ref:x,sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:[a.jsx(Ie,{sx:{position:"absolute"},children:a.jsxs(Jme,{tabIndex:-1,ref:w,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:i.width,height:i.height,scale:{x:l,y:l},onTouchStart:M,onTouchMove:O,onTouchEnd:E,onMouseDown:M,onMouseLeave:D,onMouseMove:O,onMouseUp:E,onDragStart:A,onDragMove:R,onDragEnd:$,onContextMenu:K=>K.evt.preventDefault(),onWheel:I,draggable:(f==="move"||p)&&!t,children:[a.jsx(Iu,{id:"grid",visible:r,children:a.jsx(mme,{})}),a.jsx(Iu,{id:"base",ref:k,listening:!1,imageSmoothingEnabled:m,children:a.jsx(Mme,{})}),a.jsxs(Iu,{id:"mask",visible:e,listening:!1,children:[a.jsx(kme,{visible:!0,listening:!1}),a.jsx(Cme,{listening:!1})]}),a.jsx(Iu,{children:a.jsx(fme,{})}),a.jsxs(Iu,{id:"preview",imageSmoothingEnabled:m,children:[!p&&a.jsx(Qme,{visible:f!=="move",listening:!1}),a.jsx(Rme,{visible:p}),h&&a.jsx(xme,{}),a.jsx(qme,{visible:n&&!p})]})]})}),a.jsx(Ume,{}),a.jsx(Tme,{})]})},tge=d.memo(ege);function nge(e,t,n=250){const[r,o]=d.useState(0);return d.useEffect(()=>{const s=setTimeout(()=>{r===1&&e(),o(0)},n);return r===2&&t(),()=>clearTimeout(s)},[r,e,t,n]),()=>o(s=>s+1)}const rge=_e(fO,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),Qv={width:6,height:6,borderColor:"base.100"},oge=e=>{const{styleClass:t="",...n}=e;return a.jsx(rge,{sx:{".react-colorful__hue-pointer":Qv,".react-colorful__saturation-pointer":Qv,".react-colorful__alpha-pointer":Qv},className:t,...n})},g8=d.memo(oge),sge=ae([$t,bo],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Di(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:kt}}),age=()=>{const e=te(),{t}=we(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:i}=F(sge);Qe(["q"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[n]),Qe(["shift+c"],()=>{f()},{enabled:()=>!i,preventDefault:!0},[]),Qe(["h"],()=>{p()},{enabled:()=>!i,preventDefault:!0},[o]);const l=()=>{e(m3(n==="mask"?"base":"mask"))},f=()=>e(f3()),p=()=>e(Xx(!o)),h=async()=>{e(A9())};return a.jsx(Vd,{triggerComponent:a.jsx(pn,{children:a.jsx(Te,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:a.jsx(DE,{}),isChecked:n==="mask",isDisabled:i})}),children:a.jsxs(T,{direction:"column",gap:2,children:[a.jsx(ur,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:p}),a.jsx(ur,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:m=>e(D9(m.target.checked))}),a.jsx(g8,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:m=>e(R9(m))}),a.jsx(it,{size:"sm",leftIcon:a.jsx(eg,{}),onClick:h,children:"Save Mask"}),a.jsxs(it,{size:"sm",leftIcon:a.jsx(Wr,{}),onClick:f,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},ige=d.memo(age),lge=ae([$t,wn,vo],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:kt}});function cge(){const e=te(),{canRedo:t,activeTabName:n}=F(lge),{t:r}=we(),o=()=>{e(N9())};return Qe(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),a.jsx(Te,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:a.jsx(MZ,{}),onClick:o,isDisabled:!t})}const uge=()=>{const e=F(bo),t=te(),{t:n}=we();return a.jsxs(Hy,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(T9()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:a.jsx(it,{size:"sm",leftIcon:a.jsx(Wr,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),a.jsx("br",{}),a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},dge=d.memo(uge),fge=ae([$t],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:l,shouldRestrictStrokesToBox:f,shouldAntialias:p}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:l,shouldRestrictStrokesToBox:f,shouldAntialias:p}},{memoizeOptions:{resultEqualityCheck:kt}}),pge=()=>{const e=te(),{t}=we(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:i,shouldShowIntermediates:l,shouldSnapToGrid:f,shouldRestrictStrokesToBox:p,shouldAntialias:h}=F(fge);Qe(["n"],()=>{e(Xp(!f))},{enabled:!0,preventDefault:!0},[f]);const m=v=>e(Xp(v.target.checked));return a.jsx(Vd,{isLazy:!1,triggerComponent:a.jsx(Te,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx($E,{})}),children:a.jsxs(T,{direction:"column",gap:2,children:[a.jsx(ur,{label:t("unifiedCanvas.showIntermediates"),isChecked:l,onChange:v=>e($9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.showGrid"),isChecked:i,onChange:v=>e(L9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.snapToGrid"),isChecked:f,onChange:m}),a.jsx(ur,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:v=>e(z9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:v=>e(F9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:v=>e(B9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:v=>e(H9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:v=>e(W9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.antialiasing"),isChecked:h,onChange:v=>e(V9(v.target.checked))}),a.jsx(dge,{})]})})},hge=d.memo(pge),mge=ae([$t,bo,vo],(e,t,n)=>{const{isProcessing:r}=n,{tool:o,brushColor:s,brushSize:i}=e;return{tool:o,isStaging:t,isProcessing:r,brushColor:s,brushSize:i}},{memoizeOptions:{resultEqualityCheck:kt}}),gge=()=>{const e=te(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=F(mge),{t:s}=we();Qe(["b"],()=>{i()},{enabled:()=>!o,preventDefault:!0},[]),Qe(["e"],()=>{l()},{enabled:()=>!o,preventDefault:!0},[t]),Qe(["c"],()=>{f()},{enabled:()=>!o,preventDefault:!0},[t]),Qe(["shift+f"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),Qe(["delete","backspace"],()=>{h()},{enabled:()=>!o,preventDefault:!0}),Qe(["BracketLeft"],()=>{r-5<=5?e(Gf(Math.max(r-1,1))):e(Gf(Math.max(r-5,1)))},{enabled:()=>!o,preventDefault:!0},[r]),Qe(["BracketRight"],()=>{e(Gf(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),Qe(["Shift+BracketLeft"],()=>{e(Q0({...n,a:Ri(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),Qe(["Shift+BracketRight"],()=>{e(Q0({...n,a:Ri(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const i=()=>e(Yl("brush")),l=()=>e(Yl("eraser")),f=()=>e(Yl("colorPicker")),p=()=>e(U9()),h=()=>e(G9());return a.jsxs(pn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:a.jsx(IZ,{}),isChecked:t==="brush"&&!o,onClick:i,isDisabled:o}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:a.jsx(fZ,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:l}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(yZ,{}),isDisabled:o,onClick:p}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(tl,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:h}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(vZ,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:f}),a.jsx(Vd,{triggerComponent:a.jsx(Te,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:a.jsx(NE,{})}),children:a.jsxs(T,{minWidth:60,direction:"column",gap:4,width:"100%",children:[a.jsx(T,{gap:4,justifyContent:"space-between",children:a.jsx(Ze,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:m=>e(Gf(m)),sliderNumberInputProps:{max:500}})}),a.jsx(g8,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:m=>e(Q0(m))})]})})]})},vge=d.memo(gge),xge=ae([$t,wn,vo],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:kt}});function bge(){const e=te(),{t}=we(),{canUndo:n,activeTabName:r}=F(xge),o=()=>{e(K9())};return Qe(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),a.jsx(Te,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:a.jsx(tg,{}),onClick:o,isDisabled:!n})}const yge=ae([vo,$t,bo],(e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:s,layer:i,isMaskEnabled:l}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:l,tool:o,layer:i,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:kt}}),Cge=()=>{const e=te(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s}=F(yge),i=u1(),{t:l}=we(),{isClipboardAPIAvailable:f}=TM(),{getUploadButtonProps:p,getUploadInputProps:h}=ky({postUploadAction:{type:"SET_CANVAS_INITIAL_IMAGE"}});Qe(["v"],()=>{m()},{enabled:()=>!n,preventDefault:!0},[]),Qe(["r"],()=>{x()},{enabled:()=>!0,preventDefault:!0},[i]),Qe(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[i,t]),Qe(["shift+s"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[i,t]),Qe(["meta+c","ctrl+c"],()=>{k()},{enabled:()=>!n&&f,preventDefault:!0},[i,t,f]),Qe(["shift+d"],()=>{_()},{enabled:()=>!n,preventDefault:!0},[i,t]);const m=()=>e(Yl("move")),v=nge(()=>x(!1),()=>x(!0)),x=(I=!1)=>{const M=u1();if(!M)return;const E=M.getClientRect({skipTransform:!0});e(X9({contentRect:E,shouldScaleTo1:I}))},C=()=>{e(Rj())},b=()=>{e(Y9())},w=()=>{e(Q9())},k=()=>{f&&e(Z9())},_=()=>{e(J9())},j=I=>{const M=I;e(m3(M)),M==="mask"&&!r&&e(Xx(!0))};return a.jsxs(T,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[a.jsx(Ie,{w:24,children:a.jsx(Bn,{tooltip:`${l("unifiedCanvas.layer")} (Q)`,value:o,data:q9,onChange:j,disabled:n})}),a.jsx(ige,{}),a.jsx(vge,{}),a.jsxs(pn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${l("unifiedCanvas.move")} (V)`,tooltip:`${l("unifiedCanvas.move")} (V)`,icon:a.jsx(sZ,{}),isChecked:s==="move"||n,onClick:m}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.resetView")} (R)`,tooltip:`${l("unifiedCanvas.resetView")} (R)`,icon:a.jsx(cZ,{}),onClick:v})]}),a.jsxs(pn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(_Z,{}),onClick:b,isDisabled:n}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(eg,{}),onClick:w,isDisabled:n}),f&&a.jsx(Te,{"aria-label":`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(Hc,{}),onClick:k,isDisabled:n}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(Jm,{}),onClick:_,isDisabled:n})]}),a.jsxs(pn,{isAttached:!0,children:[a.jsx(bge,{}),a.jsx(cge,{})]}),a.jsxs(pn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${l("common.upload")}`,tooltip:`${l("common.upload")}`,icon:a.jsx(ng,{}),isDisabled:n,...p()}),a.jsx("input",{...h()}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.clearCanvas")}`,tooltip:`${l("unifiedCanvas.clearCanvas")}`,icon:a.jsx(Wr,{}),onClick:C,colorScheme:"error",isDisabled:n})]}),a.jsx(pn,{isAttached:!0,children:a.jsx(hge,{})})]})},wge=d.memo(Cge),gj={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},Sge=()=>{const{isOver:e,setNodeRef:t,active:n}=mM({id:"unifiedCanvas",data:gj});return a.jsxs(T,{layerStyle:"first",ref:t,tabIndex:-1,sx:{flexDirection:"column",alignItems:"center",gap:4,p:2,borderRadius:"base",w:"full",h:"full"},children:[a.jsx(wge,{}),a.jsx(tge,{}),gM(gj,n)&&a.jsx(vM,{isOver:e,label:"Set Canvas Initial Image"})]})},kge=d.memo(Sge),_ge=()=>a.jsx(kge,{}),jge=d.memo(_ge),Pge=[{id:"txt2img",translationKey:"common.txt2img",icon:a.jsx(An,{as:CZ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Kpe,{})},{id:"img2img",translationKey:"common.img2img",icon:a.jsx(An,{as:Wi,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(tue,{})},{id:"unifiedCanvas",translationKey:"common.unifiedCanvas",icon:a.jsx(An,{as:bne,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(jge,{})},{id:"nodes",translationKey:"common.nodes",icon:a.jsx(An,{as:vg,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Upe,{})},{id:"modelManager",translationKey:"modelManager.modelManager",icon:a.jsx(An,{as:uZ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(ede,{})}],Ige=ae([xe],({config:e})=>{const{disabledTabs:t}=e;return Pge.filter(r=>!t.includes(r.id))},{memoizeOptions:{resultEqualityCheck:kt}}),Ege=448,Mge=448,Oge=360,Dge=["modelManager"],Rge=["modelManager"],Age=()=>{const e=F(eN),t=F(wn),n=F(Ige),{t:r}=we(),o=te(),s=d.useCallback(R=>{R.target instanceof HTMLElement&&R.target.blur()},[]),i=d.useMemo(()=>n.map(R=>a.jsx(Dt,{hasArrow:!0,label:String(r(R.translationKey)),placement:"end",children:a.jsxs(Pr,{onClick:s,children:[a.jsx(D3,{children:String(r(R.translationKey))}),R.icon]})},R.id)),[n,r,s]),l=d.useMemo(()=>n.map(R=>a.jsx(fo,{children:R.content},R.id)),[n]),f=d.useCallback(R=>{const $=tN[R];$&&o(Ra($))},[o]),{minSize:p,isCollapsed:h,setIsCollapsed:m,ref:v,reset:x,expand:C,collapse:b,toggle:w}=S_(Ege,"pixels"),{ref:k,minSize:_,isCollapsed:j,setIsCollapsed:I,reset:M,expand:E,collapse:O,toggle:D}=S_(Oge,"pixels");Qe("f",()=>{j||h?(E(),C()):(b(),O())},[o,j,h]),Qe(["t","o"],()=>{w()},[o]),Qe("g",()=>{D()},[o]);const A=Oy();return a.jsxs(Yi,{variant:"appTabs",defaultIndex:e,index:e,onChange:f,sx:{flexGrow:1,gap:4},isLazy:!0,children:[a.jsxs(Qi,{sx:{pt:2,gap:4,flexDir:"column"},children:[i,a.jsx(Za,{}),a.jsx(pJ,{})]}),a.jsxs(yg,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},storage:A,units:"pixels",children:[!Rge.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(Va,{order:0,id:"side",ref:v,defaultSize:p,minSize:p,onCollapse:m,collapsible:!0,children:t==="nodes"?a.jsx(qoe,{}):a.jsx(Sce,{})}),a.jsx(om,{onDoubleClick:x,collapsedDirection:h?"left":void 0}),a.jsx(Zoe,{isSidePanelCollapsed:h,sidePanelRef:v})]}),a.jsx(Va,{id:"main",order:1,minSize:Mge,children:a.jsx(zc,{style:{height:"100%",width:"100%"},children:l})}),!Dge.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(om,{onDoubleClick:M,collapsedDirection:j?"right":void 0}),a.jsx(Va,{id:"gallery",ref:k,order:2,defaultSize:_,minSize:_,onCollapse:I,collapsible:!0,children:a.jsx(Yne,{})}),a.jsx(Yoe,{isGalleryCollapsed:j,galleryPanelRef:k})]})]})]})},Nge=d.memo(Age),Tge=d.createContext(null),Zv={didCatch:!1,error:null};class $ge extends d.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Zv}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:s,reason:"imperative-api"}),this.setState(Zv)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&Lge(t.resetKeys,o)){var s,i;(s=(i=this.props).onReset)===null||s===void 0||s.call(i,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Zv)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:s,error:i}=this.state;let l=t;if(s){const f={error:i,resetErrorBoundary:this.resetErrorBoundary};if(d.isValidElement(o))l=o;else if(typeof n=="function")l=n(f);else if(r)l=d.createElement(r,f);else throw i}return d.createElement(Tge.Provider,{value:{didCatch:s,error:i,resetErrorBoundary:this.resetErrorBoundary}},l)}}function Lge(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}const zge=()=>{const e=te(),[t,n]=d.useState(),[r,o]=d.useState(),{recallAllParameters:s}=gg(),i=Zi(),{currentData:l}=po(t??zr.skipToken),{currentData:f}=nN(r??zr.skipToken);return{handlePreselectedImage:d.useCallback(h=>{h&&(h.action==="sendToCanvas"&&(n(h==null?void 0:h.imageName),l&&(e(Bj(l)),e(Ra("unifiedCanvas")),i({title:rN("toast.sentToUnifiedCanvas"),status:"info",duration:2500,isClosable:!0}))),h.action==="sendToImg2Img"&&(n(h==null?void 0:h.imageName),l&&e(pm(l))),h.action==="useAllParameters"&&(o(h==null?void 0:h.imageName),f&&s(f.metadata)))},[e,l,f,s,i])}};function Fge(e={}){let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");const n=new URL(`${t}/issues/new`),r=["body","title","labels","template","milestone","assignee","projects"];for(const o of r){let s=e[o];if(s!==void 0){if(o==="labels"||o==="projects"){if(!Array.isArray(s))throw new TypeError(`The \`${o}\` option should be an array`);s=s.join(",")}n.searchParams.set(o,s)}}return n.toString()}const Bge=({error:e,resetErrorBoundary:t})=>{const n=k3(),r=d.useCallback(()=>{const s=JSON.stringify(oN(e),null,2);navigator.clipboard.writeText(`\`\`\`
${s}
\`\`\``),n({title:"Error Copied"})},[e,n]),o=d.useMemo(()=>Fge({user:"invoke-ai",repo:"InvokeAI",template:"BUG_REPORT.yml",title:`[bug]: ${e.name}: ${e.message}`}),[e.message,e.name]);return a.jsx(T,{layerStyle:"body",sx:{w:"100vw",h:"100vh",alignItems:"center",justifyContent:"center",p:4},children:a.jsxs(T,{layerStyle:"first",sx:{flexDir:"column",borderRadius:"base",justifyContent:"center",gap:8,p:16},children:[a.jsx(oo,{children:"Something went wrong"}),a.jsx(T,{layerStyle:"second",sx:{px:8,py:4,borderRadius:"base",gap:4,justifyContent:"space-between",alignItems:"center"},children:a.jsxs(be,{sx:{fontWeight:600,color:"error.500",_dark:{color:"error.400"}},children:[e.name,": ",e.message]})}),a.jsxs(T,{sx:{gap:4},children:[a.jsx(it,{leftIcon:a.jsx(Dpe,{}),onClick:t,children:"Reset UI"}),a.jsx(it,{leftIcon:a.jsx(Hc,{}),onClick:r,children:"Copy Error"}),a.jsx(Im,{href:o,isExternal:!0,children:a.jsx(it,{leftIcon:a.jsx(PE,{}),children:"Create Issue"})})]})]})})},Hge=d.memo(Bge),Wge=ae([xe],({hotkeys:e})=>{const{shift:t,ctrl:n,meta:r}=e;return{shift:t,ctrl:n,meta:r}},{memoizeOptions:{resultEqualityCheck:kt}}),Vge=()=>{const e=te(),{shift:t,ctrl:n,meta:r}=F(Wge);return Qe("*",()=>{Tp("shift")?!t&&e(Ir(!0)):t&&e(Ir(!1)),Tp("ctrl")?!n&&e(vw(!0)):n&&e(vw(!1)),Tp("meta")?!r&&e(xw(!0)):r&&e(xw(!1))},{keyup:!0,keydown:!0},[t,n,r]),Qe("1",()=>{e(Ra("txt2img"))}),Qe("2",()=>{e(Ra("img2img"))}),Qe("3",()=>{e(Ra("unifiedCanvas"))}),Qe("4",()=>{e(Ra("nodes"))}),Qe("5",()=>{e(Ra("modelManager"))}),null},Uge=d.memo(Vge),Gge={},Kge=({config:e=Gge,headerComponent:t,selectedImage:n})=>{const r=F(OP),o=DP("system"),s=te(),{handlePreselectedImage:i}=zge(),l=d.useCallback(()=>(localStorage.clear(),location.reload(),!1),[]);return d.useEffect(()=>{bn.changeLanguage(r)},[r]),d.useEffect(()=>{Xj(e)&&(o.info({config:e},"Received config"),s(sN(e)))},[s,e,o]),d.useEffect(()=>{s(aN())},[s]),d.useEffect(()=>{i(n)},[i,n]),a.jsxs($ge,{onReset:l,FallbackComponent:Hge,children:[a.jsx(Ua,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:a.jsx(OV,{children:a.jsxs(Ua,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[t||a.jsx(uJ,{}),a.jsx(T,{sx:{gap:4,w:"full",h:"full"},children:a.jsx(Nge,{})})]})})}),a.jsx(XQ,{}),a.jsx(VQ,{}),a.jsx(yW,{}),a.jsx(Uge,{})]})},n0e=d.memo(Kge);export{n0e as default};