mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
170 lines
901 KiB
JavaScript
170 lines
901 KiB
JavaScript
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)},Zr=(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){Zr(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 xj,c as yj,d as Cj,e as Jv,f as wj,i as e1,g as i7,k as l7,h as MC,j as Sj,t as c7,l as u7,m as d7,n as f7,o as p7,p as h7,q as m7,r as V0,s as g7,u,v as a,w as Db,x as Bp,y as v7,z as b7,A as x7,B as y7,P as C7,C as Rb,D as w7,E as S7,F as k7,G as _7,H as kj,I as Pe,J as j7,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 lo,Y as Yl,Z as aa,_ as cm,$ as Ab,a0 as Dc,a1 as nn,a2 as P7,a3 as H,a4 as DC,a5 as I7,a6 as _j,a7 as t1,a8 as bd,a9 as E7,aa as jj,ab as Pj,ac as ds,ad as O7,ae,af as Ce,ag as kt,ah as F,ai as M7,aj as RC,ak as D7,al as R7,am as A7,an as qi,ao as J,ap as N7,aq as Nt,ar as zt,as as Ie,at as $,au as ro,av as be,aw as wn,ax as Ij,ay as T7,az as $7,aA as L7,aB as z7,aC as oo,aD as Nb,aE as ia,aF as Pr,aG as um,aH as F7,aI as B7,aJ as AC,aK as Tb,aL as xe,aM as Do,aN as H7,aO as Ej,aP as Oj,aQ as NC,aR as V7,aS as W7,aT as U7,aU as Xi,aV as Mj,aW as xn,aX as G7,aY as K7,aZ as q7,a_ as Dj,a$ as rr,b0 as dm,b1 as X7,b2 as TC,b3 as Rj,b4 as Y7,b5 as Q7,b6 as Z7,b7 as J7,b8 as eD,b9 as tD,ba as nD,bb as rD,bc as Aj,bd as oD,be as sD,bf as aD,bg as iD,bh as lD,bi as Lr,bj as cD,bk as uD,bl as dD,bm as $C,bn as fD,bo as pD,bp as Fa,bq as fm,br as Nj,bs as Tj,bt as fo,bu as $j,bv as hD,bw as Ri,bx as Eu,by as LC,bz as mD,bA as gD,bB as vD,bC as Hf,bD as Vf,bE as bu,bF as W0,bG as $u,bH as Lu,bI as zu,bJ as Fu,bK as zC,bL as Hp,bM as U0,bN as Vp,bO as FC,bP as n1,bQ as G0,bR as r1,bS as K0,bT as Wp,bU as BC,bV as Ai,bW as HC,bX as Ni,bY as VC,bZ as Up,b_ as pm,b$ as bD,c0 as Lj,c1 as o1,c2 as s1,c3 as zj,c4 as xD,c5 as a1,c6 as yD,c7 as i1,c8 as CD,c9 as l1,ca as $b,cb as Lb,cc as zb,cd as Fb,ce as hm,cf as Bb,cg as Fj,ch as Ra,ci as Bj,cj as Hb,ck as Hj,cl as wD,cm as xu,cn as Ti,co as Vj,cp as Wj,cq as WC,cr as SD,cs as kD,ct as _D,cu as Cn,cv as jD,cw as Tn,cx as xd,cy as mm,cz as PD,cA as ID,cB as ED,cC as OD,cD as MD,cE as DD,cF as RD,cG as AD,cH as ND,cI as TD,cJ as UC,cK as Vb,cL as $D,cM as LD,cN as yd,cO as zD,cP as FD,cQ as gm,cR as BD,cS as HD,cT as VD,cU as Wb,cV as WD,cW as un,cX as UD,cY as GD,cZ as KD,c_ as vm,c$ as qD,d0 as XD,d1 as YD,d2 as Xu,d3 as GC,d4 as Bo,d5 as Uj,d6 as QD,d7 as Ub,d8 as ZD,d9 as KC,da as JD,db as eR,dc as tR,dd as Gj,de as nR,df as rR,dg as oR,dh as sR,di as Kj,dj as aR,dk as iR,dl as lR,dm as cR,dn as uR,dp as dR,dq as fR,dr as pR,ds as qj,dt as Xj,du as hR,dv as mR,dw as gR,dx as vR,dy as bR,dz as Ro,dA as xR,dB as mo,dC as yR,dD as CR,dE as wR,dF as SR,dG as kR,dH as _R,dI as jR,dJ as PR,dK as IR,dL as ER,dM as OR,dN as MR,dO as DR,dP as RR,dQ as AR,dR as NR,dS as qC,dT as TR,dU as XC,dV as $R,dW as LR,dX as zR,dY as FR,dZ as BR,d_ as HR,d$ as YC,e0 as QC,e1 as ZC,e2 as Gb,e3 as VR,e4 as Eo,e5 as Yu,e6 as No,e7 as WR,e8 as UR,e9 as Yj,ea as Qj,eb as GR,ec as JC,ed as KR,ee as ew,ef as tw,eg as nw,eh as qR,ei as XR,ej as rw,ek as ow,el as YR,em as QR,en as Gp,eo as ZR,ep as sw,eq as Wf,er as aw,es as iw,et as JR,eu as eA,ev as tA,ew as Zj,ex as nA,ey as rA,ez as lw,eA as oA,eB as cw,eC as sA,eD as Jj,eE as e5,eF as Cd,eG as t5,eH as Ci,eI as n5,eJ as uw,eK as aA,eL as iA,eM as r5,eN as lA,eO as cA,eP as uA,eQ as dA,eR as fA,eS as Kb,eT as c1,eU as dw,eV as Yi,eW as pA,eX as hA,eY as o5,eZ as Us,e_ as Gs,e$ as s5,f0 as a5,f1 as qb,f2 as i5,f3 as mA,f4 as Ks,f5 as gA,f6 as l5,f7 as vA,f8 as bA,f9 as xA,fa as yA,fb as CA,fc as wA,fd as SA,fe as Kp,ff as Ou,fg as Vl,fh as kA,fi as _A,fj as jA,fk as PA,fl as IA,fm as EA,fn as OA,fo as MA,fp as DA,fq as RA,fr as AA,fs as NA,ft as TA,fu as $A,fv as LA,fw as zA,fx as FA,fy as BA,fz as HA,fA as VA,fB as fw,fC as WA,fD as UA,fE as GA,fF as KA,fG as qA,fH as XA,fI as YA,fJ as QA,fK as ZA,fL as JA,fM as e9,fN as t9,fO as n9,fP as r9,fQ as pw,fR as Ip,fS as o9,fT as qp,fU as c5,fV as Xp,fW as s9,fX as a9,fY as Ql,fZ as u5,f_ as d5,f$ as Xb,g0 as i9,g1 as l9,g2 as c9,g3 as u1,g4 as f5,g5 as u9,g6 as d9,g7 as p5,g8 as f9,g9 as p9,ga as h9,gb as m9,gc as g9,gd as Sl,ge as v9,gf as b9,gg as x9,gh as y9,gi as C9,gj as w9,gk as hw,gl as S9,gm as k9,gn as _9,go as j9,gp as P9,gq as I9,gr as E9,gs as O9,gt as q0,gu as X0,gv as Y0,gw as Uf,gx as mw,gy as d1,gz as M9,gA as D9,gB as R9,gC as A9,gD as N9,gE as h5,gF as T9,gG as $9,gH as L9,gI as z9,gJ as F9,gK as B9,gL as H9,gM as V9,gN as W9,gO as U9,gP as G9,gQ as Gf,gR as Q0,gS as K9,gT as q9,gU as X9,gV as Y9,gW as Q9,gX as Z9,gY as J9,gZ as eN,g_ as tN,g$ as nN,h0 as rN,h1 as oN,h2 as sN,h3 as aN,h4 as gw,h5 as vw,h6 as iN,h7 as lN}from"./index-a548858c.js";import{I as An,u as cN,c as uN,a as Tt,b as tn,d as la,P as wd,C as dN,e as we,f as m5,g as ca,h as fN,r as Me,i as pN,j as bw,k as ut,l as Sn,m as gc}from"./menu-ae65a4ab.js";var hN=200;function mN(e,t,n,r){var o=-1,s=yj,i=!0,c=e.length,f=[],p=t.length;if(!c)return f;n&&(t=gd(t,bj(n))),r?(s=Cj,i=!1):t.length>=hN&&(s=Jv,i=!1,t=new xj(t));e:for(;++o<c;){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 gN=wj(function(e,t){return e1(e)?mN(e,i7(t,1,e1,!0)):[]});const vN=gN;function bN(e,t){return gd(t,function(n){return e[n]})}function xN(e){return e==null?[]:bN(e,l7(e))}var yN=Math.min;function CN(e,t,n){for(var r=n?Cj:yj,o=e[0].length,s=e.length,i=s,c=Array(s),f=1/0,p=[];i--;){var h=e[i];i&&t&&(h=gd(h,bj(t))),f=yN(h.length,f),c[i]=!n&&(t||o>=120&&h.length>=120)?new xj(i&&h):void 0}h=e[0];var m=-1,v=c[0];e:for(;++m<o&&p.length<f;){var b=h[m],y=t?t(b):b;if(b=n||b!==0?b:0,!(v?Jv(v,y):r(p,y,n))){for(i=s;--i;){var x=c[i];if(!(x?Jv(x,y):r(e[i],y,n)))continue e}v&&v.push(y),p.push(b)}}return p}function wN(e){return e1(e)?e:[]}var SN=wj(function(e){var t=gd(e,wN);return t.length&&t[0]===e[0]?CN(t):[]});const kN=SN;function _N(e,t,n,r){if(!MC(e))return e;t=Sj(t,e);for(var o=-1,s=t.length,i=s-1,c=e;c!=null&&++o<s;){var f=c7(t[o]),p=n;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(o!=i){var h=c[f];p=r?r(h,f,c):void 0,p===void 0&&(p=MC(h)?h:u7(t[o+1])?[]:{})}d7(c,f,p),c=c[f]}return e}function jN(e,t,n){for(var r=-1,o=t.length,s={};++r<o;){var i=t[r],c=f7(e,i);n(c,i)&&_N(s,Sj(i,e),c)}return s}function xw(e,t){if(e==null)return{};var n=gd(p7(e),function(r){return[r]});return t=h7(t),jN(e,n,function(r,o){return t(r,o[0])})}var PN=Math.ceil,IN=Math.max;function EN(e,t,n,r){for(var o=-1,s=IN(PN((t-e)/(n||1)),0),i=Array(s);s--;)i[r?s:++o]=e,e+=n;return i}function ON(e){return function(t,n,r){return r&&typeof r!="number"&&m7(t,n,r)&&(n=r=void 0),t=V0(t),n===void 0?(n=t,t=0):n=V0(n),r=r===void 0?t<n?1:-1:V0(r),EN(t,n,r,e)}}var MN=ON();const yw=MN;function Cw(e){return e&&e.length?g7(e):[]}function DN(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 g5=({id:e,x:t,y:n,width:r,height:o,style:s,color:i,strokeColor:c,strokeWidth:f,className:p,borderRadius:h,shapeRendering:m,onClick:v,selected:b})=>{const{background:y,backgroundColor:x}=s||{},w=i||y||x;return a.jsx("rect",{className:Db(["react-flow__minimap-node",{selected:b},p]),x:t,y:n,rx:h,ry:h,width:r,height:o,fill:w,stroke:c,strokeWidth:f,shapeRendering:m,onClick:v?k=>v(k,e):void 0})};g5.displayName="MiniMapNode";var RN=u.memo(g5);const AN=e=>e.nodeOrigin,NN=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),Z0=e=>e instanceof Function?e:()=>e;function TN({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=RN,onClick:i}){const c=Bp(NN,Rb),f=Bp(AN),p=Z0(t),h=Z0(e),m=Z0(n),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:c.map(b=>{const{x:y,y:x}=v7(b,f).positionAbsolute;return a.jsx(s,{x:y,y:x,width:b.width,height:b.height,style:b.style,selected:b.selected,className:m(b),color:p(b),borderRadius:r,strokeColor:h(b),strokeWidth:o,shapeRendering:v,onClick:i,id:b.id},b.id)})})}var $N=u.memo(TN);const LN=200,zN=150,FN=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?k7(_7(t,e.nodeOrigin),n):n,rfId:e.rfId}},BN="react-flow__minimap-desc";function v5({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:i=2,nodeComponent:c,maskColor:f="rgb(240, 240, 240, 0.6)",maskStrokeColor:p="none",maskStrokeWidth:h=1,position:m="bottom-right",onClick:v,onNodeClick:b,pannable:y=!1,zoomable:x=!1,ariaLabel:w="React Flow mini map",inversePan:k=!1,zoomStep:_=10,offsetScale:j=5}){const I=b7(),E=u.useRef(null),{boundingRect:O,viewBB:M,rfId:D}=Bp(FN,Rb),A=(e==null?void 0:e.width)??LN,R=(e==null?void 0:e.height)??zN,T=O.width/A,q=O.height/R,B=Math.max(T,q),G=B*A,Y=B*R,V=j*B,L=O.x-(G-O.width)/2-V,X=O.y-(Y-O.height)/2-V,z=G+V*2,K=Y+V*2,ne=`${BN}-${D}`,Q=u.useRef(0);Q.current=B,u.useEffect(()=>{if(E.current){const W=x7(E.current),U=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)},ee=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=w7.translate(je.x,je.y).scale(fe[2]),Ue=me.constrain()(rt,Be,ye);me.transform(de,Ue)},se=y7().on("zoom",y?ee:null).on("zoom.wheel",x?U:null);return W.call(se),()=>{W.on("zoom",null)}}},[y,x,k,_]);const ie=v?W=>{const U=S7(W);v(W,{x:U[0],y:U[1]})}:void 0,oe=b?(W,U)=>{const ee=I.getState().nodeInternals.get(U);b(W,ee)}:void 0;return a.jsx(C7,{position:m,style:e,className:Db(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:A,height:R,viewBox:`${L} ${X} ${z} ${K}`,role:"img","aria-labelledby":ne,ref:E,onClick:ie,children:[w&&a.jsx("title",{id:ne,children:w}),a.jsx($N,{onClick:oe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:c}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${L-V},${X-V}h${z+V*2}v${K+V*2}h${-z-V*2}z
|
||
M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fill:f,fillRule:"evenodd",stroke:p,strokeWidth:h,pointerEvents:"none"})]})})}v5.displayName="MiniMap";var HN=u.memo(v5),To;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(To||(To={}));function VN({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 WN({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const UN={[To.Dots]:"#91919a",[To.Lines]:"#eee",[To.Cross]:"#e2e2e2"},GN={[To.Dots]:1,[To.Lines]:1,[To.Cross]:6},KN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function b5({id:e,variant:t=To.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:c,className:f}){const p=u.useRef(null),{transform:h,patternId:m}=Bp(KN,Rb),v=i||UN[t],b=r||GN[t],y=t===To.Dots,x=t===To.Cross,w=Array.isArray(n)?n:[n,n],k=[w[0]*h[2]||1,w[1]*h[2]||1],_=b*h[2],j=x?[_,_]:k,I=y?[_/s,_/s]:[j[0]/s,j[1]/s];return a.jsxs("svg",{className:Db(["react-flow__background",f]),style:{...c,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:y?a.jsx(WN,{color:v,radius:_/s}):a.jsx(VN,{dimensions:j,color:v,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`})]})}b5.displayName="Background";var qN=u.memo(b5);const ww=(e,t,n)=>{XN(n);const r=kj(e,t);return x5[n].includes(r)},x5={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Sw=Object.keys(x5),XN=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Sw.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Sw.join("|")}`)};function YN(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var QN=YN();const y5=1/60*1e3,ZN=typeof performance<"u"?()=>performance.now():()=>Date.now(),C5=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(ZN()),y5);function JN(e){let t=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,c={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)&&(c.schedule(h),e())}o=!1,s&&(s=!1,c.process(f))}};return c}const eT=40;let f1=!0,Qu=!1,p1=!1;const Zl={delta:0,timestamp:0},Sd=["read","update","preRender","render","postRender"],bm=Sd.reduce((e,t)=>(e[t]=JN(()=>Qu=!0),e),{}),tT=Sd.reduce((e,t)=>{const n=bm[t];return e[t]=(r,o=!1,s=!1)=>(Qu||oT(),n.schedule(r,o,s)),e},{}),nT=Sd.reduce((e,t)=>(e[t]=bm[t].cancel,e),{});Sd.reduce((e,t)=>(e[t]=()=>bm[t].process(Zl),e),{});const rT=e=>bm[e].process(Zl),w5=e=>{Qu=!1,Zl.delta=f1?y5:Math.max(Math.min(e-Zl.timestamp,eT),1),Zl.timestamp=e,p1=!0,Sd.forEach(rT),p1=!1,Qu&&(f1=!1,C5(w5))},oT=()=>{Qu=!0,f1=!0,p1||C5(w5)},kw=()=>Zl;function kd(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=u.Children.toArray(e.path),i=Pe((c,f)=>a.jsx(An,{ref:f,viewBox:t,...o,...c,children:s.length?s:a.jsx("path",{fill:"currentColor",d:n})}));return i.displayName=r,i}function S5(e){const{theme:t}=j7(),n=cN();return u.useMemo(()=>uN(t.direction,{...n,...e}),[e,t.direction,n])}var sT=Object.defineProperty,aT=(e,t,n)=>t in e?sT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pn=(e,t,n)=>(aT(e,typeof t!="symbol"?t+"":t,n),n);function _w(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 iT=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function jw(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function Pw(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var h1=typeof window<"u"?u.useLayoutEffect:u.useEffect,Yp=e=>e,lT=class{constructor(){pn(this,"descendants",new Map),pn(this,"register",e=>{if(e!=null)return iT(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),pn(this,"unregister",e=>{this.descendants.delete(e);const t=_w(Array.from(this.descendants.keys()));this.assignIndex(t)}),pn(this,"destroy",()=>{this.descendants.clear()}),pn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),pn(this,"count",()=>this.descendants.size),pn(this,"enabledCount",()=>this.enabledValues().length),pn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),pn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),pn(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),pn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),pn(this,"first",()=>this.item(0)),pn(this,"firstEnabled",()=>this.enabledItem(0)),pn(this,"last",()=>this.item(this.descendants.size-1)),pn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),pn(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),pn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),pn(this,"next",(e,t=!0)=>{const n=jw(e,this.count(),t);return this.item(n)}),pn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=jw(r,this.enabledCount(),t);return this.enabledItem(o)}),pn(this,"prev",(e,t=!0)=>{const n=Pw(e,this.count()-1,t);return this.item(n)}),pn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Pw(r,this.enabledCount()-1,t);return this.enabledItem(o)}),pn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=_w(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 cT(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=>{cT(n,t)})}}function uT(...e){return u.useMemo(()=>yt(...e),e)}function dT(){const e=u.useRef(new lT);return h1(()=>()=>e.current.destroy()),e.current}var[fT,k5]=Tt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function pT(e){const t=k5(),[n,r]=u.useState(-1),o=u.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 Yb(){return[Yp(fT),()=>Yp(k5()),()=>dT(),o=>pT(o)]}var[hT,xm]=Tt({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[mT,Qb]=Tt({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[gT,r0e,vT,bT]=Yb(),Al=Pe(function(t,n){const{getButtonProps:r}=Qb(),o=r(t,n),i={display:"flex",alignItems:"center",width:"100%",outline:0,...xm().button};return a.jsx(_e.button,{...o,className:et("chakra-accordion__button",t.className),__css:i})});Al.displayName="AccordionButton";function Rc(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(v,b)=>v!==b}=e,s=tn(r),i=tn(o),[c,f]=u.useState(n),p=t!==void 0,h=p?t:c,m=tn(v=>{const y=typeof v=="function"?v(h):v;i(h,y)&&(p||f(y),s(y))},[p,s,h,i]);return[h,m]}function xT(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...i}=e;wT(e),ST(e);const c=vT(),[f,p]=u.useState(-1);u.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:b=>{let y=!1;return b!==null&&(y=Array.isArray(h)?h.includes(b):h===b),{isOpen:y,onChange:w=>{if(b!==null)if(o&&Array.isArray(h)){const k=w?h.concat(b):h.filter(_=>_!==b);m(k)}else w?m(b):s&&m(-1)}}},focusedIndex:f,setFocusedIndex:p,descendants:c}}var[yT,Zb]=Tt({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function CT(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:i}=Zb(),c=u.useRef(null),f=u.useId(),p=r??f,h=`accordion-button-${p}`,m=`accordion-panel-${p}`;kT(e);const{register:v,index:b,descendants:y}=bT({disabled:t&&!n}),{isOpen:x,onChange:w}=s(b===-1?null:b);_T({isOpen:x,isDisabled:t});const k=()=>{w==null||w(!0)},_=()=>{w==null||w(!1)},j=u.useCallback(()=>{w==null||w(!x),i(b)},[b,i,x,w]),I=u.useCallback(D=>{const R={ArrowDown:()=>{const T=y.nextEnabled(b);T==null||T.node.focus()},ArrowUp:()=>{const T=y.prevEnabled(b);T==null||T.node.focus()},Home:()=>{const T=y.firstEnabled();T==null||T.node.focus()},End:()=>{const T=y.lastEnabled();T==null||T.node.focus()}}[D.key];R&&(D.preventDefault(),R(D))},[y,b]),E=u.useCallback(()=>{i(b)},[i,b]),O=u.useCallback(function(A={},R=null){return{...A,type:"button",ref:yt(v,c,R),id:h,disabled:!!t,"aria-expanded":!!x,"aria-controls":m,onClick:Fe(A.onClick,j),onFocus:Fe(A.onFocus,E),onKeyDown:Fe(A.onKeyDown,I)}},[h,t,x,j,E,I,m,v]),M=u.useCallback(function(A={},R=null){return{...A,ref:R,role:"region",id:m,"aria-labelledby":h,hidden:!x}},[h,x,m]);return{isOpen:x,isDisabled:t,isFocusable:n,onOpen:k,onClose:_,getButtonProps:O,getPanelProps:M,htmlProps:o}}function wT(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 ST(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 kT(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 _T(e){vd({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Nl(e){const{isOpen:t,isDisabled:n}=Qb(),{reduceMotion:r}=Zb(),o=et("chakra-accordion__icon",e.className),s=xm(),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"})})}Nl.displayName="AccordionIcon";var Tl=Pe(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...i}=CT(t),f={...xm().container,overflowAnchor:"none"},p=u.useMemo(()=>i,[i]);return a.jsx(mT,{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})})});Tl.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})},jT=e=>e!=null&&parseInt(e.toString(),10)>0,Iw={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}}},PT={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:jT(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:Xs.exit(Iw.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(Iw.enter,o)}}},ym=u.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:i="auto",style:c,className:f,transition:p,transitionEnd:h,...m}=e,[v,b]=u.useState(!1);u.useEffect(()=>{const _=setTimeout(()=>{b(!0)});return()=>clearTimeout(_)},[]),vd({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const y=parseFloat(s.toString())>0,x={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:y?"block":"none"}}},w=r?n:!0,k=n||r?"enter":"exit";return a.jsx(nr,{initial:!1,custom:x,children:w&&a.jsx(gn.div,{ref:t,...m,className:et("chakra-collapse",f),style:{overflow:"hidden",display:"block",...c},custom:x,variants:PT,initial:r?"exit":!1,animate:k,exit:"exit"})})});ym.displayName="Collapse";var IT={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}}},_5={initial:"exit",animate:"enter",exit:"exit",variants:IT},ET=u.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:i,transitionEnd:c,delay:f,...p}=t,h=o||r?"enter":"exit",m=r?o&&r:!0,v={transition:i,transitionEnd:c,delay:f};return a.jsx(nr,{custom:v,children:m&&a.jsx(gn.div,{ref:n,className:et("chakra-fade",s),custom:v,..._5,animate:h,...p})})});ET.displayName="Fade";var OT={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}}},j5={initial:"exit",animate:"enter",exit:"exit",variants:OT},MT=u.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:i=.95,className:c,transition:f,transitionEnd:p,delay:h,...m}=t,v=r?o&&r:!0,b=o||r?"enter":"exit",y={initialScale:i,reverse:s,transition:f,transitionEnd:p,delay:h};return a.jsx(nr,{custom:y,children:v&&a.jsx(gn.div,{ref:n,className:et("chakra-offset-slide",c),...j5,animate:b,custom:y,...m})})});MT.displayName="ScaleFade";var DT={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 c={x:t,y:e};return{opacity:0,transition:(i=n==null?void 0:n.exit)!=null?i:Xs.exit(ki.exit,s),...o?{...c,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...c,...r==null?void 0:r.exit}}}}},m1={initial:"initial",animate:"enter",exit:"exit",variants:DT},RT=u.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:i,offsetX:c=0,offsetY:f=8,transition:p,transitionEnd:h,delay:m,...v}=t,b=r?o&&r:!0,y=o||r?"enter":"exit",x={offsetX:c,offsetY:f,reverse:s,transition:p,transitionEnd:h,delay:m};return a.jsx(nr,{custom:x,children:b&&a.jsx(gn.div,{ref:n,className:et("chakra-offset-slide",i),custom:x,...m1,animate:y,...v})})});RT.displayName="SlideFade";var $l=Pe(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:i}=Zb(),{getPanelProps:c,isOpen:f}=Qb(),p=c(s,n),h=et("chakra-accordion__panel",r),m=xm();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})});$l.displayName="AccordionPanel";var P5=Pe(function({children:t,reduceMotion:n,...r},o){const s=Hn("Accordion",r),i=Xt(r),{htmlProps:c,descendants:f,...p}=xT(i),h=u.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return a.jsx(gT,{value:f,children:a.jsx(yT,{value:h,children:a.jsx(hT,{value:s,children:a.jsx(_e.div,{ref:o,...c,className:et("chakra-accordion",r.className),__css:s.root,children:t})})})})});P5.displayName="Accordion";function _d(e){return u.Children.toArray(e).filter(t=>u.isValidElement(t))}var[AT,NT]=Tt({strict:!1,name:"ButtonGroupContext"}),TT={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}}},$T={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},hn=Pe(function(t,n){const{size:r,colorScheme:o,variant:s,className:i,spacing:c="0.5rem",isAttached:f,isDisabled:p,orientation:h="horizontal",...m}=t,v=et("chakra-button__group",i),b=u.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let y={display:"inline-flex",...f?TT[h]:$T[h](c)};const x=h==="vertical";return a.jsx(AT,{value:b,children:a.jsx(_e.div,{ref:n,role:"group",__css:y,className:v,"data-attached":f?"":void 0,"data-orientation":h,flexDir:x?"column":void 0,...m})})});hn.displayName="ButtonGroup";function LT(e){const[t,n]=u.useState(!e);return{ref:u.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function g1(e){const{children:t,className:n,...r}=e,o=u.isValidElement(t)?u.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,...c}=e,f=et("chakra-button__spinner",s),p=n==="start"?"marginEnd":"marginStart",h=u.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,...c,__css:h,children:o})}Qp.displayName="ButtonSpinner";var vc=Pe((e,t)=>{const n=NT(),r=Qa("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:i,children:c,leftIcon:f,rightIcon:p,loadingText:h,iconSpacing:m="0.5rem",type:v,spinner:b,spinnerPlacement:y="start",className:x,as:w,...k}=Xt(e),_=u.useMemo(()=>{const O={...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:O}}},[r,n]),{ref:j,type:I}=LT(w),E={rightIcon:p,leftIcon:f,iconSpacing:m,children:c};return a.jsxs(_e.button,{ref:uT(t,j),as:w,type:v??I,"data-active":at(i),"data-loading":at(s),__css:_,className:et("chakra-button",x),...k,disabled:o||s,children:[s&&y==="start"&&a.jsx(Qp,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:m,children:b}),s?h||a.jsx(_e.span,{opacity:0,children:a.jsx(Ew,{...E})}):a.jsx(Ew,{...E}),s&&y==="end"&&a.jsx(Qp,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:m,children:b})]})});vc.displayName="Button";function Ew(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,c=n||r,f=u.isValidElement(c)?u.cloneElement(c,{"aria-hidden":!0,focusable:!1}):null;return a.jsx(vc,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...i,children:f})});ps.displayName="IconButton";var[o0e,zT]=Tt({name:"CheckboxGroupContext",strict:!1});function FT(e){const[t,n]=u.useState(e),[r,o]=u.useState(!1);return e!==t&&(o(!0),n(e)),r}function BT(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 HT(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 VT(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?HT:BT;return n||t?a.jsx(_e.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(o,{...r})}):null}var[WT,I5]=Tt({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[UT,jd]=Tt({strict:!1,name:"FormControlContext"});function GT(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...i}=e,c=u.useId(),f=t||`field-${c}`,p=`${f}-label`,h=`${f}-feedback`,m=`${f}-helptext`,[v,b]=u.useState(!1),[y,x]=u.useState(!1),[w,k]=u.useState(!1),_=u.useCallback((M={},D=null)=>({id:m,...M,ref:yt(D,A=>{A&&x(!0)})}),[m]),j=u.useCallback((M={},D=null)=>({...M,ref:D,"data-focus":at(w),"data-disabled":at(o),"data-invalid":at(r),"data-readonly":at(s),id:M.id!==void 0?M.id:p,htmlFor:M.htmlFor!==void 0?M.htmlFor:f}),[f,o,w,r,s,p]),I=u.useCallback((M={},D=null)=>({id:h,...M,ref:yt(D,A=>{A&&b(!0)}),"aria-live":"polite"}),[h]),E=u.useCallback((M={},D=null)=>({...M,...i,ref:D,role:"group"}),[i]),O=u.useCallback((M={},D=null)=>({...M,ref:D,role:"presentation","aria-hidden":!0,children:M.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!w,onFocus:()=>k(!0),onBlur:()=>k(!1),hasFeedbackText:v,setHasFeedbackText:b,hasHelpText:y,setHasHelpText:x,id:f,labelId:p,feedbackId:h,helpTextId:m,htmlProps:i,getHelpTextProps:_,getErrorMessageProps:I,getRootProps:E,getLabelProps:j,getRequiredIndicatorProps:O}}var dn=Pe(function(t,n){const r=Hn("Form",t),o=Xt(t),{getRootProps:s,htmlProps:i,...c}=GT(o),f=et("chakra-form-control",t.className);return a.jsx(UT,{value:c,children:a.jsx(WT,{value:r,children:a.jsx(_e.div,{...s({},n),className:f,__css:r.container})})})});dn.displayName="FormControl";var E5=Pe(function(t,n){const r=jd(),o=I5(),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})});E5.displayName="FormHelperText";var Gn=Pe(function(t,n){var r;const o=Qa("FormLabel",t),s=Xt(t),{className:i,children:c,requiredIndicator:f=a.jsx(O5,{}),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:[c,m!=null&&m.isRequired?f:p]})});Gn.displayName="FormLabel";var O5=Pe(function(t,n){const r=jd(),o=I5();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})});O5.displayName="RequiredIndicator";function Jb(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=ex(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":lo(n),"aria-required":lo(o),"aria-readonly":lo(r)}}function ex(e){var t,n,r;const o=jd(),{id:s,disabled:i,readOnly:c,required:f,isRequired:p,isInvalid:h,isReadOnly:m,isDisabled:v,onFocus:b,onBlur:y,...x}=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),{...x,"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=c??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,b),onBlur:Fe(o==null?void 0:o.onBlur,y)}}var tx={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},M5=_e("span",{baseStyle:tx});M5.displayName="VisuallyHidden";var KT=_e("input",{baseStyle:tx});KT.displayName="VisuallyHiddenInput";const qT=()=>typeof document<"u";let Ow=!1,Pd=null,$i=!1,v1=!1;const b1=new Set;function nx(e,t){b1.forEach(n=>n(e,t))}const XT=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function YT(e){return!(e.metaKey||!XT&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Mw(e){$i=!0,YT(e)&&(Pd="keyboard",nx("keyboard",e))}function kl(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;nx("pointer",e)}}function QT(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function ZT(e){QT(e)&&($i=!0,Pd="virtual")}function JT(e){e.target===window||e.target===document||(!$i&&!v1&&(Pd="virtual",nx("virtual",e)),$i=!1,v1=!1)}function e$(){$i=!1,v1=!0}function Dw(){return Pd!=="pointer"}function t$(){if(!qT()||Ow)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){$i=!0,e.apply(this,n)},document.addEventListener("keydown",Mw,!0),document.addEventListener("keyup",Mw,!0),document.addEventListener("click",ZT,!0),window.addEventListener("focus",JT,!0),window.addEventListener("blur",e$,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",kl,!0),document.addEventListener("pointermove",kl,!0),document.addEventListener("pointerup",kl,!0)):(document.addEventListener("mousedown",kl,!0),document.addEventListener("mousemove",kl,!0),document.addEventListener("mouseup",kl,!0)),Ow=!0}function D5(e){t$(),e(Dw());const t=()=>e(Dw());return b1.add(t),()=>{b1.delete(t)}}function n$(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function R5(e={}){const t=ex(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:i,onBlur:c,onFocus:f,"aria-describedby":p}=t,{defaultChecked:h,isChecked:m,isFocusable:v,onChange:b,isIndeterminate:y,name:x,value:w,tabIndex:k=void 0,"aria-label":_,"aria-labelledby":j,"aria-invalid":I,...E}=e,O=n$(E,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),M=tn(b),D=tn(c),A=tn(f),[R,T]=u.useState(!1),[q,B]=u.useState(!1),[G,Y]=u.useState(!1),[V,L]=u.useState(!1);u.useEffect(()=>D5(T),[]);const X=u.useRef(null),[z,K]=u.useState(!0),[ne,Q]=u.useState(!!h),ie=m!==void 0,oe=ie?m:ne,W=u.useCallback(ue=>{if(r||n){ue.preventDefault();return}ie||Q(oe?ue.target.checked:y?!0:ue.target.checked),M==null||M(ue)},[r,n,oe,ie,y,M]);Yl(()=>{X.current&&(X.current.indeterminate=!!y)},[y]),la(()=>{n&&B(!1)},[n,B]),Yl(()=>{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 U=n&&!v,ee=u.useCallback(ue=>{ue.key===" "&&L(!0)},[L]),se=u.useCallback(ue=>{ue.key===" "&&L(!1)},[L]);Yl(()=>{if(!X.current)return;X.current.checked!==oe&&Q(X.current.checked)},[X.current]);const re=u.useCallback((ue={},De=null)=>{const je=Be=>{q&&Be.preventDefault(),L(!0)};return{...ue,ref:De,"data-active":at(V),"data-hover":at(G),"data-checked":at(oe),"data-focus":at(q),"data-focus-visible":at(q&&R),"data-indeterminate":at(y),"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))}},[V,oe,n,q,R,G,y,s,r]),fe=u.useCallback((ue={},De=null)=>({...ue,ref:De,"data-active":at(V),"data-hover":at(G),"data-checked":at(oe),"data-focus":at(q),"data-focus-visible":at(q&&R),"data-indeterminate":at(y),"data-disabled":at(n),"data-invalid":at(s),"data-readonly":at(r)}),[V,oe,n,q,R,G,y,s,r]),de=u.useCallback((ue={},De=null)=>({...O,...ue,ref:yt(De,je=>{je&&K(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)}),[O,n,oe,s,z]),me=u.useCallback((ue={},De=null)=>({...ue,ref:yt(X,De),type:"checkbox",name:x,value:w,id:i,tabIndex:k,onChange:Fe(ue.onChange,W),onBlur:Fe(ue.onBlur,D,()=>B(!1)),onFocus:Fe(ue.onFocus,A,()=>B(!0)),onKeyDown:Fe(ue.onKeyDown,ee),onKeyUp:Fe(ue.onKeyUp,se),required:o,checked:oe,disabled:U,readOnly:r,"aria-label":_,"aria-labelledby":j,"aria-invalid":I?!!I:s,"aria-describedby":p,"aria-disabled":n,style:tx}),[x,w,i,W,D,A,ee,se,o,oe,U,r,_,j,I,s,p,n,k]),ye=u.useCallback((ue={},De=null)=>({...ue,ref:De,onMouseDown:Fe(ue.onMouseDown,r$),"data-disabled":at(n),"data-checked":at(oe),"data-invalid":at(s)}),[oe,n,s]);return{state:{isInvalid:s,isFocused:q,isChecked:oe,isActive:V,isHovered:G,isIndeterminate:y,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:de,getCheckboxProps:re,getIndicatorProps:fe,getInputProps:me,getLabelProps:ye,htmlProps:O}}function r$(e){e.preventDefault(),e.stopPropagation()}var o$={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},s$={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},a$=aa({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),i$=aa({from:{opacity:0},to:{opacity:1}}),l$=aa({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Cm=Pe(function(t,n){const r=zT(),o={...r,...t},s=Hn("Checkbox",o),i=Xt(t),{spacing:c="0.5rem",className:f,children:p,iconColor:h,iconSize:m,icon:v=a.jsx(VT,{}),isChecked:b,isDisabled:y=r==null?void 0:r.isDisabled,onChange:x,inputProps:w,...k}=i;let _=b;r!=null&&r.value&&i.value&&(_=r.value.includes(i.value));let j=x;r!=null&&r.onChange&&i.value&&(j=cm(r.onChange,x));const{state:I,getInputProps:E,getCheckboxProps:O,getLabelProps:M,getRootProps:D}=R5({...k,isDisabled:y,isChecked:_,onChange:j}),A=FT(I.isChecked),R=u.useMemo(()=>({animation:A?I.isIndeterminate?`${i$} 20ms linear, ${l$} 200ms linear`:`${a$} 200ms linear`:void 0,fontSize:m,color:h,...s.icon}),[h,m,A,I.isIndeterminate,s.icon]),T=u.cloneElement(v,{__css:R,isIndeterminate:I.isIndeterminate,isChecked:I.isChecked});return a.jsxs(_e.label,{__css:{...s$,...s.container},className:et("chakra-checkbox",f),...D(),children:[a.jsx("input",{className:"chakra-checkbox__input",...E(w,n)}),a.jsx(_e.span,{__css:{...o$,...s.control},className:"chakra-checkbox__control",...O(),children:T}),p&&a.jsx(_e.span,{className:"chakra-checkbox__label",...M(),__css:{marginStart:c,...s.label},children:p})]})});Cm.displayName="Checkbox";function c$(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function rx(e,t){let n=c$(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function x1(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 A5(e,t,n){return(n-t)*e+t}function y1(e,t,n){const r=Math.round((e-t)/n)*n+t,o=x1(n);return rx(r,o)}function Jl(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 u$(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:i=Number.MIN_SAFE_INTEGER,max:c=Number.MAX_SAFE_INTEGER,keepWithinRange:f=!0}=e,p=tn(t),[h,m]=u.useState(()=>{var R;return r==null?"":(R=J0(r,s,n))!=null?R:""}),v=typeof o<"u",b=v?o:h,y=N5(Ea(b),s),x=n??y,w=u.useCallback(R=>{R!==b&&(v||m(R.toString()),p==null||p(R.toString(),Ea(R)))},[p,v,b]),k=u.useCallback(R=>{let T=R;return f&&(T=Jl(T,i,c)),rx(T,x)},[x,f,c,i]),_=u.useCallback((R=s)=>{let T;b===""?T=Ea(R):T=Ea(b)+R,T=k(T),w(T)},[k,s,w,b]),j=u.useCallback((R=s)=>{let T;b===""?T=Ea(-R):T=Ea(b)-R,T=k(T),w(T)},[k,s,w,b]),I=u.useCallback(()=>{var R;let T;r==null?T="":T=(R=J0(r,s,n))!=null?R:i,w(T)},[r,n,s,w,i]),E=u.useCallback(R=>{var T;const q=(T=J0(R,s,x))!=null?T:i;w(q)},[x,s,w,i]),O=Ea(b);return{isOutOfRange:O>c||O<i,isAtMax:O===c,isAtMin:O===i,precision:x,value:b,valueAsNumber:O,update:w,reset:I,increment:_,decrement:j,clamp:k,cast:E,setValue:m}}function Ea(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function N5(e,t){return Math.max(x1(t),x1(e))}function J0(e,t,n){const r=Ea(e);if(Number.isNaN(r))return;const o=N5(r,t);return rx(r,n??o)}var[d$,T5]=Tt({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[f$,ox]=Tt({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),$5={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},wm=Pe(function(t,n){const{getInputProps:r}=ox(),o=T5(),s=r(t,n),i=et("chakra-editable__input",t.className);return a.jsx(_e.input,{...s,__css:{outline:0,...$5,...o.input},className:i})});wm.displayName="EditableInput";var Sm=Pe(function(t,n){const{getPreviewProps:r}=ox(),o=T5(),s=r(t,n),i=et("chakra-editable__preview",t.className);return a.jsx(_e.span,{...s,__css:{cursor:"text",display:"inline-block",...$5,...o.preview},className:i})});Sm.displayName="EditablePreview";function _i(e,t,n,r){const o=tn(n);return u.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 p$(e){return"current"in e}var L5=()=>typeof window<"u";function h$(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var m$=e=>L5()&&e.test(navigator.vendor),g$=e=>L5()&&e.test(h$()),v$=()=>g$(/mac|iphone|ipad|ipod/i),b$=()=>v$()&&m$(/apple/i);function z5(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(!b$()||!r)return;const i=s.target,f=(n??[t]).some(p=>{const h=p$(p)?p.current:p;return(h==null?void 0:h.contains(i))||h===i});o().activeElement!==i&&f&&(s.preventDefault(),i.focus())})}function Rw(e,t){return e?e===t||e.contains(t):!1}function x$(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:i,defaultValue:c,startWithEditView:f,isPreviewFocusable:p=!0,submitOnBlur:h=!0,selectAllOnFocus:m=!0,placeholder:v,onEdit:b,finalFocusRef:y,...x}=e,w=tn(b),k=!!(f&&!i),[_,j]=u.useState(k),[I,E]=Rc({defaultValue:c||"",value:s,onChange:t}),[O,M]=u.useState(I),D=u.useRef(null),A=u.useRef(null),R=u.useRef(null),T=u.useRef(null),q=u.useRef(null);z5({ref:D,enabled:_,elements:[T,q]});const B=!_&&!i;Yl(()=>{var re,fe;_&&((re=D.current)==null||re.focus(),m&&((fe=D.current)==null||fe.select()))},[]),la(()=>{var re,fe,de,me;if(!_){y?(re=y.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 G=u.useCallback(()=>{B&&j(!0)},[B]),Y=u.useCallback(()=>{M(I)},[I]),V=u.useCallback(()=>{j(!1),E(O),n==null||n(O),o==null||o(O)},[n,o,E,O]),L=u.useCallback(()=>{j(!1),M(I),r==null||r(I),o==null||o(O)},[I,r,o,O]);u.useEffect(()=>{if(_)return;const re=D.current;(re==null?void 0:re.ownerDocument.activeElement)===re&&(re==null||re.blur())},[_]);const X=u.useCallback(re=>{E(re.currentTarget.value)},[E]),z=u.useCallback(re=>{const fe=re.key,me={Escape:V,Enter:ye=>{!ye.shiftKey&&!ye.metaKey&&L()}}[fe];me&&(re.preventDefault(),me(re))},[V,L]),K=u.useCallback(re=>{const fe=re.key,me={Escape:V}[fe];me&&(re.preventDefault(),me(re))},[V]),ne=I.length===0,Q=u.useCallback(re=>{var fe;if(!_)return;const de=re.currentTarget.ownerDocument,me=(fe=re.relatedTarget)!=null?fe:de.activeElement,ye=Rw(T.current,me),he=Rw(q.current,me);!ye&&!he&&(h?L():V())},[h,L,V,_]),ie=u.useCallback((re={},fe=null)=>{const de=B&&p?0:void 0;return{...re,ref:yt(fe,A),children:ne?v:I,hidden:_,"aria-disabled":lo(i),tabIndex:de,onFocus:Fe(re.onFocus,G,Y)}},[i,_,B,p,ne,G,Y,v,I]),oe=u.useCallback((re={},fe=null)=>({...re,hidden:!_,placeholder:v,ref:yt(fe,D),disabled:i,"aria-disabled":lo(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]),W=u.useCallback((re={},fe=null)=>({...re,hidden:!_,placeholder:v,ref:yt(fe,D),disabled:i,"aria-disabled":lo(i),value:I,onBlur:Fe(re.onBlur,Q),onChange:Fe(re.onChange,X),onKeyDown:Fe(re.onKeyDown,K),onFocus:Fe(re.onFocus,Y)}),[i,_,Q,X,K,Y,v,I]),U=u.useCallback((re={},fe=null)=>({"aria-label":"Edit",...re,type:"button",onClick:Fe(re.onClick,G),ref:yt(fe,R),disabled:i}),[G,i]),ee=u.useCallback((re={},fe=null)=>({...re,"aria-label":"Submit",ref:yt(q,fe),type:"button",onClick:Fe(re.onClick,L),disabled:i}),[L,i]),se=u.useCallback((re={},fe=null)=>({"aria-label":"Cancel",id:"cancel",...re,ref:yt(T,fe),type:"button",onClick:Fe(re.onClick,V),disabled:i}),[V,i]);return{isEditing:_,isDisabled:i,isValueEmpty:ne,value:I,onEdit:G,onCancel:V,onSubmit:L,getPreviewProps:ie,getInputProps:oe,getTextareaProps:W,getEditButtonProps:U,getSubmitButtonProps:ee,getCancelButtonProps:se,htmlProps:x}}var km=Pe(function(t,n){const r=Hn("Editable",t),o=Xt(t),{htmlProps:s,...i}=x$(o),{isEditing:c,onSubmit:f,onCancel:p,onEdit:h}=i,m=et("chakra-editable",t.className),v=Ab(t.children,{isEditing:c,onSubmit:f,onCancel:p,onEdit:h});return a.jsx(f$,{value:i,children:a.jsx(d$,{value:r,children:a.jsx(_e.div,{ref:n,...s,className:m,children:v})})})});km.displayName="Editable";function F5(){const{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}=ox();return{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}}var B5={exports:{}},y$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",C$=y$,w$=C$;function H5(){}function V5(){}V5.resetWarningCache=H5;var S$=function(){function e(r,o,s,i,c,f){if(f!==w$){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:V5,resetWarningCache:H5};return n.PropTypes=n,n};B5.exports=S$();var k$=B5.exports;const Bt=Dc(k$);var C1="data-focus-lock",W5="data-focus-lock-disabled",_$="data-no-focus-lock",j$="data-autofocus-inside",P$="data-no-autofocus";function I$(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function E$(e,t){var n=u.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 U5(e,t){return E$(t||null,function(n){return e.forEach(function(r){return I$(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 G5(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 c(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(c,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:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(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 Aw(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(c){i={error:c}}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 K5(e){return e}function q5(e,t){t===void 0&&(t=K5);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(c){return c!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var c=n;n=[],c.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 sx(e,t){return t===void 0&&(t=K5),q5(e,t)}function X5(e){e===void 0&&(e={});var t=q5(null);return t.options=us({async:!0,ssr:!1},e),t}var Y5=function(e){var t=e.sideCar,n=G5(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 u.createElement(r,us({},n))};Y5.isSideCarExport=!0;function O$(e,t){return e.useMedium(t),Y5}var Q5=sx({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),Z5=sx(),M$=sx(),D$=X5({async:!0}),R$=[],ax=u.forwardRef(function(t,n){var r,o=u.useState(),s=o[0],i=o[1],c=u.useRef(),f=u.useRef(!1),p=u.useRef(null),h=t.children,m=t.disabled,v=t.noFocusGuards,b=t.persistentFocus,y=t.crossFrame,x=t.autoFocus;t.allowTextSelection;var w=t.group,k=t.className,_=t.whiteList,j=t.hasPositiveIndices,I=t.shards,E=I===void 0?R$:I,O=t.as,M=O===void 0?"div":O,D=t.lockProps,A=D===void 0?{}:D,R=t.sideCar,T=t.returnFocus,q=t.focusOptions,B=t.onActivation,G=t.onDeactivation,Y=u.useState({}),V=Y[0],L=u.useCallback(function(){p.current=p.current||document&&document.activeElement,c.current&&B&&B(c.current),f.current=!0},[B]),X=u.useCallback(function(){f.current=!1,G&&G(c.current)},[G]);u.useEffect(function(){m||(p.current=null)},[]);var z=u.useCallback(function(ee){var se=p.current;if(se&&se.focus){var re=typeof T=="function"?T(se):T;if(re){var fe=typeof re=="object"?re:void 0;p.current=null,ee?Promise.resolve().then(function(){return se.focus(fe)}):se.focus(fe)}}},[T]),K=u.useCallback(function(ee){f.current&&Q5.useMedium(ee)},[]),ne=Z5.useMedium,Q=u.useCallback(function(ee){c.current!==ee&&(c.current=ee,i(ee))},[]),ie=nn((r={},r[W5]=m&&"disabled",r[C1]=w,r),A),oe=v!==!0,W=oe&&v!=="tail",U=U5([n,Q]);return u.createElement(u.Fragment,null,oe&&[u.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:m?-1:0,style:ev}),j?u.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:m?-1:1,style:ev}):null],!m&&u.createElement(R,{id:V,sideCar:D$,observed:s,disabled:m,persistentFocus:b,crossFrame:y,autoFocus:x,whiteList:_,shards:E,onActivation:L,onDeactivation:X,returnFocus:z,focusOptions:q}),u.createElement(M,nn({ref:U},ie,{className:k,onBlur:ne,onFocus:K}),h),W&&u.createElement("div",{"data-focus-guard":!0,tabIndex:m?-1:0,style:ev}))});ax.propTypes={};ax.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 J5=ax;function S1(e,t){return S1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},S1(e,t)}function A$(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,S1(e,t)}function N$(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],i;function c(){i=e(s.map(function(p){return p.props})),t(i)}var f=function(p){A$(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),c()},m.componentDidUpdate=function(){c()},m.componentWillUnmount=function(){var b=s.indexOf(this);s.splice(b,1),c()},m.render=function(){return H.createElement(o,this.props)},h}(u.PureComponent);return P7(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]},e3=function(e){return Array.isArray(e)?e[0]:e},T$=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"},t3=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},n3=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},$$=function(e,t){return!e||n3(e)||!T$(e)&&t(t3(e))},r3=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=$$(t,r3.bind(void 0,e));return e.set(t,r),r},L$=function(e,t){return e&&!n3(e)?B$(e)?t(t3(e)):!1:!0},o3=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=L$(t,o3.bind(void 0,e));return e.set(t,r),r},s3=function(e){return e.dataset},z$=function(e){return e.tagName==="BUTTON"},a3=function(e){return e.tagName==="INPUT"},i3=function(e){return a3(e)&&e.type==="radio"},F$=function(e){return!((a3(e)||z$(e))&&(e.type==="hidden"||e.disabled))},B$=function(e){var t=e.getAttribute(P$);return![!0,"true",""].includes(t)},ix=function(e){var t;return!!(e&&(!((t=s3(e))===null||t===void 0)&&t.focusGuard))},eh=function(e){return!ix(e)},H$=function(e){return!!e},V$=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},l3=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(V$)},W$=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],lx=W$.join(","),U$="".concat(lx,", [data-focus-guard]"),c3=function(e,t){return _s((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?U$:lx)?[r]:[],c3(r))},[])},G$=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=c3(r,t),i=(o=[]).concat.apply(o,s.map(function(c){return G$(c,t)}));return n.concat(i,r.parentNode?_s(r.parentNode.querySelectorAll(lx)).filter(function(c){return c===r}):[])},[])},K$=function(e){var t=e.querySelectorAll("[".concat(j$,"]"));return _s(t).map(function(n){return _m([n])}).reduce(function(n,r){return n.concat(r)},[])},cx=function(e,t){return _s(e).filter(function(n){return r3(t,n)}).filter(function(n){return F$(n)})},Nw=function(e,t){return t===void 0&&(t=new Map),_s(e).filter(function(n){return o3(t,n)})},k1=function(e,t,n){return l3(cx(_m(e,n),t),!0,n)},Tw=function(e,t){return l3(cx(_m(e),t),!1)},q$=function(e,t){return cx(K$(e),t)},ec=function(e,t){return e.shadowRoot?ec(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?ec(o,t):!1}return ec(n,t)})},X$=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,c){return!t.has(c)})},u3=function(e){return e.parentNode?u3(e.parentNode):e},ux=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?X$(_s(u3(r).querySelectorAll("[".concat(C1,'="').concat(o,'"]:not([').concat(W5,'="disabled"])')))):[r]),n},[])},Y$=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&&Y$(function(){return t.contentWindow.document})?Zu(t.contentWindow.document):t}},Q$=function(e,t){return e===t},Z$=function(e,t){return!!_s(e.querySelectorAll("iframe")).some(function(n){return Q$(n,t)})},d3=function(e,t){return t===void 0&&(t=Zu(e3(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:ux(e).some(function(n){return ec(n,t)||Z$(n,t)})},J$=function(e){e===void 0&&(e=document);var t=Zu(e);return t?_s(e.querySelectorAll("[".concat(_$,"]"))).some(function(n){return ec(n,t)}):!1},eL=function(e,t){return t.filter(i3).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},dx=function(e,t){return i3(e)&&e.name?eL(e,t):e},tL=function(e){var t=new Set;return e.forEach(function(n){return t.add(dx(n,e))}),e.filter(function(n){return t.has(n)})},$w=function(e){return e[0]&&e.length>1?dx(e[0],e):e[0]},Lw=function(e,t){return e.length>1?e.indexOf(dx(e[t],e)):t},f3="NEW_FOCUS",nL=function(e,t,n,r){var o=e.length,s=e[0],i=e[o-1],c=ix(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),b=t.indexOf(i),y=tL(t),x=n!==void 0?y.indexOf(n):-1,w=x-(r?y.indexOf(r):f),k=Lw(e,0),_=Lw(e,o-1);if(f===-1||h===-1)return f3;if(!m&&h>=0)return h;if(f<=v&&c&&Math.abs(m)>1)return _;if(f>=b&&c&&Math.abs(m)>1)return k;if(m&&Math.abs(w)>1)return h;if(f<=v)return _;if(f>b)return k;if(m)return Math.abs(m)>1?h:(o+h+m)%o}},rL=function(e){return function(t){var n,r=(n=s3(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},oL=function(e,t,n){var r=e.map(function(s){var i=s.node;return i}),o=Nw(r.filter(rL(n)));return o&&o.length?$w(o):$w(Nw(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},p3=function(e,t,n){var r=Jp(e),o=Jp(t),s=r[0],i=!1;return o.filter(Boolean).forEach(function(c){i=tv(i||c,c)||i,n.filter(Boolean).forEach(function(f){var p=tv(s,f);p&&(!i||ec(p,i)?i=p:i=tv(p,i))})}),i},sL=function(e,t){return e.reduce(function(n,r){return n.concat(q$(r,t))},[])},aL=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(H$)},iL=function(e,t){var n=Zu(Jp(e).length>0?document:e3(e).ownerDocument),r=ux(e).filter(eh),o=p3(n||e,e,r),s=new Map,i=Tw(r,s),c=k1(r,s).filter(function(b){var y=b.node;return eh(y)});if(!(!c[0]&&(c=i,!c[0]))){var f=Tw([o],s).map(function(b){var y=b.node;return y}),p=aL(f,c),h=p.map(function(b){var y=b.node;return y}),m=nL(h,f,n,t);if(m===f3){var v=oL(i,h,sL(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]}},lL=function(e){var t=ux(e).filter(eh),n=p3(e,e,t),r=new Map,o=k1([n],r,!0),s=k1(t,r).filter(function(i){var c=i.node;return eh(c)}).map(function(i){var c=i.node;return c});return o.map(function(i){var c=i.node,f=i.index;return{node:c,index:f,lockItem:s.indexOf(c)>=0,guard:ix(c)}})},cL=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},nv=0,rv=!1,h3=function(e,t,n){n===void 0&&(n={});var r=iL(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++,cL(r.node,n.focusOptions),nv--}};function fx(e){setTimeout(e,1)}var uL=function(){return document&&document.activeElement===document.body},dL=function(){return uL()||J$()},tc=null,Ul=null,nc=null,Ju=!1,fL=function(){return!0},pL=function(t){return(tc.whiteList||fL)(t)},hL=function(t,n){nc={observerNode:t,portaledElement:n}},mL=function(t){return nc&&nc.portaledElement===t};function zw(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 gL=function(t){return t&&"current"in t?t.current:t},vL=function(t){return t?!!Ju:Ju==="meanwhile"},bL=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},xL=function(t,n){return n.some(function(r){return bL(t,r,r)})},th=function(){var t=!1;if(tc){var n=tc,r=n.observed,o=n.persistentFocus,s=n.autoFocus,i=n.shards,c=n.crossFrame,f=n.focusOptions,p=r||nc&&nc.portaledElement,h=document&&document.activeElement;if(p){var m=[p].concat(i.map(gL).filter(Boolean));if((!h||pL(h))&&(o||vL(c)||!dL()||!Ul&&s)&&(p&&!(d3(m)||h&&xL(h,m)||mL(h))&&(document&&!Ul&&h&&!s?(h.blur&&h.blur(),document.body.focus()):(t=h3(m,Ul,{focusOptions:f}),nc={})),Ju=!1,Ul=document&&document.activeElement),document){var v=document&&document.activeElement,b=lL(m),y=b.map(function(x){var w=x.node;return w}).indexOf(v);y>-1&&(b.filter(function(x){var w=x.guard,k=x.node;return w&&k.dataset.focusAutoGuard}).forEach(function(x){var w=x.node;return w.removeAttribute("tabIndex")}),zw(y,b.length,1,b),zw(y,-1,-1,b))}}}return t},m3=function(t){th()&&t&&(t.stopPropagation(),t.preventDefault())},px=function(){return fx(th)},yL=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||hL(r,n)},CL=function(){return null},g3=function(){Ju="just",fx(function(){Ju="meanwhile"})},wL=function(){document.addEventListener("focusin",m3),document.addEventListener("focusout",px),window.addEventListener("blur",g3)},SL=function(){document.removeEventListener("focusin",m3),document.removeEventListener("focusout",px),window.removeEventListener("blur",g3)};function kL(e){return e.filter(function(t){var n=t.disabled;return!n})}function _L(e){var t=e.slice(-1)[0];t&&!tc&&wL();var n=tc,r=n&&t&&t.id===n.id;tc=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Ul=null,(!r||n.observed!==t.observed)&&t.onActivation(),th(),fx(th)):(SL(),Ul=null)}Q5.assignSyncMedium(yL);Z5.assignMedium(px);M$.assignMedium(function(e){return e({moveFocusInside:h3,focusInside:d3})});const jL=N$(kL,_L)(CL);var v3=u.forwardRef(function(t,n){return u.createElement(J5,nn({sideCar:jL,ref:n},t))}),b3=J5.propTypes||{};b3.sideCar;DN(b3,["sideCar"]);v3.propTypes={};const Fw=v3;function x3(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function hx(e){var t;if(!x3(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function PL(e){var t,n;return(n=(t=y3(e))==null?void 0:t.defaultView)!=null?n:window}function y3(e){return x3(e)?e.ownerDocument:document}function IL(e){return y3(e).activeElement}function EL(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 OL(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function C3(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:hx(e)&&EL(e)?e:C3(OL(e))}var w3=e=>e.hasAttribute("tabindex"),ML=e=>w3(e)&&e.tabIndex===-1;function DL(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function S3(e){return e.parentElement&&S3(e.parentElement)?!0:e.hidden}function RL(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function k3(e){if(!hx(e)||S3(e)||DL(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]():RL(e)?!0:w3(e)}function AL(e){return e?hx(e)&&k3(e)&&!ML(e):!1}var NL=["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]"],TL=NL.join(),$L=e=>e.offsetWidth>0&&e.offsetHeight>0;function _3(e){const t=Array.from(e.querySelectorAll(TL));return t.unshift(e),t.filter(n=>k3(n)&&$L(n))}var Bw,LL=(Bw=Fw.default)!=null?Bw:Fw,j3=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:i,autoFocus:c,persistentFocus:f,lockFocusAcrossFrames:p}=e,h=u.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&_3(r.current).length===0&&requestAnimationFrame(()=>{var y;(y=r.current)==null||y.focus()})},[t,r]),m=u.useCallback(()=>{var b;(b=n==null?void 0:n.current)==null||b.focus()},[n]),v=o&&!n;return a.jsx(LL,{crossFrame:p,persistentFocus:f,autoFocus:c,disabled:i,onActivation:h,onDeactivation:m,returnFocus:v,children:s})};j3.displayName="FocusLock";var zL=QN?u.useLayoutEffect:u.useEffect;function j1(e,t=[]){const n=u.useRef(e);return zL(()=>{n.current=e}),u.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function FL(e,t,n,r){const o=j1(t);return u.useEffect(()=>{var s;const i=(s=DC(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=DC(n))!=null?s:document).removeEventListener(e,o,r)}}function BL(e,t){const n=u.useId();return u.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function HL(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Ir(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=j1(n),i=j1(t),[c,f]=u.useState(e.defaultIsOpen||!1),[p,h]=HL(r,c),m=BL(o,"disclosure"),v=u.useCallback(()=>{p||f(!1),i==null||i()},[p,i]),b=u.useCallback(()=>{p||f(!0),s==null||s()},[p,s]),y=u.useCallback(()=>{(h?v:b)()},[h,b,v]);return{isOpen:!!h,onOpen:b,onClose:v,onToggle:y,isControlled:p,getButtonProps:(x={})=>({...x,"aria-expanded":h,"aria-controls":m,onClick:I7(x.onClick,y)}),getDisclosureProps:(x={})=>({...x,hidden:!h,id:m})}}var[VL,WL]=Tt({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),P3=Pe(function(t,n){const r=Hn("Input",t),{children:o,className:s,...i}=Xt(t),c=et("chakra-input__group",s),f={},p=_d(o),h=r.field;p.forEach(v=>{var b,y;r&&(h&&v.type.id==="InputLeftElement"&&(f.paddingStart=(b=h.height)!=null?b:h.h),h&&v.type.id==="InputRightElement"&&(f.paddingEnd=(y=h.height)!=null?y:h.h),v.type.id==="InputRightAddon"&&(f.borderEndRadius=0),v.type.id==="InputLeftAddon"&&(f.borderStartRadius=0))});const m=p.map(v=>{var b,y;const x=_j({size:((b=v.props)==null?void 0:b.size)||t.size,variant:((y=v.props)==null?void 0:y.variant)||t.variant});return v.type.id!=="Input"?u.cloneElement(v,x):u.cloneElement(v,Object.assign(x,f,v.props))});return a.jsx(_e.div,{className:c,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...i,children:a.jsx(VL,{value:r,children:m})})});P3.displayName="InputGroup";var UL=_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,c=WL(),f=c.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,...c.element};return a.jsx(UL,{ref:n,__css:h,...i})});jm.id="InputElement";jm.displayName="InputElement";var I3=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})});I3.id="InputLeftElement";I3.displayName="InputLeftElement";var mx=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})});mx.id="InputRightElement";mx.displayName="InputRightElement";var Pm=Pe(function(t,n){const{htmlSize:r,...o}=t,s=Hn("Input",o),i=Xt(o),c=Jb(i),f=et("chakra-input",t.className);return a.jsx(_e.input,{size:r,...c,__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[GL,E3]=Tt({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),gx=Pe(function(t,n){const r=Hn("List",t),{children:o,styleType:s="none",stylePosition:i,spacing:c,...f}=Xt(t),p=_d(o),m=c?{["& > *:not(style) ~ *:not(style)"]:{mt:c}}:{};return a.jsx(GL,{value:r,children:a.jsx(_e.ul,{ref:n,listStyleType:s,listStylePosition:i,role:"list",__css:{...r.container,...m},...f,children:p})})});gx.displayName="List";var KL=Pe((e,t)=>{const{as:n,...r}=e;return a.jsx(gx,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});KL.displayName="OrderedList";var Id=Pe(function(t,n){const{as:r,...o}=t;return a.jsx(gx,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});Id.displayName="UnorderedList";var Ao=Pe(function(t,n){const r=E3();return a.jsx(_e.li,{ref:n,...t,__css:r.item})});Ao.displayName="ListItem";var qL=Pe(function(t,n){const r=E3();return a.jsx(An,{ref:n,role:"presentation",...t,__css:r.icon})});qL.displayName="ListIcon";var Ua=Pe(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:i,column:c,row:f,autoFlow:p,autoRows:h,templateRows:m,autoColumns:v,templateColumns:b,...y}=t,x={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:i,gridAutoColumns:v,gridColumn:c,gridRow:f,gridAutoFlow:p,gridAutoRows:h,gridTemplateRows:m,gridTemplateColumns:b};return a.jsx(_e.div,{ref:n,__css:x,...y})});Ua.displayName="Grid";function O3(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 M3=e=>a.jsx(_e.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});M3.displayName="StackItem";function XL(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{"&":O3(n,o=>r[o])}}var vx=Pe((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:i="0.5rem",wrap:c,children:f,divider:p,className:h,shouldWrapChildren:m,...v}=e,b=n?"row":r??"column",y=u.useMemo(()=>XL({spacing:i,direction:b}),[i,b]),x=!!p,w=!m&&!x,k=u.useMemo(()=>{const j=_d(f);return w?j:j.map((I,E)=>{const O=typeof I.key<"u"?I.key:E,M=E+1===j.length,A=m?a.jsx(M3,{children:I},O):I;if(!x)return A;const R=u.cloneElement(p,{__css:y}),T=M?null:R;return a.jsxs(u.Fragment,{children:[A,T]},O)})},[p,y,x,w,m,f]),_=et("chakra-stack",h);return a.jsx(_e.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:b,flexWrap:c,gap:x?void 0:i,className:_,...v,children:k})});vx.displayName="Stack";var D3=Pe((e,t)=>a.jsx(vx,{align:"center",...e,direction:"column",ref:t}));D3.displayName="VStack";var bx=Pe((e,t)=>a.jsx(vx,{align:"center",...e,direction:"row",ref:t}));bx.displayName="HStack";function Hw(e){return O3(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:c,rowSpan:f,rowStart:p,...h}=t,m=_j({gridArea:r,gridColumn:Hw(o),gridRow:Hw(f),gridColumnStart:s,gridColumnEnd:i,gridRowStart:p,gridRowEnd:c});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 zr=Pe(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:i,borderWidth:c,borderStyle:f,borderColor:p,...h}=Qa("Divider",t),{className:m,orientation:v="horizontal",__css:b,...y}=Xt(t),x={vertical:{borderLeftWidth:r||i||c||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||c||"1px",width:"100%"}};return a.jsx(_e.hr,{ref:n,"aria-orientation":v,...y,__css:{...h,border:"0",borderColor:p,borderStyle:f,...x[v],...b},className:et("chakra-divider",m)})});zr.displayName="Divider";function YL(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function QL(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=u.useState([]),s=u.useRef(),i=()=>{s.current&&(clearTimeout(s.current),s.current=null)},c=()=>{i(),s.current=setTimeout(()=>{o([]),s.current=null},t)};u.useEffect(()=>i,[]);function f(p){return h=>{if(h.key==="Backspace"){const m=[...r];m.pop(),o(m);return}if(YL(h)){const m=r.concat(h.key);n(h)&&(h.preventDefault(),h.stopPropagation()),o(m),p(m.join("")),c()}}}return f}function ZL(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 JL(){const e=u.useRef(new Map),t=e.current,n=u.useCallback((o,s,i,c)=>{e.current.set(i,{type:s,el:o,options:c}),o.addEventListener(s,i,c)},[]),r=u.useCallback((o,s,i,c)=>{o.removeEventListener(s,i,c),e.current.delete(i)},[]);return u.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 R3(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:i,onMouseUp:c,onClick:f,onKeyDown:p,onKeyUp:h,tabIndex:m,onMouseOver:v,onMouseLeave:b,...y}=e,[x,w]=u.useState(!0),[k,_]=u.useState(!1),j=JL(),I=L=>{L&&L.tagName!=="BUTTON"&&w(!1)},E=x?m:m||0,O=n&&!r,M=u.useCallback(L=>{if(n){L.stopPropagation(),L.preventDefault();return}L.currentTarget.focus(),f==null||f(L)},[n,f]),D=u.useCallback(L=>{k&&ov(L)&&(L.preventDefault(),L.stopPropagation(),_(!1),j.remove(document,"keyup",D,!1))},[k,j]),A=u.useCallback(L=>{if(p==null||p(L),n||L.defaultPrevented||L.metaKey||!ov(L.nativeEvent)||x)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,x,p,o,s,j,D]),R=u.useCallback(L=>{if(h==null||h(L),n||L.defaultPrevented||L.metaKey||!ov(L.nativeEvent)||x)return;s&&L.key===" "&&(L.preventDefault(),_(!1),L.currentTarget.click())},[s,x,n,h]),T=u.useCallback(L=>{L.button===0&&(_(!1),j.remove(document,"mouseup",T,!1))},[j]),q=u.useCallback(L=>{if(L.button!==0)return;if(n){L.stopPropagation(),L.preventDefault();return}x||_(!0),L.currentTarget.focus({preventScroll:!0}),j.add(document,"mouseup",T,!1),i==null||i(L)},[n,x,i,j,T]),B=u.useCallback(L=>{L.button===0&&(x||_(!1),c==null||c(L))},[c,x]),G=u.useCallback(L=>{if(n){L.preventDefault();return}v==null||v(L)},[n,v]),Y=u.useCallback(L=>{k&&(L.preventDefault(),_(!1)),b==null||b(L)},[k,b]),V=yt(t,I);return x?{...y,ref:V,type:"button","aria-disabled":O?void 0:n,disabled:O,onClick:M,onMouseDown:i,onMouseUp:c,onKeyUp:h,onKeyDown:p,onMouseOver:v,onMouseLeave:b}:{...y,ref:V,role:"button","data-active":at(k),"aria-disabled":n?"true":void 0,tabIndex:O?void 0:E,onClick:M,onMouseDown:q,onMouseUp:B,onKeyUp:R,onKeyDown:A,onMouseOver:G,onMouseLeave:Y}}function ez(e){const t=e.current;if(!t)return!1;const n=IL(t);return!n||t.contains(n)?!1:!!AL(n)}function A3(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;la(()=>{if(!s||ez(e))return;const i=(o==null?void 0:o.current)||e.current;let c;if(i)return c=requestAnimationFrame(()=>{i.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(c)}},[s,e,o])}var tz={preventScroll:!0,shouldFocus:!1};function nz(e,t=tz){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,i=rz(e)?e.current:e,c=o&&s,f=u.useRef(c),p=u.useRef(s);Yl(()=>{!p.current&&s&&(f.current=c),p.current=s},[s,c]);const h=u.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=_3(i);m.length>0&&requestAnimationFrame(()=>{m[0].focus({preventScroll:r})})}},[s,r,i,n]);la(()=>{h()},[h]),_i(i,"transitionend",h)}function rz(e){return"current"in e}var _l=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),jn={arrowShadowColor:_l("--popper-arrow-shadow-color"),arrowSize:_l("--popper-arrow-size","8px"),arrowSizeHalf:_l("--popper-arrow-size-half"),arrowBg:_l("--popper-arrow-bg"),transformOrigin:_l("--popper-transform-origin"),arrowOffset:_l("--popper-arrow-offset")};function oz(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 sz={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"},az=e=>sz[e],Vw={scroll:!0,resize:!0};function iz(e){let t;return typeof e=="object"?t={enabled:!0,options:{...Vw,...e}}:t={enabled:e,options:Vw},t}var lz={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`}},cz={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{Ww(e)},effect:({state:e})=>()=>{Ww(e)}},Ww=e=>{e.elements.popper.style.setProperty(jn.transformOrigin.var,az(e.placement))},uz={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{dz(e)}},dz=e=>{var t;if(!e.placement)return;const n=fz(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])}},fz=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}},pz={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{Uw(e)},effect:({state:e})=>()=>{Uw(e)}},Uw=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=oz(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))"})},hz={"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"}},mz={"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 gz(e,t="ltr"){var n,r;const o=((n=hz[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=mz[e])!=null?r:o}var kr="top",po="bottom",ho="right",_r="left",xx="auto",Ed=[kr,po,ho,_r],bc="start",td="end",vz="clippingParents",N3="viewport",yu="popper",bz="reference",Gw=Ed.reduce(function(e,t){return e.concat([t+"-"+bc,t+"-"+td])},[]),T3=[].concat(Ed,[xx]).reduce(function(e,t){return e.concat([t,t+"-"+bc,t+"-"+td])},[]),xz="beforeRead",yz="read",Cz="afterRead",wz="beforeMain",Sz="main",kz="afterMain",_z="beforeWrite",jz="write",Pz="afterWrite",Iz=[xz,yz,Cz,wz,Sz,kz,_z,jz,Pz];function ms(e){return e?(e.nodeName||"").toLowerCase():null}function Fr(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=Fr(e).Element;return e instanceof t||e instanceof Element}function co(e){var t=Fr(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function yx(e){if(typeof ShadowRoot>"u")return!1;var t=Fr(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Ez(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];!co(s)||!ms(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var c=o[i];c===!1?s.removeAttribute(i):s.setAttribute(i,c===!0?"":c)}))})}function Oz(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]),c=i.reduce(function(f,p){return f[p]="",f},{});!co(o)||!ms(o)||(Object.assign(o.style,c),Object.keys(s).forEach(function(f){o.removeAttribute(f)}))})}}const Mz={name:"applyStyles",enabled:!0,phase:"write",fn:Ez,effect:Oz,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 $3(){return!/^((?!chrome|android).)*safari/i.test(P1())}function yc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&co(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)?Fr(e):window,c=i.visualViewport,f=!$3()&&n,p=(r.left+(f&&c?c.offsetLeft:0))/o,h=(r.top+(f&&c?c.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 Cx(e){var t=yc(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 L3(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&yx(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 Fr(e).getComputedStyle(e)}function Dz(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||(yx(e)?e.host:null)||Ja(e)}function Kw(e){return!co(e)||ta(e).position==="fixed"?null:e.offsetParent}function Rz(e){var t=/firefox/i.test(P1()),n=/Trident/i.test(P1());if(n&&co(e)){var r=ta(e);if(r.position==="fixed")return null}var o=Em(e);for(yx(o)&&(o=o.host);co(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 Od(e){for(var t=Fr(e),n=Kw(e);n&&Dz(n)&&ta(n).position==="static";)n=Kw(n);return n&&(ms(n)==="html"||ms(n)==="body"&&ta(n).position==="static")?t:n||Rz(e)||t}function wx(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Bu(e,t,n){return ji(e,nh(t,n))}function Az(e,t,n){var r=Bu(e,t,n);return r>n?n:r}function z3(){return{top:0,right:0,bottom:0,left:0}}function F3(e){return Object.assign({},z3(),e)}function B3(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Nz=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,F3(typeof t!="number"?t:B3(t,Ed))};function Tz(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,c=hs(n.placement),f=wx(c),p=[_r,ho].indexOf(c)>=0,h=p?"height":"width";if(!(!s||!i)){var m=Nz(o.padding,n),v=Cx(s),b=f==="y"?kr:_r,y=f==="y"?po:ho,x=n.rects.reference[h]+n.rects.reference[f]-i[f]-n.rects.popper[h],w=i[f]-n.rects.reference[f],k=Od(s),_=k?f==="y"?k.clientHeight||0:k.clientWidth||0:0,j=x/2-w/2,I=m[b],E=_-v[h]-m[y],O=_/2-v[h]/2+j,M=Bu(I,O,E),D=f;n.modifiersData[r]=(t={},t[D]=M,t.centerOffset=M-O,t)}}function $z(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)||L3(t.elements.popper,o)&&(t.elements.arrow=o))}const Lz={name:"arrow",enabled:!0,phase:"main",fn:Tz,effect:$z,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Cc(e){return e.split("-")[1]}var zz={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Fz(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 qw(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,i=e.offsets,c=e.position,f=e.gpuAcceleration,p=e.adaptive,h=e.roundOffsets,m=e.isFixed,v=i.x,b=v===void 0?0:v,y=i.y,x=y===void 0?0:y,w=typeof h=="function"?h({x:b,y:x}):{x:b,y:x};b=w.x,x=w.y;var k=i.hasOwnProperty("x"),_=i.hasOwnProperty("y"),j=_r,I=kr,E=window;if(p){var O=Od(n),M="clientHeight",D="clientWidth";if(O===Fr(n)&&(O=Ja(n),ta(O).position!=="static"&&c==="absolute"&&(M="scrollHeight",D="scrollWidth")),O=O,o===kr||(o===_r||o===ho)&&s===td){I=po;var A=m&&O===E&&E.visualViewport?E.visualViewport.height:O[M];x-=A-r.height,x*=f?1:-1}if(o===_r||(o===kr||o===po)&&s===td){j=ho;var R=m&&O===E&&E.visualViewport?E.visualViewport.width:O[D];b-=R-r.width,b*=f?1:-1}}var T=Object.assign({position:c},p&&zz),q=h===!0?Fz({x:b,y:x},Fr(n)):{x:b,y:x};if(b=q.x,x=q.y,f){var B;return Object.assign({},T,(B={},B[I]=_?"0":"",B[j]=k?"0":"",B.transform=(E.devicePixelRatio||1)<=1?"translate("+b+"px, "+x+"px)":"translate3d("+b+"px, "+x+"px, 0)",B))}return Object.assign({},T,(t={},t[I]=_?x+"px":"",t[j]=k?b+"px":"",t.transform="",t))}function Bz(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,c=n.roundOffsets,f=c===void 0?!0:c,p={placement:hs(t.placement),variation:Cc(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,qw(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,qw(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 Hz={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Bz,data:{}};var Kf={passive:!0};function Vz(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,c=i===void 0?!0:i,f=Fr(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&p.forEach(function(h){h.addEventListener("scroll",n.update,Kf)}),c&&f.addEventListener("resize",n.update,Kf),function(){s&&p.forEach(function(h){h.removeEventListener("scroll",n.update,Kf)}),c&&f.removeEventListener("resize",n.update,Kf)}}const Wz={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Vz,data:{}};var Uz={left:"right",right:"left",bottom:"top",top:"bottom"};function Ep(e){return e.replace(/left|right|bottom|top/g,function(t){return Uz[t]})}var Gz={start:"end",end:"start"};function Xw(e){return e.replace(/start|end/g,function(t){return Gz[t]})}function Sx(e){var t=Fr(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function kx(e){return yc(Ja(e)).left+Sx(e).scrollLeft}function Kz(e,t){var n=Fr(e),r=Ja(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,c=0,f=0;if(o){s=o.width,i=o.height;var p=$3();(p||!p&&t==="fixed")&&(c=o.offsetLeft,f=o.offsetTop)}return{width:s,height:i,x:c+kx(e),y:f}}function qz(e){var t,n=Ja(e),r=Sx(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),c=-r.scrollLeft+kx(e),f=-r.scrollTop;return ta(o||n).direction==="rtl"&&(c+=ji(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:c,y:f}}function _x(e){var t=ta(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function H3(e){return["html","body","#document"].indexOf(ms(e))>=0?e.ownerDocument.body:co(e)&&_x(e)?e:H3(Em(e))}function Hu(e,t){var n;t===void 0&&(t=[]);var r=H3(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Fr(r),i=o?[s].concat(s.visualViewport||[],_x(r)?r:[]):r,c=t.concat(i);return o?c:c.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 Xz(e,t){var n=yc(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 Yw(e,t,n){return t===N3?I1(Kz(e,n)):Li(t)?Xz(t,n):I1(qz(Ja(e)))}function Yz(e){var t=Hu(Em(e)),n=["absolute","fixed"].indexOf(ta(e).position)>=0,r=n&&co(e)?Od(e):e;return Li(r)?t.filter(function(o){return Li(o)&&L3(o,r)&&ms(o)!=="body"}):[]}function Qz(e,t,n,r){var o=t==="clippingParents"?Yz(e):[].concat(t),s=[].concat(o,[n]),i=s[0],c=s.reduce(function(f,p){var h=Yw(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},Yw(e,i,r));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function V3(e){var t=e.reference,n=e.element,r=e.placement,o=r?hs(r):null,s=r?Cc(r):null,i=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2,f;switch(o){case kr:f={x:i,y:t.y-n.height};break;case po:f={x:i,y:t.y+t.height};break;case ho:f={x:t.x+t.width,y:c};break;case _r:f={x:t.x-n.width,y:c};break;default:f={x:t.x,y:t.y}}var p=o?wx(o):null;if(p!=null){var h=p==="y"?"height":"width";switch(s){case bc: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,c=n.boundary,f=c===void 0?vz:c,p=n.rootBoundary,h=p===void 0?N3:p,m=n.elementContext,v=m===void 0?yu:m,b=n.altBoundary,y=b===void 0?!1:b,x=n.padding,w=x===void 0?0:x,k=F3(typeof w!="number"?w:B3(w,Ed)),_=v===yu?bz:yu,j=e.rects.popper,I=e.elements[y?_:v],E=Qz(Li(I)?I:I.contextElement||Ja(e.elements.popper),f,h,i),O=yc(e.elements.reference),M=V3({reference:O,element:j,strategy:"absolute",placement:o}),D=I1(Object.assign({},j,M)),A=v===yu?D:O,R={top:E.top-A.top+k.top,bottom:A.bottom-E.bottom+k.bottom,left:E.left-A.left+k.left,right:A.right-E.right+k.right},T=e.modifiersData.offset;if(v===yu&&T){var q=T[o];Object.keys(R).forEach(function(B){var G=[ho,po].indexOf(B)>=0?1:-1,Y=[kr,po].indexOf(B)>=0?"y":"x";R[B]+=q[Y]*G})}return R}function Zz(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,c=n.flipVariations,f=n.allowedAutoPlacements,p=f===void 0?T3:f,h=Cc(r),m=h?c?Gw:Gw.filter(function(y){return Cc(y)===h}):Ed,v=m.filter(function(y){return p.indexOf(y)>=0});v.length===0&&(v=m);var b=v.reduce(function(y,x){return y[x]=nd(e,{placement:x,boundary:o,rootBoundary:s,padding:i})[hs(x)],y},{});return Object.keys(b).sort(function(y,x){return b[y]-b[x]})}function Jz(e){if(hs(e)===xx)return[];var t=Ep(e);return[Xw(e),t,Xw(t)]}function eF(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,c=i===void 0?!0:i,f=n.fallbackPlacements,p=n.padding,h=n.boundary,m=n.rootBoundary,v=n.altBoundary,b=n.flipVariations,y=b===void 0?!0:b,x=n.allowedAutoPlacements,w=t.options.placement,k=hs(w),_=k===w,j=f||(_||!y?[Ep(w)]:Jz(w)),I=[w].concat(j).reduce(function(oe,W){return oe.concat(hs(W)===xx?Zz(t,{placement:W,boundary:h,rootBoundary:m,padding:p,flipVariations:y,allowedAutoPlacements:x}):W)},[]),E=t.rects.reference,O=t.rects.popper,M=new Map,D=!0,A=I[0],R=0;R<I.length;R++){var T=I[R],q=hs(T),B=Cc(T)===bc,G=[kr,po].indexOf(q)>=0,Y=G?"width":"height",V=nd(t,{placement:T,boundary:h,rootBoundary:m,altBoundary:v,padding:p}),L=G?B?ho:_r:B?po:kr;E[Y]>O[Y]&&(L=Ep(L));var X=Ep(L),z=[];if(s&&z.push(V[q]<=0),c&&z.push(V[L]<=0,V[X]<=0),z.every(function(oe){return oe})){A=T,D=!1;break}M.set(T,z)}if(D)for(var K=y?3:1,ne=function(W){var U=I.find(function(ee){var se=M.get(ee);if(se)return se.slice(0,W).every(function(re){return re})});if(U)return A=U,"break"},Q=K;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 tF={name:"flip",enabled:!0,phase:"main",fn:eF,requiresIfExists:["offset"],data:{_skip:!1}};function Qw(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 Zw(e){return[kr,ho,po,_r].some(function(t){return e[t]>=0})}function nF(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"}),c=nd(t,{altBoundary:!0}),f=Qw(i,r),p=Qw(c,o,s),h=Zw(f),m=Zw(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 rF={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:nF};function oF(e,t,n){var r=hs(e),o=[_r,kr].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=s[0],c=s[1];return i=i||0,c=(c||0)*o,[_r,ho].indexOf(r)>=0?{x:c,y:i}:{x:i,y:c}}function sF(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,i=T3.reduce(function(h,m){return h[m]=oF(m,t.rects,s),h},{}),c=i[t.placement],f=c.x,p=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=i}const aF={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:sF};function iF(e){var t=e.state,n=e.name;t.modifiersData[n]=V3({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const lF={name:"popperOffsets",enabled:!0,phase:"read",fn:iF,data:{}};function cF(e){return e==="x"?"y":"x"}function uF(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,c=i===void 0?!1:i,f=n.boundary,p=n.rootBoundary,h=n.altBoundary,m=n.padding,v=n.tether,b=v===void 0?!0:v,y=n.tetherOffset,x=y===void 0?0:y,w=nd(t,{boundary:f,rootBoundary:p,padding:m,altBoundary:h}),k=hs(t.placement),_=Cc(t.placement),j=!_,I=wx(k),E=cF(I),O=t.modifiersData.popperOffsets,M=t.rects.reference,D=t.rects.popper,A=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,R=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,q={x:0,y:0};if(O){if(s){var B,G=I==="y"?kr:_r,Y=I==="y"?po:ho,V=I==="y"?"height":"width",L=O[I],X=L+w[G],z=L-w[Y],K=b?-D[V]/2:0,ne=_===bc?M[V]:D[V],Q=_===bc?-D[V]:-M[V],ie=t.elements.arrow,oe=b&&ie?Cx(ie):{width:0,height:0},W=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:z3(),U=W[G],ee=W[Y],se=Bu(0,M[V],oe[V]),re=j?M[V]/2-K-se-U-R.mainAxis:ne-se-U-R.mainAxis,fe=j?-M[V]/2+K+se+ee+R.mainAxis:Q+se+ee+R.mainAxis,de=t.elements.arrow&&Od(t.elements.arrow),me=de?I==="y"?de.clientTop||0:de.clientLeft||0:0,ye=(B=T==null?void 0:T[I])!=null?B:0,he=L+re-ye-me,ue=L+fe-ye,De=Bu(b?nh(X,he):X,L,b?ji(z,ue):z);O[I]=De,q[I]=De-L}if(c){var je,Be=I==="x"?kr:_r,rt=I==="x"?po:ho,Ue=O[E],Ct=E==="y"?"height":"width",Xe=Ue+w[Be],tt=Ue-w[rt],ve=[kr,_r].indexOf(k)!==-1,Re=(je=T==null?void 0:T[E])!=null?je:0,st=ve?Xe:Ue-M[Ct]-D[Ct]-Re+R.altAxis,mt=ve?Ue+M[Ct]+D[Ct]-Re-R.altAxis:tt,ge=b&&ve?Az(st,Ue,mt):Bu(b?st:Xe,Ue,b?mt:tt);O[E]=ge,q[E]=ge-Ue}t.modifiersData[r]=q}}const dF={name:"preventOverflow",enabled:!0,phase:"main",fn:uF,requiresIfExists:["offset"]};function fF(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function pF(e){return e===Fr(e)||!co(e)?Sx(e):fF(e)}function hF(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 mF(e,t,n){n===void 0&&(n=!1);var r=co(t),o=co(t)&&hF(t),s=Ja(t),i=yc(e,o,n),c={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((ms(t)!=="body"||_x(s))&&(c=pF(t)),co(t)?(f=yc(t,!0),f.x+=t.clientLeft,f.y+=t.clientTop):s&&(f.x=kx(s))),{x:i.left+c.scrollLeft-f.x,y:i.top+c.scrollTop-f.y,width:i.width,height:i.height}}function gF(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(c){if(!n.has(c)){var f=t.get(c);f&&o(f)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function vF(e){var t=gF(e);return Iz.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function bF(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function xF(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 Jw={placement:"bottom",modifiers:[],strategy:"absolute"};function eS(){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 yF(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?Jw:o;return function(c,f,p){p===void 0&&(p=s);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},Jw,s),modifiersData:{},elements:{reference:c,popper:f},attributes:{},styles:{}},m=[],v=!1,b={state:h,setOptions:function(k){var _=typeof k=="function"?k(h.options):k;x(),h.options=Object.assign({},s,h.options,_),h.scrollParents={reference:Li(c)?Hu(c):c.contextElement?Hu(c.contextElement):[],popper:Hu(f)};var j=vF(xF([].concat(r,h.options.modifiers)));return h.orderedModifiers=j.filter(function(I){return I.enabled}),y(),b.update()},forceUpdate:function(){if(!v){var k=h.elements,_=k.reference,j=k.popper;if(eS(_,j)){h.rects={reference:mF(_,Od(j),h.options.strategy==="fixed"),popper:Cx(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 E=h.orderedModifiers[I],O=E.fn,M=E.options,D=M===void 0?{}:M,A=E.name;typeof O=="function"&&(h=O({state:h,options:D,name:A,instance:b})||h)}}}},update:bF(function(){return new Promise(function(w){b.forceUpdate(),w(h)})}),destroy:function(){x(),v=!0}};if(!eS(c,f))return b;b.setOptions(p).then(function(w){!v&&p.onFirstUpdate&&p.onFirstUpdate(w)});function y(){h.orderedModifiers.forEach(function(w){var k=w.name,_=w.options,j=_===void 0?{}:_,I=w.effect;if(typeof I=="function"){var E=I({state:h,name:k,instance:b,options:j}),O=function(){};m.push(E||O)}})}function x(){m.forEach(function(w){return w()}),m=[]}return b}}var CF=[Wz,lF,Hz,Mz,aF,tF,dF,Lz,rF],wF=yF({defaultModifiers:CF});function jx(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:i=!0,offset:c,gutter:f=8,flip:p=!0,boundary:h="clippingParents",preventOverflow:m=!0,matchWidth:v,direction:b="ltr"}=e,y=u.useRef(null),x=u.useRef(null),w=u.useRef(null),k=gz(r,b),_=u.useRef(()=>{}),j=u.useCallback(()=>{var R;!t||!y.current||!x.current||((R=_.current)==null||R.call(_),w.current=wF(y.current,x.current,{placement:k,modifiers:[pz,uz,cz,{...lz,enabled:!!v},{name:"eventListeners",...iz(i)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:c??[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,c,f,p,m,h,o]);u.useEffect(()=>()=>{var R;!y.current&&!x.current&&((R=w.current)==null||R.destroy(),w.current=null)},[]);const I=u.useCallback(R=>{y.current=R,j()},[j]),E=u.useCallback((R={},T=null)=>({...R,ref:yt(I,T)}),[I]),O=u.useCallback(R=>{x.current=R,j()},[j]),M=u.useCallback((R={},T=null)=>({...R,ref:yt(O,T),style:{...R.style,position:o,minWidth:v?void 0:"max-content",inset:"0 auto auto 0"}}),[o,O,v]),D=u.useCallback((R={},T=null)=>{const{size:q,shadowColor:B,bg:G,style:Y,...V}=R;return{...V,ref:T,"data-popper-arrow":"",style:SF(R)}},[]),A=u.useCallback((R={},T=null)=>({...R,ref:T,"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:O,getPopperProps:M,getArrowProps:D,getArrowInnerProps:A,getReferenceProps:E}}function SF(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 Px(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=tn(n),i=tn(t),[c,f]=u.useState(e.defaultIsOpen||!1),p=r!==void 0?r:c,h=r!==void 0,m=u.useId(),v=o??`disclosure-${m}`,b=u.useCallback(()=>{h||f(!1),i==null||i()},[h,i]),y=u.useCallback(()=>{h||f(!0),s==null||s()},[h,s]),x=u.useCallback(()=>{p?b():y()},[p,y,b]);function w(_={}){return{..._,"aria-expanded":p,"aria-controls":v,onClick(j){var I;(I=_.onClick)==null||I.call(_,j),x()}}}function k(_={}){return{..._,hidden:!p,id:v}}return{isOpen:p,onOpen:y,onClose:b,onToggle:x,isControlled:h,getButtonProps:w,getDisclosureProps:k}}function kF(e){const{ref:t,handler:n,enabled:r=!0}=e,o=tn(n),i=u.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;u.useEffect(()=>{if(!r)return;const c=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=W3(t.current);return h.addEventListener("mousedown",c,!0),h.addEventListener("mouseup",f,!0),h.addEventListener("touchstart",c,!0),h.addEventListener("touchend",p,!0),()=>{h.removeEventListener("mousedown",c,!0),h.removeEventListener("mouseup",f,!0),h.removeEventListener("touchstart",c,!0),h.removeEventListener("touchend",p,!0)}},[n,t,o,i,r])}function sv(e,t){var n;const r=e.target;return r&&!W3(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function W3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function U3(e){const{isOpen:t,ref:n}=e,[r,o]=u.useState(t),[s,i]=u.useState(!1);return u.useEffect(()=>{s||(o(t),i(!0))},[t,s,r]),_i(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var f;const p=PL(n.current),h=new p.CustomEvent("animationend",{bubbles:!0});(f=n.current)==null||f.dispatchEvent(h)}}}function Ix(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[_F,jF,PF,IF]=Yb(),[EF,Md]=Tt({strict:!1,name:"MenuContext"});function OF(e,...t){const n=u.useId(),r=e||n;return u.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function G3(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function tS(e){return G3(e).activeElement===e}function MF(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:i,isOpen:c,defaultIsOpen:f,onClose:p,onOpen:h,placement:m="bottom-start",lazyBehavior:v="unmount",direction:b,computePositionOnMount:y=!1,...x}=e,w=u.useRef(null),k=u.useRef(null),_=PF(),j=u.useCallback(()=>{requestAnimationFrame(()=>{var ie;(ie=w.current)==null||ie.focus({preventScroll:!1})})},[]),I=u.useCallback(()=>{const ie=setTimeout(()=>{var oe;if(o)(oe=o.current)==null||oe.focus();else{const W=_.firstEnabled();W&&B(W.index)}});X.current.add(ie)},[_,o]),E=u.useCallback(()=>{const ie=setTimeout(()=>{const oe=_.lastEnabled();oe&&B(oe.index)});X.current.add(ie)},[_]),O=u.useCallback(()=>{h==null||h(),s?I():j()},[s,I,j,h]),{isOpen:M,onOpen:D,onClose:A,onToggle:R}=Px({isOpen:c,defaultIsOpen:f,onClose:p,onOpen:O});kF({enabled:M&&r,ref:w,handler:ie=>{var oe;(oe=k.current)!=null&&oe.contains(ie.target)||A()}});const T=jx({...x,enabled:M||y,placement:m,direction:b}),[q,B]=u.useState(-1);la(()=>{M||B(-1)},[M]),A3(w,{focusRef:k,visible:M,shouldFocus:!0});const G=U3({isOpen:M,ref:w}),[Y,V]=OF(t,"menu-button","menu-list"),L=u.useCallback(()=>{D(),j()},[D,j]),X=u.useRef(new Set([]));zF(()=>{X.current.forEach(ie=>clearTimeout(ie)),X.current.clear()});const z=u.useCallback(()=>{D(),I()},[I,D]),K=u.useCallback(()=>{D(),E()},[D,E]),ne=u.useCallback(()=>{var ie,oe;const W=G3(w.current),U=(ie=w.current)==null?void 0:ie.contains(W.activeElement);if(!(M&&!U))return;const se=(oe=_.item(q))==null?void 0:oe.node;se==null||se.focus()},[M,q,_]),Q=u.useRef(null);return{openAndFocusMenu:L,openAndFocusFirstItem:z,openAndFocusLastItem:K,onTransitionEnd:ne,unstable__animationState:G,descendants:_,popper:T,buttonId:Y,menuId:V,forceUpdate:T.forceUpdate,orientation:"vertical",isOpen:M,onToggle:R,onOpen:D,onClose:A,menuRef:w,buttonRef:k,focusedIndex:q,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:B,isLazy:i,lazyBehavior:v,initialFocusRef:o,rafId:Q}}function DF(e={},t=null){const n=Md(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:i}=n,c=u.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,c)}}function E1(e){var t;return $F(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function RF(e={},t=null){const n=Md();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:c,menuId:f,isLazy:p,lazyBehavior:h,unstable__animationState:m}=n,v=jF(),b=QL({preventDefault:k=>k.key!==" "&&E1(k.target)}),y=u.useCallback(k=>{if(!k.currentTarget.contains(k.target))return;const _=k.key,I={Tab:O=>O.preventDefault(),Escape:c,ArrowDown:()=>{const O=v.nextEnabled(r);O&&o(O.index)},ArrowUp:()=>{const O=v.prevEnabled(r);O&&o(O.index)}}[_];if(I){k.preventDefault(),I(k);return}const E=b(O=>{const M=ZL(v.values(),O,D=>{var A,R;return(R=(A=D==null?void 0:D.node)==null?void 0:A.textContent)!=null?R:""},v.item(r));if(M){const D=v.indexOf(M.node);o(D)}});E1(k.target)&&E(k)},[v,r,b,c,o]),x=u.useRef(!1);i&&(x.current=!0);const w=Ix({wasSelected:x.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,y)}}function AF(e={}){const{popper:t,isOpen:n}=Md();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function K3(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:i,isDisabled:c,isFocusable:f,closeOnSelect:p,type:h,...m}=e,v=Md(),{setFocusedIndex:b,focusedIndex:y,closeOnSelect:x,onClose:w,menuRef:k,isOpen:_,menuId:j,rafId:I}=v,E=u.useRef(null),O=`${j}-menuitem-${u.useId()}`,{index:M,register:D}=IF({disabled:c&&!f}),A=u.useCallback(L=>{n==null||n(L),!c&&b(M)},[b,M,c,n]),R=u.useCallback(L=>{r==null||r(L),E.current&&!tS(E.current)&&A(L)},[A,r]),T=u.useCallback(L=>{o==null||o(L),!c&&b(-1)},[b,c,o]),q=u.useCallback(L=>{s==null||s(L),E1(L.currentTarget)&&(p??x)&&w()},[w,s,x,p]),B=u.useCallback(L=>{i==null||i(L),b(M)},[b,i,M]),G=M===y,Y=c&&!f;la(()=>{_&&(G&&!Y&&E.current?(I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{var L;(L=E.current)==null||L.focus(),I.current=null})):k.current&&!tS(k.current)&&k.current.focus({preventScroll:!0}))},[G,Y,k,_]);const V=R3({onClick:q,onFocus:B,onMouseEnter:A,onMouseMove:R,onMouseLeave:T,ref:yt(D,E,t),isDisabled:c,isFocusable:f});return{...m,...V,type:h??V.type,id:O,role:"menuitem",tabIndex:G?0:-1}}function NF(e={},t=null){const{type:n="radio",isChecked:r,...o}=e;return{...K3(o,t),role:`menuitem${n}`,"aria-checked":r}}function TF(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=u.useCallback(y=>{if(n==="radio"&&typeof p=="string"&&h(y),n==="checkbox"&&Array.isArray(p)){const x=p.includes(y)?p.filter(w=>w!==y):p.concat(y);h(x)}},[p,h,n]),b=_d(t).map(y=>{if(y.type.id!=="MenuItemOption")return y;const x=k=>{var _,j;m(y.props.value),(j=(_=y.props).onClick)==null||j.call(_,k)},w=n==="radio"?y.props.value===p:p.includes(y.props.value);return u.cloneElement(y,{type:n,onClick:x,isChecked:w})});return{...i,children:b}}function $F(e){var t;if(!LF(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function LF(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function zF(e,t=[]){return u.useEffect(()=>()=>e(),t)}var[FF,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}=bd(),{descendants:s,...i}=MF({...r,direction:o}),c=u.useMemo(()=>i,[i]),{isOpen:f,onClose:p,forceUpdate:h}=c;return a.jsx(_F,{value:s,children:a.jsx(EF,{value:c,children:a.jsx(FF,{value:n,children:Ab(t,{isOpen:f,onClose:p,forceUpdate:h})})})})};Dd.displayName="Menu";var q3=Pe((e,t)=>{const n=Tc();return a.jsx(_e.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});q3.displayName="MenuCommand";var X3=Pe((e,t)=>{const{type:n,...r}=e,o=Tc(),s=r.as||n?n??void 0:"button",i=u.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})}),Ex=e=>{const{className:t,children:n,...r}=e,o=Tc(),s=u.Children.only(n),i=u.isValidElement(s)?u.cloneElement(s,{focusable:"false","aria-hidden":!0,className:et("chakra-menu__icon",s.props.className)}):null,c=et("chakra-menu__icon-wrapper",t);return a.jsx(_e.span,{className:c,...r,__css:o.icon,children:i})};Ex.displayName="MenuIcon";var Ht=Pe((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:i,...c}=e,f=K3(c,t),h=n||o?a.jsx("span",{style:{pointerEvents:"none",flex:1},children:i}):i;return a.jsxs(X3,{...f,className:et("chakra-menu__menuitem",f.className),children:[n&&a.jsx(Ex,{fontSize:"0.8em",marginEnd:r,children:n}),h,o&&a.jsx(q3,{marginStart:s,children:o})]})});Ht.displayName="MenuItem";var BF={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"}}},HF=_e(gn.div),Ga=Pe(function(t,n){var r,o;const{rootProps:s,motionProps:i,...c}=t,{isOpen:f,onTransitionEnd:p,unstable__animationState:h}=Md(),m=RF(c,n),v=AF(s),b=Tc();return a.jsx(_e.div,{...v,__css:{zIndex:(o=t.zIndex)!=null?o:(r=b.list)==null?void 0:r.zIndex},children:a.jsx(HF,{variants:BF,initial:!1,animate:f?"enter":"exit",__css:{outline:0,...b.list},...i,className:et("chakra-menu__menu-list",m.className),...m,onUpdate:p,onAnimationComplete:cm(h.onComplete,m.onAnimationComplete)})})});Ga.displayName="MenuList";var wc=Pe((e,t)=>{const{title:n,children:r,className:o,...s}=e,i=et("chakra-menu__group__title",o),c=Tc();return a.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&a.jsx(_e.p,{className:i,...s,__css:c.groupTitle,children:n}),r]})});wc.displayName="MenuGroup";var Y3=e=>{const{className:t,title:n,...r}=e,o=TF(r);return a.jsx(wc,{title:n,className:et("chakra-menu__option-group",t),...o})};Y3.displayName="MenuOptionGroup";var VF=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=DF(o,t),i=r||VF;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 WF=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=NF(o,t);return a.jsxs(X3,{...s,className:et("chakra-menu__menuitem-option",o.className),children:[n!==null&&a.jsx(Ex,{fontSize:"0.8em",marginEnd:r,opacity:e.isChecked?1:0,children:n||a.jsx(WF,{})}),a.jsx("span",{style:{flex:1},children:s.children})]})});rh.id="MenuItemOption";rh.displayName="MenuItemOption";var UF={slideInBottom:{...m1,custom:{offsetY:16,reverse:!0}},slideInRight:{...m1,custom:{offsetX:16,reverse:!0}},scale:{...j5,custom:{initialScale:.95,reverse:!0}},none:{}},GF=_e(gn.section),KF=e=>UF[e||"none"],Q3=u.forwardRef((e,t)=>{const{preset:n,motionProps:r=KF(n),...o}=e;return a.jsx(GF,{ref:t,...r,...o})});Q3.displayName="ModalTransition";var qF=Object.defineProperty,XF=(e,t,n)=>t in e?qF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YF=(e,t,n)=>(XF(e,typeof t!="symbol"?t+"":t,n),n),QF=class{constructor(){YF(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}},O1=new QF;function Z3(e,t){const[n,r]=u.useState(0);return u.useEffect(()=>{const o=e.current;if(o){if(t){const s=O1.add(o);r(s)}return()=>{O1.remove(o),r(0)}}},[t,e]),n}var ZF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},jl=new WeakMap,qf=new WeakMap,Xf={},av=0,J3=function(e){return e&&(e.host||J3(e.parentNode))},JF=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=J3(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})},eB=function(e,t,n,r){var o=JF(t,Array.isArray(e)?e:[e]);Xf[n]||(Xf[n]=new WeakMap);var s=Xf[n],i=[],c=new Set,f=new Set(o),p=function(m){!m||c.has(m)||(c.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(c.has(v))h(v);else{var b=v.getAttribute(r),y=b!==null&&b!=="false",x=(jl.get(v)||0)+1,w=(s.get(v)||0)+1;jl.set(v,x),s.set(v,w),i.push(v),x===1&&y&&qf.set(v,!0),w===1&&v.setAttribute(n,"true"),y||v.setAttribute(r,"true")}})};return h(t),c.clear(),av++,function(){i.forEach(function(m){var v=jl.get(m)-1,b=s.get(m)-1;jl.set(m,v),s.set(m,b),v||(qf.has(m)||m.removeAttribute(r),qf.delete(m)),b||m.removeAttribute(n)}),av--,av||(jl=new WeakMap,jl=new WeakMap,qf=new WeakMap,Xf={})}},tB=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||ZF(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),eB(r,o,n,"aria-hidden")):function(){return null}};function nB(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:i=!0,onOverlayClick:c,onEsc:f}=e,p=u.useRef(null),h=u.useRef(null),[m,v,b]=oB(r,"chakra-modal","chakra-modal--header","chakra-modal--body");rB(p,t&&i);const y=Z3(p,t),x=u.useRef(null),w=u.useCallback(A=>{x.current=A.target},[]),k=u.useCallback(A=>{A.key==="Escape"&&(A.stopPropagation(),s&&(n==null||n()),f==null||f())},[s,n,f]),[_,j]=u.useState(!1),[I,E]=u.useState(!1),O=u.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?b:void 0,onClick:Fe(A.onClick,T=>T.stopPropagation())}),[b,I,m,v,_]),M=u.useCallback(A=>{A.stopPropagation(),x.current===A.target&&O1.isTopModal(p.current)&&(o&&(n==null||n()),c==null||c())},[n,o,c]),D=u.useCallback((A={},R=null)=>({...A,ref:yt(R,h),onClick:Fe(A.onClick,M),onKeyDown:Fe(A.onKeyDown,k),onMouseDown:Fe(A.onMouseDown,w)}),[k,w,M]);return{isOpen:t,onClose:n,headerId:v,bodyId:b,setBodyMounted:E,setHeaderMounted:j,dialogRef:p,overlayRef:h,getDialogProps:O,getDialogContainerProps:D,index:y}}function rB(e,t){const n=e.current;u.useEffect(()=>{if(!(!e.current||!t))return tB(e.current)},[t,e,n])}function oB(e,...t){const n=u.useId(),r=e||n;return u.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[sB,$c]=Tt({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[aB,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:c,returnFocusOnClose:f,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:b,onCloseComplete:y}=t,x=Hn("Modal",t),k={...nB(t),autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:c,returnFocusOnClose:f,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:b};return a.jsx(aB,{value:k,children:a.jsx(sB,{value:x,children:a.jsx(nr,{onExitComplete:y,children:k.isOpen&&a.jsx(wd,{...n,children:r})})})})};Fi.displayName="Modal";var Op="right-scroll-bar-position",Mp="width-before-scroll-bar",iB="with-scroll-bars-hidden",lB="--removed-body-scroll-bar-size",eP=X5(),iv=function(){},Om=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:iv,onWheelCapture:iv,onTouchMoveCapture:iv}),o=r[0],s=r[1],i=e.forwardProps,c=e.children,f=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,v=e.sideCar,b=e.noIsolation,y=e.inert,x=e.allowPinchZoom,w=e.as,k=w===void 0?"div":w,_=e.gapMode,j=G5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=v,E=U5([n,t]),O=us(us({},j),o);return u.createElement(u.Fragment,null,h&&u.createElement(I,{sideCar:eP,removeScrollBar:p,shards:m,noIsolation:b,inert:y,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:_}),i?u.cloneElement(u.Children.only(c),us(us({},O),{ref:E})):u.createElement(k,us({},O,{className:f,ref:E}),c))});Om.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Om.classNames={fullWidth:Mp,zeroRight:Op};var nS,cB=function(){if(nS)return nS;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function uB(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=cB();return t&&e.setAttribute("nonce",t),e}function dB(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fB(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var pB=function(){var e=0,t=null;return{add:function(n){e==0&&(t=uB())&&(dB(t,n),fB(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hB=function(){var e=pB();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tP=function(){var e=hB(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},mB={left:0,top:0,right:0,gap:0},lv=function(e){return parseInt(e||"",10)||0},gB=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)]},vB=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return mB;var t=gB(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])}},bB=tP(),xB=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(iB,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(c,"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(c,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Op,` {
|
||
right: `).concat(c,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Mp,` {
|
||
margin-right: `).concat(c,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Op," .").concat(Op,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(Mp," .").concat(Mp,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body {
|
||
`).concat(lB,": ").concat(c,`px;
|
||
}
|
||
`)},yB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=u.useMemo(function(){return vB(o)},[o]);return u.createElement(bB,{styles:xB(s,!t,o,n?"":"!important")})},M1=!1;if(typeof window<"u")try{var Yf=Object.defineProperty({},"passive",{get:function(){return M1=!0,!0}});window.addEventListener("test",Yf,Yf),window.removeEventListener("test",Yf,Yf)}catch{M1=!1}var Pl=M1?{passive:!1}:!1,CB=function(e){return e.tagName==="TEXTAREA"},nP=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!CB(e)&&n[t]==="visible")},wB=function(e){return nP(e,"overflowY")},SB=function(e){return nP(e,"overflowX")},rS=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=rP(e,r);if(o){var s=oP(e,r),i=s[1],c=s[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},kB=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_B=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},rP=function(e,t){return e==="v"?wB(t):SB(t)},oP=function(e,t){return e==="v"?kB(t):_B(t)},jB=function(e,t){return e==="h"&&t==="rtl"?-1:1},PB=function(e,t,n,r,o){var s=jB(e,window.getComputedStyle(t).direction),i=s*r,c=n.target,f=t.contains(c),p=!1,h=i>0,m=0,v=0;do{var b=oP(e,c),y=b[0],x=b[1],w=b[2],k=x-w-s*y;(y||k)&&rP(e,c)&&(m+=k,v+=y),c=c.parentNode}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));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]},oS=function(e){return[e.deltaX,e.deltaY]},sS=function(e){return e&&"current"in e?e.current:e},IB=function(e,t){return e[0]===t[0]&&e[1]===t[1]},EB=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},OB=0,Il=[];function MB(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),o=u.useState(OB++)[0],s=u.useState(tP)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var x=w1([e.lockRef.current],(e.shards||[]).map(sS),!0).filter(Boolean);return x.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),x.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=u.useCallback(function(x,w){if("touches"in x&&x.touches.length===2)return!i.current.allowPinchZoom;var k=Qf(x),_=n.current,j="deltaX"in x?x.deltaX:_[0]-k[0],I="deltaY"in x?x.deltaY:_[1]-k[1],E,O=x.target,M=Math.abs(j)>Math.abs(I)?"h":"v";if("touches"in x&&M==="h"&&O.type==="range")return!1;var D=rS(M,O);if(!D)return!0;if(D?E=M:(E=M==="v"?"h":"v",D=rS(M,O)),!D)return!1;if(!r.current&&"changedTouches"in x&&(j||I)&&(r.current=E),!E)return!0;var A=r.current||E;return PB(A,w,x,A==="h"?j:I,!0)},[]),f=u.useCallback(function(x){var w=x;if(!(!Il.length||Il[Il.length-1]!==s)){var k="deltaY"in w?oS(w):Qf(w),_=t.current.filter(function(E){return E.name===w.type&&E.target===w.target&&IB(E.delta,k)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var j=(i.current.shards||[]).map(sS).filter(Boolean).filter(function(E){return E.contains(w.target)}),I=j.length>0?c(w,j[0]):!i.current.noIsolation;I&&w.cancelable&&w.preventDefault()}}},[]),p=u.useCallback(function(x,w,k,_){var j={name:x,delta:w,target:k,should:_};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(I){return I!==j})},1)},[]),h=u.useCallback(function(x){n.current=Qf(x),r.current=void 0},[]),m=u.useCallback(function(x){p(x.type,oS(x),x.target,c(x,e.lockRef.current))},[]),v=u.useCallback(function(x){p(x.type,Qf(x),x.target,c(x,e.lockRef.current))},[]);u.useEffect(function(){return Il.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",f,Pl),document.addEventListener("touchmove",f,Pl),document.addEventListener("touchstart",h,Pl),function(){Il=Il.filter(function(x){return x!==s}),document.removeEventListener("wheel",f,Pl),document.removeEventListener("touchmove",f,Pl),document.removeEventListener("touchstart",h,Pl)}},[]);var b=e.removeScrollBar,y=e.inert;return u.createElement(u.Fragment,null,y?u.createElement(s,{styles:EB(o)}):null,b?u.createElement(yB,{gapMode:e.gapMode}):null)}const DB=O$(eP,MB);var sP=u.forwardRef(function(e,t){return u.createElement(Om,us({},e,{ref:t,sideCar:DB}))});sP.classNames=Om.classNames;const RB=sP;function AB(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:i,finalFocusRef:c,returnFocusOnClose:f,preserveScrollBarGap:p,lockFocusAcrossFrames:h,isOpen:m}=zi(),[v,b]=E7();u.useEffect(()=>{!v&&b&&setTimeout(b)},[v,b]);const y=Z3(r,m);return a.jsx(j3,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:c,restoreFocus:f,contentRef:r,lockFocusAcrossFrames:h,children:a.jsx(RB,{removeScrollBar:!p,allowPinchZoom:i,enabled:y===1&&s,forwardProps:!0,children:e.children})})}var Bi=Pe((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...i}=e,{getDialogProps:c,getDialogContainerProps:f}=zi(),p=c(i,t),h=f(o),m=et("chakra-modal__content",n),v=$c(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},y={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{motionPreset:x}=zi();return a.jsx(AB,{children:a.jsx(_e.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:y,children:a.jsx(Q3,{preset:x,motionProps:s,className:m,...p,__css:b,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();u.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 NB=_e(gn.div),Vo=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"?{}:_5);return a.jsx(NB,{...m,__css:f,ref:t,className:i,...s})});Vo.displayName="ModalOverlay";var Wo=Pe((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=zi();u.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=et("chakra-modal__body",n),c=$c();return a.jsx(_e.div,{ref:t,className:i,id:o,...r,__css:c.body})});Wo.displayName="ModalBody";var Td=Pe((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=zi(),i=et("chakra-modal__close-btn",r),c=$c();return a.jsx(dN,{ref:t,__css:c.closeButton,className:i,onClick:Fe(n,f=>{f.stopPropagation(),s()}),...o})});Td.displayName="ModalCloseButton";var TB=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"})}),$B=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 aS(e,t,n,r){u.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,i=Array.isArray(t)?t:[t],c=new s.MutationObserver(f=>{for(const p of f)p.type==="attributes"&&p.attributeName&&i.includes(p.attributeName)&&n(p)});return c.observe(e.current,{attributes:!0,attributeFilter:i}),()=>c.disconnect()})}function LB(e,t){const n=tn(e);u.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var zB=50,iS=300;function FB(e,t){const[n,r]=u.useState(!1),[o,s]=u.useState(null),[i,c]=u.useState(!0),f=u.useRef(null),p=()=>clearTimeout(f.current);LB(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?zB:null);const h=u.useCallback(()=>{i&&e(),f.current=setTimeout(()=>{c(!1),r(!0),s("increment")},iS)},[e,i]),m=u.useCallback(()=>{i&&t(),f.current=setTimeout(()=>{c(!1),r(!0),s("decrement")},iS)},[t,i]),v=u.useCallback(()=>{c(!0),r(!1),p()},[]);return u.useEffect(()=>()=>p(),[]),{up:h,down:m,stop:v,isSpinning:n}}var BB=/^[Ee0-9+\-.]$/;function HB(e){return BB.test(e)}function VB(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 WB(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:c,isDisabled:f,isRequired:p,isInvalid:h,pattern:m="[0-9]*(.[0-9]+)?",inputMode:v="decimal",allowMouseWheel:b,id:y,onChange:x,precision:w,name:k,"aria-describedby":_,"aria-label":j,"aria-labelledby":I,onFocus:E,onBlur:O,onInvalid:M,getAriaValueText:D,isValidCharacter:A,format:R,parse:T,...q}=e,B=tn(E),G=tn(O),Y=tn(M),V=tn(A??HB),L=tn(D),X=u$(e),{update:z,increment:K,decrement:ne}=X,[Q,ie]=u.useState(!1),oe=!(c||f),W=u.useRef(null),U=u.useRef(null),ee=u.useRef(null),se=u.useRef(null),re=u.useCallback(ge=>ge.split("").filter(V).join(""),[V]),fe=u.useCallback(ge=>{var Ye;return(Ye=T==null?void 0:T(ge))!=null?Ye:ge},[T]),de=u.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]),Yl(()=>{if(!W.current)return;if(W.current.value!=X.value){const Ye=fe(W.current.value);X.setValue(re(Ye))}},[fe,re]);const me=u.useCallback((ge=i)=>{oe&&K(ge)},[K,oe,i]),ye=u.useCallback((ge=i)=>{oe&&ne(ge)},[ne,oe,i]),he=FB(me,ye);aS(ee,"disabled",he.stop,he.isSpinning),aS(se,"disabled",he.stop,he.isSpinning);const ue=u.useCallback(ge=>{if(ge.nativeEvent.isComposing)return;const ot=fe(ge.currentTarget.value);z(re(ot)),U.current={start:ge.currentTarget.selectionStart,end:ge.currentTarget.selectionEnd}},[z,re,fe]),De=u.useCallback(ge=>{var Ye,ot,lt;B==null||B(ge),U.current&&(ge.target.selectionStart=(ot=U.current.start)!=null?ot:(Ye=ge.currentTarget.value)==null?void 0:Ye.length,ge.currentTarget.selectionEnd=(lt=U.current.end)!=null?lt:ge.currentTarget.selectionStart)},[B]),je=u.useCallback(ge=>{if(ge.nativeEvent.isComposing)return;VB(ge,V)||ge.preventDefault();const Ye=Be(ge)*i,ot=ge.key,Oe={ArrowUp:()=>me(Ye),ArrowDown:()=>ye(Ye),Home:()=>z(o),End:()=>z(s)}[ot];Oe&&(ge.preventDefault(),Oe(ge))},[V,i,me,ye,z,o,s]),Be=ge=>{let Ye=1;return(ge.metaKey||ge.ctrlKey)&&(Ye=.1),ge.shiftKey&&(Ye=10),Ye},rt=u.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=u.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=u.useCallback(()=>{ie(!1),n&&Ue()},[n,ie,Ue]),Xe=u.useCallback(()=>{t&&requestAnimationFrame(()=>{var ge;(ge=W.current)==null||ge.focus()})},[t]),tt=u.useCallback(ge=>{ge.preventDefault(),he.up(),Xe()},[Xe,he]),ve=u.useCallback(ge=>{ge.preventDefault(),he.down(),Xe()},[Xe,he]);_i(()=>W.current,"wheel",ge=>{var Ye,ot;const Oe=((ot=(Ye=W.current)==null?void 0:Ye.ownerDocument)!=null?ot:document).activeElement===W.current;if(!b||!Oe)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=u.useCallback((ge={},Ye=null)=>{const ot=f||r&&X.isAtMax;return{...ge,ref:yt(Ye,ee),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":lo(ot)}},[X.isAtMax,r,tt,he.stop,f]),st=u.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":lo(ot)}},[X.isAtMin,r,ve,he.stop,f]),mt=u.useCallback((ge={},Ye=null)=>{var ot,lt,Oe,$e;return{name:k,inputMode:v,type:"text",pattern:m,"aria-labelledby":I,"aria-label":j,"aria-describedby":_,id:y,disabled:f,...ge,readOnly:(ot=ge.readOnly)!=null?ot:c,"aria-readonly":(lt=ge.readOnly)!=null?lt:c,"aria-required":(Oe=ge.required)!=null?Oe:p,required:($e=ge.required)!=null?$e:p,ref:yt(W,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":lo(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,G,Ct)}},[k,v,m,I,j,de,_,y,f,p,c,h,X.value,X.valueAsNumber,X.isOutOfRange,o,s,rt,ue,je,De,G,Ct]);return{value:de(X.value),valueAsNumber:X.valueAsNumber,isFocused:Q,isDisabled:f,isReadOnly:c,getIncrementButtonProps:Re,getDecrementButtonProps:st,getInputProps:mt,htmlProps:q}}var[UB,Mm]=Tt({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[GB,Ox]=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=ex(o),{htmlProps:i,...c}=WB(s),f=u.useMemo(()=>c,[c]);return a.jsx(GB,{value:f,children:a.jsx(UB,{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=Mm();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}=Ox(),o=r(t,n),s=Mm();return a.jsx(_e.input,{...o,className:et("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Am.displayName="NumberInputField";var aP=_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=Mm(),{getDecrementButtonProps:s}=Ox(),i=s(t,n);return a.jsx(aP,{...i,__css:o.stepper,children:(r=t.children)!=null?r:a.jsx(TB,{})})});Nm.displayName="NumberDecrementStepper";var Tm=Pe(function(t,n){var r;const{getIncrementButtonProps:o}=Ox(),s=o(t,n),i=Mm();return a.jsx(aP,{...s,__css:i.stepper,children:(r=t.children)!=null?r:a.jsx($B,{})})});Tm.displayName="NumberIncrementStepper";var[KB,Lc]=Tt({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[qB,Mx]=Tt({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Dx(e){const t=u.Children.only(e.children),{getTriggerProps:n}=Lc();return u.cloneElement(t,n(t.props,t.ref))}Dx.displayName="PopoverTrigger";var El={click:"click",hover:"hover"};function XB(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:i=!0,arrowSize:c,arrowShadowColor:f,trigger:p=El.click,openDelay:h=200,closeDelay:m=200,isLazy:v,lazyBehavior:b="unmount",computePositionOnMount:y,...x}=e,{isOpen:w,onClose:k,onOpen:_,onToggle:j}=Px(e),I=u.useRef(null),E=u.useRef(null),O=u.useRef(null),M=u.useRef(!1),D=u.useRef(!1);w&&(D.current=!0);const[A,R]=u.useState(!1),[T,q]=u.useState(!1),B=u.useId(),G=o??B,[Y,V,L,X]=["popover-trigger","popover-content","popover-header","popover-body"].map(ue=>`${ue}-${G}`),{referenceRef:z,getArrowProps:K,getPopperProps:ne,getArrowInnerProps:Q,forceUpdate:ie}=jx({...x,enabled:w||!!y}),oe=U3({isOpen:w,ref:O});z5({enabled:w,ref:E}),A3(O,{focusRef:E,visible:w,shouldFocus:s&&p===El.click}),nz(O,{focusRef:r,visible:w,shouldFocus:i&&p===El.click});const W=Ix({wasSelected:D.current,enabled:v,mode:b,isSelected:oe.present}),U=u.useCallback((ue={},De=null)=>{const je={...ue,style:{...ue.style,transformOrigin:jn.transformOrigin.varRef,[jn.arrowSize.var]:c?`${c}px`:void 0,[jn.arrowShadowColor.var]:f},ref:yt(O,De),children:W?ue.children:null,id:V,tabIndex:-1,role:"dialog",onKeyDown:Fe(ue.onKeyDown,Be=>{n&&Be.key==="Escape"&&k()}),onBlur:Fe(ue.onBlur,Be=>{const rt=lS(Be),Ue=cv(O.current,rt),Ct=cv(E.current,rt);w&&t&&(!Ue&&!Ct)&&k()}),"aria-labelledby":A?L:void 0,"aria-describedby":T?X:void 0};return p===El.hover&&(je.role="tooltip",je.onMouseEnter=Fe(ue.onMouseEnter,()=>{M.current=!0}),je.onMouseLeave=Fe(ue.onMouseLeave,Be=>{Be.nativeEvent.relatedTarget!==null&&(M.current=!1,setTimeout(()=>k(),m))})),je},[W,V,A,L,T,X,p,n,k,w,t,m,f,c]),ee=u.useCallback((ue={},De=null)=>ne({...ue,style:{visibility:w?"visible":"hidden",...ue.style}},De),[w,ne]),se=u.useCallback((ue,De=null)=>({...ue,ref:yt(De,I,z)}),[I,z]),re=u.useRef(),fe=u.useRef(),de=u.useCallback(ue=>{I.current==null&&z(ue)},[z]),me=u.useCallback((ue={},De=null)=>{const je={...ue,ref:yt(E,De,de),id:Y,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":V};return p===El.click&&(je.onClick=Fe(ue.onClick,j)),p===El.hover&&(je.onFocus=Fe(ue.onFocus,()=>{re.current===void 0&&_()}),je.onBlur=Fe(ue.onBlur,Be=>{const rt=lS(Be),Ue=!cv(O.current,rt);w&&t&&Ue&&k()}),je.onKeyDown=Fe(ue.onKeyDown,Be=>{Be.key==="Escape"&&k()}),je.onMouseEnter=Fe(ue.onMouseEnter,()=>{M.current=!0,re.current=window.setTimeout(()=>_(),h)}),je.onMouseLeave=Fe(ue.onMouseLeave,()=>{M.current=!1,re.current&&(clearTimeout(re.current),re.current=void 0),fe.current=window.setTimeout(()=>{M.current===!1&&k()},m)})),je},[Y,w,V,p,de,j,_,t,k,h,m]);u.useEffect(()=>()=>{re.current&&clearTimeout(re.current),fe.current&&clearTimeout(fe.current)},[]);const ye=u.useCallback((ue={},De=null)=>({...ue,id:L,ref:yt(De,je=>{R(!!je)})}),[L]),he=u.useCallback((ue={},De=null)=>({...ue,id:X,ref:yt(De,je=>{q(!!je)})}),[X]);return{forceUpdate:ie,isOpen:w,onAnimationComplete:oe.onComplete,onClose:k,getAnchorProps:se,getArrowProps:K,getArrowInnerProps:Q,getPopoverPositionerProps:ee,getPopoverProps:U,getTriggerProps:me,getHeaderProps:ye,getBodyProps:he}}function cv(e,t){return e===t||(e==null?void 0:e.contains(t))}function lS(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=bd(),s=XB({...r,direction:o.direction});return a.jsx(KB,{value:s,children:a.jsx(qB,{value:t,children:Ab(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}$m.displayName="Popover";function iP(e){const t=u.Children.only(e.children),{getAnchorProps:n}=Lc();return u.cloneElement(t,n(t.props,t.ref))}iP.displayName="PopoverAnchor";var uv=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function lP(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:i,shadowColor:c}=e,{getArrowProps:f,getArrowInnerProps:p}=Lc(),h=Mx(),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",c),"--popper-arrow-bg":uv("colors",m),"--popper-arrow-shadow":uv("shadows",v),...h.arrow}})})}lP.displayName="PopoverArrow";var Rx=Pe(function(t,n){const{getBodyProps:r}=Lc(),o=Mx();return a.jsx(_e.div,{...r(t,n),className:et("chakra-popover__body",t.className),__css:o.body})});Rx.displayName="PopoverBody";function YB(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var QB={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]}}},ZB=_e(gn.section),cP=Pe(function(t,n){const{variants:r=QB,...o}=t,{isOpen:s}=Lc();return a.jsx(ZB,{ref:n,variants:YB(r),initial:!1,animate:s?"enter":"exit",...o})});cP.displayName="PopoverTransition";var Lm=Pe(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:i,getPopoverPositionerProps:c,onAnimationComplete:f}=Lc(),p=Mx(),h={position:"relative",display:"flex",flexDirection:"column",...p.content};return a.jsx(_e.div,{...c(r),__css:p.popper,className:"chakra-popover__popper",children:a.jsx(cP,{...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 JB(e,t,n){return(e-t)*100/(n-t)}var eH=aa({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),tH=aa({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),nH=aa({"0%":{left:"-40%"},"100%":{left:"100%"}}),rH=aa({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function uP(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:i,role:c="progressbar"}=e,f=JB(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:c},percent:f,value:t}}var dP=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?`${tH} 2s linear infinite`:void 0},...r})};dP.displayName="Shape";var R1=Pe((e,t)=>{var n;const{size:r="48px",max:o=100,min:s=0,valueText:i,getValueText:c,value:f,capIsRound:p,children:h,thickness:m="10px",color:v="#0078d4",trackColor:b="#edebe9",isIndeterminate:y,...x}=e,w=uP({min:s,max:o,value:f,valueText:i,getValueText:c,isIndeterminate:y}),k=y?void 0:((n=w.percent)!=null?n:0)*2.64,_=k==null?void 0:`${k} ${264-k}`,j=y?{css:{animation:`${eH} 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,...x,__css:I,children:[a.jsxs(dP,{size:r,isIndeterminate:y,children:[a.jsx(D1,{stroke:b,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&&!y?0:void 0,...j})]}),h]})});R1.displayName="CircularProgress";var[oH,sH]=Tt({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),aH=Pe((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:i,...c}=e,f=uP({value:o,min:n,max:r,isIndeterminate:s,role:i}),h={height:"100%",...sH().filledTrack};return a.jsx(_e.div,{ref:t,style:{width:`${f.percent}%`,...c.style},...f.bind,...c,__css:h})}),fP=Pe((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:i,isAnimated:c,children:f,borderRadius:p,isIndeterminate:h,"aria-label":m,"aria-labelledby":v,"aria-valuetext":b,title:y,role:x,...w}=Xt(e),k=Hn("Progress",e),_=p??((n=k.track)==null?void 0:n.borderRadius),j={animation:`${rH} 1s linear infinite`},O={...!h&&i&&c&&j,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${nH} 1s ease infinite normal none running`}},M={overflow:"hidden",position:"relative",...k.track};return a.jsx(_e.div,{ref:t,borderRadius:_,__css:M,...w,children:a.jsxs(oH,{value:k,children:[a.jsx(aH,{"aria-label":m,"aria-labelledby":v,"aria-valuetext":b,min:o,max:s,value:r,isIndeterminate:h,css:O,borderRadius:_,title:y,role:x}),f]})})});fP.displayName="Progress";function iH(e){return e&&t1(e)&&t1(e.target)}function lH(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:i,isNative:c,...f}=e,[p,h]=u.useState(r||""),m=typeof n<"u",v=m?n:p,b=u.useRef(null),y=u.useCallback(()=>{const E=b.current;if(!E)return;let O="input:not(:disabled):checked";const M=E.querySelector(O);if(M){M.focus();return}O="input:not(:disabled)";const D=E.querySelector(O);D==null||D.focus()},[]),w=`radio-${u.useId()}`,k=o||w,_=u.useCallback(E=>{const O=iH(E)?E.target.value:E;m||h(O),t==null||t(String(O))},[t,m]),j=u.useCallback((E={},O=null)=>({...E,ref:yt(O,b),role:"radiogroup"}),[]),I=u.useCallback((E={},O=null)=>({...E,ref:O,name:k,[c?"checked":"isChecked"]:v!=null?E.value===v:void 0,onChange(D){_(D)},"data-radiogroup":!0}),[c,k,_,v]);return{getRootProps:j,getRadioProps:I,name:k,ref:b,focus:y,setValue:h,value:v,onChange:_,isDisabled:s,isFocusable:i,htmlProps:f}}var[cH,pP]=Tt({name:"RadioGroupContext",strict:!1}),oh=Pe((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:i,isDisabled:c,isFocusable:f,...p}=e,{value:h,onChange:m,getRootProps:v,name:b,htmlProps:y}=lH(p),x=u.useMemo(()=>({name:b,size:r,onChange:m,colorScheme:n,value:h,variant:o,isDisabled:c,isFocusable:f}),[b,r,m,n,h,o,c,f]);return a.jsx(cH,{value:x,children:a.jsx(_e.div,{...v(y,t),className:et("chakra-radio-group",i),children:s})})});oh.displayName="RadioGroup";var uH={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function dH(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:i,onChange:c,isInvalid:f,name:p,value:h,id:m,"data-radiogroup":v,"aria-describedby":b,...y}=e,x=`radio-${u.useId()}`,w=jd(),_=!!pP()||!!v;let I=!!w&&!_?w.id:x;I=m??I;const E=o??(w==null?void 0:w.isDisabled),O=s??(w==null?void 0:w.isReadOnly),M=i??(w==null?void 0:w.isRequired),D=f??(w==null?void 0:w.isInvalid),[A,R]=u.useState(!1),[T,q]=u.useState(!1),[B,G]=u.useState(!1),[Y,V]=u.useState(!1),[L,X]=u.useState(!!t),z=typeof n<"u",K=z?n:L;u.useEffect(()=>D5(R),[]);const ne=u.useCallback(de=>{if(O||E){de.preventDefault();return}z||X(de.target.checked),c==null||c(de)},[z,E,O,c]),Q=u.useCallback(de=>{de.key===" "&&V(!0)},[V]),ie=u.useCallback(de=>{de.key===" "&&V(!1)},[V]),oe=u.useCallback((de={},me=null)=>({...de,ref:me,"data-active":at(Y),"data-hover":at(B),"data-disabled":at(E),"data-invalid":at(D),"data-checked":at(K),"data-focus":at(T),"data-focus-visible":at(T&&A),"data-readonly":at(O),"aria-hidden":!0,onMouseDown:Fe(de.onMouseDown,()=>V(!0)),onMouseUp:Fe(de.onMouseUp,()=>V(!1)),onMouseEnter:Fe(de.onMouseEnter,()=>G(!0)),onMouseLeave:Fe(de.onMouseLeave,()=>G(!1))}),[Y,B,E,D,K,T,O,A]),{onFocus:W,onBlur:U}=w??{},ee=u.useCallback((de={},me=null)=>{const ye=E&&!r;return{...de,id:I,ref:me,type:"radio",name:p,value:h,onChange:Fe(de.onChange,ne),onBlur:Fe(U,de.onBlur,()=>q(!1)),onFocus:Fe(W,de.onFocus,()=>q(!0)),onKeyDown:Fe(de.onKeyDown,Q),onKeyUp:Fe(de.onKeyUp,ie),checked:K,disabled:ye,readOnly:O,required:M,"aria-invalid":lo(D),"aria-disabled":lo(ye),"aria-required":lo(M),"data-readonly":at(O),"aria-describedby":b,style:uH}},[E,r,I,p,h,ne,U,W,Q,ie,K,O,M,D,b]);return{state:{isInvalid:D,isFocused:T,isChecked:K,isActive:Y,isHovered:B,isDisabled:E,isReadOnly:O,isRequired:M},getCheckboxProps:oe,getRadioProps:oe,getInputProps:ee,getLabelProps:(de={},me=null)=>({...de,ref:me,onMouseDown:Fe(de.onMouseDown,fH),"data-disabled":at(E),"data-checked":at(K),"data-invalid":at(D)}),getRootProps:(de,me=null)=>({...de,ref:me,"data-disabled":at(E),"data-checked":at(K),"data-invalid":at(D)}),htmlProps:y}}function fH(e){e.preventDefault(),e.stopPropagation()}function pH(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=pP(),{onChange:o,value:s}=e,i=Hn("Radio",{...r,...e}),c=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,...b}=c;let y=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(y=r.value===s);let x=o;r!=null&&r.onChange&&s!=null&&(x=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:E}=dH({...b,isChecked:y,isFocusable:m,isDisabled:h,onChange:x,name:w}),[O,M]=pH(E,jj),D=_(M),A=k(v,t),R=j(),T=Object.assign({},O,I()),q={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},G={userSelect:"none",marginStart:f,...i.label};return a.jsxs(_e.label,{className:"chakra-radio",...T,__css:q,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:G,children:p})]})});zs.displayName="Radio";var hP=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]})});hP.displayName="SelectField";function hH(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 mP=Pe((e,t)=>{var n;const r=Hn("Select",e),{rootProps:o,placeholder:s,icon:i,color:c,height:f,h:p,minH:h,minHeight:m,iconColor:v,iconSize:b,...y}=Xt(e),[x,w]=hH(y,jj),k=Jb(w),_={width:"100%",height:"fit-content",position:"relative",color:c},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:_,...x,...o,children:[a.jsx(hP,{ref:t,height:p??f,minH:h??m,placeholder:s,...k,__css:j,children:e.children}),a.jsx(gP,{"data-disabled":at(k.disabled),...(v||c)&&{color:v||c},__css:r.icon,...b&&{fontSize:b},children:i})]})});mP.displayName="Select";var mH=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"})}),gH=_e("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),gP=e=>{const{children:t=a.jsx(mH,{}),...n}=e,r=u.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return a.jsx(gH,{...n,className:"chakra-select__icon-wrapper",children:u.isValidElement(t)?r:null})};gP.displayName="SelectIcon";function vH(){const e=u.useRef(!0);return u.useEffect(()=>{e.current=!1},[]),e.current}function bH(e){const t=u.useRef();return u.useEffect(()=>{t.current=e},[e]),t.current}var xH=_e("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),A1=Pj("skeleton-start-color"),N1=Pj("skeleton-end-color"),yH=aa({from:{opacity:0},to:{opacity:1}}),CH=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=vH(),{startColor:s="",endColor:i="",isLoaded:c,fadeDuration:f,speed:p,className:h,fitContent:m,...v}=Xt(n),[b,y]=ds("colors",[s,i]),x=bH(c),w=et("chakra-skeleton",h),k={...b&&{[A1.variable]:b},...y&&{[N1.variable]:y}};if(c){const _=o||x?"none":`${yH} ${f}s`;return a.jsx(_e.div,{ref:t,className:w,__css:{animation:_},...v})}return a.jsx(xH,{ref:t,className:w,...v,__css:{width:m?"fit-content":void 0,...r,...k,_dark:{...r._dark,...k},animation:`${p}s linear infinite alternate ${CH}`}})});zm.displayName="Skeleton";var no=e=>e?"":void 0,rc=e=>e?!0:void 0,ei=(...e)=>e.filter(Boolean).join(" ");function oc(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function wH(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 Mu(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 vP(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=x=>{var w;const k=(w=r[x])!=null?w:Dp;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Mu({orientation:t,vertical:{bottom:`calc(${n[x]}% - ${k.height/2}px)`},horizontal:{left:`calc(${n[x]}% - ${k.width/2}px)`}})}},i=t==="vertical"?r.reduce((x,w)=>Zf(x).height>Zf(w).height?x:w,Dp):r.reduce((x,w)=>Zf(x).width>Zf(w).width?x:w,Dp),c={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Mu({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",...Mu({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 b=Math.abs(m[m.length-1]-m[0]),y={...f,...Mu({orientation:t,vertical:o?{height:`${b}%`,top:`${v}%`}:{height:`${b}%`,bottom:`${v}%`},horizontal:o?{width:`${b}%`,right:`${v}%`}:{width:`${b}%`,left:`${v}%`}})};return{trackStyle:f,innerTrackStyle:y,rootStyle:c,getThumbStyle:s}}function bP(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function SH(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function kH(e){const t=jH(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function xP(e){return!!e.touches}function _H(e){return xP(e)&&e.touches.length>1}function jH(e){var t;return(t=e.view)!=null?t:window}function PH(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function IH(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function yP(e,t="page"){return xP(e)?PH(e,t):IH(e,t)}function EH(e){return t=>{const n=kH(t);(!n||n&&t.button===0)&&e(t)}}function OH(e,t=!1){function n(o){e(o,{point:yP(o)})}return t?EH(n):n}function Rp(e,t,n,r){return SH(e,t,OH(n,t==="pointerdown"),r)}var MH=Object.defineProperty,DH=(e,t,n)=>t in e?MH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jo=(e,t,n)=>(DH(e,typeof t!="symbol"?t+"":t,n),n),RH=class{constructor(e,t,n){jo(this,"history",[]),jo(this,"startEvent",null),jo(this,"lastEvent",null),jo(this,"lastEventInfo",null),jo(this,"handlers",{}),jo(this,"removeListeners",()=>{}),jo(this,"threshold",3),jo(this,"win"),jo(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const c=dv(this.lastEventInfo,this.history),f=this.startEvent!==null,p=$H(c.offset,{x:0,y:0})>=this.threshold;if(!f&&!p)return;const{timestamp:h}=kw();this.history.push({...c.point,timestamp:h});const{onStart:m,onMove:v}=this.handlers;f||(m==null||m(this.lastEvent,c),this.startEvent=this.lastEvent),v==null||v(this.lastEvent,c)}),jo(this,"onPointerMove",(c,f)=>{this.lastEvent=c,this.lastEventInfo=f,tT.update(this.updatePoint,!0)}),jo(this,"onPointerUp",(c,f)=>{const p=dv(f,this.history),{onEnd:h,onSessionEnd:m}=this.handlers;m==null||m(c,p),this.end(),!(!h||!this.startEvent)&&(h==null||h(c,p))});var r;if(this.win=(r=e.view)!=null?r:window,_H(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:yP(e)},{timestamp:s}=kw();this.history=[{...o.point,timestamp:s}];const{onSessionStart:i}=t;i==null||i(e,dv(o,this.history)),this.removeListeners=TH(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),nT.update(this.updatePoint)}};function cS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function dv(e,t){return{point:e.point,delta:cS(e.point,t[t.length-1]),offset:cS(e.point,t[0]),velocity:NH(t,.1)}}var AH=e=>e*1e3;function NH(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>AH(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 TH(...e){return t=>e.reduce((n,r)=>r(n),t)}function fv(e,t){return Math.abs(e-t)}function uS(e){return"x"in e&&"y"in e}function $H(e,t){if(typeof e=="number"&&typeof t=="number")return fv(e,t);if(uS(e)&&uS(t)){const n=fv(e.x,t.x),r=fv(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function CP(e){const t=u.useRef(null);return t.current=e,t}function wP(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:i,threshold:c}=t,f=!!(n||r||o||s||i),p=u.useRef(null),h=CP({onSessionStart:s,onSessionEnd:i,onStart:r,onMove:n,onEnd(m,v){p.current=null,o==null||o(m,v)}});u.useEffect(()=>{var m;(m=p.current)==null||m.updateHandlers(h.current)}),u.useEffect(()=>{const m=e.current;if(!m||!f)return;function v(b){p.current=new RH(b,h.current,c)}return Rp(m,"pointerdown",v)},[e,f,h,c]),u.useEffect(()=>()=>{var m;(m=p.current)==null||m.end(),p.current=null},[])}function LH(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,c;if("borderBoxSize"in s){const f=s.borderBoxSize,p=Array.isArray(f)?f[0]:f;i=p.inlineSize,c=p.blockSize}else i=e.offsetWidth,c=e.offsetHeight;t({width:i,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var zH=globalThis!=null&&globalThis.document?u.useLayoutEffect:u.useEffect;function FH(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 SP({getNodes:e,observeMutation:t=!0}){const[n,r]=u.useState([]),[o,s]=u.useState(0);return zH(()=>{const i=e(),c=i.map((f,p)=>LH(f,h=>{r(m=>[...m.slice(0,p),h,...m.slice(p+1)])}));if(t){const f=i[0];c.push(FH(f,()=>{s(p=>p+1)}))}return()=>{c.forEach(f=>{f==null||f()})}},[o]),n}function BH(e){return typeof e=="object"&&e!==null&&"current"in e}function HH(e){const[t]=SP({observeMutation:!1,getNodes(){return[BH(e)?e.current:e]}});return t}function VH(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:i,direction:c="ltr",orientation:f="horizontal",id:p,isDisabled:h,isReadOnly:m,onChangeStart:v,onChangeEnd:b,step:y=1,getAriaValueText:x,"aria-valuetext":w,"aria-label":k,"aria-labelledby":_,name:j,focusThumbOnChange:I=!0,minStepsBetweenThumbs:E=0,...O}=e,M=tn(v),D=tn(b),A=tn(x),R=bP({isReversed:i,direction:c,orientation:f}),[T,q]=Rc({value:o,defaultValue:s??[25,75],onChange:r});if(!Array.isArray(T))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof T}\``);const[B,G]=u.useState(!1),[Y,V]=u.useState(!1),[L,X]=u.useState(-1),z=!(h||m),K=u.useRef(T),ne=T.map(ke=>Jl(ke,t,n)),Q=E*y,ie=WH(ne,t,n,Q),oe=u.useRef({eventSource:null,value:[],valueBounds:[]});oe.current.value=ne,oe.current.valueBounds=ie;const W=ne.map(ke=>n-ke+t),ee=(R?W:ne).map(ke=>Zp(ke,t,n)),se=f==="vertical",re=u.useRef(null),fe=u.useRef(null),de=SP({getNodes(){const ke=fe.current,ze=ke==null?void 0:ke.querySelectorAll("[role=slider]");return ze?Array.from(ze):[]}}),me=u.useId(),he=wH(p??me),ue=u.useCallback(ke=>{var ze,Le;if(!re.current)return;oe.current.eventSource="pointer";const We=re.current.getBoundingClientRect(),{clientX:ct,clientY:vn}=(Le=(ze=ke.touches)==null?void 0:ze[0])!=null?Le:ke,_t=se?We.bottom-vn:ct-We.left,jt=se?We.height:We.width;let sr=_t/jt;return R&&(sr=1-sr),A5(sr,t,n)},[se,R,n,t]),De=(n-t)/10,je=y||(n-t)/100,Be=u.useMemo(()=>({setValueAtIndex(ke,ze){if(!z)return;const Le=oe.current.valueBounds[ke];ze=parseFloat(y1(ze,Le.min,je)),ze=Jl(ze,Le.min,Le.max);const We=[...oe.current.value];We[ke]=ze,q(We)},setActiveIndex:X,stepUp(ke,ze=je){const Le=oe.current.value[ke],We=R?Le-ze:Le+ze;Be.setValueAtIndex(ke,We)},stepDown(ke,ze=je){const Le=oe.current.value[ke],We=R?Le+ze:Le-ze;Be.setValueAtIndex(ke,We)},reset(){q(K.current)}}),[je,R,q,z]),rt=u.useCallback(ke=>{const ze=ke.key,We={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];We&&(ke.preventDefault(),ke.stopPropagation(),We(ke),oe.current.eventSource="keyboard")},[Be,L,De,ie]),{getThumbStyle:Ue,rootStyle:Ct,trackStyle:Xe,innerTrackStyle:tt}=u.useMemo(()=>vP({isReversed:R,orientation:f,thumbRects:de,thumbPercents:ee}),[R,f,ee,de]),ve=u.useCallback(ke=>{var ze;const Le=ke??L;if(Le!==-1&&I){const We=he.getThumb(Le),ct=(ze=fe.current)==null?void 0:ze.ownerDocument.getElementById(We);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)),We=Math.min(...Le);let ct=Le.indexOf(We);const vn=Le.filter(jt=>jt===We);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)};wP(fe,{onPanSessionStart(ke){z&&(G(!0),Re(ke),M==null||M(oe.current.value))},onPanSessionEnd(){z&&(G(!1),D==null||D(oe.current.value))},onPan(ke){z&&st(ke)}});const mt=u.useCallback((ke={},ze=null)=>({...ke,...O,id:he.root,ref:yt(ze,fe),tabIndex:-1,"aria-disabled":rc(h),"data-focused":no(Y),style:{...ke.style,...Ct}}),[O,h,Y,Ct,he]),ge=u.useCallback((ke={},ze=null)=>({...ke,ref:yt(ze,re),id:he.track,"data-disabled":no(h),style:{...ke.style,...Xe}}),[h,Xe,he]),Ye=u.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:he.innerTrack,style:{...ke.style,...tt}}),[tt,he]),ot=u.useCallback((ke,ze=null)=>{var Le;const{index:We,...ct}=ke,vn=ne[We];if(vn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${We}\`. The \`value\` or \`defaultValue\` length is : ${ne.length}`);const _t=ie[We];return{...ct,ref:ze,role:"slider",tabIndex:z?0:void 0,id:he.getThumb(We),"data-active":no(B&&L===We),"aria-valuetext":(Le=A==null?void 0:A(vn))!=null?Le:w==null?void 0:w[We],"aria-valuemin":_t.min,"aria-valuemax":_t.max,"aria-valuenow":vn,"aria-orientation":f,"aria-disabled":rc(h),"aria-readonly":rc(m),"aria-label":k==null?void 0:k[We],"aria-labelledby":k!=null&&k[We]||_==null?void 0:_[We],style:{...ke.style,...Ue(We)},onKeyDown:oc(ke.onKeyDown,rt),onFocus:oc(ke.onFocus,()=>{V(!0),X(We)}),onBlur:oc(ke.onBlur,()=>{V(!1),X(-1)})}},[he,ne,ie,z,B,L,A,w,f,h,m,k,_,Ue,rt,V]),lt=u.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:he.output,htmlFor:ne.map((Le,We)=>he.getThumb(We)).join(" "),"aria-live":"off"}),[he,ne]),Oe=u.useCallback((ke,ze=null)=>{const{value:Le,...We}=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",...Mu({orientation:f,vertical:{bottom:`${_t}%`},horizontal:{left:`${_t}%`}})};return{...We,ref:ze,id:he.getMarker(ke.value),role:"presentation","aria-hidden":!0,"data-disabled":no(h),"data-invalid":no(!ct),"data-highlighted":no(vn),style:{...ke.style,...jt}}},[h,R,n,t,f,ne,he]),$e=u.useCallback((ke,ze=null)=>{const{index:Le,...We}=ke;return{...We,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=>ee[ke],getThumbMinValue:ke=>ie[ke].min,getThumbMaxValue:ke=>ie[ke].max},actions:Be,getRootProps:mt,getTrackProps:ge,getInnerTrackProps:Ye,getThumbProps:ot,getMarkerProps:Oe,getInputProps:$e,getOutputProps:lt}}function WH(e,t,n,r){return e.map((o,s)=>{const i=s===0?t:e[s-1]+r,c=s===e.length-1?n:e[s+1]-r;return{min:i,max:c}})}var[UH,Fm]=Tt({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[GH,Bm]=Tt({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),kP=Pe(function(t,n){const r={orientation:"horizontal",...t},o=Hn("Slider",r),s=Xt(r),{direction:i}=bd();s.direction=i;const{getRootProps:c,...f}=VH(s),p=u.useMemo(()=>({...f,name:r.name}),[f,r.name]);return a.jsx(UH,{value:p,children:a.jsx(GH,{value:o,children:a.jsx(_e.div,{...c({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});kP.displayName="RangeSlider";var T1=Pe(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=Fm(),i=Bm(),c=r(t,n);return a.jsxs(_e.div,{...c,className:ei("chakra-slider__thumb",t.className),__css:i.thumb,children:[c.children,s&&a.jsx("input",{...o({index:t.index})})]})});T1.displayName="RangeSliderThumb";var _P=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"})});_P.displayName="RangeSliderTrack";var jP=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})});jP.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 KH(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:i,isReversed:c,direction:f="ltr",orientation:p="horizontal",id:h,isDisabled:m,isReadOnly:v,onChangeStart:b,onChangeEnd:y,step:x=1,getAriaValueText:w,"aria-valuetext":k,"aria-label":_,"aria-labelledby":j,name:I,focusThumbOnChange:E=!0,...O}=e,M=tn(b),D=tn(y),A=tn(w),R=bP({isReversed:c,direction:f,orientation:p}),[T,q]=Rc({value:s,defaultValue:i??XH(n,r),onChange:o}),[B,G]=u.useState(!1),[Y,V]=u.useState(!1),L=!(m||v),X=(r-n)/10,z=x||(r-n)/100,K=Jl(T,n,r),ne=r-K+n,ie=Zp(R?ne:K,n,r),oe=p==="vertical",W=CP({min:n,max:r,step:x,isDisabled:m,value:K,isInteractive:L,isReversed:R,isVertical:oe,eventSource:null,focusThumbOnChange:E,orientation:p}),U=u.useRef(null),ee=u.useRef(null),se=u.useRef(null),re=u.useId(),fe=h??re,[de,me]=[`slider-thumb-${fe}`,`slider-track-${fe}`],ye=u.useCallback(Oe=>{var $e,Rt;if(!U.current)return;const ke=W.current;ke.eventSource="pointer";const ze=U.current.getBoundingClientRect(),{clientX:Le,clientY:We}=(Rt=($e=Oe.touches)==null?void 0:$e[0])!=null?Rt:Oe,ct=oe?ze.bottom-We:Le-ze.left,vn=oe?ze.height:ze.width;let _t=ct/vn;R&&(_t=1-_t);let jt=A5(_t,ke.min,ke.max);return ke.step&&(jt=parseFloat(y1(jt,ke.min,ke.step))),jt=Jl(jt,ke.min,ke.max),jt},[oe,R,W]),he=u.useCallback(Oe=>{const $e=W.current;$e.isInteractive&&(Oe=parseFloat(y1(Oe,$e.min,z)),Oe=Jl(Oe,$e.min,$e.max),q(Oe))},[z,q,W]),ue=u.useMemo(()=>({stepUp(Oe=z){const $e=R?K-Oe:K+Oe;he($e)},stepDown(Oe=z){const $e=R?K+Oe:K-Oe;he($e)},reset(){he(i||0)},stepTo(Oe){he(Oe)}}),[he,R,K,z,i]),De=u.useCallback(Oe=>{const $e=W.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)}[Oe.key];ke&&(Oe.preventDefault(),Oe.stopPropagation(),ke(Oe),$e.eventSource="keyboard")},[ue,he,X,W]),je=(t=A==null?void 0:A(K))!=null?t:k,Be=HH(ee),{getThumbStyle:rt,rootStyle:Ue,trackStyle:Ct,innerTrackStyle:Xe}=u.useMemo(()=>{const Oe=W.current,$e=Be??{width:0,height:0};return vP({isReversed:R,orientation:Oe.orientation,thumbRects:[$e],thumbPercents:[ie]})},[R,Be,ie,W]),tt=u.useCallback(()=>{W.current.focusThumbOnChange&&setTimeout(()=>{var $e;return($e=ee.current)==null?void 0:$e.focus()})},[W]);la(()=>{const Oe=W.current;tt(),Oe.eventSource==="keyboard"&&(D==null||D(Oe.value))},[K,D]);function ve(Oe){const $e=ye(Oe);$e!=null&&$e!==W.current.value&&q($e)}wP(se,{onPanSessionStart(Oe){const $e=W.current;$e.isInteractive&&(G(!0),tt(),ve(Oe),M==null||M($e.value))},onPanSessionEnd(){const Oe=W.current;Oe.isInteractive&&(G(!1),D==null||D(Oe.value))},onPan(Oe){W.current.isInteractive&&ve(Oe)}});const Re=u.useCallback((Oe={},$e=null)=>({...Oe,...O,ref:yt($e,se),tabIndex:-1,"aria-disabled":rc(m),"data-focused":no(Y),style:{...Oe.style,...Ue}}),[O,m,Y,Ue]),st=u.useCallback((Oe={},$e=null)=>({...Oe,ref:yt($e,U),id:me,"data-disabled":no(m),style:{...Oe.style,...Ct}}),[m,me,Ct]),mt=u.useCallback((Oe={},$e=null)=>({...Oe,ref:$e,style:{...Oe.style,...Xe}}),[Xe]),ge=u.useCallback((Oe={},$e=null)=>({...Oe,ref:yt($e,ee),role:"slider",tabIndex:L?0:void 0,id:de,"data-active":no(B),"aria-valuetext":je,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":K,"aria-orientation":p,"aria-disabled":rc(m),"aria-readonly":rc(v),"aria-label":_,"aria-labelledby":_?void 0:j,style:{...Oe.style,...rt(0)},onKeyDown:oc(Oe.onKeyDown,De),onFocus:oc(Oe.onFocus,()=>V(!0)),onBlur:oc(Oe.onBlur,()=>V(!1))}),[L,de,B,je,n,r,K,p,m,v,_,j,rt,De]),Ye=u.useCallback((Oe,$e=null)=>{const Rt=!(Oe.value<n||Oe.value>r),ke=K>=Oe.value,ze=Zp(Oe.value,n,r),Le={position:"absolute",pointerEvents:"none",...qH({orientation:p,vertical:{bottom:R?`${100-ze}%`:`${ze}%`},horizontal:{left:R?`${100-ze}%`:`${ze}%`}})};return{...Oe,ref:$e,role:"presentation","aria-hidden":!0,"data-disabled":no(m),"data-invalid":no(!Rt),"data-highlighted":no(ke),style:{...Oe.style,...Le}}},[m,R,r,n,p,K]),ot=u.useCallback((Oe={},$e=null)=>({...Oe,ref:$e,type:"hidden",value:K,name:I}),[I,K]);return{state:{value:K,isFocused:Y,isDragging:B},actions:ue,getRootProps:Re,getTrackProps:st,getInnerTrackProps:mt,getThumbProps:ge,getMarkerProps:Ye,getInputProps:ot}}function qH(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function XH(e,t){return t<e?e:e+(t-e)/2}var[YH,Hm]=Tt({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[QH,Vm]=Tt({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),Ax=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}=bd();s.direction=i;const{getInputProps:c,getRootProps:f,...p}=KH(s),h=f(),m=c({},t);return a.jsx(YH,{value:p,children:a.jsx(QH,{value:o,children:a.jsxs(_e.div,{...h,className:ei("chakra-slider",r.className),__css:o.container,children:[r.children,a.jsx("input",{...m})]})})})});Ax.displayName="Slider";var Nx=Pe((e,t)=>{const{getThumbProps:n}=Hm(),r=Vm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__thumb",e.className),__css:r.thumb})});Nx.displayName="SliderThumb";var Tx=Pe((e,t)=>{const{getTrackProps:n}=Hm(),r=Vm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__track",e.className),__css:r.track})});Tx.displayName="SliderTrack";var $x=Pe((e,t)=>{const{getInnerTrackProps:n}=Hm(),r=Vm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__filled-track",e.className),__css:r.filledTrack})});$x.displayName="SliderFilledTrack";var Ll=Pe((e,t)=>{const{getMarkerProps:n}=Hm(),r=Vm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__marker",e.className),__css:r.mark})});Ll.displayName="SliderMark";var Lx=Pe(function(t,n){const r=Hn("Switch",t),{spacing:o="0.5rem",children:s,...i}=Xt(t),{getIndicatorProps:c,getInputProps:f,getCheckboxProps:p,getRootProps:h,getLabelProps:m}=R5(i),v=u.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),b=u.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),y=u.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:b,children:a.jsx(_e.span,{__css:r.thumb,className:"chakra-switch__thumb",...c()})}),s&&a.jsx(_e.span,{className:"chakra-switch__label",...m(),__css:y,children:s})]})});Lx.displayName="Switch";var[ZH,JH,eV,tV]=Yb();function nV(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:i,lazyBehavior:c="unmount",orientation:f="horizontal",direction:p="ltr",...h}=e,[m,v]=u.useState(n??0),[b,y]=Rc({defaultValue:n??0,value:o,onChange:r});u.useEffect(()=>{o!=null&&v(o)},[o]);const x=eV(),w=u.useId();return{id:`tabs-${(t=e.id)!=null?t:w}`,selectedIndex:b,focusedIndex:m,setSelectedIndex:y,setFocusedIndex:v,isManual:s,isLazy:i,lazyBehavior:c,orientation:f,descendants:x,direction:p,htmlProps:h}}var[rV,Wm]=Tt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function oV(e){const{focusedIndex:t,orientation:n,direction:r}=Wm(),o=JH(),s=u.useCallback(i=>{const c=()=>{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",b=i.key,y=r==="ltr"?"ArrowLeft":"ArrowRight",x=r==="ltr"?"ArrowRight":"ArrowLeft",k={[y]:()=>m&&f(),[x]:()=>m&&c(),ArrowDown:()=>v&&c(),ArrowUp:()=>v&&f(),Home:p,End:h}[b];k&&(i.preventDefault(),k(i))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Fe(e.onKeyDown,s)}}function sV(e){const{isDisabled:t=!1,isFocusable:n=!1,...r}=e,{setSelectedIndex:o,isManual:s,id:i,setFocusedIndex:c,selectedIndex:f}=Wm(),{index:p,register:h}=tV({disabled:t&&!n}),m=p===f,v=()=>{o(p)},b=()=>{c(p),!s&&!(t&&n)&&o(p)},y=R3({...r,ref:yt(h,e.ref),isDisabled:t,isFocusable:n,onClick:Fe(e.onClick,v)}),x="button";return{...y,id:PP(i,p),role:"tab",tabIndex:m?0:-1,type:x,"aria-selected":m,"aria-controls":IP(i,p),onFocus:t?void 0:Fe(e.onFocus,b)}}var[aV,iV]=Tt({});function lV(e){const t=Wm(),{id:n,selectedIndex:r}=t,s=_d(e.children).map((i,c)=>u.createElement(aV,{key:c,value:{isSelected:c===r,id:IP(n,c),tabId:PP(n,c),selectedIndex:r}},i));return{...e,children:s}}function cV(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=Wm(),{isSelected:s,id:i,tabId:c}=iV(),f=u.useRef(!1);s&&(f.current=!0);const p=Ix({wasSelected:f.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:p?t:null,role:"tabpanel","aria-labelledby":c,hidden:!s,id:i}}function PP(e,t){return`${e}--tab-${t}`}function IP(e,t){return`${e}--tabpanel-${t}`}var[uV,Um]=Tt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),Qi=Pe(function(t,n){const r=Hn("Tabs",t),{children:o,className:s,...i}=Xt(t),{htmlProps:c,descendants:f,...p}=nV(i),h=u.useMemo(()=>p,[p]),{isFitted:m,...v}=c;return a.jsx(ZH,{value:f,children:a.jsx(rV,{value:h,children:a.jsx(uV,{value:r,children:a.jsx(_e.div,{className:et("chakra-tabs",s),ref:n,...v,__css:r.root,children:o})})})})});Qi.displayName="Tabs";var Zi=Pe(function(t,n){const r=oV({...t,ref:n}),s={display:"flex",...Um().tablist};return a.jsx(_e.div,{...r,className:et("chakra-tabs__tablist",t.className),__css:s})});Zi.displayName="TabList";var uo=Pe(function(t,n){const r=cV({...t,ref:n}),o=Um();return a.jsx(_e.div,{outline:"0",...r,className:et("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});uo.displayName="TabPanel";var zc=Pe(function(t,n){const r=lV(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 jr=Pe(function(t,n){const r=Um(),o=sV({...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})});jr.displayName="Tab";function dV(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var fV=["h","minH","height","minHeight"],EP=Pe((e,t)=>{const n=Qa("Textarea",e),{className:r,rows:o,...s}=Xt(e),i=Jb(s),c=o?dV(n,fV):n;return a.jsx(_e.textarea,{ref:t,rows:o,...i,className:et("chakra-textarea",r),__css:c})});EP.displayName="Textarea";var pV={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 hV(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:i=o,closeOnEsc:c=!0,onOpen:f,onClose:p,placement:h,id:m,isOpen:v,defaultIsOpen:b,arrowSize:y=10,arrowShadowColor:x,arrowPadding:w,modifiers:k,isDisabled:_,gutter:j,offset:I,direction:E,...O}=e,{isOpen:M,onOpen:D,onClose:A}=Px({isOpen:v,defaultIsOpen:b,onOpen:f,onClose:p}),{referenceRef:R,getPopperProps:T,getArrowInnerProps:q,getArrowProps:B}=jx({enabled:M,placement:h,arrowPadding:w,modifiers:k,gutter:j,offset:I,direction:E}),G=u.useId(),V=`tooltip-${m??G}`,L=u.useRef(null),X=u.useRef(),z=u.useCallback(()=>{X.current&&(clearTimeout(X.current),X.current=void 0)},[]),K=u.useRef(),ne=u.useCallback(()=>{K.current&&(clearTimeout(K.current),K.current=void 0)},[]),Q=u.useCallback(()=>{ne(),A()},[A,ne]),ie=mV(L,Q),oe=u.useCallback(()=>{if(!_&&!X.current){M&&ie();const me=Np(L);X.current=me.setTimeout(D,t)}},[ie,_,M,D,t]),W=u.useCallback(()=>{z();const me=Np(L);K.current=me.setTimeout(Q,n)},[n,Q,z]),U=u.useCallback(()=>{M&&r&&W()},[r,W,M]),ee=u.useCallback(()=>{M&&i&&W()},[i,W,M]),se=u.useCallback(me=>{M&&me.key==="Escape"&&W()},[M,W]);_i(()=>$1(L),"keydown",c?se:void 0),_i(()=>{const me=L.current;if(!me)return null;const ye=C3(me);return ye.localName==="body"?Np(L):ye},"scroll",()=>{M&&s&&Q()},{passive:!0,capture:!0}),u.useEffect(()=>{_&&(z(),M&&A())},[_,M,A,z]),u.useEffect(()=>()=>{z(),ne()},[z,ne]),_i(()=>L.current,"pointerleave",W);const re=u.useCallback((me={},ye=null)=>({...me,ref:yt(L,ye,R),onPointerEnter:Fe(me.onPointerEnter,ue=>{ue.pointerType!=="touch"&&oe()}),onClick:Fe(me.onClick,U),onPointerDown:Fe(me.onPointerDown,ee),onFocus:Fe(me.onFocus,oe),onBlur:Fe(me.onBlur,W),"aria-describedby":M?V:void 0}),[oe,W,ee,M,V,U,R]),fe=u.useCallback((me={},ye=null)=>T({...me,style:{...me.style,[jn.arrowSize.var]:y?`${y}px`:void 0,[jn.arrowShadowColor.var]:x}},ye),[T,y,x]),de=u.useCallback((me={},ye=null)=>{const he={...me.style,position:"relative",transformOrigin:jn.transformOrigin.varRef};return{ref:ye,...O,...me,id:V,role:"tooltip",style:he}},[O,V]);return{isOpen:M,show:oe,hide:W,getTriggerProps:re,getTooltipProps:de,getTooltipPositionerProps:fe,getArrowProps:B,getArrowInnerProps:q}}var pv="chakra-ui:close-tooltip";function mV(e,t){return u.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 gV(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function vV(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var bV=_e(gn.div),Dt=Pe((e,t)=>{var n,r;const o=Qa("Tooltip",e),s=Xt(e),i=bd(),{children:c,label:f,shouldWrapChildren:p,"aria-label":h,hasArrow:m,bg:v,portalProps:b,background:y,backgroundColor:x,bgColor:w,motionProps:k,..._}=s,j=(r=(n=y??x)!=null?n:v)!=null?r:w;if(j){o.bg=j;const T=O7(i,"colors",j);o[jn.arrowBg.var]=T}const I=hV({..._,direction:i.direction}),E=typeof c=="string"||p;let O;if(E)O=a.jsx(_e.span,{display:"inline-block",tabIndex:0,...I.getTriggerProps(),children:c});else{const T=u.Children.only(c);O=u.cloneElement(T,I.getTriggerProps(T.props,T.ref))}const M=!!h,D=I.getTooltipProps({},t),A=M?gV(D,["role","id"]):D,R=vV(D,["role","id"]);return f?a.jsxs(a.Fragment,{children:[O,a.jsx(nr,{children:I.isOpen&&a.jsx(wd,{...b,children:a.jsx(_e.div,{...I.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:a.jsxs(bV,{variants:pV,initial:"exit",animate:"enter",exit:"exit",...k,...A,__css:o,children:[f,M&&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:c})});Dt.displayName="Tooltip";const go=e=>e.system,xV=e=>e.system.toastQueue,OP=ae(go,e=>e.language,Ce),Pn=ae(e=>e,e=>e.system.isProcessing||!e.system.isConnected),yV=ae(go,e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=e;return{consoleLogLevel:t,shouldLogToConsole:n}},{memoizeOptions:{resultEqualityCheck:kt}}),MP=e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=F(yV);return u.useEffect(()=>{n?(localStorage.setItem("ROARR_LOG","true"),localStorage.setItem("ROARR_FILTER",`context.logLevel:>=${M7[t]}`)):localStorage.setItem("ROARR_LOG","false"),RC.ROARR.write=D7.createLogWriter()},[t,n]),u.useEffect(()=>{const o={...R7};A7.set(RC.Roarr.child(o))},[]),u.useMemo(()=>qi(e),[e])},CV=()=>{const e=J(),t=F(xV),n=S5();return u.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(N7())},[e,n,t]),null},Ji=()=>{const e=J();return u.useCallback(n=>e(Nt(zt(n))),[e])},wV=u.memo(CV);var SV=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=kV(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 kV(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=SV.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var _V=[".DS_Store","Thumbs.db"];function jV(e){return Ac(this,void 0,void 0,function(){return Nc(this,function(t){return sh(e)&&PV(e.dataTransfer)?[2,MV(e.dataTransfer,e.type)]:IV(e)?[2,EV(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,OV(e)]:[2,[]]})})}function PV(e){return sh(e)}function IV(e){return sh(e)&&sh(e.target)}function sh(e){return typeof e=="object"&&e!==null}function EV(e){return L1(e.target.files).map(function(t){return $d(t)})}function OV(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 MV(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(DV))]):[3,2];case 1:return r=o.sent(),[2,dS(DP(r))];case 2:return[2,dS(L1(e.files).map(function(s){return $d(s)}))]}})})}function dS(e){return e.filter(function(t){return _V.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 DV(e){if(typeof e.webkitGetAsEntry!="function")return fS(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?RP(t):fS(e)}function DP(e){return e.reduce(function(t,n){return w1(w1([],Aw(t),!1),Aw(Array.isArray(n)?DP(n):[n]),!1)},[])}function fS(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 RV(e){return Ac(this,void 0,void 0,function(){return Nc(this,function(t){return[2,e.isDirectory?RP(e):AV(e)]})})}function RP(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var i=this;t.readEntries(function(c){return Ac(i,void 0,void 0,function(){var f,p,h;return Nc(this,function(m){switch(m.label){case 0:if(c.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(c.map(RV)),o.push(h),s(),m.label=6;case 6:return[2]}})})},function(c){r(c)})}s()})}function AV(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 NV=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 c=i.trim().toLowerCase();return c.charAt(0)==="."?r.toLowerCase().endsWith(c):c.endsWith("/*")?s===c.replace(/\/.*$/,""):o===c})}return!0};function pS(e){return LV(e)||$V(e)||NP(e)||TV()}function TV(){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 $V(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function LV(e){if(Array.isArray(e))return z1(e)}function hS(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 mS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hS(Object(n),!0).forEach(function(r){AP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AP(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 BV(e)||FV(e,t)||NP(e,t)||zV()}function zV(){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 NP(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 FV(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,c;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,c=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw c}}return r}}function BV(e){if(Array.isArray(e))return e}var HV="file-invalid-type",VV="file-too-large",WV="file-too-small",UV="too-many-files",GV=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:HV,message:"File type must be ".concat(n)}},gS=function(t){return{code:VV,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},vS=function(t){return{code:WV,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},KV={code:UV,message:"Too many files"};function TP(e,t){var n=e.type==="application/x-moz-file"||NV(e,t);return[n,n?null:GV(t)]}function $P(e,t,n){if(xi(e.size))if(xi(t)&&xi(n)){if(e.size>n)return[!1,gS(n)];if(e.size<t)return[!1,vS(t)]}else{if(xi(t)&&e.size<t)return[!1,vS(t)];if(xi(n)&&e.size>n)return[!1,gS(n)]}return[!0,null]}function xi(e){return e!=null}function qV(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,c=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(f){var p=TP(f,n),h=rd(p,1),m=h[0],v=$P(f,r,o),b=rd(v,1),y=b[0],x=c?c(f):null;return m&&y&&!x})}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 XV(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function YV(e){return e.indexOf("Edge/")!==-1}function QV(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return XV(e)||YV(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(c){return!ah(r)&&c&&c.apply(void 0,[r].concat(s)),ah(r)})}}function ZV(){return"showOpenFilePicker"in window}function JV(e){if(xi(e)){var t=Object.entries(e).filter(function(n){var r=rd(n,2),o=r[0],s=r[1],i=!0;return LP(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(zP))&&(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 mS(mS({},n),{},AP({},s,i))},{});return[{description:"Files",accept:t}]}return e}function eW(e){if(xi(e))return Object.entries(e).reduce(function(t,n){var r=rd(n,2),o=r[0],s=r[1];return[].concat(pS(t),[o],pS(s))},[]).filter(function(t){return LP(t)||zP(t)}).join(",")}function tW(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function nW(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function LP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function zP(e){return/^.*\.[\w]+$/.test(e)}var rW=["children"],oW=["open"],sW=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],aW=["refKey","onChange","onClick"];function iW(e){return uW(e)||cW(e)||FP(e)||lW()}function lW(){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 cW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uW(e){if(Array.isArray(e))return F1(e)}function hv(e,t){return pW(e)||fW(e,t)||FP(e,t)||dW()}function dW(){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 FP(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 fW(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,c;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,c=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw c}}return r}}function pW(e){if(Array.isArray(e))return e}function xS(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?xS(Object(n),!0).forEach(function(r){B1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xS(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=hW(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 hW(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 zx=u.forwardRef(function(e,t){var n=e.children,r=ih(e,rW),o=Fx(r),s=o.open,i=ih(o,oW);return u.useImperativeHandle(t,function(){return{open:s}},[s]),H.createElement(u.Fragment,null,n(an(an({},i),{},{open:s})))});zx.displayName="Dropzone";var BP={disabled:!1,getFilesFromEvent:jV,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};zx.defaultProps=BP;zx.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 Fx(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=an(an({},BP),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,c=t.multiple,f=t.maxFiles,p=t.onDragEnter,h=t.onDragLeave,m=t.onDragOver,v=t.onDrop,b=t.onDropAccepted,y=t.onDropRejected,x=t.onFileDialogCancel,w=t.onFileDialogOpen,k=t.useFsAccessApi,_=t.autoFocus,j=t.preventDropOnDocument,I=t.noClick,E=t.noKeyboard,O=t.noDrag,M=t.noDragEventsBubbling,D=t.onError,A=t.validator,R=u.useMemo(function(){return eW(n)},[n]),T=u.useMemo(function(){return JV(n)},[n]),q=u.useMemo(function(){return typeof w=="function"?w:yS},[w]),B=u.useMemo(function(){return typeof x=="function"?x:yS},[x]),G=u.useRef(null),Y=u.useRef(null),V=u.useReducer(mW,H1),L=hv(V,2),X=L[0],z=L[1],K=X.isFocused,ne=X.isFileDialogActive,Q=u.useRef(typeof window<"u"&&window.isSecureContext&&k&&ZV()),ie=function(){!Q.current&&ne&&setTimeout(function(){if(Y.current){var Re=Y.current.files;Re.length||(z({type:"closeDialog"}),B())}},300)};u.useEffect(function(){return window.addEventListener("focus",ie,!1),function(){window.removeEventListener("focus",ie,!1)}},[Y,ne,B,Q]);var oe=u.useRef([]),W=function(Re){G.current&&G.current.contains(Re.target)||(Re.preventDefault(),oe.current=[])};u.useEffect(function(){return j&&(document.addEventListener("dragover",bS,!1),document.addEventListener("drop",W,!1)),function(){j&&(document.removeEventListener("dragover",bS),document.removeEventListener("drop",W))}},[G,j]),u.useEffect(function(){return!r&&_&&G.current&&G.current.focus(),function(){}},[G,_,r]);var U=u.useCallback(function(ve){D?D(ve):console.error(ve)},[D]),ee=u.useCallback(function(ve){ve.preventDefault(),ve.persist(),Ue(ve),oe.current=[].concat(iW(oe.current),[ve.target]),Jf(ve)&&Promise.resolve(o(ve)).then(function(Re){if(!(ah(ve)&&!M)){var st=Re.length,mt=st>0&&qV({files:Re,accept:R,minSize:i,maxSize:s,multiple:c,maxFiles:f,validator:A}),ge=st>0&&!mt;z({isDragAccept:mt,isDragReject:ge,isDragActive:!0,type:"setDraggedFiles"}),p&&p(ve)}}).catch(function(Re){return U(Re)})},[o,p,U,M,R,i,s,c,f,A]),se=u.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,M]),re=u.useCallback(function(ve){ve.preventDefault(),ve.persist(),Ue(ve);var Re=oe.current.filter(function(mt){return G.current&&G.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))},[G,h,M]),fe=u.useCallback(function(ve,Re){var st=[],mt=[];ve.forEach(function(ge){var Ye=TP(ge,R),ot=hv(Ye,2),lt=ot[0],Oe=ot[1],$e=$P(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 We=[Oe,ze];Le&&(We=We.concat(Le)),mt.push({file:ge,errors:We.filter(function(ct){return ct})})}}),(!c&&st.length>1||c&&f>=1&&st.length>f)&&(st.forEach(function(ge){mt.push({file:ge,errors:[KV]})}),st.splice(0)),z({acceptedFiles:st,fileRejections:mt,type:"setFiles"}),v&&v(st,mt,Re),mt.length>0&&y&&y(mt,Re),st.length>0&&b&&b(st,Re)},[z,c,R,i,s,f,v,b,y,A]),de=u.useCallback(function(ve){ve.preventDefault(),ve.persist(),Ue(ve),oe.current=[],Jf(ve)&&Promise.resolve(o(ve)).then(function(Re){ah(ve)&&!M||fe(Re,ve)}).catch(function(Re){return U(Re)}),z({type:"reset"})},[o,fe,U,M]),me=u.useCallback(function(){if(Q.current){z({type:"openDialog"}),q();var ve={multiple:c,types:T};window.showOpenFilePicker(ve).then(function(Re){return o(Re)}).then(function(Re){fe(Re,null),z({type:"closeDialog"})}).catch(function(Re){tW(Re)?(B(Re),z({type:"closeDialog"})):nW(Re)?(Q.current=!1,Y.current?(Y.current.value=null,Y.current.click()):U(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."))):U(Re)});return}Y.current&&(z({type:"openDialog"}),q(),Y.current.value=null,Y.current.click())},[z,q,B,k,fe,U,T,c]),ye=u.useCallback(function(ve){!G.current||!G.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),me())},[G,me]),he=u.useCallback(function(){z({type:"focus"})},[]),ue=u.useCallback(function(){z({type:"blur"})},[]),De=u.useCallback(function(){I||(QV()?setTimeout(me,0):me())},[I,me]),je=function(Re){return r?null:Re},Be=function(Re){return E?null:je(Re)},rt=function(Re){return O?null:je(Re)},Ue=function(Re){M&&Re.stopPropagation()},Ct=u.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,Oe=ve.onDragEnter,$e=ve.onDragOver,Rt=ve.onDragLeave,ke=ve.onDrop,ze=ih(ve,sW);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(Oe,ee)),onDragOver:rt(ss($e,se)),onDragLeave:rt(ss(Rt,re)),onDrop:rt(ss(ke,de)),role:typeof mt=="string"&&mt!==""?mt:"presentation"},st,G),!r&&!E?{tabIndex:0}:{}),ze)}},[G,ye,he,ue,De,ee,se,re,de,E,O,r]),Xe=u.useCallback(function(ve){ve.stopPropagation()},[]),tt=u.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,aW),ot=B1({accept:R,multiple:c,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,c,de,r]);return an(an({},X),{},{isFocused:K&&!r,getRootProps:Ct,getInputProps:tt,rootRef:G,inputRef:Y,open:je(me)})}function mW(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 yS(){}function V1(){return V1=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},V1.apply(this,arguments)}var HP=["shift","alt","meta","mod","ctrl"],gW={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(gW[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function vW(e){return HP.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!HP.includes(i)});return V1({},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&&WP([$a(e.key),$a(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){La.clear()})})();var La=new Set;function Bx(e){return Array.isArray(e)}function Tp(e,t){t===void 0&&(t=",");var n=Bx(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!vW(n)&&La.delete(n.toLowerCase())}),t.forEach(function(n){return La.add(n.toLowerCase())})}function WP(e){var t=Array.isArray(e)?e:[e];e==="meta"?La.clear():t.forEach(function(n){return La.delete(n.toLowerCase())})}function bW(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function xW(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function yW(e){return UP(e,["input","textarea","select"])}function UP(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return Bx(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function CW(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 wW=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,i=n.mod,c=n.shift,f=n.ctrl,p=n.keys,h=t.key,m=t.code,v=t.ctrlKey,b=t.metaKey,y=t.shiftKey,x=t.altKey,w=$a(m),k=h.toLowerCase();if(!r){if(o===!x&&k!=="alt"||c===!y&&k!=="shift")return!1;if(i){if(!b&&!v)return!1}else if(s===!b&&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},SW=u.createContext(void 0),kW=function(){return u.useContext(SW)};function GP(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&&GP(e[r],t[r])},!0):e===t}var _W=u.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),jW=function(){return u.useContext(_W)};function PW(e){var t=u.useRef(void 0);return GP(t.current,e)||(t.current=e),t.current}var CS=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},IW=typeof window<"u"?u.useLayoutEffect:u.useEffect;function Qe(e,t,n,r){var o=u.useRef(null),s=u.useRef(!1),i=n instanceof Array?r instanceof Array?void 0:r:n,c=Bx(e)?e.join(i==null?void 0:i.splitKey):e,f=n instanceof Array?n:r instanceof Array?r:void 0,p=u.useCallback(t,f??[]),h=u.useRef(p);f?h.current=p:h.current=t;var m=PW(i),v=jW(),b=v.enabledScopes,y=kW();return IW(function(){if(!((m==null?void 0:m.enabled)===!1||!CW(b,m==null?void 0:m.scopes))){var x=function(I,E){var O;if(E===void 0&&(E=!1),!(yW(I)&&!UP(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)){CS(I);return}(O=I.target)!=null&&O.isContentEditable&&!(m!=null&&m.enableOnContentEditable)||mv(c,m==null?void 0:m.splitKey).forEach(function(M){var D,A=gv(M,m==null?void 0:m.combinationKey);if(wW(I,A,m==null?void 0:m.ignoreModifiers)||(D=A.keys)!=null&&D.includes("*")){if(E&&s.current)return;if(bW(I,A,m==null?void 0:m.preventDefault),!xW(I,A,m==null?void 0:m.enabled)){CS(I);return}h.current(I,A),E||(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)&&x(I))},k=function(I){I.key!==void 0&&(WP($a(I.code)),s.current=!1,m!=null&&m.keyup&&x(I,!0))},_=o.current||(i==null?void 0:i.document)||document;return _.addEventListener("keyup",k),_.addEventListener("keydown",w),y&&mv(c,m==null?void 0:m.splitKey).forEach(function(j){return y.addHotkey(gv(j,m==null?void 0:m.combinationKey,m==null?void 0:m.description))}),function(){_.removeEventListener("keyup",k),_.removeEventListener("keydown",w),y&&mv(c,m==null?void 0:m.splitKey).forEach(function(j){return y.removeHotkey(gv(j,m==null?void 0:m.combinationKey,m==null?void 0:m.description))})}}},[c,m,b]),o}const EW=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($,{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($,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"full",height:"full",alignItems:"center",justifyContent:"center",p:4},children:a.jsx($,{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(ro,{size:"lg",children:"Drop to Upload"}):a.jsxs(a.Fragment,{children:[a.jsx(ro,{size:"lg",children:"Invalid Upload"}),a.jsx(ro,{size:"md",children:"Must be single JPEG or PNG image"})]})})})]})},OW=u.memo(EW),MW=ae([be,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),DW=e=>{const{children:t}=e,{autoAddBoardId:n,postUploadAction:r}=F(MW),o=F(Pn),s=Ji(),{t:i}=we(),[c,f]=u.useState(!1),[p]=Ij(),h=u.useCallback(j=>{f(!0),s({title:i("toast.uploadFailed"),description:j.errors.map(I=>I.message).join(`
|
||
`),status:"error"})},[i,s]),m=u.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=u.useCallback((j,I)=>{if(I.length>1){s({title:i("toast.uploadFailed"),description:i("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}I.forEach(E=>{h(E)}),j.forEach(E=>{m(E)})},[i,s,m,h]),{getRootProps:b,getInputProps:y,isDragAccept:x,isDragReject:w,isDragActive:k,inputRef:_}=Fx({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>f(!0),disabled:o,multiple:!1});return u.useEffect(()=>{const j=async I=>{var E,O;_.current&&(E=I.clipboardData)!=null&&E.files&&(_.current.files=I.clipboardData.files,(O=_.current)==null||O.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",j),()=>{document.removeEventListener("paste",j)}},[_]),a.jsxs(Ie,{...b({style:{}}),onKeyDown:j=>{j.key},children:[a.jsx("input",{...y()}),t,a.jsx(nr,{children:k&&c&&a.jsx(gn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(OW,{isDragAccept:x,isDragReject:w,setIsHandlingUpload:f})},"image-upload-overlay")})]})},RW=u.memo(DW),AW=Pe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...i}={},isChecked:c,...f}=e;return a.jsx(Dt,{label:r,placement:o,hasArrow:s,...i,children:a.jsx(vc,{ref:t,colorScheme:c?"accent":"base",...f,children:n})})}),it=u.memo(AW);function NW(e){const t=u.createContext(null);return[({children:o,value:s})=>H.createElement(t.Provider,{value:s},o),()=>{const o=u.useContext(t);if(o===null)throw new Error(e);return o}]}function KP(e){return Array.isArray(e)?e:[e]}const TW=()=>{};function $W(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||TW:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function qP({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 XP(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==H.Fragment:!1}function YP(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=YP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function QP(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=YP(t))&&(r&&(r+=" "),r+=n);return r}const LW={app:100,modal:200,popover:300,overlay:400,max:9999};function Hx(e){return LW[e]}function zW(e,t){const n=u.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 FW=T7({key:"mantine",prepend:!0});function BW(){return m5()||FW}var HW=Object.defineProperty,wS=Object.getOwnPropertySymbols,VW=Object.prototype.hasOwnProperty,WW=Object.prototype.propertyIsEnumerable,SS=(e,t,n)=>t in e?HW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UW=(e,t)=>{for(var n in t||(t={}))VW.call(t,n)&&SS(e,n,t[n]);if(wS)for(var n of wS(t))WW.call(t,n)&&SS(e,n,t[n]);return e};const vv="ref";function GW(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=UW({},n);return delete r[vv],{args:[r],ref:t}}const{cssFactory:KW}=(()=>{function e(n,r,o){const s=[],i=z7(n,s,o);return s.length<2?o:i+r(s)}function t(n){const{cache:r}=n,o=(...i)=>{const{ref:c,args:f}=GW(i),p=$7(f,r.registered);return L7(r,p,!1),`${r.key}-${p.name}${c===void 0?"":` ${c}`}`};return{css:o,cx:(...i)=>e(r.registered,o,QP(i))}}return{cssFactory:t}})();function ZP(){const e=BW();return zW(()=>KW({cache:e}),[e])}function qW({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const i=n.reduce((c,f)=>(Object.keys(f.classNames).forEach(p=>{typeof c[p]!="string"?c[p]=`${f.classNames[p]}`:c[p]=`${c[p]} ${f.classNames[p]}`}),c),{});return Object.keys(t).reduce((c,f)=>(c[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),c),{})}var XW=Object.defineProperty,kS=Object.getOwnPropertySymbols,YW=Object.prototype.hasOwnProperty,QW=Object.prototype.propertyIsEnumerable,_S=(e,t,n)=>t in e?XW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bv=(e,t)=>{for(var n in t||(t={}))YW.call(t,n)&&_S(e,n,t[n]);if(kS)for(var n of kS(t))QW.call(t,n)&&_S(e,n,t[n]);return e};function W1(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=bv(bv({},e[n]),t[n]):e[n]=bv({},t[n])}),e}function jS(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)=>W1(s,i),{}):o(e)}function ZW({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,i)=>(i.variants&&r in i.variants&&W1(s,i.variants[r](t,n,{variant:r,size:o})),i.sizes&&o in i.sizes&&W1(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=fN(o==null?void 0:o.name),c=m5(),f={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:p,cx:h}=ZP(),m=t(s,r,f),v=jS(o==null?void 0:o.styles,s,r,f),b=jS(i,s,r,f),y=ZW({ctx:i,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),x=Object.fromEntries(Object.keys(m).map(w=>{const k=h({[p(m[w])]:!(o!=null&&o.unstyled)},p(y[w]),p(b[w]),p(v[w]));return[w,k]}));return{classes:qW({cx:h,classes:x,context:i,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:c}),cx:h,theme:s}}return n}function PS(e){return`___ref-${e||""}`}var JW=Object.defineProperty,eU=Object.defineProperties,tU=Object.getOwnPropertyDescriptors,IS=Object.getOwnPropertySymbols,nU=Object.prototype.hasOwnProperty,rU=Object.prototype.propertyIsEnumerable,ES=(e,t,n)=>t in e?JW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cu=(e,t)=>{for(var n in t||(t={}))nU.call(t,n)&&ES(e,n,t[n]);if(IS)for(var n of IS(t))rU.call(t,n)&&ES(e,n,t[n]);return e},wu=(e,t)=>eU(e,tU(t));const Su={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${Me(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(-${Me(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(${Me(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(${Me(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Me(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 oU(e,t,n){const r=u.useRef();return u.useEffect(()=>{const o=s=>{const{target:i}=s??{};if(Array.isArray(n)){const c=(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))&&!c&&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 sU(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function aU(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function iU(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=u.useState(n?t:aU(e,t)),s=u.useRef();return u.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),sU(s.current,i=>o(i.matches))},[e]),r}const JP=typeof document<"u"?u.useLayoutEffect:u.useEffect;function $o(e,t){const n=u.useRef(!1);u.useEffect(()=>()=>{n.current=!1},[]),u.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function lU({opened:e,shouldReturnFocus:t=!0}){const n=u.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 cU=/input|select|textarea|button|object/,e6="a, input, select, textarea, button, object, [tabindex]";function uU(e){return e.style.display==="none"}function dU(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(uU(n))return!1;n=n.parentNode}return!0}function t6(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(t6(e));return(cU.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&dU(e)}function n6(e){const t=t6(e);return(Number.isNaN(t)||t>=0)&&U1(e)}function fU(e){return Array.from(e.querySelectorAll(e6)).filter(n6)}function pU(e,t){const n=fU(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 Vx(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function hU(e,t="body > :not(script)"){const n=Vx(),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"),c=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"):!c&&!f&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:c||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 mU(e=!0){const t=u.useRef(),n=u.useRef(null),r=s=>{let i=s.querySelector("[data-autofocus]");if(!i){const c=Array.from(s.querySelectorAll(e6));i=c.find(n6)||c.find(U1)||null,!i&&U1(s)&&(i=s)}i&&i.focus({preventScroll:!0})},o=u.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=hU(s),t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)}},[e]);return u.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=i=>{i.key==="Tab"&&t.current&&pU(t.current,i)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const gU=H["useId".toString()]||(()=>{});function vU(){const e=gU();return e?`mantine-${e.replace(/:/g,"")}`:""}function Wx(e){const t=vU(),[n,r]=u.useState(t);return JP(()=>{r(Vx())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function MS(e,t,n){u.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function r6(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function bU(...e){return t=>{e.forEach(n=>r6(n,t))}}function Ld(...e){return u.useCallback(bU(...e),e)}function od({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=u.useState(t!==void 0?t:n),i=c=>{s(c),r==null||r(c)};return e!==void 0?[e,r,!0]:[o,i,!1]}function o6(e,t){return iU("(prefers-reduced-motion: reduce)",e,t)}const xU=e=>e<.5?2*e*e:-1+(4-2*e)*e,yU=({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 b=m-o;return b<=p.height*(s?0:1)||!s?b:0}const v=i?f.height:window.innerHeight;if(r==="end"){const b=m+o-v+p.height;return b>=-p.height*(s?0:1)||!s?b: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 b=m-o;return b<=p.width||!s?b:0}const v=i?f.width:window.innerWidth;if(r==="end"){const b=m+o-v+p.width;return b>=-p.width||!s?b:0}return r==="center"?m-v/2+p.width/2:0}return 0},CU=({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]},wU=({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 s6({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=xU,offset:o=0,cancelable:s=!0,isList:i=!1}={}){const c=u.useRef(0),f=u.useRef(0),p=u.useRef(!1),h=u.useRef(null),m=u.useRef(null),v=o6(),b=()=>{c.current&&cancelAnimationFrame(c.current)},y=u.useCallback(({alignment:w="start"}={})=>{var k;p.current=!1,c.current&&b();const _=(k=CU({parent:h.current,axis:t}))!=null?k:0,j=yU({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 O=performance.now()-f.current,M=v||e===0?1:O/e,D=_+j*r(M);wU({parent:h.current,axis:t,distance:D}),!p.current&&M<1?c.current=requestAnimationFrame(I):(typeof n=="function"&&n(),f.current=0,c.current=0,b())}I()},[t,e,r,i,o,n,v]),x=()=>{s&&(p.current=!0)};return MS("wheel",x,{passive:!0}),MS("touchmove",x,{passive:!0}),u.useEffect(()=>b,[]),{scrollableRef:h,targetRef:m,scrollIntoView:y,cancel:b}}var DS=Object.getOwnPropertySymbols,SU=Object.prototype.hasOwnProperty,kU=Object.prototype.propertyIsEnumerable,_U=(e,t)=>{var n={};for(var r in e)SU.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&DS)for(var r of DS(e))t.indexOf(r)<0&&kU.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:c,mr:f,p,px:h,py:m,pt:v,pb:b,pl:y,pr:x,bg:w,c:k,opacity:_,ff:j,fz:I,fw:E,lts:O,ta:M,lh:D,fs:A,tt:R,td:T,w:q,miw:B,maw:G,h:Y,mih:V,mah:L,bgsz:X,bgp:z,bgr:K,bga:ne,pos:Q,top:ie,left:oe,bottom:W,right:U,inset:ee,display:se}=t,re=_U(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:pN({m:n,mx:r,my:o,mt:s,mb:i,ml:c,mr:f,p,px:h,py:m,pt:v,pb:b,pl:y,pr:x,bg:w,c:k,opacity:_,ff:j,fz:I,fw:E,lts:O,ta:M,lh:D,fs:A,tt:R,td:T,w:q,miw:B,maw:G,h:Y,mih:V,mah:L,bgsz:X,bgp:z,bgr:K,bga:ne,pos:Q,top:ie,left:oe,bottom:W,right:U,inset:ee,display:se}),rest:re}}function jU(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 PU({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return jU(e,t).reduce((i,c)=>{if(c==="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[c],t);return Array.isArray(r)?(i[t.fn.largerThan(c)]={},r.forEach(p=>{i[t.fn.largerThan(c)][p]=f}),i):(i[t.fn.largerThan(c)]={[r]:f},i)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,i)=>(s[i]=o,s),{}):{[r]:o}}function IU(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 EU(e){return Me(e)}function OU(e){return e}function MU(e,t){return ut({size:e,sizes:t.fontSizes})}const DU=["-xs","-sm","-md","-lg","-xl"];function RU(e,t){return DU.includes(e)?`calc(${ut({size:e.replace("-",""),sizes:t.spacing})} * -1)`:ut({size:e,sizes:t.spacing})}const AU={identity:OU,color:IU,size:EU,fontSize:MU,spacing:RU},NU={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 TU=Object.defineProperty,RS=Object.getOwnPropertySymbols,$U=Object.prototype.hasOwnProperty,LU=Object.prototype.propertyIsEnumerable,AS=(e,t,n)=>t in e?TU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NS=(e,t)=>{for(var n in t||(t={}))$U.call(t,n)&&AS(e,n,t[n]);if(RS)for(var n of RS(t))LU.call(t,n)&&AS(e,n,t[n]);return e};function TS(e,t,n=NU){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(PU({value:e[s],getValue:AU[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]=NS(NS({},o[i]),s[i]):o[i]=s[i]}),o),{})}function $S(e,t){return typeof e=="function"?e(t):e}function zU(e,t,n){const r=ca(),{css:o,cx:s}=ZP();return Array.isArray(e)?s(n,o(TS(t,r)),e.map(i=>o($S(i,r)))):s(n,o($S(e,r)),o(TS(t,r)))}var FU=Object.defineProperty,lh=Object.getOwnPropertySymbols,a6=Object.prototype.hasOwnProperty,i6=Object.prototype.propertyIsEnumerable,LS=(e,t,n)=>t in e?FU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BU=(e,t)=>{for(var n in t||(t={}))a6.call(t,n)&&LS(e,n,t[n]);if(lh)for(var n of lh(t))i6.call(t,n)&&LS(e,n,t[n]);return e},HU=(e,t)=>{var n={};for(var r in e)a6.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&&i6.call(e,r)&&(n[r]=e[r]);return n};const l6=u.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:i}=n,c=HU(n,["className","component","style","sx"]);const{systemStyles:f,rest:p}=Gm(c),h=o||"div";return H.createElement(h,BU({ref:t,className:zU(i,f,r),style:s},p))});l6.displayName="@mantine/core/Box";const Er=l6;var VU=Object.defineProperty,WU=Object.defineProperties,UU=Object.getOwnPropertyDescriptors,zS=Object.getOwnPropertySymbols,GU=Object.prototype.hasOwnProperty,KU=Object.prototype.propertyIsEnumerable,FS=(e,t,n)=>t in e?VU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BS=(e,t)=>{for(var n in t||(t={}))GU.call(t,n)&&FS(e,n,t[n]);if(zS)for(var n of zS(t))KU.call(t,n)&&FS(e,n,t[n]);return e},qU=(e,t)=>WU(e,UU(t)),XU=or(e=>({root:qU(BS(BS({},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 YU=XU;var QU=Object.defineProperty,ch=Object.getOwnPropertySymbols,c6=Object.prototype.hasOwnProperty,u6=Object.prototype.propertyIsEnumerable,HS=(e,t,n)=>t in e?QU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZU=(e,t)=>{for(var n in t||(t={}))c6.call(t,n)&&HS(e,n,t[n]);if(ch)for(var n of ch(t))u6.call(t,n)&&HS(e,n,t[n]);return e},JU=(e,t)=>{var n={};for(var r in e)c6.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&&u6.call(e,r)&&(n[r]=e[r]);return n};const d6=u.forwardRef((e,t)=>{const n=Sn("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:i}=n,c=JU(n,["className","component","unstyled","variant"]),{classes:f,cx:p}=YU(null,{name:"UnstyledButton",unstyled:s,variant:i});return H.createElement(Er,ZU({component:o,ref:t,className:p(f.root,r),type:o==="button"?"button":void 0},c))});d6.displayName="@mantine/core/UnstyledButton";const eG=d6;var tG=Object.defineProperty,nG=Object.defineProperties,rG=Object.getOwnPropertyDescriptors,VS=Object.getOwnPropertySymbols,oG=Object.prototype.hasOwnProperty,sG=Object.prototype.propertyIsEnumerable,WS=(e,t,n)=>t in e?tG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G1=(e,t)=>{for(var n in t||(t={}))oG.call(t,n)&&WS(e,n,t[n]);if(VS)for(var n of VS(t))sG.call(t,n)&&WS(e,n,t[n]);return e},US=(e,t)=>nG(e,rG(t));const aG=["subtle","filled","outline","light","default","transparent","gradient"],tp={xs:Me(18),sm:Me(22),md:Me(28),lg:Me(34),xl:Me(44)};function iG({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%"})}:aG.includes(e)?G1({border:`${Me(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var lG=or((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:US(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})},iG({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":US(G1({content:'""'},e.fn.cover(Me(-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 cG=lG;var uG=Object.defineProperty,uh=Object.getOwnPropertySymbols,f6=Object.prototype.hasOwnProperty,p6=Object.prototype.propertyIsEnumerable,GS=(e,t,n)=>t in e?uG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KS=(e,t)=>{for(var n in t||(t={}))f6.call(t,n)&&GS(e,n,t[n]);if(uh)for(var n of uh(t))p6.call(t,n)&&GS(e,n,t[n]);return e},qS=(e,t)=>{var n={};for(var r in e)f6.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&&p6.call(e,r)&&(n[r]=e[r]);return n};function dG(e){var t=e,{size:n,color:r}=t,o=qS(t,["size","color"]);const s=o,{style:i}=s,c=qS(s,["style"]);return H.createElement("svg",KS({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,style:KS({width:n},i)},c),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 fG=Object.defineProperty,dh=Object.getOwnPropertySymbols,h6=Object.prototype.hasOwnProperty,m6=Object.prototype.propertyIsEnumerable,XS=(e,t,n)=>t in e?fG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YS=(e,t)=>{for(var n in t||(t={}))h6.call(t,n)&&XS(e,n,t[n]);if(dh)for(var n of dh(t))m6.call(t,n)&&XS(e,n,t[n]);return e},QS=(e,t)=>{var n={};for(var r in e)h6.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&&m6.call(e,r)&&(n[r]=e[r]);return n};function pG(e){var t=e,{size:n,color:r}=t,o=QS(t,["size","color"]);const s=o,{style:i}=s,c=QS(s,["style"]);return H.createElement("svg",YS({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r,style:YS({width:n,height:n},i)},c),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 hG=Object.defineProperty,fh=Object.getOwnPropertySymbols,g6=Object.prototype.hasOwnProperty,v6=Object.prototype.propertyIsEnumerable,ZS=(e,t,n)=>t in e?hG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JS=(e,t)=>{for(var n in t||(t={}))g6.call(t,n)&&ZS(e,n,t[n]);if(fh)for(var n of fh(t))v6.call(t,n)&&ZS(e,n,t[n]);return e},e4=(e,t)=>{var n={};for(var r in e)g6.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&&v6.call(e,r)&&(n[r]=e[r]);return n};function mG(e){var t=e,{size:n,color:r}=t,o=e4(t,["size","color"]);const s=o,{style:i}=s,c=e4(s,["style"]);return H.createElement("svg",JS({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,style:JS({width:n},i)},c),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 gG=Object.defineProperty,ph=Object.getOwnPropertySymbols,b6=Object.prototype.hasOwnProperty,x6=Object.prototype.propertyIsEnumerable,t4=(e,t,n)=>t in e?gG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vG=(e,t)=>{for(var n in t||(t={}))b6.call(t,n)&&t4(e,n,t[n]);if(ph)for(var n of ph(t))x6.call(t,n)&&t4(e,n,t[n]);return e},bG=(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&&x6.call(e,r)&&(n[r]=e[r]);return n};const xv={bars:dG,oval:pG,dots:mG},xG={xs:Me(18),sm:Me(22),md:Me(36),lg:Me(44),xl:Me(58)},yG={size:"md"};function y6(e){const t=Sn("Loader",yG,e),{size:n,color:r,variant:o}=t,s=bG(t,["size","color","variant"]),i=ca(),c=o in xv?o:i.loader;return H.createElement(Er,vG({role:"presentation",component:xv[c]||xv.bars,size:ut({size:n,sizes:xG}),color:i.fn.variant({variant:"filled",primaryFallback:!1,color:r||i.primaryColor}).background},s))}y6.displayName="@mantine/core/Loader";var CG=Object.defineProperty,hh=Object.getOwnPropertySymbols,C6=Object.prototype.hasOwnProperty,w6=Object.prototype.propertyIsEnumerable,n4=(e,t,n)=>t in e?CG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,r4=(e,t)=>{for(var n in t||(t={}))C6.call(t,n)&&n4(e,n,t[n]);if(hh)for(var n of hh(t))w6.call(t,n)&&n4(e,n,t[n]);return e},wG=(e,t)=>{var n={};for(var r in e)C6.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&&w6.call(e,r)&&(n[r]=e[r]);return n};const SG={color:"gray",size:"md",variant:"subtle"},S6=u.forwardRef((e,t)=>{const n=Sn("ActionIcon",SG,e),{className:r,color:o,children:s,radius:i,size:c,variant:f,gradient:p,disabled:h,loaderProps:m,loading:v,unstyled:b,__staticSelector:y}=n,x=wG(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:w,cx:k,theme:_}=cG({radius:i,color:o,gradient:p},{name:["ActionIcon",y],unstyled:b,size:c,variant:f}),j=H.createElement(y6,r4({color:_.fn.variant({color:o,variant:f}).color,size:"100%","data-action-icon-loader":!0},m));return H.createElement(eG,r4({className:k(w.root,r),ref:t,disabled:h,"data-disabled":h||void 0,"data-loading":v||void 0,unstyled:b},x),v?j:s)});S6.displayName="@mantine/core/ActionIcon";const kG=S6;var _G=Object.defineProperty,jG=Object.defineProperties,PG=Object.getOwnPropertyDescriptors,mh=Object.getOwnPropertySymbols,k6=Object.prototype.hasOwnProperty,_6=Object.prototype.propertyIsEnumerable,o4=(e,t,n)=>t in e?_G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IG=(e,t)=>{for(var n in t||(t={}))k6.call(t,n)&&o4(e,n,t[n]);if(mh)for(var n of mh(t))_6.call(t,n)&&o4(e,n,t[n]);return e},EG=(e,t)=>jG(e,PG(t)),OG=(e,t)=>{var n={};for(var r in e)k6.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&&_6.call(e,r)&&(n[r]=e[r]);return n};function j6(e){const t=Sn("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,i=OG(t,["children","target","className","innerRef"]),c=ca(),[f,p]=u.useState(!1),h=u.useRef();return JP(()=>(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?oo.createPortal(H.createElement("div",EG(IG({className:o,dir:c.dir},i),{ref:s}),n),h.current):null}j6.displayName="@mantine/core/Portal";var MG=Object.defineProperty,gh=Object.getOwnPropertySymbols,P6=Object.prototype.hasOwnProperty,I6=Object.prototype.propertyIsEnumerable,s4=(e,t,n)=>t in e?MG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DG=(e,t)=>{for(var n in t||(t={}))P6.call(t,n)&&s4(e,n,t[n]);if(gh)for(var n of gh(t))I6.call(t,n)&&s4(e,n,t[n]);return e},RG=(e,t)=>{var n={};for(var r in e)P6.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&&I6.call(e,r)&&(n[r]=e[r]);return n};function E6(e){var t=e,{withinPortal:n=!0,children:r}=t,o=RG(t,["withinPortal","children"]);return n?H.createElement(j6,DG({},o),r):H.createElement(H.Fragment,null,r)}E6.displayName="@mantine/core/OptionalPortal";var AG=Object.defineProperty,vh=Object.getOwnPropertySymbols,O6=Object.prototype.hasOwnProperty,M6=Object.prototype.propertyIsEnumerable,a4=(e,t,n)=>t in e?AG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,i4=(e,t)=>{for(var n in t||(t={}))O6.call(t,n)&&a4(e,n,t[n]);if(vh)for(var n of vh(t))M6.call(t,n)&&a4(e,n,t[n]);return e},NG=(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&&M6.call(e,r)&&(n[r]=e[r]);return n};function D6(e){const t=e,{width:n,height:r,style:o}=t,s=NG(t,["width","height","style"]);return H.createElement("svg",i4({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:i4({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"}))}D6.displayName="@mantine/core/CloseIcon";var TG=Object.defineProperty,bh=Object.getOwnPropertySymbols,R6=Object.prototype.hasOwnProperty,A6=Object.prototype.propertyIsEnumerable,l4=(e,t,n)=>t in e?TG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$G=(e,t)=>{for(var n in t||(t={}))R6.call(t,n)&&l4(e,n,t[n]);if(bh)for(var n of bh(t))A6.call(t,n)&&l4(e,n,t[n]);return e},LG=(e,t)=>{var n={};for(var r in e)R6.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&&A6.call(e,r)&&(n[r]=e[r]);return n};const zG={xs:Me(12),sm:Me(16),md:Me(20),lg:Me(28),xl:Me(34)},FG={size:"sm"},N6=u.forwardRef((e,t)=>{const n=Sn("CloseButton",FG,e),{iconSize:r,size:o,children:s}=n,i=LG(n,["iconSize","size","children"]),c=Me(r||zG[o]);return H.createElement(kG,$G({ref:t,__staticSelector:"CloseButton",size:o},i),s||H.createElement(D6,{width:c,height:c}))});N6.displayName="@mantine/core/CloseButton";const T6=N6;var BG=Object.defineProperty,HG=Object.defineProperties,VG=Object.getOwnPropertyDescriptors,c4=Object.getOwnPropertySymbols,WG=Object.prototype.hasOwnProperty,UG=Object.prototype.propertyIsEnumerable,u4=(e,t,n)=>t in e?BG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,np=(e,t)=>{for(var n in t||(t={}))WG.call(t,n)&&u4(e,n,t[n]);if(c4)for(var n of c4(t))UG.call(t,n)&&u4(e,n,t[n]);return e},GG=(e,t)=>HG(e,VG(t));function KG({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function qG({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 XG(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function YG({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 QG=or((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:i,gradient:c,weight:f,transform:p,align:h,strikethrough:m,italic:v},{size:b})=>{const y=e.fn.variant({variant:"gradient",gradient:c});return{root:GG(np(np(np(np({},e.fn.fontStyles()),e.fn.focusStyles()),XG(n)),YG({theme:e,truncate:r})),{color:qG({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||b===void 0?"inherit":ut({size:b,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:KG({underline:i,strikethrough:m}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":f,textTransform:p,textAlign:h,fontStyle:v?"italic":void 0}),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const ZG=QG;var JG=Object.defineProperty,xh=Object.getOwnPropertySymbols,$6=Object.prototype.hasOwnProperty,L6=Object.prototype.propertyIsEnumerable,d4=(e,t,n)=>t in e?JG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eK=(e,t)=>{for(var n in t||(t={}))$6.call(t,n)&&d4(e,n,t[n]);if(xh)for(var n of xh(t))L6.call(t,n)&&d4(e,n,t[n]);return e},tK=(e,t)=>{var n={};for(var r in e)$6.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&&L6.call(e,r)&&(n[r]=e[r]);return n};const nK={variant:"text"},z6=u.forwardRef((e,t)=>{const n=Sn("Text",nK,e),{className:r,size:o,weight:s,transform:i,color:c,align:f,variant:p,lineClamp:h,truncate:m,gradient:v,inline:b,inherit:y,underline:x,strikethrough:w,italic:k,classNames:_,styles:j,unstyled:I,span:E,__staticSelector:O}=n,M=tK(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}=ZG({color:c,lineClamp:h,truncate:m,inline:b,inherit:y,underline:x,strikethrough:w,italic:k,weight:s,transform:i,align:f,gradient:v},{unstyled:I,name:O||"Text",variant:p,size:o});return H.createElement(Er,eK({ref:t,className:A(D.root,{[D.gradient]:p==="gradient"},r),component:E?"span":"div"},M))});z6.displayName="@mantine/core/Text";const Sc=z6,rp={xs:Me(1),sm:Me(2),md:Me(3),lg:Me(4),xl:Me(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 rK=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:Me(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:Me(ut({size:n,sizes:rp})),borderTopColor:op(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:Me(ut({size:n,sizes:rp})),borderLeftColor:op(e,t),borderLeftStyle:r}}));const oK=rK;var sK=Object.defineProperty,aK=Object.defineProperties,iK=Object.getOwnPropertyDescriptors,yh=Object.getOwnPropertySymbols,F6=Object.prototype.hasOwnProperty,B6=Object.prototype.propertyIsEnumerable,f4=(e,t,n)=>t in e?sK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p4=(e,t)=>{for(var n in t||(t={}))F6.call(t,n)&&f4(e,n,t[n]);if(yh)for(var n of yh(t))B6.call(t,n)&&f4(e,n,t[n]);return e},lK=(e,t)=>aK(e,iK(t)),cK=(e,t)=>{var n={};for(var r in e)F6.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&&B6.call(e,r)&&(n[r]=e[r]);return n};const uK={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},K1=u.forwardRef((e,t)=>{const n=Sn("Divider",uK,e),{className:r,color:o,orientation:s,size:i,label:c,labelPosition:f,labelProps:p,variant:h,styles:m,classNames:v,unstyled:b}=n,y=cK(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:x,cx:w}=oK({color:o},{classNames:v,styles:m,unstyled:b,name:"Divider",variant:h,size:i}),k=s==="vertical",_=s==="horizontal",j=!!c&&_,I=!(p!=null&&p.color);return H.createElement(Er,p4({ref:t,className:w(x.root,{[x.vertical]:k,[x.horizontal]:_,[x.withLabel]:j},r),role:"separator"},y),j&&H.createElement(Sc,lK(p4({},p),{size:(p==null?void 0:p.size)||"xs",mt:Me(2),className:w(x.label,x[f],{[x.labelDefaultStyles]:I})}),c))});K1.displayName="@mantine/core/Divider";var dK=Object.defineProperty,fK=Object.defineProperties,pK=Object.getOwnPropertyDescriptors,h4=Object.getOwnPropertySymbols,hK=Object.prototype.hasOwnProperty,mK=Object.prototype.propertyIsEnumerable,m4=(e,t,n)=>t in e?dK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g4=(e,t)=>{for(var n in t||(t={}))hK.call(t,n)&&m4(e,n,t[n]);if(h4)for(var n of h4(t))mK.call(t,n)&&m4(e,n,t[n]);return e},gK=(e,t)=>fK(e,pK(t)),vK=or((e,t,{size:n})=>({item:gK(g4({},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]":g4({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 bK=vK;var xK=Object.defineProperty,v4=Object.getOwnPropertySymbols,yK=Object.prototype.hasOwnProperty,CK=Object.prototype.propertyIsEnumerable,b4=(e,t,n)=>t in e?xK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wK=(e,t)=>{for(var n in t||(t={}))yK.call(t,n)&&b4(e,n,t[n]);if(v4)for(var n of v4(t))CK.call(t,n)&&b4(e,n,t[n]);return e};function Ux({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:i,onItemHover:c,onItemSelect:f,itemsRefs:p,itemComponent:h,size:m,nothingFound:v,creatable:b,createLabel:y,unstyled:x,variant:w}){const{classes:k}=bK(null,{classNames:n,styles:r,unstyled:x,name:i,variant:w,size:m}),_=[],j=[];let I=null;const E=(M,D)=>{const A=typeof o=="function"?o(M.value):!1;return H.createElement(h,wK({key:M.value,className:k.item,"data-disabled":M.disabled||void 0,"data-hovered":!M.disabled&&t===D||void 0,"data-selected":!M.disabled&&A||void 0,selected:A,onMouseEnter:()=>c(D),id:`${s}-${D}`,role:"option",tabIndex:-1,"aria-selected":t===D,ref:R=>{p&&p.current&&(p.current[M.value]=R)},onMouseDown:M.disabled?null:R=>{R.preventDefault(),f(M)},disabled:M.disabled,variant:w},M))};let O=null;if(e.forEach((M,D)=>{M.creatable?I=D:M.group?(O!==M.group&&(O=M.group,j.push(H.createElement("div",{className:k.separator,key:`__mantine-divider-${D}`},H.createElement(K1,{classNames:{label:k.separatorLabel},label:M.group})))),j.push(E(M,D))):_.push(E(M,D))}),b){const M=e[I];_.push(H.createElement("div",{key:Vx(),className:k.item,"data-hovered":t===I||void 0,onMouseEnter:()=>c(I),onMouseDown:D=>{D.preventDefault(),f(M)},tabIndex:-1,ref:D=>{p&&p.current&&(p.current[M.value]=D)}},y))}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(Sc,{size:m,unstyled:x,className:k.nothingFound},v)}Ux.displayName="@mantine/core/SelectItems";var SK=Object.defineProperty,Ch=Object.getOwnPropertySymbols,H6=Object.prototype.hasOwnProperty,V6=Object.prototype.propertyIsEnumerable,x4=(e,t,n)=>t in e?SK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kK=(e,t)=>{for(var n in t||(t={}))H6.call(t,n)&&x4(e,n,t[n]);if(Ch)for(var n of Ch(t))V6.call(t,n)&&x4(e,n,t[n]);return e},_K=(e,t)=>{var n={};for(var r in e)H6.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 Gx=u.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=_K(n,["label","value"]);return H.createElement("div",kK({ref:t},s),r||o)});Gx.displayName="@mantine/core/DefaultItem";function jK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function W6(...e){return t=>e.forEach(n=>jK(n,t))}function el(...e){return u.useCallback(W6(...e),e)}const U6=u.forwardRef((e,t)=>{const{children:n,...r}=e,o=u.Children.toArray(n),s=o.find(IK);if(s){const i=s.props.children,c=o.map(f=>f===s?u.Children.count(i)>1?u.Children.only(null):u.isValidElement(i)?i.props.children:null:f);return u.createElement(q1,nn({},r,{ref:t}),u.isValidElement(i)?u.cloneElement(i,void 0,c):null)}return u.createElement(q1,nn({},r,{ref:t}),n)});U6.displayName="Slot";const q1=u.forwardRef((e,t)=>{const{children:n,...r}=e;return u.isValidElement(n)?u.cloneElement(n,{...EK(r,n.props),ref:W6(t,n.ref)}):u.Children.count(n)>1?u.Children.only(null):null});q1.displayName="SlotClone";const PK=({children:e})=>u.createElement(u.Fragment,null,e);function IK(e){return u.isValidElement(e)&&e.type===PK}function EK(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]=(...c)=>{s(...c),o(...c)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}const OK=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],zd=OK.reduce((e,t)=>{const n=u.forwardRef((r,o)=>{const{asChild:s,...i}=r,c=s?U6:t;return u.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),u.createElement(c,nn({},i,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),X1=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{};function MK(e,t){return u.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Fd=e=>{const{present:t,children:n}=e,r=DK(t),o=typeof n=="function"?n({present:r.isPresent}):u.Children.only(n),s=el(r.ref,o.ref);return typeof n=="function"||r.isPresent?u.cloneElement(o,{ref:s}):null};Fd.displayName="Presence";function DK(e){const[t,n]=u.useState(),r=u.useRef({}),o=u.useRef(e),s=u.useRef("none"),i=e?"mounted":"unmounted",[c,f]=MK(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const p=sp(r.current);s.current=c==="mounted"?p:"none"},[c]),X1(()=>{const p=r.current,h=o.current;if(h!==e){const v=s.current,b=sp(p);e?f("MOUNT"):b==="none"||(p==null?void 0:p.display)==="none"?f("UNMOUNT"):f(h&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),X1(()=>{if(t){const p=m=>{const b=sp(r.current).includes(m.animationName);m.target===t&&b&&oo.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(c),ref:u.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function sp(e){return(e==null?void 0:e.animationName)||"none"}function RK(e,t=[]){let n=[];function r(s,i){const c=u.createContext(i),f=n.length;n=[...n,i];function p(m){const{scope:v,children:b,...y}=m,x=(v==null?void 0:v[e][f])||c,w=u.useMemo(()=>y,Object.values(y));return u.createElement(x.Provider,{value:w},b)}function h(m,v){const b=(v==null?void 0:v[e][f])||c,y=u.useContext(b);if(y)return y;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=>u.createContext(i));return function(c){const f=(c==null?void 0:c[e])||s;return u.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return o.scopeName=e,[r,AK(o,...t)]}function AK(...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((c,{useScope:f,scopeName:p})=>{const m=f(s)[`__scope${p}`];return{...c,...m}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function yi(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const NK=u.createContext(void 0);function TK(e){const t=u.useContext(NK);return e||t||"ltr"}function $K(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 LK(e,t){return u.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const G6="ScrollArea",[K6,s0e]=RK(G6),[zK,vo]=K6(G6),FK=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[c,f]=u.useState(null),[p,h]=u.useState(null),[m,v]=u.useState(null),[b,y]=u.useState(null),[x,w]=u.useState(null),[k,_]=u.useState(0),[j,I]=u.useState(0),[E,O]=u.useState(!1),[M,D]=u.useState(!1),A=el(t,T=>f(T)),R=TK(o);return u.createElement(zK,{scope:n,type:r,dir:R,scrollHideDelay:s,scrollArea:c,viewport:p,onViewportChange:h,content:m,onContentChange:v,scrollbarX:b,onScrollbarXChange:y,scrollbarXEnabled:E,onScrollbarXEnabledChange:O,scrollbarY:x,onScrollbarYChange:w,scrollbarYEnabled:M,onScrollbarYEnabledChange:D,onCornerWidthChange:_,onCornerHeightChange:I},u.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}})))}),BK="ScrollAreaViewport",HK=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=vo(BK,n),i=u.useRef(null),c=el(t,i,s.onViewportChange);return u.createElement(u.Fragment,null,u.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}"}}),u.createElement(zd.div,nn({"data-radix-scroll-area-viewport":""},o,{ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),u.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),da="ScrollAreaScrollbar",VK=u.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=vo(da,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,c=e.orientation==="horizontal";return u.useEffect(()=>(c?s(!0):i(!0),()=>{c?s(!1):i(!1)}),[c,s,i]),o.type==="hover"?u.createElement(WK,nn({},r,{ref:t,forceMount:n})):o.type==="scroll"?u.createElement(UK,nn({},r,{ref:t,forceMount:n})):o.type==="auto"?u.createElement(q6,nn({},r,{ref:t,forceMount:n})):o.type==="always"?u.createElement(Kx,nn({},r,{ref:t})):null}),WK=u.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=vo(da,e.__scopeScrollArea),[s,i]=u.useState(!1);return u.useEffect(()=>{const c=o.scrollArea;let f=0;if(c){const p=()=>{window.clearTimeout(f),i(!0)},h=()=>{f=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",p),c.addEventListener("pointerleave",h),()=>{window.clearTimeout(f),c.removeEventListener("pointerenter",p),c.removeEventListener("pointerleave",h)}}},[o.scrollArea,o.scrollHideDelay]),u.createElement(Fd,{present:n||s},u.createElement(q6,nn({"data-state":s?"visible":"hidden"},r,{ref:t})))}),UK=u.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=vo(da,e.__scopeScrollArea),s=e.orientation==="horizontal",i=qm(()=>f("SCROLL_END"),100),[c,f]=LK("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 u.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,o.scrollHideDelay,f]),u.useEffect(()=>{const p=o.viewport,h=s?"scrollLeft":"scrollTop";if(p){let m=p[h];const v=()=>{const b=p[h];m!==b&&(f("SCROLL"),i()),m=b};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[o.viewport,s,f,i]),u.createElement(Fd,{present:n||c!=="hidden"},u.createElement(Kx,nn({"data-state":c==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Pi(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Pi(e.onPointerLeave,()=>f("POINTER_LEAVE"))})))}),q6=u.forwardRef((e,t)=>{const n=vo(da,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=u.useState(!1),c=e.orientation==="horizontal",f=qm(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;i(c?p:h)}},10);return kc(n.viewport,f),kc(n.content,f),u.createElement(Fd,{present:r||s},u.createElement(Kx,nn({"data-state":s?"visible":"hidden"},o,{ref:t})))}),Kx=u.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=vo(da,e.__scopeScrollArea),s=u.useRef(null),i=u.useRef(0),[c,f]=u.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=Z6(c.viewport,c.content),h={...r,sizes:c,onSizesChange:f,hasThumb:p>0&&p<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:v=>i.current=v};function m(v,b){return JK(v,i.current,c,b)}return n==="horizontal"?u.createElement(GK,nn({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollLeft,b=y4(v,c,o.dir);s.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollLeft=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollLeft=m(v,o.dir))}})):n==="vertical"?u.createElement(KK,nn({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollTop,b=y4(v,c);s.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollTop=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollTop=m(v))}})):null}),GK=u.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=vo(da,e.__scopeScrollArea),[i,c]=u.useState(),f=u.useRef(null),p=el(t,f,s.onScrollbarXChange);return u.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),u.createElement(Y6,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),eI(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)}})}}))}),KK=u.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=vo(da,e.__scopeScrollArea),[i,c]=u.useState(),f=u.useRef(null),p=el(t,f,s.onScrollbarYChange);return u.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),u.createElement(Y6,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),eI(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)}})}}))}),[qK,X6]=K6(da),Y6=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:f,onDragScroll:p,onWheelScroll:h,onResize:m,...v}=e,b=vo(da,n),[y,x]=u.useState(null),w=el(t,A=>x(A)),k=u.useRef(null),_=u.useRef(""),j=b.viewport,I=r.content-r.viewport,E=yi(h),O=yi(f),M=qm(m,10);function D(A){if(k.current){const R=A.clientX-k.current.left,T=A.clientY-k.current.top;p({x:R,y:T})}}return u.useEffect(()=>{const A=R=>{const T=R.target;(y==null?void 0:y.contains(T))&&E(R,I)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[j,y,I,E]),u.useEffect(O,[r,O]),kc(y,M),kc(b.content,M),u.createElement(qK,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:yi(s),onThumbPointerUp:yi(i),onThumbPositionChange:O,onThumbPointerDown:yi(c)},u.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=y.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",XK=u.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=X6(Y1,e.__scopeScrollArea);return u.createElement(Fd,{present:n||o.hasThumb},u.createElement(YK,nn({ref:t},r)))}),YK=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=vo(Y1,n),i=X6(Y1,n),{onThumbPositionChange:c}=i,f=el(t,m=>i.onThumbChange(m)),p=u.useRef(),h=qm(()=>{p.current&&(p.current(),p.current=void 0)},100);return u.useEffect(()=>{const m=s.viewport;if(m){const v=()=>{if(h(),!p.current){const b=eq(m,c);p.current=b,c()}};return c(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[s.viewport,h,c]),u.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 b=m.target.getBoundingClientRect(),y=m.clientX-b.left,x=m.clientY-b.top;i.onThumbPointerDown({x:y,y:x})}),onPointerUp:Pi(e.onPointerUp,i.onThumbPointerUp)}))}),Q6="ScrollAreaCorner",QK=u.forwardRef((e,t)=>{const n=vo(Q6,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?u.createElement(ZK,nn({},e,{ref:t})):null}),ZK=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=vo(Q6,n),[s,i]=u.useState(0),[c,f]=u.useState(0),p=!!(s&&c);return kc(o.scrollbarX,()=>{var h;const m=((h=o.scrollbarX)===null||h===void 0?void 0:h.offsetHeight)||0;o.onCornerHeightChange(m),f(m)}),kc(o.scrollbarY,()=>{var h;const m=((h=o.scrollbarY)===null||h===void 0?void 0:h.offsetWidth)||0;o.onCornerWidthChange(m),i(m)}),p?u.createElement(zd.div,nn({},r,{ref:t,style:{width:s,height:c,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 Z6(e,t){const n=e/t;return isNaN(n)?0:n}function Km(e){const t=Z6(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function JK(e,t,n,r="ltr"){const o=Km(n),s=o/2,i=t||s,c=o-i,f=n.scrollbar.paddingStart+i,p=n.scrollbar.size-n.scrollbar.paddingEnd-c,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return J6([f,p],m)(e)}function y4(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,c=s-r,f=n==="ltr"?[0,i]:[i*-1,0],p=$K(e,f);return J6([0,i],[0,c])(p)}function J6(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 eI(e,t){return e>0&&e<t}const eq=(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,c=n.top!==s.top;(i||c)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function qm(e,t){const n=yi(e),r=u.useRef(0);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),u.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function kc(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 tq=FK,nq=HK,C4=VK,w4=XK,rq=QK;var oq=or((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?Me(t):void 0,paddingBottom:n?Me(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${Me(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${PS("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:Me(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:Me(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:PS("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:Me(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:Me(44),minHeight:Me(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 sq=oq;var aq=Object.defineProperty,iq=Object.defineProperties,lq=Object.getOwnPropertyDescriptors,Sh=Object.getOwnPropertySymbols,tI=Object.prototype.hasOwnProperty,nI=Object.prototype.propertyIsEnumerable,S4=(e,t,n)=>t in e?aq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q1=(e,t)=>{for(var n in t||(t={}))tI.call(t,n)&&S4(e,n,t[n]);if(Sh)for(var n of Sh(t))nI.call(t,n)&&S4(e,n,t[n]);return e},rI=(e,t)=>iq(e,lq(t)),oI=(e,t)=>{var n={};for(var r in e)tI.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&&nI.call(e,r)&&(n[r]=e[r]);return n};const sI={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},Xm=u.forwardRef((e,t)=>{const n=Sn("ScrollArea",sI,e),{children:r,className:o,classNames:s,styles:i,scrollbarSize:c,scrollHideDelay:f,type:p,dir:h,offsetScrollbars:m,viewportRef:v,onScrollPositionChange:b,unstyled:y,variant:x,viewportProps:w}=n,k=oI(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[_,j]=u.useState(!1),I=ca(),{classes:E,cx:O}=sq({scrollbarSize:c,offsetScrollbars:m,scrollbarHovered:_,hidden:p==="never"},{name:"ScrollArea",classNames:s,styles:i,unstyled:y,variant:x});return H.createElement(tq,{type:p==="never"?"always":p,scrollHideDelay:f,dir:h||I.dir,ref:t,asChild:!0},H.createElement(Er,Q1({className:O(E.root,o)},k),H.createElement(nq,rI(Q1({},w),{className:E.viewport,ref:v,onScroll:typeof b=="function"?({currentTarget:M})=>b({x:M.scrollLeft,y:M.scrollTop}):void 0}),r),H.createElement(C4,{orientation:"horizontal",className:E.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(w4,{className:E.thumb})),H.createElement(C4,{orientation:"vertical",className:E.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(w4,{className:E.thumb})),H.createElement(rq,{className:E.corner})))}),aI=u.forwardRef((e,t)=>{const n=Sn("ScrollAreaAutosize",sI,e),{children:r,classNames:o,styles:s,scrollbarSize:i,scrollHideDelay:c,type:f,dir:p,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:b,sx:y,variant:x,viewportProps:w}=n,k=oI(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return H.createElement(Er,rI(Q1({},k),{ref:t,sx:[{display:"flex"},...KP(y)]}),H.createElement(Er,{sx:{display:"flex",flexDirection:"column",flex:1}},H.createElement(Xm,{classNames:o,styles:s,scrollHideDelay:c,scrollbarSize:i,type:f,dir:p,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:b,variant:x,viewportProps:w},r)))});aI.displayName="@mantine/core/ScrollAreaAutosize";Xm.displayName="@mantine/core/ScrollArea";Xm.Autosize=aI;const iI=Xm;var cq=Object.defineProperty,uq=Object.defineProperties,dq=Object.getOwnPropertyDescriptors,kh=Object.getOwnPropertySymbols,lI=Object.prototype.hasOwnProperty,cI=Object.prototype.propertyIsEnumerable,k4=(e,t,n)=>t in e?cq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_4=(e,t)=>{for(var n in t||(t={}))lI.call(t,n)&&k4(e,n,t[n]);if(kh)for(var n of kh(t))cI.call(t,n)&&k4(e,n,t[n]);return e},fq=(e,t)=>uq(e,dq(t)),pq=(e,t)=>{var n={};for(var r in e)lI.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&&cI.call(e,r)&&(n[r]=e[r]);return n};const Ym=u.forwardRef((e,t)=>{var n=e,{style:r}=n,o=pq(n,["style"]);return H.createElement(iI,fq(_4({},o),{style:_4({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});Ym.displayName="@mantine/core/SelectScrollArea";var hq=or(()=>({dropdown:{},itemsWrapper:{padding:Me(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const mq=hq;function Fc(e){return e.split("-")[1]}function qx(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 j4(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,c=ti(t),f=qx(c),p=r[f]/2-o[f]/2,h=c==="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[c]-=p*(n&&h?-1:1);break;case"end":m[c]+=p*(n&&h?-1:1)}return m}const gq=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=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}=j4(p,r,f),v=r,b={},y=0;for(let x=0;x<c.length;x++){const{name:w,fn:k}=c[x],{x:_,y:j,data:I,reset:E}=await k({x:h,y:m,initialPlacement:r,placement:v,strategy:o,middlewareData:b,rects:p,platform:i,elements:{reference:e,floating:t}});h=_??h,m=j??m,b={...b,[w]:{...b[w],...I}},E&&y<=50&&(y++,typeof E=="object"&&(E.placement&&(v=E.placement),E.rects&&(p=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:h,y:m}=j4(p,v,f)),x=-1)}return{x:h,y:m,placement:v,strategy:o,middlewareData:b}};function na(e,t){return typeof e=="function"?e(t):e}function Xx(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 _c(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Yx(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:v=!1,padding:b=0}=na(t,e),y=Xx(b),x=c[v?m==="floating"?"reference":"floating":m],w=_c(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.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(c.floating)),j=await(s.isElement==null?void 0:s.isElement(_))&&await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1},I=_c(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:k,offsetParent:_,strategy:f}):k);return{top:(w.top-I.top+y.top)/j.y,bottom:(I.bottom-w.bottom+y.bottom)/j.y,left:(w.left-I.left+y.left)/j.x,right:(I.right-w.right+y.right)/j.x}}const Ka=Math.min,ls=Math.max;function Z1(e,t,n){return ls(e,Ka(t,n))}const P4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c}=t,{element:f,padding:p=0}=na(e,t)||{};if(f==null)return{};const h=Xx(p),m={x:n,y:r},v=ti(o),b=qx(v),y=await i.getDimensions(f),x=v==="y",w=x?"top":"left",k=x?"bottom":"right",_=x?"clientHeight":"clientWidth",j=s.reference[b]+s.reference[v]-m[v]-s.floating[b],I=m[v]-s.reference[v],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let O=E?E[_]:0;O&&await(i.isElement==null?void 0:i.isElement(E))||(O=c.floating[_]||s.floating[b]);const M=j/2-I/2,D=O/2-y[b]/2-1,A=Ka(h[w],D),R=Ka(h[k],D),T=A,q=O-y[b]-R,B=O/2-y[b]/2+M,G=Z1(T,B,q),Y=Fc(o)!=null&&B!=G&&s.reference[b]/2-(B<T?A:R)-y[b]/2<0?B<T?T-B:q-B:0;return{[v]:m[v]-Y,data:{[v]:G,centerOffset:B-G+Y}}}}),vq=["top","right","bottom","left"];vq.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const bq={left:"right",right:"left",bottom:"top",top:"bottom"};function _h(e){return e.replace(/left|right|bottom|top/g,t=>bq[t])}function xq(e,t,n){n===void 0&&(n=!1);const r=Fc(e),o=ti(e),s=qx(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 yq={start:"end",end:"start"};function yv(e){return e.replace(/start|end/g,t=>yq[t])}const Cq=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:c,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...x}=na(e,t),w=Lo(r),k=Lo(i)===i,_=await(c.isRTL==null?void 0:c.isRTL(f.floating)),j=m||(k||!y?[_h(i)]:function(T){const q=_h(T);return[yv(T),q,yv(q)]}(i));m||b==="none"||j.push(...function(T,q,B,G){const Y=Fc(T);let V=function(L,X,z){const K=["left","right"],ne=["right","left"],Q=["top","bottom"],ie=["bottom","top"];switch(L){case"top":case"bottom":return z?X?ne:K:X?K:ne;case"left":case"right":return X?Q:ie;default:return[]}}(Lo(T),B==="start",G);return Y&&(V=V.map(L=>L+"-"+Y),q&&(V=V.concat(V.map(yv)))),V}(i,y,b,_));const I=[i,...j],E=await Yx(t,x),O=[];let M=((n=o.flip)==null?void 0:n.overflows)||[];if(p&&O.push(E[w]),h){const{main:T,cross:q}=xq(r,s,_);O.push(E[T],E[q])}if(M=[...M,{placement:r,overflows:O}],!O.every(T=>T<=0)){var D,A;const T=(((D=o.flip)==null?void 0:D.index)||0)+1,q=I[T];if(q)return{data:{index:T,overflows:M},reset:{placement:q}};let B=(A=M.filter(G=>G.overflows[0]<=0).sort((G,Y)=>G.overflows[1]-Y.overflows[1])[0])==null?void 0:A.placement;if(!B)switch(v){case"bestFit":{var R;const G=(R=M.map(Y=>[Y.placement,Y.overflows.filter(V=>V>0).reduce((V,L)=>V+L,0)]).sort((Y,V)=>Y[1]-V[1])[0])==null?void 0:R[0];G&&(B=G);break}case"initialPlacement":B=i}if(r!==B)return{reset:{placement:B}}}return{}}}};function I4(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 wq=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:c=2,x:f,y:p}=na(e,t),h=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),m=function(x){const w=x.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=>_c(I4(j)))}(h),v=_c(I4(h)),b=Xx(c),y=await s.getElementRects({reference:{getBoundingClientRect:function(){if(m.length===2&&m[0].left>m[1].right&&f!=null&&p!=null)return m.find(x=>f>x.left-b.left&&f<x.right+b.right&&p>x.top-b.top&&p<x.bottom+b.bottom)||v;if(m.length>=2){if(ti(n)==="x"){const E=m[0],O=m[m.length-1],M=Lo(n)==="top",D=E.top,A=O.bottom,R=M?E.left:O.left,T=M?E.right:O.right;return{top:D,bottom:A,left:R,right:T,width:T-R,height:A-D,x:R,y:D}}const x=Lo(n)==="left",w=ls(...m.map(E=>E.right)),k=Ka(...m.map(E=>E.left)),_=m.filter(E=>x?E.left===k:E.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!==y.reference.x||o.reference.y!==y.reference.y||o.reference.width!==y.reference.width||o.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},Sq=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:c,platform:f,elements:p}=s,h=await(f.isRTL==null?void 0:f.isRTL(p.floating)),m=Lo(c),v=Fc(c),b=ti(c)==="x",y=["left","top"].includes(m)?-1:1,x=h&&b?-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),b?{x:_*x,y:k*y}:{x:k*y,y:_*x}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function uI(e){return e==="x"?"y":"x"}const kq=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:c={fn:w=>{let{x:k,y:_}=w;return{x:k,y:_}}},...f}=na(e,t),p={x:n,y:r},h=await Yx(t,f),m=ti(Lo(o)),v=uI(m);let b=p[m],y=p[v];if(s){const w=m==="y"?"bottom":"right";b=Z1(b+h[m==="y"?"top":"left"],b,b-h[w])}if(i){const w=v==="y"?"bottom":"right";y=Z1(y+h[v==="y"?"top":"left"],y,y-h[w])}const x=c.fn({...t,[m]:b,[v]:y});return{...x,data:{x:x.x-n,y:x.y-r}}}}},_q=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:f=!0,crossAxis:p=!0}=na(e,t),h={x:n,y:r},m=ti(o),v=uI(m);let b=h[m],y=h[v];const x=na(c,t),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const j=m==="y"?"height":"width",I=s.reference[m]-s.floating[j]+w.mainAxis,E=s.reference[m]+s.reference[j]-w.mainAxis;b<I?b=I:b>E&&(b=E)}if(p){var k,_;const j=m==="y"?"width":"height",I=["top","left"].includes(Lo(o)),E=s.reference[v]-s.floating[j]+(I&&((k=i.offset)==null?void 0:k[v])||0)+(I?0:w.crossAxis),O=s.reference[v]+s.reference[j]+(I?0:((_=i.offset)==null?void 0:_[v])||0)-(I?w.crossAxis:0);y<E?y=E:y>O&&(y=O)}return{[m]:b,[v]:y}}}},jq=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=()=>{},...c}=na(e,t),f=await Yx(t,c),p=Lo(n),h=Fc(n),m=ti(n)==="x",{width:v,height:b}=r.floating;let y,x;p==="top"||p==="bottom"?(y=p,x=h===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(x=p,y=h==="end"?"top":"bottom");const w=b-f[y],k=v-f[x],_=!t.middlewareData.shift;let j=w,I=k;if(m){const O=v-f.left-f.right;I=h||_?Ka(k,O):O}else{const O=b-f.top-f.bottom;j=h||_?Ka(w,O):O}if(_&&!h){const O=ls(f.left,0),M=ls(f.right,0),D=ls(f.top,0),A=ls(f.bottom,0);m?I=v-2*(O!==0||M!==0?O+M:ls(f.left,f.right)):j=b-2*(D!==0||A!==0?D+A:ls(f.top,f.bottom))}await i({...t,availableWidth:I,availableHeight:j});const E=await o.getDimensions(s.floating);return v!==E.width||b!==E.height?{reset:{rects:!0}}:{}}}};function $r(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vs(e){return $r(e).getComputedStyle(e)}function dI(e){return e instanceof $r(e).Node}function qa(e){return dI(e)?(e.nodeName||"").toLowerCase():"#document"}function Uo(e){return e instanceof HTMLElement||e instanceof $r(e).HTMLElement}function E4(e){return typeof ShadowRoot<"u"&&(e instanceof $r(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 Pq(e){return["table","td","th"].includes(qa(e))}function J1(e){const t=Qx(),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 Qx(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Qm(e){return["html","body","#document"].includes(qa(e))}const eb=Math.min,sc=Math.max,jh=Math.round,ap=Math.floor,Xa=e=>({x:e,y:e});function fI(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,c=jh(n)!==s||jh(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function Ys(e){return e instanceof Element||e instanceof $r(e).Element}function Zx(e){return Ys(e)?e:e.contextElement}function ac(e){const t=Zx(e);if(!Uo(t))return Xa(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=fI(t);let i=(s?jh(n.width):n.width)/r,c=(s?jh(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),c&&Number.isFinite(c)||(c=1),{x:i,y:c}}const Iq=Xa(0);function pI(e){const t=$r(e);return Qx()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Iq}function Hi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Zx(e);let i=Xa(1);t&&(r?Ys(r)&&(i=ac(r)):i=ac(e));const c=function(v,b,y){return b===void 0&&(b=!1),!(!y||b&&y!==$r(v))&&b}(s,n,r)?pI(s):Xa(0);let f=(o.left+c.x)/i.x,p=(o.top+c.y)/i.y,h=o.width/i.x,m=o.height/i.y;if(s){const v=$r(s),b=r&&Ys(r)?$r(r):r;let y=v.frameElement;for(;y&&r&&b!==v;){const x=ac(y),w=y.getBoundingClientRect(),k=getComputedStyle(y),_=w.left+(y.clientLeft+parseFloat(k.paddingLeft))*x.x,j=w.top+(y.clientTop+parseFloat(k.paddingTop))*x.y;f*=x.x,p*=x.y,h*=x.x,m*=x.y,f+=_,p+=j,y=$r(y).frameElement}}return _c({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=(dI(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hI(e){return Hi(Qs(e)).left+Zm(e).scrollLeft}function jc(e){if(qa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||E4(e)&&e.host||Qs(e);return E4(t)?t.host:t}function mI(e){const t=jc(e);return Qm(t)?e.ownerDocument?e.ownerDocument.body:e.body:Uo(t)&&sd(t)?t:mI(t)}function Ph(e,t){var n;t===void 0&&(t=[]);const r=mI(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=$r(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=$r(o),c=Qs(o),f=i.visualViewport;let p=c.clientWidth,h=c.clientHeight,m=0,v=0;if(f){p=f.width,h=f.height;const b=Qx();(!b||b&&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),c=o.ownerDocument.body,f=sc(s.scrollWidth,s.clientWidth,c.scrollWidth,c.clientWidth),p=sc(s.scrollHeight,s.clientHeight,c.scrollHeight,c.clientHeight);let h=-i.scrollLeft+hI(o);const m=-i.scrollTop;return vs(c).direction==="rtl"&&(h+=sc(s.clientWidth,c.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"),c=i.top+o.clientTop,f=i.left+o.clientLeft,p=Uo(o)?ac(o):Xa(1);return{width:o.clientWidth*p.x,height:o.clientHeight*p.y,x:f*p.x,y:c*p.y}}(t,n);else{const o=pI(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return _c(r)}function gI(e,t){const n=jc(e);return!(n===t||!Ys(n)||Qm(n))&&(vs(n).position==="fixed"||gI(n,t))}function Eq(e,t,n){const r=Uo(t),o=Qs(t),s=n==="fixed",i=Hi(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const f=Xa(0);if(r||!r&&!s)if((qa(t)!=="body"||sd(o))&&(c=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=hI(o));return{x:i.left+c.scrollLeft-f.x,y:i.top+c.scrollTop-f.y,width:i.width,height:i.height}}function M4(e,t){return Uo(e)&&vs(e).position!=="fixed"?t?t(e):e.offsetParent:null}function D4(e,t){const n=$r(e);if(!Uo(e))return n;let r=M4(e,t);for(;r&&Pq(r)&&vs(r).position==="static";)r=M4(r,t);return r&&(qa(r)==="html"||qa(r)==="body"&&vs(r).position==="static"&&!J1(r))?n:r||function(o){let s=jc(o);for(;Uo(s)&&!Qm(s);){if(J1(s))return s;s=jc(s)}return null}(e)||n}const Oq={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},c=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);c=ac(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-i.scrollLeft*c.x+f.x,y:t.y*c.y-i.scrollTop*c.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(x=>Ys(x)&&qa(x)!=="body"),v=null;const b=vs(f).position==="fixed";let y=b?jc(f):f;for(;Ys(y)&&!Qm(y);){const x=vs(y),w=J1(y);w||x.position!=="fixed"||(v=null),(b?!w&&!v:!w&&x.position==="static"&&v&&["absolute","fixed"].includes(v.position)||sd(y)&&!w&&gI(f,y))?m=m.filter(k=>k!==y):v=x,y=jc(y)}return p.set(f,m),m}(t,this._c):[].concat(n),r],i=s[0],c=s.reduce((f,p)=>{const h=O4(t,p,o);return f.top=sc(h.top,f.top),f.right=eb(h.right,f.right),f.bottom=eb(h.bottom,f.bottom),f.left=sc(h.left,f.left),f},O4(t,i,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:D4,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||D4,s=this.getDimensions;return{reference:Eq(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 fI(e)},getScale:ac,isElement:Ys,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function Mq(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=Zx(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&&c?function(w,k){let _,j=null;const I=Qs(w);function E(){clearTimeout(_),j&&j.disconnect(),j=null}return function O(M,D){M===void 0&&(M=!1),D===void 0&&(D=1),E();const{left:A,top:R,width:T,height:q}=w.getBoundingClientRect();if(M||k(),!T||!q)return;const B={rootMargin:-ap(R)+"px "+-ap(I.clientWidth-(A+T))+"px "+-ap(I.clientHeight-(R+q))+"px "+-ap(A)+"px",threshold:sc(0,eb(1,D))||1};let G=!0;function Y(V){const L=V[0].intersectionRatio;if(L!==D){if(!G)return O();L?O(!1,L):_=setTimeout(()=>{O(!1,1e-7)},100)}G=!1}try{j=new IntersectionObserver(Y,{...B,root:I.ownerDocument})}catch{j=new IntersectionObserver(Y,B)}j.observe(w)}(!0),E}(p,n):null;let v,b=-1,y=null;i&&(y=new ResizeObserver(w=>{let[k]=w;k&&k.target===p&&y&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),p&&!f&&y.observe(p),y.observe(t));let x=f?Hi(e):null;return f&&function w(){const k=Hi(e);!x||k.x===x.x&&k.y===x.y&&k.width===x.width&&k.height===x.height||n(),x=k,v=requestAnimationFrame(w)}(),n(),()=>{h.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),m&&m(),y&&y.disconnect(),y=null,f&&cancelAnimationFrame(v)}}const Dq=(e,t,n)=>{const r=new Map,o={platform:Oq,...n},s={...o.platform,_c:r};return gq(e,t,{...o,platform:s})},Rq=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?P4({element:t.current,padding:n}).fn(o):{}:t?P4({element:t,padding:n}).fn(o):{}}}};var $p=typeof document<"u"?u.useLayoutEffect:u.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 R4(e){const t=u.useRef(e);return $p(()=>{t.current=e}),t}function Aq(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:i}=e,[c,f]=u.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=u.useState(r);Ih(p,r)||h(r);const m=u.useRef(null),v=u.useRef(null),b=u.useRef(c),y=R4(s),x=R4(o),[w,k]=u.useState(null),[_,j]=u.useState(null),I=u.useCallback(R=>{m.current!==R&&(m.current=R,k(R))},[]),E=u.useCallback(R=>{v.current!==R&&(v.current=R,j(R))},[]),O=u.useCallback(()=>{if(!m.current||!v.current)return;const R={placement:t,strategy:n,middleware:p};x.current&&(R.platform=x.current),Dq(m.current,v.current,R).then(T=>{const q={...T,isPositioned:!0};M.current&&!Ih(b.current,q)&&(b.current=q,oo.flushSync(()=>{f(q)}))})},[p,t,n,x]);$p(()=>{i===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,f(R=>({...R,isPositioned:!1})))},[i]);const M=u.useRef(!1);$p(()=>(M.current=!0,()=>{M.current=!1}),[]),$p(()=>{if(w&&_){if(y.current)return y.current(w,_,O);O()}},[w,_,O,y]);const D=u.useMemo(()=>({reference:m,floating:v,setReference:I,setFloating:E}),[I,E]),A=u.useMemo(()=>({reference:w,floating:_}),[w,_]);return u.useMemo(()=>({...c,update:O,refs:D,elements:A,reference:I,floating:E}),[c,O,D,A,I,E])}var Nq=typeof document<"u"?u.useLayoutEffect:u.useEffect;function Tq(){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 $q=u.createContext(null),Lq=()=>u.useContext($q);function zq(e){return(e==null?void 0:e.ownerDocument)||document}function Fq(e){return zq(e).defaultView||window}function ip(e){return e?e instanceof Fq(e).Element:!1}const Bq=Nb["useInsertionEffect".toString()],Hq=Bq||(e=>e());function Vq(e){const t=u.useRef(()=>{});return Hq(()=>{t.current=e}),u.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 Wq(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=Aq(e),s=Lq(),i=u.useRef(null),c=u.useRef({}),f=u.useState(()=>Tq())[0],[p,h]=u.useState(null),m=u.useCallback(k=>{const _=ip(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;o.refs.setReference(_)},[o.refs]),v=u.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]),b=u.useMemo(()=>({...o.refs,setReference:v,setPositionReference:m,domReference:i}),[o.refs,v,m]),y=u.useMemo(()=>({...o.elements,domReference:p}),[o.elements,p]),x=Vq(n),w=u.useMemo(()=>({...o,refs:b,elements:y,dataRef:c,nodeId:r,events:f,open:t,onOpenChange:x}),[o,r,f,t,x,b,y]);return Nq(()=>{const k=s==null?void 0:s.nodesRef.current.find(_=>_.id===r);k&&(k.context=w)}),u.useMemo(()=>({...o,context:w,refs:b,reference:v,positionReference:m}),[o,b,w,v,m])}function Uq({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=u.useState(0);u.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return Mq(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 Gq(e){const t=[Sq(e.offset)];return e.middlewares.shift&&t.push(kq({limiter:_q()})),e.middlewares.flip&&t.push(Cq()),e.middlewares.inline&&t.push(wq()),t.push(Rq({element:e.arrowRef,padding:e.arrowOffset})),t}function Kq(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,c;t?((i=e.onClose)==null||i.call(e),n(!1)):((c=e.onOpen)==null||c.call(e),n(!0))},s=Wq({placement:e.position,middleware:[...Gq(e),...e.width==="target"?[jq({apply({rects:i}){var c,f;Object.assign((f=(c=s.refs.floating.current)==null?void 0:c.style)!=null?f:{},{width:`${i.reference.width}px`})}})]:[]]});return Uq({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,c;e.opened?(c=e.onOpen)==null||c.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 vI={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"},[qq,bI]=NW(vI.context);var Xq=Object.defineProperty,Yq=Object.defineProperties,Qq=Object.getOwnPropertyDescriptors,Eh=Object.getOwnPropertySymbols,xI=Object.prototype.hasOwnProperty,yI=Object.prototype.propertyIsEnumerable,A4=(e,t,n)=>t in e?Xq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lp=(e,t)=>{for(var n in t||(t={}))xI.call(t,n)&&A4(e,n,t[n]);if(Eh)for(var n of Eh(t))yI.call(t,n)&&A4(e,n,t[n]);return e},Zq=(e,t)=>Yq(e,Qq(t)),Jq=(e,t)=>{var n={};for(var r in e)xI.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&&yI.call(e,r)&&(n[r]=e[r]);return n};const eX={refProp:"ref",popupType:"dialog"},CI=u.forwardRef((e,t)=>{const n=Sn("PopoverTarget",eX,e),{children:r,refProp:o,popupType:s}=n,i=Jq(n,["children","refProp","popupType"]);if(!XP(r))throw new Error(vI.children);const c=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 u.cloneElement(r,lp(Zq(lp(lp(lp({},c),h),f.targetProps),{className:QP(f.targetProps.className,c.className,r.props.className),[o]:p}),f.controlled?null:{onClick:f.onToggle}))});CI.displayName="@mantine/core/PopoverTarget";var tX=or((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${Me(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:`${Me(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const nX=tX;var rX=Object.defineProperty,N4=Object.getOwnPropertySymbols,oX=Object.prototype.hasOwnProperty,sX=Object.prototype.propertyIsEnumerable,T4=(e,t,n)=>t in e?rX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ol=(e,t)=>{for(var n in t||(t={}))oX.call(t,n)&&T4(e,n,t[n]);if(N4)for(var n of N4(t))sX.call(t,n)&&T4(e,n,t[n]);return e};const $4={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function aX({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in ep?Ol(Ol(Ol({transitionProperty:ep[e].transitionProperty},o),ep[e].common),ep[e][$4[t]]):null:Ol(Ol(Ol({transitionProperty:e.transitionProperty},o),e.common),e[$4[t]])}function iX({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:i,onExited:c}){const f=ca(),p=o6(),h=f.respectReducedMotion?p:!1,[m,v]=u.useState(h?0:e),[b,y]=u.useState(r?"entered":"exited"),x=u.useRef(-1),w=k=>{const _=k?o:s,j=k?i:c;y(k?"pre-entering":"pre-exiting"),window.clearTimeout(x.current);const I=h?0:k?e:t;if(v(I),I===0)typeof _=="function"&&_(),typeof j=="function"&&j(),y(k?"entered":"exited");else{const E=window.setTimeout(()=>{typeof _=="function"&&_(),y(k?"entering":"exiting")},10);x.current=window.setTimeout(()=>{window.clearTimeout(E),typeof j=="function"&&j(),y(k?"entered":"exited")},I)}};return $o(()=>{w(r)},[r]),u.useEffect(()=>()=>window.clearTimeout(x.current),[]),{transitionDuration:m,transitionStatus:b,transitionTimingFunction:n||f.transitionTimingFunction}}function wI({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:i,onExit:c,onEntered:f,onEnter:p,onExited:h}){const{transitionDuration:m,transitionStatus:v,transitionTimingFunction:b}=iX({mounted:o,exitDuration:r,duration:n,timingFunction:i,onExit:c,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(aX({transition:t,duration:m,state:v,timingFunction:b})))}wI.displayName="@mantine/core/Transition";function SI({children:e,active:t=!0,refProp:n="ref"}){const r=mU(t),o=Ld(r,e==null?void 0:e.ref);return XP(e)?u.cloneElement(e,{[n]:o}):e}SI.displayName="@mantine/core/FocusTrap";var lX=Object.defineProperty,cX=Object.defineProperties,uX=Object.getOwnPropertyDescriptors,L4=Object.getOwnPropertySymbols,dX=Object.prototype.hasOwnProperty,fX=Object.prototype.propertyIsEnumerable,z4=(e,t,n)=>t in e?lX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ja=(e,t)=>{for(var n in t||(t={}))dX.call(t,n)&&z4(e,n,t[n]);if(L4)for(var n of L4(t))fX.call(t,n)&&z4(e,n,t[n]);return e},cp=(e,t)=>cX(e,uX(t));function F4(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function B4(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 pX={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function hX({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:i,dir:c}){const[f,p="center"]=e.split("-"),h={width:Me(t),height:Me(t),transform:"rotate(45deg)",position:"absolute",[pX[f]]:Me(r)},m=Me(-t/2);return f==="left"?cp(ja(ja({},h),F4(p,i,n,o)),{right:m,borderLeftColor:"transparent",borderBottomColor:"transparent"}):f==="right"?cp(ja(ja({},h),F4(p,i,n,o)),{left:m,borderRightColor:"transparent",borderTopColor:"transparent"}):f==="top"?cp(ja(ja({},h),B4(p,s,n,o,c)),{bottom:m,borderTopColor:"transparent",borderLeftColor:"transparent"}):f==="bottom"?cp(ja(ja({},h),B4(p,s,n,o,c)),{top:m,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var mX=Object.defineProperty,gX=Object.defineProperties,vX=Object.getOwnPropertyDescriptors,Oh=Object.getOwnPropertySymbols,kI=Object.prototype.hasOwnProperty,_I=Object.prototype.propertyIsEnumerable,H4=(e,t,n)=>t in e?mX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bX=(e,t)=>{for(var n in t||(t={}))kI.call(t,n)&&H4(e,n,t[n]);if(Oh)for(var n of Oh(t))_I.call(t,n)&&H4(e,n,t[n]);return e},xX=(e,t)=>gX(e,vX(t)),yX=(e,t)=>{var n={};for(var r in e)kI.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&&_I.call(e,r)&&(n[r]=e[r]);return n};const jI=u.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:c,visible:f,arrowX:p,arrowY:h}=n,m=yX(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const v=ca();return f?H.createElement("div",xX(bX({},m),{ref:t,style:hX({position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:c,dir:v.dir,arrowX:p,arrowY:h})})):null});jI.displayName="@mantine/core/FloatingArrow";var CX=Object.defineProperty,wX=Object.defineProperties,SX=Object.getOwnPropertyDescriptors,Mh=Object.getOwnPropertySymbols,PI=Object.prototype.hasOwnProperty,II=Object.prototype.propertyIsEnumerable,V4=(e,t,n)=>t in e?CX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ml=(e,t)=>{for(var n in t||(t={}))PI.call(t,n)&&V4(e,n,t[n]);if(Mh)for(var n of Mh(t))II.call(t,n)&&V4(e,n,t[n]);return e},up=(e,t)=>wX(e,SX(t)),kX=(e,t)=>{var n={};for(var r in e)PI.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&&II.call(e,r)&&(n[r]=e[r]);return n};const _X={};function EI(e){var t;const n=Sn("PopoverDropdown",_X,e),{style:r,className:o,children:s,onKeyDownCapture:i}=n,c=kX(n,["style","className","children","onKeyDownCapture"]),f=bI(),{classes:p,cx:h}=nX({radius:f.radius,shadow:f.shadow},{name:f.__staticSelector,classNames:f.classNames,styles:f.styles,unstyled:f.unstyled,variant:f.variant}),m=lU({opened:f.opened,shouldReturnFocus:f.returnFocus}),v=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:"dialog"}:{};return f.disabled?null:H.createElement(E6,up(Ml({},f.portalProps),{withinPortal:f.withinPortal}),H.createElement(wI,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}),b=>{var y,x;return H.createElement(SI,{active:f.trapFocus},H.createElement(Er,Ml(up(Ml({},v),{tabIndex:-1,ref:f.floating,style:up(Ml(Ml({},r),b),{zIndex:f.zIndex,top:(y=f.y)!=null?y:0,left:(x=f.x)!=null?x:0,width:f.width==="target"?void 0:Me(f.width)}),className:h(p.dropdown,o),onKeyDownCapture:$W(f.onClose,{active:f.closeOnEscape,onTrigger:m,onKeyDown:i}),"data-position":f.placement}),c),s,H.createElement(jI,{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})))}))}EI.displayName="@mantine/core/PopoverDropdown";function jX(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 W4=Object.getOwnPropertySymbols,PX=Object.prototype.hasOwnProperty,IX=Object.prototype.propertyIsEnumerable,EX=(e,t)=>{var n={};for(var r in e)PX.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&W4)for(var r of W4(e))t.indexOf(r)<0&&IX.call(e,r)&&(n[r]=e[r]);return n};const OX={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:Hx("popover"),__staticSelector:"Popover",width:"max-content"};function Bc(e){var t,n,r,o,s,i;const c=u.useRef(null),f=Sn("Popover",OX,e),{children:p,position:h,offset:m,onPositionChange:v,positionDependencies:b,opened:y,transitionProps:x,width:w,middlewares:k,withArrow:_,arrowSize:j,arrowOffset:I,arrowRadius:E,arrowPosition:O,unstyled:M,classNames:D,styles:A,closeOnClickOutside:R,withinPortal:T,portalProps:q,closeOnEscape:B,clickOutsideEvents:G,trapFocus:Y,onClose:V,onOpen:L,onChange:X,zIndex:z,radius:K,shadow:ne,id:Q,defaultOpened:ie,__staticSelector:oe,withRoles:W,disabled:U,returnFocus:ee,variant:se,keepMounted:re}=f,fe=EX(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]=u.useState(null),[ye,he]=u.useState(null),ue=Wx(Q),De=ca(),je=Kq({middlewares:k,width:w,position:jX(De.dir,h),offset:typeof m=="number"?m+(_?j/2:0):m,arrowRef:c,arrowOffset:I,onPositionChange:v,positionDependencies:b,opened:y,defaultOpened:ie,onChange:X,onOpen:L,onClose:V});oU(()=>je.opened&&R&&je.onClose(),G,[de,ye]);const Be=u.useCallback(Ue=>{me(Ue),je.floating.reference(Ue)},[je.floating.reference]),rt=u.useCallback(Ue=>{he(Ue),je.floating.floating(Ue)},[je.floating.floating]);return H.createElement(qq,{value:{returnFocus:ee,disabled:U,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:c,transitionProps:x,width:w,withArrow:_,arrowSize:j,arrowOffset:I,arrowRadius:E,arrowPosition:O,placement:je.floating.placement,trapFocus:Y,withinPortal:T,portalProps:q,zIndex:z,radius:K,shadow:ne,closeOnEscape:B,onClose:je.onClose,onToggle:je.onToggle,getTargetId:()=>`${ue}-target`,getDropdownId:()=>`${ue}-dropdown`,withRoles:W,targetProps:fe,__staticSelector:oe,classNames:D,styles:A,unstyled:M,variant:se,keepMounted:re}},p)}Bc.Target=CI;Bc.Dropdown=EI;Bc.displayName="@mantine/core/Popover";var MX=Object.defineProperty,Dh=Object.getOwnPropertySymbols,OI=Object.prototype.hasOwnProperty,MI=Object.prototype.propertyIsEnumerable,U4=(e,t,n)=>t in e?MX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DX=(e,t)=>{for(var n in t||(t={}))OI.call(t,n)&&U4(e,n,t[n]);if(Dh)for(var n of Dh(t))MI.call(t,n)&&U4(e,n,t[n]);return e},RX=(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&&MI.call(e,r)&&(n[r]=e[r]);return n};function AX(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:i,innerRef:c,__staticSelector:f,styles:p,classNames:h,unstyled:m}=t,v=RX(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:b}=mq(null,{name:f,styles:p,classNames:h,unstyled:m});return H.createElement(Bc.Dropdown,DX({p:0,onMouseDown:y=>y.preventDefault()},v),H.createElement("div",{style:{maxHeight:Me(o),display:"flex"}},H.createElement(Er,{component:r||"div",id:`${i}-items`,"aria-labelledby":`${i}-label`,role:"listbox",onMouseDown:y=>y.preventDefault(),style:{flex:1,overflowY:r!==Ym?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:c},H.createElement("div",{className:b.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:c,switchDirectionOnFlip:f,zIndex:p,dropdownPosition:h,positionDependencies:m=[],classNames:v,styles:b,unstyled:y,readOnly:x,variant:w}){return H.createElement(Bc,{unstyled:y,classNames:v,styles:b,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:x,onPositionChange:k=>f&&(c==null?void 0:c(k==="top"?"column-reverse":"column")),variant:w},s)}Ba.Target=Bc.Target;Ba.Dropdown=AX;var NX=Object.defineProperty,TX=Object.defineProperties,$X=Object.getOwnPropertyDescriptors,Rh=Object.getOwnPropertySymbols,DI=Object.prototype.hasOwnProperty,RI=Object.prototype.propertyIsEnumerable,G4=(e,t,n)=>t in e?NX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dp=(e,t)=>{for(var n in t||(t={}))DI.call(t,n)&&G4(e,n,t[n]);if(Rh)for(var n of Rh(t))RI.call(t,n)&&G4(e,n,t[n]);return e},LX=(e,t)=>TX(e,$X(t)),zX=(e,t)=>{var n={};for(var r in e)DI.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&&RI.call(e,r)&&(n[r]=e[r]);return n};function AI(e,t,n){const r=Sn(e,t,n),{label:o,description:s,error:i,required:c,classNames:f,styles:p,className:h,unstyled:m,__staticSelector:v,sx:b,errorProps:y,labelProps:x,descriptionProps:w,wrapperProps:k,id:_,size:j,style:I,inputContainer:E,inputWrapperOrder:O,withAsterisk:M,variant:D}=r,A=zX(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),R=Wx(_),{systemStyles:T,rest:q}=Gm(A),B=dp({label:o,description:s,error:i,required:c,classNames:f,className:h,__staticSelector:v,sx:b,errorProps:y,labelProps:x,descriptionProps:w,unstyled:m,styles:p,id:R,size:j,style:I,inputContainer:E,inputWrapperOrder:O,withAsterisk:M,variant:D},k);return LX(dp({},q),{classNames:f,styles:p,unstyled:m,wrapperProps:dp(dp({},B),T),inputProps:{required:c,classNames:f,styles:p,unstyled:m,id:R,size:j,__staticSelector:v,error:i,variant:D}})}var FX=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 BX=FX;var HX=Object.defineProperty,Ah=Object.getOwnPropertySymbols,NI=Object.prototype.hasOwnProperty,TI=Object.prototype.propertyIsEnumerable,K4=(e,t,n)=>t in e?HX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VX=(e,t)=>{for(var n in t||(t={}))NI.call(t,n)&&K4(e,n,t[n]);if(Ah)for(var n of Ah(t))TI.call(t,n)&&K4(e,n,t[n]);return e},WX=(e,t)=>{var n={};for(var r in e)NI.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&&TI.call(e,r)&&(n[r]=e[r]);return n};const UX={labelElement:"label",size:"sm"},Jx=u.forwardRef((e,t)=>{const n=Sn("InputLabel",UX,e),{labelElement:r,children:o,required:s,size:i,classNames:c,styles:f,unstyled:p,className:h,htmlFor:m,__staticSelector:v,variant:b,onMouseDown:y}=n,x=WX(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:w,cx:k}=BX(null,{name:["InputWrapper",v],classNames:c,styles:f,unstyled:p,variant:b,size:i});return H.createElement(Er,VX({component:r,ref:t,className:k(w.label,h),htmlFor:r==="label"?m:void 0,onMouseDown:_=>{y==null||y(_),!_.defaultPrevented&&_.detail>1&&_.preventDefault()}},x),o,s&&H.createElement("span",{className:w.required,"aria-hidden":!0}," *"))});Jx.displayName="@mantine/core/InputLabel";var GX=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})} - ${Me(2)})`,lineHeight:1.2,display:"block"}}));const KX=GX;var qX=Object.defineProperty,Nh=Object.getOwnPropertySymbols,$I=Object.prototype.hasOwnProperty,LI=Object.prototype.propertyIsEnumerable,q4=(e,t,n)=>t in e?qX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XX=(e,t)=>{for(var n in t||(t={}))$I.call(t,n)&&q4(e,n,t[n]);if(Nh)for(var n of Nh(t))LI.call(t,n)&&q4(e,n,t[n]);return e},YX=(e,t)=>{var n={};for(var r in e)$I.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&&LI.call(e,r)&&(n[r]=e[r]);return n};const QX={size:"sm"},ey=u.forwardRef((e,t)=>{const n=Sn("InputError",QX,e),{children:r,className:o,classNames:s,styles:i,unstyled:c,size:f,__staticSelector:p,variant:h}=n,m=YX(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:b}=KX(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:c,variant:h,size:f});return H.createElement(Sc,XX({className:b(v.error,o),ref:t},m),r)});ey.displayName="@mantine/core/InputError";var ZX=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})} - ${Me(2)})`,lineHeight:1.2,display:"block"}}));const JX=ZX;var eY=Object.defineProperty,Th=Object.getOwnPropertySymbols,zI=Object.prototype.hasOwnProperty,FI=Object.prototype.propertyIsEnumerable,X4=(e,t,n)=>t in e?eY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tY=(e,t)=>{for(var n in t||(t={}))zI.call(t,n)&&X4(e,n,t[n]);if(Th)for(var n of Th(t))FI.call(t,n)&&X4(e,n,t[n]);return e},nY=(e,t)=>{var n={};for(var r in e)zI.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&&FI.call(e,r)&&(n[r]=e[r]);return n};const rY={size:"sm"},ty=u.forwardRef((e,t)=>{const n=Sn("InputDescription",rY,e),{children:r,className:o,classNames:s,styles:i,unstyled:c,size:f,__staticSelector:p,variant:h}=n,m=nY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:b}=JX(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:c,variant:h,size:f});return H.createElement(Sc,tY({color:"dimmed",className:b(v.description,o),ref:t,unstyled:c},m),r)});ty.displayName="@mantine/core/InputDescription";const BI=u.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),oY=BI.Provider,sY=()=>u.useContext(BI);function aY(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 iY=Object.defineProperty,lY=Object.defineProperties,cY=Object.getOwnPropertyDescriptors,Y4=Object.getOwnPropertySymbols,uY=Object.prototype.hasOwnProperty,dY=Object.prototype.propertyIsEnumerable,Q4=(e,t,n)=>t in e?iY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fY=(e,t)=>{for(var n in t||(t={}))uY.call(t,n)&&Q4(e,n,t[n]);if(Y4)for(var n of Y4(t))dY.call(t,n)&&Q4(e,n,t[n]);return e},pY=(e,t)=>lY(e,cY(t)),hY=or(e=>({root:pY(fY({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const mY=hY;var gY=Object.defineProperty,vY=Object.defineProperties,bY=Object.getOwnPropertyDescriptors,$h=Object.getOwnPropertySymbols,HI=Object.prototype.hasOwnProperty,VI=Object.prototype.propertyIsEnumerable,Z4=(e,t,n)=>t in e?gY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pa=(e,t)=>{for(var n in t||(t={}))HI.call(t,n)&&Z4(e,n,t[n]);if($h)for(var n of $h(t))VI.call(t,n)&&Z4(e,n,t[n]);return e},J4=(e,t)=>vY(e,bY(t)),xY=(e,t)=>{var n={};for(var r in e)HI.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 yY={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},WI=u.forwardRef((e,t)=>{const n=Sn("InputWrapper",yY,e),{className:r,label:o,children:s,required:i,id:c,error:f,description:p,labelElement:h,labelProps:m,descriptionProps:v,errorProps:b,classNames:y,styles:x,size:w,inputContainer:k,__staticSelector:_,unstyled:j,inputWrapperOrder:I,withAsterisk:E,variant:O}=n,M=xY(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}=mY(null,{classNames:y,styles:x,name:["InputWrapper",_],unstyled:j,variant:O,size:w}),R={classNames:y,styles:x,unstyled:j,size:w,variant:O,__staticSelector:_},T=typeof E=="boolean"?E:i,q=c?`${c}-error`:b==null?void 0:b.id,B=c?`${c}-description`:v==null?void 0:v.id,Y=`${!!f&&typeof f!="boolean"?q:""} ${p?B:""}`,V=Y.trim().length>0?Y.trim():void 0,L=o&&H.createElement(Jx,Pa(Pa({key:"label",labelElement:h,id:c?`${c}-label`:void 0,htmlFor:c,required:T},R),m),o),X=p&&H.createElement(ty,J4(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(u.Fragment,{key:"input"},k(s)),K=typeof f!="boolean"&&f&&H.createElement(ey,J4(Pa(Pa({},b),R),{size:(b==null?void 0:b.size)||R.size,key:"error",id:(b==null?void 0:b.id)||q}),f),ne=I.map(Q=>{switch(Q){case"label":return L;case"input":return z;case"description":return X;case"error":return K;default:return null}});return H.createElement(oY,{value:Pa({describedBy:V},aY(I,{hasDescription:!!X,hasError:!!K}))},H.createElement(Er,Pa({className:A(D.root,r),ref:t},M),ne))});WI.displayName="@mantine/core/InputWrapper";var CY=Object.defineProperty,Lh=Object.getOwnPropertySymbols,UI=Object.prototype.hasOwnProperty,GI=Object.prototype.propertyIsEnumerable,ek=(e,t,n)=>t in e?CY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wY=(e,t)=>{for(var n in t||(t={}))UI.call(t,n)&&ek(e,n,t[n]);if(Lh)for(var n of Lh(t))GI.call(t,n)&&ek(e,n,t[n]);return e},SY=(e,t)=>{var n={};for(var r in e)UI.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&&GI.call(e,r)&&(n[r]=e[r]);return n};const kY={},KI=u.forwardRef((e,t)=>{const n=Sn("InputPlaceholder",kY,e),{sx:r}=n,o=SY(n,["sx"]);return H.createElement(Er,wY({component:"span",sx:[s=>s.fn.placeholderStyles(),...KP(r)],ref:t},o))});KI.displayName="@mantine/core/InputPlaceholder";var _Y=Object.defineProperty,jY=Object.defineProperties,PY=Object.getOwnPropertyDescriptors,tk=Object.getOwnPropertySymbols,IY=Object.prototype.hasOwnProperty,EY=Object.prototype.propertyIsEnumerable,nk=(e,t,n)=>t in e?_Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fp=(e,t)=>{for(var n in t||(t={}))IY.call(t,n)&&nk(e,n,t[n]);if(tk)for(var n of tk(t))EY.call(t,n)&&nk(e,n,t[n]);return e},Cv=(e,t)=>jY(e,PY(t));const eo={xs:Me(30),sm:Me(36),md:Me(42),lg:Me(50),xl:Me(60)},OY=["default","filled","unstyled"];function MY({theme:e,variant:t}){return OY.includes(t)?t==="default"?{border:`${Me(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:`${Me(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:Me(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var DY=or((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:i,offsetBottom:c,offsetTop:f,pointer:p},{variant:h,size:m})=>{const v=e.fn.variant({variant:"filled",color:"red"}).background,b=h==="default"||h==="filled"?{minHeight:ut({size:m,sizes:eo}),paddingLeft:`calc(${ut({size:m,sizes:eo})} / 3)`,paddingRight:s?o||ut({size:m,sizes:eo}):`calc(${ut({size:m,sizes:eo})} / 3)`,borderRadius:e.fn.radius(n)}:h==="unstyled"&&s?{paddingRight:o||ut({size:m,sizes:eo})}:null;return{wrapper:{position:"relative",marginTop:f?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:c?`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:eo}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${ut({size:m,sizes:eo})} - ${Me(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}),MY({theme:e,variant:h})),b),{"&: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"?Me(i):ut({size:m,sizes:eo})},"&::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?Me(i):ut({size:m,sizes:eo}),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:eo})}}});const RY=DY;var AY=Object.defineProperty,NY=Object.defineProperties,TY=Object.getOwnPropertyDescriptors,zh=Object.getOwnPropertySymbols,qI=Object.prototype.hasOwnProperty,XI=Object.prototype.propertyIsEnumerable,rk=(e,t,n)=>t in e?AY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pp=(e,t)=>{for(var n in t||(t={}))qI.call(t,n)&&rk(e,n,t[n]);if(zh)for(var n of zh(t))XI.call(t,n)&&rk(e,n,t[n]);return e},ok=(e,t)=>NY(e,TY(t)),$Y=(e,t)=>{var n={};for(var r in e)qI.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&&XI.call(e,r)&&(n[r]=e[r]);return n};const LY={size:"sm",variant:"default"},tl=u.forwardRef((e,t)=>{const n=Sn("Input",LY,e),{className:r,error:o,required:s,disabled:i,variant:c,icon:f,style:p,rightSectionWidth:h,iconWidth:m,rightSection:v,rightSectionProps:b,radius:y,size:x,wrapperProps:w,classNames:k,styles:_,__staticSelector:j,multiline:I,sx:E,unstyled:O,pointer:M}=n,D=$Y(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:T}=sY(),{classes:q,cx:B}=RY({radius:y,multiline:I,invalid:!!o,rightSectionWidth:h?Me(h):void 0,iconWidth:m,withRightSection:!!v,offsetBottom:A,offsetTop:R,pointer:M},{classNames:k,styles:_,name:["Input",j],unstyled:O,variant:c,size:x}),{systemStyles:G,rest:Y}=Gm(D);return H.createElement(Er,pp(pp({className:B(q.wrapper,r),sx:E,style:p},G),w),f&&H.createElement("div",{className:q.icon},f),H.createElement(Er,ok(pp({component:"input"},Y),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":T,disabled:i,"data-disabled":i||void 0,"data-with-icon":!!f||void 0,"data-invalid":!!o||void 0,className:q.input})),v&&H.createElement("div",ok(pp({},b),{className:q.rightSection}),v))});tl.displayName="@mantine/core/Input";tl.Wrapper=WI;tl.Label=Jx;tl.Description=ty;tl.Error=ey;tl.Placeholder=KI;const Pc=tl;var zY=Object.defineProperty,Fh=Object.getOwnPropertySymbols,YI=Object.prototype.hasOwnProperty,QI=Object.prototype.propertyIsEnumerable,sk=(e,t,n)=>t in e?zY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ak=(e,t)=>{for(var n in t||(t={}))YI.call(t,n)&&sk(e,n,t[n]);if(Fh)for(var n of Fh(t))QI.call(t,n)&&sk(e,n,t[n]);return e},FY=(e,t)=>{var n={};for(var r in e)YI.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&&QI.call(e,r)&&(n[r]=e[r]);return n};const BY={multiple:!1},ZI=u.forwardRef((e,t)=>{const n=Sn("FileButton",BY,e),{onChange:r,children:o,multiple:s,accept:i,name:c,form:f,resetRef:p,disabled:h,capture:m,inputProps:v}=n,b=FY(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),y=u.useRef(),x=()=>{!h&&y.current.click()},w=_=>{r(s?Array.from(_.currentTarget.files):_.currentTarget.files[0]||null)};return r6(p,()=>{y.current.value=""}),H.createElement(H.Fragment,null,o(ak({onClick:x},b)),H.createElement("input",ak({style:{display:"none"},type:"file",accept:i,multiple:s,onChange:w,ref:Ld(t,y),name:c,form:f,capture:m},v)))});ZI.displayName="@mantine/core/FileButton";const JI={xs:Me(16),sm:Me(22),md:Me(26),lg:Me(30),xl:Me(36)},HY={xs:Me(10),sm:Me(12),md:Me(14),lg:Me(16),xl:Me(18)};var VY=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:JI}),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:HY}),borderRadius:ut({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${Me(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 WY=VY;var UY=Object.defineProperty,Bh=Object.getOwnPropertySymbols,eE=Object.prototype.hasOwnProperty,tE=Object.prototype.propertyIsEnumerable,ik=(e,t,n)=>t in e?UY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GY=(e,t)=>{for(var n in t||(t={}))eE.call(t,n)&&ik(e,n,t[n]);if(Bh)for(var n of Bh(t))tE.call(t,n)&&ik(e,n,t[n]);return e},KY=(e,t)=>{var n={};for(var r in e)eE.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&&tE.call(e,r)&&(n[r]=e[r]);return n};const qY={xs:16,sm:22,md:24,lg:26,xl:30};function nE(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:i,disabled:c,readOnly:f,size:p,radius:h="sm",variant:m,unstyled:v}=t,b=KY(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:y,cx:x}=WY({disabled:c,readOnly:f,radius:h},{name:"MultiSelect",classNames:r,styles:o,unstyled:v,size:p,variant:m});return H.createElement("div",GY({className:x(y.defaultValue,s)},b),H.createElement("span",{className:y.defaultValueLabel},n),!c&&!f&&H.createElement(T6,{"aria-hidden":!0,onMouseDown:i,size:qY[p],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:y.defaultValueRemove,tabIndex:-1,unstyled:v}))}nE.displayName="@mantine/core/MultiSelect/DefaultValue";function XY({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 c=[];for(let f=0;f<e.length&&(o(r,!i&&s.some(p=>p===e[f].value&&!e[f].disabled),e[f])&&c.push(e[f]),!(c.length>=n));f+=1);return c}var YY=Object.defineProperty,Hh=Object.getOwnPropertySymbols,rE=Object.prototype.hasOwnProperty,oE=Object.prototype.propertyIsEnumerable,lk=(e,t,n)=>t in e?YY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ck=(e,t)=>{for(var n in t||(t={}))rE.call(t,n)&&lk(e,n,t[n]);if(Hh)for(var n of Hh(t))oE.call(t,n)&&lk(e,n,t[n]);return e},QY=(e,t)=>{var n={};for(var r in e)rE.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&&oE.call(e,r)&&(n[r]=e[r]);return n};const ZY={xs:Me(14),sm:Me(18),md:Me(20),lg:Me(24),xl:Me(28)};function JY(e){var t=e,{size:n,error:r,style:o}=t,s=QY(t,["size","error","style"]);const i=ca(),c=ut({size:n,sizes:ZY});return H.createElement("svg",ck({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:ck({color:r?i.colors.red[6]:i.colors.gray[6],width:c,height:c},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 eQ=Object.defineProperty,tQ=Object.defineProperties,nQ=Object.getOwnPropertyDescriptors,uk=Object.getOwnPropertySymbols,rQ=Object.prototype.hasOwnProperty,oQ=Object.prototype.propertyIsEnumerable,dk=(e,t,n)=>t in e?eQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sQ=(e,t)=>{for(var n in t||(t={}))rQ.call(t,n)&&dk(e,n,t[n]);if(uk)for(var n of uk(t))oQ.call(t,n)&&dk(e,n,t[n]);return e},aQ=(e,t)=>tQ(e,nQ(t));function sE({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?H.createElement(T6,aQ(sQ({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):H.createElement(JY,{error:o,size:r})}sE.displayName="@mantine/core/SelectRightSection";var iQ=Object.defineProperty,lQ=Object.defineProperties,cQ=Object.getOwnPropertyDescriptors,Vh=Object.getOwnPropertySymbols,aE=Object.prototype.hasOwnProperty,iE=Object.prototype.propertyIsEnumerable,fk=(e,t,n)=>t in e?iQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wv=(e,t)=>{for(var n in t||(t={}))aE.call(t,n)&&fk(e,n,t[n]);if(Vh)for(var n of Vh(t))iE.call(t,n)&&fk(e,n,t[n]);return e},pk=(e,t)=>lQ(e,cQ(t)),uQ=(e,t)=>{var n={};for(var r in e)aE.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&&iE.call(e,r)&&(n[r]=e[r]);return n};function lE(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,i=uQ(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const c=typeof n=="function"?n(s):n;return{rightSection:!i.readOnly&&!(i.disabled&&i.shouldClear)&&H.createElement(sE,wv({},i)),styles:pk(wv({},c),{rightSection:pk(wv({},c==null?void 0:c.rightSection),{pointerEvents:i.shouldClear?void 0:"none"})})}}var dQ=Object.defineProperty,fQ=Object.defineProperties,pQ=Object.getOwnPropertyDescriptors,hk=Object.getOwnPropertySymbols,hQ=Object.prototype.hasOwnProperty,mQ=Object.prototype.propertyIsEnumerable,mk=(e,t,n)=>t in e?dQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gQ=(e,t)=>{for(var n in t||(t={}))hQ.call(t,n)&&mk(e,n,t[n]);if(hk)for(var n of hk(t))mQ.call(t,n)&&mk(e,n,t[n]);return e},vQ=(e,t)=>fQ(e,pQ(t)),bQ=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:eo})} - ${Me(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:ut({size:n,sizes:eo})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${Me(2)}) calc(${e.spacing.xs} / 2)`},searchInput:vQ(gQ({},e.fn.fontStyles()),{flex:1,minWidth:Me(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:JI}),"&::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 xQ=bQ;var yQ=Object.defineProperty,CQ=Object.defineProperties,wQ=Object.getOwnPropertyDescriptors,Wh=Object.getOwnPropertySymbols,cE=Object.prototype.hasOwnProperty,uE=Object.prototype.propertyIsEnumerable,gk=(e,t,n)=>t in e?yQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dl=(e,t)=>{for(var n in t||(t={}))cE.call(t,n)&&gk(e,n,t[n]);if(Wh)for(var n of Wh(t))uE.call(t,n)&&gk(e,n,t[n]);return e},vk=(e,t)=>CQ(e,wQ(t)),SQ=(e,t)=>{var n={};for(var r in e)cE.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&&uE.call(e,r)&&(n[r]=e[r]);return n};function kQ(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function _Q(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 jQ={size:"sm",valueComponent:nE,itemComponent:Gx,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:kQ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:_Q,switchDirectionOnFlip:!1,zIndex:Hx("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},dE=u.forwardRef((e,t)=>{const n=Sn("MultiSelect",jQ,e),{className:r,style:o,required:s,label:i,description:c,size:f,error:p,classNames:h,styles:m,wrapperProps:v,value:b,defaultValue:y,data:x,onChange:w,valueComponent:k,itemComponent:_,id:j,transitionProps:I,maxDropdownHeight:E,shadow:O,nothingFound:M,onFocus:D,onBlur:A,searchable:R,placeholder:T,filter:q,limit:B,clearSearchOnChange:G,clearable:Y,clearSearchOnBlur:V,variant:L,onSearchChange:X,searchValue:z,disabled:K,initiallyOpened:ne,radius:Q,icon:ie,rightSection:oe,rightSectionWidth:W,creatable:U,getCreateLabel:ee,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:Oe,clearButtonProps:$e,hoverOnSearchChange:Rt,disableSelectedItemFiltering:ke}=n,ze=SQ(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:We,theme:ct}=xQ({invalid:!!p},{name:"MultiSelect",classNames:h,styles:m,unstyled:ge,size:f,variant:L}),{systemStyles:vn,rest:_t}=Gm(ze),jt=u.useRef(),sr=u.useRef({}),In=Wx(j),[fn,rn]=u.useState(ne),[Yt,hr]=u.useState(-1),[xo,ar]=u.useState("column"),[ir,Is]=od({value:z,defaultValue:"",finalValue:void 0,onChange:X}),[Es,pa]=u.useState(!1),{scrollIntoView:ha,targetRef:il,scrollableRef:ma}=s6({duration:0,offset:5,cancelable:!1,isList:!0}),ll=U&&typeof ee=="function";let qe=null;const At=x.map(Je=>typeof Je=="string"?{label:Je,value:Je}:Je),En=qP({data:At}),[vt,ga]=od({value:bk(b,x),defaultValue:bk(y,x),finalValue:[],onChange:w}),Dr=u.useRef(!!he&&he<vt.length),qd=Je=>{if(!lt){const wt=vt.filter(bt=>bt!==Je);ga(wt),he&&wt.length<he&&(Dr.current=!1)}},Mg=Je=>{Is(Je.currentTarget.value),!K&&!Dr.current&&R&&rn(!0)},Dg=Je=>{typeof D=="function"&&D(Je),!K&&!Dr.current&&R&&rn(!0)},On=XY({data:En,searchable:R,searchValue:ir,limit:B,filter:q,value:vt,disableSelectedItemFiltering:ke});ll&&se(ir,En)&&(qe=ee(ir),On.push({label:ir,value:ir,creatable:!0}));const Os=Math.min(Yt,On.length-1),Xd=(Je,wt,bt)=>{let St=Je;for(;bt(St);)if(St=wt(St),!On[St].disabled)return St;return Je};$o(()=>{hr(Rt&&ir?0:-1)},[ir,Rt]),$o(()=>{!K&&vt.length>x.length&&rn(!1),he&&vt.length<he&&(Dr.current=!1),he&&vt.length>=he&&(Dr.current=!0,rn(!1))},[vt]);const cl=Je=>{if(!lt)if(G&&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&&(Dr.current=!0,rn(!1)),On.length===1&&rn(!1)}},Yc=Je=>{typeof A=="function"&&A(Je),rt&&On[Os]&&fn&&cl(On[Os]),V&&Is(""),rn(!1)},ai=Je=>{if(Es||(mt==null||mt(Je),lt)||Je.key!=="Backspace"&&he&&Dr.current)return;const wt=xo==="column",bt=()=>{hr(Kn=>{var Vt;const kn=Xd(Kn,lr=>lr+1,lr=>lr<On.length-1);return fn&&(il.current=sr.current[(Vt=On[kn])==null?void 0:Vt.value],ha({alignment:wt?"end":"start"})),kn})},St=()=>{hr(Kn=>{var Vt;const kn=Xd(Kn,lr=>lr-1,lr=>lr>0);return fn&&(il.current=sr.current[(Vt=On[kn])==null?void 0:Vt.value],ha({alignment:wt?"start":"end"})),kn})};switch(Je.key){case"ArrowUp":{Je.preventDefault(),rn(!0),wt?St():bt();break}case"ArrowDown":{Je.preventDefault(),rn(!0),wt?bt():St();break}case"Enter":{Je.preventDefault(),On[Os]&&fn?cl(On[Os]):rn(!0);break}case" ":{R||(Je.preventDefault(),On[Os]&&fn?cl(On[Os]):rn(!0));break}case"Backspace":{vt.length>0&&ir.length===0&&(ga(vt.slice(0,-1)),rn(!0),he&&(Dr.current=!1));break}case"Home":{if(!R){Je.preventDefault(),fn||rn(!0);const Kn=On.findIndex(Vt=>!Vt.disabled);hr(Kn),ha({alignment:wt?"end":"start"})}break}case"End":{if(!R){Je.preventDefault(),fn||rn(!0);const Kn=On.map(Vt=>!!Vt.disabled).lastIndexOf(!1);hr(Kn),ha({alignment:wt?"end":"start"})}break}case"Escape":rn(!1)}},Qc=vt.map(Je=>{let wt=En.find(bt=>bt.value===Je&&!bt.disabled);return!wt&&ll&&(wt={value:Je,label:Je}),wt}).filter(Je=>!!Je).map((Je,wt)=>H.createElement(k,vk(Dl({},Je),{variant:L,disabled:K,className:Le.value,readOnly:lt,onRemove:bt=>{bt.preventDefault(),bt.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&&(Dr.current=!1)},va=!lt&&(On.length>0?fn:fn&&!!M);return $o(()=>{const Je=va?ye:me;typeof Je=="function"&&Je()},[va]),H.createElement(Pc.Wrapper,Dl(Dl({required:s,id:In,label:i,error:p,description:c,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:Oe,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":fn&&va?`${In}-items`:null,"aria-controls":In,"aria-expanded":fn,onMouseLeave:()=>hr(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:Ue,value:vt.join(","),form:Re,disabled:K}),H.createElement(Pc,Dl({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:f,variant:L,disabled:K,error:p,required:s,radius:Q,icon:ie,unstyled:ge,onMouseDown:Je=>{var wt;Je.preventDefault(),!K&&!Dr.current&&rn(!fn),(wt=jt.current)==null||wt.focus()},classNames:vk(Dl({},h),{input:We({[Le.input]:!R},h==null?void 0:h.input)})},lE({theme:ct,rightSection:oe,rightSectionWidth:W,styles:m,size:f,shouldClear:Y&&vt.length>0,onClear:Rg,error:p,disabled:K,clearButtonProps:$e,readOnly:lt})),H.createElement("div",{className:Le.values,"data-clearable":Y||void 0},Qc,H.createElement("input",Dl({ref:Ld(t,jt),type:"search",id:In,className:We(Le.searchInput,{[Le.searchInputPointer]:!R,[Le.searchInputInputHidden]:!fn&&vt.length>0||!R&&vt.length>0,[Le.searchInputEmpty]:vt.length===0}),onKeyDown:ai,value:ir,onChange:Mg,onFocus:Dg,onBlur:Yc,readOnly:!R||Dr.current||lt,placeholder:vt.length===0?T:void 0,disabled:K,"data-mantine-stop-propagation":fn,autoComplete:"off",onCompositionStart:()=>pa(!0),onCompositionEnd:()=>pa(!1)},_t)))))),H.createElement(Ba.Dropdown,{component:de||Ym,maxHeight:E,direction:xo,id:In,innerRef:ma,__staticSelector:"MultiSelect",classNames:h,styles:m},H.createElement(Ux,{data:On,hovered:Os,classNames:h,styles:m,uuid:In,__staticSelector:"MultiSelect",onItemHover:hr,onItemSelect:cl,itemsRefs:sr,itemComponent:_,size:f,nothingFound:M,isItemSelected:Zc,creatable:U&&!!qe,createLabel:qe,unstyled:ge,variant:L}))))});dE.displayName="@mantine/core/MultiSelect";var PQ=Object.defineProperty,IQ=Object.defineProperties,EQ=Object.getOwnPropertyDescriptors,Uh=Object.getOwnPropertySymbols,fE=Object.prototype.hasOwnProperty,pE=Object.prototype.propertyIsEnumerable,xk=(e,t,n)=>t in e?PQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sv=(e,t)=>{for(var n in t||(t={}))fE.call(t,n)&&xk(e,n,t[n]);if(Uh)for(var n of Uh(t))pE.call(t,n)&&xk(e,n,t[n]);return e},OQ=(e,t)=>IQ(e,EQ(t)),MQ=(e,t)=>{var n={};for(var r in e)fE.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&&pE.call(e,r)&&(n[r]=e[r]);return n};const DQ={type:"text",size:"sm",__staticSelector:"TextInput"},hE=u.forwardRef((e,t)=>{const n=AI("TextInput",DQ,e),{inputProps:r,wrapperProps:o}=n,s=MQ(n,["inputProps","wrapperProps"]);return H.createElement(Pc.Wrapper,Sv({},o),H.createElement(Pc,OQ(Sv(Sv({},r),s),{ref:t})))});hE.displayName="@mantine/core/TextInput";function RQ({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:i}){if(!t)return e;const c=s!=null&&e.find(p=>p.value===s)||null;if(c&&!i&&(c==null?void 0:c.label)===r){if(n){if(n>=e.length)return e;const p=e.indexOf(c),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 AQ=or(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const NQ=AQ;var TQ=Object.defineProperty,$Q=Object.defineProperties,LQ=Object.getOwnPropertyDescriptors,Gh=Object.getOwnPropertySymbols,mE=Object.prototype.hasOwnProperty,gE=Object.prototype.propertyIsEnumerable,yk=(e,t,n)=>t in e?TQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ku=(e,t)=>{for(var n in t||(t={}))mE.call(t,n)&&yk(e,n,t[n]);if(Gh)for(var n of Gh(t))gE.call(t,n)&&yk(e,n,t[n]);return e},kv=(e,t)=>$Q(e,LQ(t)),zQ=(e,t)=>{var n={};for(var r in e)mE.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&&gE.call(e,r)&&(n[r]=e[r]);return n};function FQ(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function BQ(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const HQ={required:!1,size:"sm",shadow:"sm",itemComponent:Gx,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:FQ,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:BQ,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:Hx("popover"),positionDependencies:[],dropdownPosition:"flip"},ny=u.forwardRef((e,t)=>{const n=AI("Select",HQ,e),{inputProps:r,wrapperProps:o,shadow:s,data:i,value:c,defaultValue:f,onChange:p,itemComponent:h,onKeyDown:m,onBlur:v,onFocus:b,transitionProps:y,initiallyOpened:x,unstyled:w,classNames:k,styles:_,filter:j,maxDropdownHeight:I,searchable:E,clearable:O,nothingFound:M,limit:D,disabled:A,onSearchChange:R,searchValue:T,rightSection:q,rightSectionWidth:B,creatable:G,getCreateLabel:Y,shouldCreate:V,selectOnBlur:L,onCreate:X,dropdownComponent:z,onDropdownClose:K,onDropdownOpen:ne,withinPortal:Q,portalProps:ie,switchDirectionOnFlip:oe,zIndex:W,name:U,dropdownPosition:ee,allowDeselect:se,placeholder:re,filterDataOnExactSearchMatch:fe,form:de,positionDependencies:me,readOnly:ye,clearButtonProps:he,hoverOnSearchChange:ue}=n,De=zQ(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}=NQ(),[Ue,Ct]=u.useState(x),[Xe,tt]=u.useState(-1),ve=u.useRef(),Re=u.useRef({}),[st,mt]=u.useState("column"),ge=st==="column",{scrollIntoView:Ye,targetRef:ot,scrollableRef:lt}=s6({duration:0,offset:5,cancelable:!1,isList:!0}),Oe=se===void 0?O:se,$e=qe=>{if(Ue!==qe){Ct(qe);const At=qe?ne:K;typeof At=="function"&&At()}},Rt=G&&typeof Y=="function";let ke=null;const ze=i.map(qe=>typeof qe=="string"?{label:qe,value:qe}:qe),Le=qP({data:ze}),[We,ct,vn]=od({value:c,defaultValue:f,finalValue:null,onChange:p}),_t=Le.find(qe=>qe.value===We),[jt,sr]=od({value:T,defaultValue:(_t==null?void 0:_t.label)||"",finalValue:void 0,onChange:R}),In=qe=>{sr(qe),E&&typeof R=="function"&&R(qe)},fn=()=>{var qe;ye||(ct(null),vn||In(""),(qe=ve.current)==null||qe.focus())};u.useEffect(()=>{const qe=Le.find(At=>At.value===We);qe?In(qe.label):(!Rt||!We)&&In("")},[We]),u.useEffect(()=>{_t&&(!E||!Ue)&&In(_t.label)},[_t==null?void 0:_t.label]);const rn=qe=>{if(!ye)if(Oe&&(_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=RQ({data:Le,searchable:E,limit:D,searchValue:jt,filter:j,filterDataOnExactSearchMatch:fe,value:We});Rt&&V(jt,Yt)&&(ke=Y(jt),Yt.push({label:jt,value:jt,creatable:!0}));const hr=(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 xo=We?Yt.findIndex(qe=>qe.value===We):0,ar=!ye&&(Yt.length>0?Ue:Ue&&!!M),ir=()=>{tt(qe=>{var At;const En=hr(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=hr(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[xo])==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(xo),$e(!0),Es());break}case"ArrowDown":{qe.preventDefault(),Ue?ge?Is():ir():(tt(xo),$e(!0),Es());break}case"Home":{if(!E){qe.preventDefault(),Ue||$e(!0);const At=Yt.findIndex(En=>!En.disabled);tt(At),ar&&Ye({alignment:ge?"end":"start"})}break}case"End":{if(!E){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" ":{E||(qe.preventDefault(),Yt[Xe]&&Ue?rn(Yt[Xe]):($e(!0),tt(xo),Es()));break}case"Enter":E||qe.preventDefault(),Yt[Xe]&&Ue&&(qe.preventDefault(),rn(Yt[Xe]))}},ha=qe=>{typeof v=="function"&&v(qe);const At=Le.find(En=>En.value===We);L&&Yt[Xe]&&Ue&&rn(Yt[Xe]),In((At==null?void 0:At.label)||""),$e(!1)},il=qe=>{typeof b=="function"&&b(qe),E&&$e(!0)},ma=qe=>{ye||(In(qe.currentTarget.value),O&&qe.currentTarget.value===""&&ct(null),tt(-1),$e(!0))},ll=()=>{ye||($e(!Ue),We&&!Ue&&tt(xo))};return H.createElement(Pc.Wrapper,kv(ku({},o),{__staticSelector:"Select"}),H.createElement(Ba,{opened:ar,transitionProps:y,shadow:s,withinPortal:Q,portalProps:ie,__staticSelector:"Select",onDirectionChange:mt,switchDirectionOnFlip:oe,zIndex:W,dropdownPosition:ee,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:U,value:We||"",form:de,disabled:A}),H.createElement(Pc,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:ll,onBlur:ha,onFocus:il,readOnly:!E||ye,disabled:A,"data-mantine-stop-propagation":ar,name:null,classNames:kv(ku({},k),{input:Be({[je.input]:!E},k==null?void 0:k.input)})}),lE({theme:rt,rightSection:q,rightSectionWidth:B,styles:_,size:r.size,shouldClear:O&&!!_t,onClear:fn,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(Ux,{data:Yt,hovered:Xe,classNames:k,styles:_,isItemSelected:qe=>qe===We,uuid:r.id,__staticSelector:"Select",onItemHover:tt,onItemSelect:rn,itemsRefs:Re,itemComponent:h,size:r.size,nothingFound:M,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,c,f,p,h,m,v,b,y,x,w,k,_,j,I,E,O,M,D,A,R,T,q,B,G,Y,V,L,X,z,K,ne,Q,ie,oe,W,U,ee,se,re,fe,de,me,ye,he,ue,De,je,Be,rt,Ue,Ct,Xe,tt,ve,Re,st,mt,ge,Ye,ot,lt,Oe,$e,Rt,ke,ze,Le,We,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:c,base450:f,base500:p,base550:h,base600:m,base650:v,base700:b,base750:y,base800:x,base850:w,base900:k,base950:_,accent50:j,accent100:I,accent150:E,accent200:O,accent250:M,accent300:D,accent350:A,accent400:R,accent450:T,accent500:q,accent550:B,accent600:G,accent650:Y,accent700:V,accent750:L,accent800:X,accent850:z,accent900:K,accent950:ne,baseAlpha50:Q,baseAlpha100:ie,baseAlpha150:oe,baseAlpha200:W,baseAlpha250:U,baseAlpha300:ee,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:Oe,accentAlpha650:$e,accentAlpha700:Rt,accentAlpha750:ke,accentAlpha800:ze,accentAlpha850:Le,accentAlpha900:We,accentAlpha950:ct}},Ae=(e,t)=>n=>n==="light"?e:t,vE=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:c,base800:f,base900:p,accent200:h,accent300:m,accent400:v,accent500:b,accent600:y}=Bd(),{colorMode:x}=ia(),[w]=ds("shadows",["dark-lg"]),[k,_,j]=ds("space",[1,2,6]),[I]=ds("radii",["base"]),[E]=ds("lineHeights",["base"]);return u.useCallback(()=>({label:{color:Ae(c,r)(x)},separatorLabel:{color:Ae(s,s)(x),"::after":{borderTopColor:Ae(r,c)(x)}},input:{border:"unset",backgroundColor:Ae(e,p)(x),borderRadius:I,borderStyle:"solid",borderWidth:"2px",borderColor:Ae(n,f)(x),color:Ae(p,t)(x),minHeight:"unset",lineHeight:E,height:"auto",paddingRight:0,paddingLeft:0,paddingInlineStart:_,paddingInlineEnd:j,paddingTop:k,paddingBottom:k,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(x)},"&:focus":{borderColor:Ae(m,y)(x)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(x)},"&:focus-within":{borderColor:Ae(h,y)(x)},"&[data-disabled]":{backgroundColor:Ae(r,c)(x),color:Ae(i,o)(x),cursor:"not-allowed"}},value:{backgroundColor:Ae(t,p)(x),color:Ae(p,t)(x),button:{color:Ae(p,t)(x)},"&:hover":{backgroundColor:Ae(r,c)(x),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,f)(x),borderColor:Ae(n,f)(x),boxShadow:w},item:{backgroundColor:Ae(n,f)(x),color:Ae(f,n)(x),padding:6,"&[data-hovered]":{color:Ae(p,t)(x),backgroundColor:Ae(r,c)(x)},"&[data-active]":{backgroundColor:Ae(r,c)(x),"&:hover":{color:Ae(p,t)(x),backgroundColor:Ae(r,c)(x)}},"&[data-selected]":{backgroundColor:Ae(v,y)(x),color:Ae(e,t)(x),fontWeight:600,"&:hover":{backgroundColor:Ae(b,b)(x),color:Ae("white",e)(x)}},"&[data-disabled]":{color:Ae(s,i)(x),cursor:"not-allowed"}},rightSection:{width:32,button:{color:Ae(p,t)(x)}}}),[h,m,v,b,y,t,n,r,o,e,s,i,c,f,p,w,x,E,I,k,_,j])},VQ=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,onChange:o,label:s,disabled:i,...c}=e,f=J(),[p,h]=u.useState(""),m=u.useCallback(x=>{x.shiftKey&&f(Pr(!0))},[f]),v=u.useCallback(x=>{x.shiftKey||f(Pr(!1))},[f]),b=u.useCallback(x=>{o&&o(x)},[o]),y=vE();return a.jsx(Dt,{label:n,placement:"top",hasArrow:!0,children:a.jsx(ny,{ref:r,label:s?a.jsx(dn,{isDisabled:i,children:a.jsx(Gn,{children:s})}):void 0,disabled:i,searchValue:p,onSearchChange:h,onChange:b,onKeyDown:m,onKeyUp:v,searchable:t,maxDropdownHeight:300,styles:y,...c})})},Gt=u.memo(VQ),WQ=ae([be],({changeBoardModal:e})=>{const{isModalOpen:t,imagesToChange:n}=e;return{isModalOpen:t,imagesToChange:n}},Ce),UQ=()=>{const e=J(),[t,n]=u.useState(),{data:r,isFetching:o}=um(),{imagesToChange:s,isModalOpen:i}=F(WQ),[c]=F7(),[f]=B7(),p=u.useMemo(()=>{const b=[{label:"Uncategorized",value:"none"}];return(r??[]).forEach(y=>b.push({label:y.board_name,value:y.board_id})),b},[r]),h=u.useCallback(()=>{e(AC()),e(Tb(!1))},[e]),m=u.useCallback(()=>{!s.length||!t||(t==="none"?f({imageDTOs:s}):c({imageDTOs:s,board_id:t}),n(null),e(AC()))},[c,e,s,f,t]),v=u.useRef(null);return a.jsx(Ad,{isOpen:i,onClose:h,leastDestructiveRef:v,isCentered:!0,children:a.jsx(Vo,{children:a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:"Change Board"}),a.jsx(Wo,{children:a.jsxs($,{sx:{flexDir:"column",gap:4},children:[a.jsxs(xe,{children:["Moving ",`${s.length}`," image",`${s.length>1?"s":""}`," to board:"]}),a.jsx(Gt,{placeholder:o?"Loading...":"Select Board",disabled:o,onChange:b=>n(b),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"})]})]})})})},GQ=u.memo(UQ),KQ=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:i,helperText:c,...f}=e;return a.jsx(Dt,{label:i,hasArrow:!0,placement:"top",isDisabled:!i,children:a.jsx(dn,{isDisabled:n,width:r,alignItems:"center",...o,children:a.jsxs($,{sx:{flexDir:"column",w:"full"},children:[a.jsxs($,{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(Lx,{...f})]}),c&&a.jsx(E5,{children:a.jsx(xe,{variant:"subtext",children:c})})]})})})},Ut=u.memo(KQ),qQ=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||!Do(t)?null:a.jsxs(a.Fragment,{children:[a.jsx(xe,{children:n}),a.jsxs(Id,{sx:{paddingInlineStart:6},children:[t.isInitialImage&&a.jsx(Ao,{children:"Image to Image"}),t.isCanvasImage&&a.jsx(Ao,{children:"Unified Canvas"}),t.isControlNetImage&&a.jsx(Ao,{children:"ControlNet"}),t.isNodesImage&&a.jsx(Ao,{children:"Node Editor"})]}),a.jsx(xe,{children:r})]})},bE=u.memo(qQ),XQ=ae([be,H7],(e,t)=>{const{system:n,config:r,deleteImageModal:o}=e,{shouldConfirmOnDelete:s}=n,{canRestoreDeletedImagesFromBin:i}=r,{imagesToDelete:c,isModalOpen:f}=o,p=(c??[]).map(({image_name:m})=>Ej(e,m)),h={isInitialImage:Do(p,m=>m.isInitialImage),isCanvasImage:Do(p,m=>m.isCanvasImage),isNodesImage:Do(p,m=>m.isNodesImage),isControlNetImage:Do(p,m=>m.isControlNetImage)};return{shouldConfirmOnDelete:s,canRestoreDeletedImagesFromBin:i,imagesToDelete:c,imagesUsage:t,isModalOpen:f,imageUsageSummary:h}},Ce),YQ=()=>{const e=J(),{t}=we(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imagesToDelete:o,imagesUsage:s,isModalOpen:i,imageUsageSummary:c}=F(XQ),f=u.useCallback(v=>e(Oj(!v.target.checked)),[e]),p=u.useCallback(()=>{e(NC()),e(V7(!1))},[e]),h=u.useCallback(()=>{!o.length||!s.length||(e(NC()),e(W7({imageDTOs:o,imagesUsage:s})))},[e,o,s]),m=u.useRef(null);return a.jsx(Ad,{isOpen:i,onClose:p,leastDestructiveRef:m,isCentered:!0,children:a.jsx(Vo,{children:a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),a.jsx(Wo,{children:a.jsxs($,{direction:"column",gap:3,children:[a.jsx(bE,{imageUsage:c}),a.jsx(zr,{}),a.jsx(xe,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),a.jsx(xe,{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"})]})]})})})},QQ=u.memo(YQ),xE=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})})});xE.displayName="IAIIconButton";const Te=u.memo(xE);var yE={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ck=H.createContext&&H.createContext(yE),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)},ZQ=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 CE(e){return e&&e.map(function(t,n){return H.createElement(t.tag,Ha({key:n},t.attr),CE(t.child))})}function Ne(e){return function(t){return H.createElement(JQ,Ha({attr:Ha({},e.attr)},t),CE(e.child))}}function JQ(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,i=ZQ(e,["attr","size","title"]),c=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:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),s&&H.createElement("title",null,s),e.children)};return Ck!==void 0?H.createElement(Ck.Consumer,null,function(n){return t(n)}):t(yE)}function eZ(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 tZ(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 nZ(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 rZ(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 oZ(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 sZ(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 aZ(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 iZ(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 wE(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 lZ(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 cZ(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 SE(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 uZ(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 kE(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 _E(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 dZ(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 fZ(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 pZ(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 hZ(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 mZ(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 gZ(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 vZ(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 bZ(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 jE(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 xZ(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 yZ(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 CZ(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 wZ(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 PE(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 SZ(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 kZ(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 Vi(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 _Z(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 IE(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 jZ(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 PZ(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 EE(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 IZ(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 ME(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 EZ(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 OZ(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 wk(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 nl(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 DE(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 MZ(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 DZ(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 RZ(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 AZ(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 RE(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 NZ(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 TZ(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 Sk(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 AE(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 $Z(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 NE(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 LZ(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 Hr(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 zZ(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 TE(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=u.useMemo(()=>n.includes(e)||r.includes(e)||t.includes(e),[n,r,t,e]),s=u.useMemo(()=>!(n.includes(e)||r.includes(e)||t.includes(e)),[n,r,t,e]);return{isFeatureDisabled:o,isFeatureEnabled:s}};function FZ(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(xe,{fontWeight:600,children:t}),r&&a.jsx(xe,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),a.jsx(Ie,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function BZ({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Ir(),{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"}],c=[{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($,{flexDir:"column",gap:4,children:m.map((v,b)=>a.jsxs($,{flexDir:"column",px:2,gap:4,children:[a.jsx(FZ,{title:v.title,description:v.desc,hotkey:v.hotkey}),b<m.length-1&&a.jsx(zr,{})]},b))});return a.jsxs(a.Fragment,{children:[u.cloneElement(e,{onClick:n}),a.jsxs(Fi,{isOpen:t,onClose:r,children:[a.jsx(Vo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{children:o("hotkeys.keyboardShortcuts")}),a.jsx(Td,{}),a.jsx(Wo,{children:a.jsx(P5,{allowMultiple:!0,children:a.jsxs($,{flexDir:"column",gap:2,children:[a.jsxs(Tl,{children:[a.jsx(Al,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.appHotkeys")}),a.jsx(Nl,{})]})}),a.jsx($l,{children:h(s)})]}),a.jsxs(Tl,{children:[a.jsx(Al,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.generalHotkeys")}),a.jsx(Nl,{})]})}),a.jsx($l,{children:h(i)})]}),a.jsxs(Tl,{children:[a.jsx(Al,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),a.jsx(Nl,{})]})}),a.jsx($l,{children:h(c)})]}),a.jsxs(Tl,{children:[a.jsx(Al,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),a.jsx(Nl,{})]})}),a.jsx($l,{children:h(f)})]}),a.jsxs(Tl,{children:[a.jsx(Al,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.nodesHotkeys")}),a.jsx(Nl,{})]})}),a.jsx($l,{children:h(p)})]})]})})}),a.jsx(gs,{})]})]})]})}function kk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function _k(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var HZ=function(e,t){return typeof t=="boolean"?t:!e},VZ=function(e){return u.useReducer(HZ,e)};const WZ=VZ;function UZ(e,t){t===void 0&&(t=0);var n=u.useRef(!1),r=u.useRef(),o=u.useRef(e),s=u.useCallback(function(){return n.current},[]),i=u.useCallback(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},t)},[t]),c=u.useCallback(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return u.useEffect(function(){o.current=e},[e]),u.useEffect(function(){return i(),c},[t]),[s,c,i]}function GZ(e,t,n){t===void 0&&(t=0),n===void 0&&(n=[]);var r=UZ(e,t),o=r[0],s=r[1],i=r[2];return u.useEffect(i,n),[o,s]}var KZ=function(e,t){t===void 0&&(t=!0);var n=u.useState(!1),r=n[0],o=n[1];return u.useEffect(function(){var s=function(){return o(!0)},i=function(){return o(!1)};t&&e&&e.current&&(kk(e.current,"mouseover",s),kk(e.current,"mouseout",i));var c=e.current;return function(){t&&c&&(_k(c,"mouseover",s),_k(c,"mouseout",i))}},[t,e]),r};const $E=KZ,qZ=({showVersion:e=!0})=>{const{data:t}=U7(),n=u.useRef(null),r=$E(n);return a.jsxs($,{alignItems:"center",gap:5,ps:1,ref:n,children:[a.jsx(Xi,{src:Mj,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),a.jsxs($,{sx:{gap:3,alignItems:"center"},children:[a.jsxs(xe,{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(xe,{sx:{fontWeight:600,marginTop:1,color:"base.300",fontSize:14},variant:"subtext",children:t.version})},"statusText")})]})]})},XZ=u.memo(qZ),YZ=e=>{const{tooltip:t,inputRef:n,label:r,disabled:o,required:s,...i}=e,c=vE();return a.jsx(Dt,{label:t,placement:"top",hasArrow:!0,children:a.jsx(ny,{label:r?a.jsx(dn,{isRequired:s,isDisabled:o,children:a.jsx(Gn,{children:r})}):void 0,disabled:o,ref:n,styles:c,...i})})},$n=u.memo(YZ),QZ={ar:xn.t("common.langArabic",{lng:"ar"}),nl:xn.t("common.langDutch",{lng:"nl"}),en:xn.t("common.langEnglish",{lng:"en"}),fr:xn.t("common.langFrench",{lng:"fr"}),de:xn.t("common.langGerman",{lng:"de"}),he:xn.t("common.langHebrew",{lng:"he"}),it:xn.t("common.langItalian",{lng:"it"}),ja:xn.t("common.langJapanese",{lng:"ja"}),ko:xn.t("common.langKorean",{lng:"ko"}),pl:xn.t("common.langPolish",{lng:"pl"}),pt_BR:xn.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:xn.t("common.langPortuguese",{lng:"pt"}),ru:xn.t("common.langRussian",{lng:"ru"}),zh_CN:xn.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:xn.t("common.langSpanish",{lng:"es"}),uk:xn.t("common.langUkranian",{lng:"ua"})};function Po(e){const{t}=we(),{label:n,textProps:r,useBadge:o=!1,badgeLabel:s=t("settings.experimental"),badgeProps:i,...c}=e;return a.jsxs($,{justifyContent:"space-between",py:1,children:[a.jsxs($,{gap:2,alignItems:"center",children:[a.jsx(xe,{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,{...c})]})}const ZZ=e=>a.jsx($,{sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base",bg:"base.100",_dark:{bg:"base.900"}},children:e.children}),zl=u.memo(ZZ);function JZ(){const e=J(),{data:t,refetch:n}=G7(),[r,{isLoading:o}]=K7(),s=u.useCallback(()=>{r().unwrap().then(c=>{e(q7()),e(Dj()),e(Nt({title:`Cleared ${c} intermediates`,status:"info"}))})},[r,e]);u.useEffect(()=>{n()},[n]);const i=t?`Clear ${t} Intermediate${t>1?"s":""}`:"No Intermediates to Clear";return a.jsxs(zl,{children:[a.jsx(ro,{size:"sm",children:"Clear Intermediates"}),a.jsx(it,{colorScheme:"warning",onClick:s,isLoading:o,isDisabled:!t,children:i}),a.jsx(xe,{fontWeight:"bold",children:"Clearing intermediates will reset your Canvas and ControlNet state."}),a.jsx(xe,{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(xe,{variant:"subtext",children:"Your gallery images will not be deleted."})]})}const eJ=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:c,base800:f,base900:p,accent200:h,accent300:m,accent400:v,accent500:b,accent600:y}=Bd(),{colorMode:x}=ia(),[w]=ds("shadows",["dark-lg"]);return u.useCallback(()=>({label:{color:Ae(c,r)(x)},separatorLabel:{color:Ae(s,s)(x),"::after":{borderTopColor:Ae(r,c)(x)}},searchInput:{":placeholder":{color:Ae(r,c)(x)}},input:{backgroundColor:Ae(e,p)(x),borderWidth:"2px",borderColor:Ae(n,f)(x),color:Ae(p,t)(x),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(x)},"&:focus":{borderColor:Ae(m,y)(x)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(x)},"&:focus-within":{borderColor:Ae(h,y)(x)},"&[data-disabled]":{backgroundColor:Ae(r,c)(x),color:Ae(i,o)(x),cursor:"not-allowed"}},value:{backgroundColor:Ae(n,f)(x),color:Ae(p,t)(x),button:{color:Ae(p,t)(x)},"&:hover":{backgroundColor:Ae(r,c)(x),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,f)(x),borderColor:Ae(n,f)(x),boxShadow:w},item:{backgroundColor:Ae(n,f)(x),color:Ae(f,n)(x),padding:6,"&[data-hovered]":{color:Ae(p,t)(x),backgroundColor:Ae(r,c)(x)},"&[data-active]":{backgroundColor:Ae(r,c)(x),"&:hover":{color:Ae(p,t)(x),backgroundColor:Ae(r,c)(x)}},"&[data-selected]":{backgroundColor:Ae(v,y)(x),color:Ae(e,t)(x),fontWeight:600,"&:hover":{backgroundColor:Ae(b,b)(x),color:Ae("white",e)(x)}},"&[data-disabled]":{color:Ae(s,i)(x),cursor:"not-allowed"}},rightSection:{width:24,padding:20,button:{color:Ae(p,t)(x)}}}),[h,m,v,b,y,t,n,r,o,e,s,i,c,f,p,w,x])},tJ=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,label:o,disabled:s,...i}=e,c=J(),f=u.useCallback(m=>{m.shiftKey&&c(Pr(!0))},[c]),p=u.useCallback(m=>{m.shiftKey||c(Pr(!1))},[c]),h=eJ();return a.jsx(Dt,{label:n,placement:"top",hasArrow:!0,isOpen:!0,children:a.jsx(dE,{label:o?a.jsx(dn,{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})})},nJ=u.memo(tJ),rJ=rr(dm,(e,t)=>({value:t,label:e})).sort((e,t)=>e.label.localeCompare(t.label));function oJ(){const e=J(),{t}=we(),n=F(o=>o.ui.favoriteSchedulers),r=u.useCallback(o=>{e(X7(o))},[e]);return a.jsx(nJ,{label:t("settings.favoriteSchedulers"),value:n,data:rJ,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const sJ=ae([be],({system:e,ui:t,generation:n})=>{const{shouldConfirmOnDelete:r,enableImageDebugging:o,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:c,shouldUseNSFWChecker:f,shouldUseWatermarker:p}=e,{shouldUseSliders:h,shouldShowProgressInViewer:m,shouldAutoChangeDimensions:v}=t,{shouldShowAdvancedOptions:b}=n;return{shouldConfirmOnDelete:r,enableImageDebugging:o,shouldUseSliders:h,shouldShowProgressInViewer:m,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:c,shouldShowAdvancedOptions:b,shouldUseNSFWChecker:f,shouldUseWatermarker:p,shouldAutoChangeDimensions:v}},{memoizeOptions:{resultEqualityCheck:kt}}),aJ=({children:e,config:t})=>{const n=J(),{t:r}=we(),[o,s]=u.useState(3),i=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,c=(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;u.useEffect(()=>{i||n(TC(!1))},[i,n]);const{isNSFWCheckerAvailable:m,isWatermarkerAvailable:v}=Rj(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:b,onOpen:y,onClose:x}=Ir(),{isOpen:w,onOpen:k,onClose:_}=Ir(),{shouldConfirmOnDelete:j,enableImageDebugging:I,shouldUseSliders:E,shouldShowProgressInViewer:O,consoleLogLevel:M,shouldLogToConsole:D,shouldAntialiasProgressImage:A,shouldShowAdvancedOptions:R,shouldUseNSFWChecker:T,shouldUseWatermarker:q,shouldAutoChangeDimensions:B}=F(sJ),G=u.useCallback(()=>{Object.keys(window.localStorage).forEach(Q=>{(Y7.includes(Q)||Q.startsWith(Q7))&&localStorage.removeItem(Q)}),x(),k(),setInterval(()=>s(Q=>Q-1),1e3)},[x,k]);u.useEffect(()=>{o<=0&&window.location.reload()},[o]);const Y=u.useCallback(Q=>{n(Z7(Q))},[n]),V=u.useCallback(Q=>{n(J7(Q))},[n]),L=u.useCallback(Q=>{n(TC(Q.target.checked))},[n]),{colorMode:X,toggleColorMode:z}=ia(),K=qt("localization").isFeatureEnabled,ne=F(OP);return a.jsxs(a.Fragment,{children:[u.cloneElement(e,{onClick:y}),a.jsxs(Fi,{isOpen:b,onClose:x,size:"2xl",isCentered:!0,children:[a.jsx(Vo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{bg:"none",children:r("common.settingsLabel")}),a.jsx(Td,{}),a.jsx(Wo,{children:a.jsxs($,{sx:{gap:4,flexDirection:"column"},children:[a.jsxs(zl,{children:[a.jsx(ro,{size:"sm",children:r("settings.general")}),a.jsx(Po,{label:r("settings.confirmOnDelete"),isChecked:j,onChange:Q=>n(Oj(Q.target.checked))}),f&&a.jsx(Po,{label:r("settings.showAdvancedOptions"),isChecked:R,onChange:Q=>n(eD(Q.target.checked))})]}),a.jsxs(zl,{children:[a.jsx(ro,{size:"sm",children:r("settings.generation")}),a.jsx(oJ,{}),a.jsx(Po,{label:"Enable NSFW Checker",isDisabled:!m,isChecked:T,onChange:Q=>n(tD(Q.target.checked))}),a.jsx(Po,{label:"Enable Invisible Watermark",isDisabled:!v,isChecked:q,onChange:Q=>n(nD(Q.target.checked))})]}),a.jsxs(zl,{children:[a.jsx(ro,{size:"sm",children:r("settings.ui")}),a.jsx(Po,{label:r("common.darkMode"),isChecked:X==="dark",onChange:z}),a.jsx(Po,{label:r("settings.useSlidersForAll"),isChecked:E,onChange:Q=>n(rD(Q.target.checked))}),a.jsx(Po,{label:r("settings.showProgressInViewer"),isChecked:O,onChange:Q=>n(Aj(Q.target.checked))}),a.jsx(Po,{label:r("settings.antialiasProgressImages"),isChecked:A,onChange:Q=>n(oD(Q.target.checked))}),a.jsx(Po,{label:r("settings.autoChangeDimensions"),isChecked:B,onChange:Q=>n(sD(Q.target.checked))}),h&&a.jsx($n,{disabled:!K,label:r("common.languagePickerLabel"),value:ne,data:Object.entries(QZ).map(([Q,ie])=>({value:Q,label:ie})),onChange:V})]}),i&&a.jsxs(zl,{children:[a.jsx(ro,{size:"sm",children:r("settings.developer")}),a.jsx(Po,{label:r("settings.shouldLogToConsole"),isChecked:D,onChange:L}),a.jsx($n,{disabled:!D,label:r("settings.consoleLogLevel"),onChange:Y,value:M,data:aD.concat()}),a.jsx(Po,{label:r("settings.enableImageDebugging"),isChecked:I,onChange:Q=>n(iD(Q.target.checked))})]}),p&&a.jsx(JZ,{}),a.jsxs(zl,{children:[a.jsx(ro,{size:"sm",children:r("settings.resetWebUI")}),a.jsx(it,{colorScheme:"error",onClick:G,children:r("settings.resetWebUI")}),c&&a.jsxs(a.Fragment,{children:[a.jsx(xe,{variant:"subtext",children:r("settings.resetWebUIDesc1")}),a.jsx(xe,{variant:"subtext",children:r("settings.resetWebUIDesc2")})]})]})]})}),a.jsx(gs,{children:a.jsx(it,{onClick:x,children:r("common.close")})})]})]}),a.jsxs(Fi,{closeOnOverlayClick:!1,isOpen:w,onClose:_,isCentered:!0,closeOnEsc:!1,children:[a.jsx(Vo,{backdropFilter:"blur(40px)"}),a.jsxs(Bi,{children:[a.jsx(Ho,{}),a.jsx(Wo,{children:a.jsx($,{justifyContent:"center",children:a.jsx(xe,{fontSize:"lg",children:a.jsxs(xe,{children:[r("settings.resetComplete")," Reloading in ",o,"..."]})})})}),a.jsx(gs,{})]})]})]})},iJ=u.memo(aJ),lJ=ae(go,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),jk={ok:"green.400",working:"yellow.400",error:"red.400"},Pk={ok:"green.600",working:"yellow.500",error:"red.500"},cJ=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,statusTranslationKey:o}=F(lJ),{t:s}=we(),i=u.useRef(null),c=u.useMemo(()=>t?"working":e?"ok":"error",[t,e]),f=u.useMemo(()=>{if(n&&r)return` (${n}/${r})`},[n,r]),p=$E(i);return a.jsxs($,{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(xe,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:Pk[c],_dark:{color:jk[c]}},children:[s(o),f]})},"statusText")}),a.jsx(An,{as:uZ,sx:{boxSize:"0.5rem",color:Pk[c],_dark:{color:jk[c]}}})]})},uJ=u.memo(cJ),dJ=()=>{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($,{sx:{gap:2,alignItems:"center"},children:[a.jsx(XZ,{}),a.jsx(Za,{}),a.jsx(uJ,{}),a.jsxs(Dd,{children:[a.jsx(Rd,{as:Te,variant:"link","aria-label":e("accessibility.menu"),icon:a.jsx(lZ,{}),sx:{boxSize:8}}),a.jsxs(Ga,{motionProps:gc,children:[a.jsxs(wc,{title:e("common.communityLabel"),children:[r&&a.jsx(Ht,{as:"a",href:o,target:"_blank",icon:a.jsx(tZ,{}),children:e("common.githubLabel")}),t&&a.jsx(Ht,{as:"a",href:`${o}/issues`,target:"_blank",icon:a.jsx(cZ,{}),children:e("common.reportBugLabel")}),n&&a.jsx(Ht,{as:"a",href:s,target:"_blank",icon:a.jsx(eZ,{}),children:e("common.discordLabel")})]}),a.jsxs(wc,{title:e("common.settingsLabel"),children:[a.jsx(BZ,{children:a.jsx(Ht,{as:"button",icon:a.jsx(jZ,{}),children:e("common.hotkeysLabel")})}),a.jsx(iJ,{children:a.jsx(Ht,{as:"button",icon:a.jsx(_E,{}),children:e("common.settingsLabel")})})]})]})]})]})},fJ=u.memo(dJ),pJ=ae(go,e=>{const{isUploading:t}=e;let n="";return t&&(n="Uploading..."),{tooltip:n,shouldShow:t}}),hJ=()=>{const{shouldShow:e,tooltip:t}=F(pJ);return e?a.jsx($,{sx:{alignItems:"center",justifyContent:"center",color:"base.600"},children:a.jsx(Dt,{label:t,placement:"right",hasArrow:!0,children:a.jsx(Ki,{})})}):null},mJ=u.memo(hJ);/*!
|
||
* OverlayScrollbars
|
||
* Version: 2.2.1
|
||
*
|
||
* Copyright (c) Rene Haas | KingSora.
|
||
* https://github.com/KingSora
|
||
*
|
||
* Released under the MIT license.
|
||
*/function Mt(e,t){if(og(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Mt(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?Mk(e,s,t):t.reduce((i,c)=>(i[c]=Mk(e,s,c),i),o)}return o}e&&Mt(Br(t),o=>MJ(e,o,t[o]))}const Oo=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,i;const c=(h,m)=>{const v=s,b=h,y=m||(r?!r(v,b):v!==b);return(y||o)&&(s=b,i=v),[s,y,i]};return[t?h=>c(t(s,i),h):c,h=>[s,!!h,i]]},Hd=()=>typeof window<"u",LE=Hd()&&Node.ELEMENT_NODE,{toString:gJ,hasOwnProperty:_v}=Object.prototype,fa=e=>e===void 0,rg=e=>e===null,vJ=e=>fa(e)||rg(e)?`${e}`:gJ.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Va=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=Va(t)&&t>-1&&t%1==0;return Ko(e)||!Go(e)&&n?t>0&&ad(e)?t-1 in e:!0:!1},tb=e=>{if(!e||!ad(e)||vJ(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===LE:!1},sg=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===LE:!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),Wi=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{Lt(n,r)}):Mt(e,r=>{Lt(n,r)}),n)},sy=e=>!!e&&e.length===0,js=(e,t,n)=>{Mt(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},ag=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Br=e=>e?Object.keys(e):[],cn=(e,t,n,r,o,s,i)=>{const c=[t,n,r,o,s,i];return(typeof e!="object"||rg(e))&&!Go(e)&&(e={}),Mt(c,f=>{Mt(Br(f),p=>{const h=f[p];if(e===h)return!0;const m=Ko(h);if(h&&(tb(h)||m)){const v=e[p];let b=v;m&&!Ko(v)?b=[]:!m&&!tb(v)&&(b={}),e[p]=cn(b,h)}else e[p]=h})}),e},ay=e=>{for(const t in e)return!1;return!0},zE=(e,t,n,r)=>{if(fa(r))return n?n[e]:t;n&&(ni(r)||Va(r))&&(n[e]=r)},Jn=(e,t,n)=>{if(fa(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},yr=(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=Wi(s).join(" ").trim();Jn(e,t,i)}},bJ=(e,t,n)=>{const r=Jn(e,t)||"";return new Set(r.split(" ")).has(n)},zo=(e,t)=>zE("scrollLeft",0,e,t),Zs=(e,t)=>zE("scrollTop",0,e,t),nb=Hd()&&Element.prototype,FE=(e,t)=>{const n=[],r=t?sg(t)?t:null:document;return r?Lt(n,r.querySelectorAll(e)):n},xJ=(e,t)=>{const n=t?sg(t)?t:null:document;return n?n.querySelector(e):null},qh=(e,t)=>sg(e)?(nb.matches||nb.msMatchesSelector).call(e,t):!1,iy=e=>e?Wi(e.childNodes):[],ra=e=>e?e.parentElement:null,Gl=(e,t)=>{if(sg(e)){const n=nb.closest;if(n)return n.call(e,t);do{if(qh(e,t))return e;e=ra(e)}while(e)}return null},yJ=(e,t,n)=>{const r=e&&Gl(e,t),o=e&&xJ(n,r),s=Gl(o,t)===r;return r&&o?r===e||o===e||s&&Gl(Gl(e,n),t)!==r:!1},ly=(e,t,n)=>{if(n&&e){let r=t,o;og(n)?(o=document.createDocumentFragment(),Mt(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)}},io=(e,t)=>{ly(e,null,t)},CJ=(e,t)=>{ly(ra(e),e,t)},Ik=(e,t)=>{ly(ra(e),e&&e.nextSibling,t)},bs=e=>{if(og(e))Mt(Wi(e),t=>bs(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},BE=e=>{const t=Ei();return t.innerHTML=e.trim(),Mt(iy(t),n=>bs(n))},rb=e=>e.charAt(0).toUpperCase()+e.slice(1),wJ=()=>Ei().style,SJ=["-webkit-","-moz-","-o-","-ms-"],kJ=["WebKit","Moz","O","MS","webkit","moz","o","ms"],jv={},Pv={},_J=e=>{let t=Pv[e];if(ag(Pv,e))return t;const n=rb(e),r=wJ();return Mt(SJ,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,rb(s)+n].find(c=>r[c]!==void 0))}),Pv[e]=t||""},Vd=e=>{if(Hd()){let t=jv[e]||window[e];return ag(jv,e)||(Mt(kJ,n=>(t=t||window[n+rb(e)],!t)),jv[e]=t),t}},jJ=Vd("MutationObserver"),Ek=Vd("IntersectionObserver"),Kl=Vd("ResizeObserver"),HE=Vd("cancelAnimationFrame"),VE=Vd("requestAnimationFrame"),Xh=Hd()&&window.setTimeout,ob=Hd()&&window.clearTimeout,PJ=/[^\x20\t\r\n\f]+/g,WE=(e,t,n)=>{const r=e&&e.classList;let o,s=0,i=!1;if(r&&t&&ni(t)){const c=t.match(PJ)||[];for(i=c.length>0;o=c[s++];)i=!!n(r,o)&&i}return i},cy=(e,t)=>{WE(e,t,(n,r)=>n.remove(r))},Js=(e,t)=>(WE(e,t,(n,r)=>n.add(r)),cy.bind(0,e,t)),ig=(e,t,n,r)=>{if(e&&t){let o=!0;return Mt(n,s=>{const i=r?r(e[s]):e[s],c=r?r(t[s]):t[s];i!==c&&(o=!1)}),o}return!1},UE=(e,t)=>ig(e,t,["w","h"]),GE=(e,t)=>ig(e,t,["x","y"]),IJ=(e,t)=>ig(e,t,["t","r","b","l"]),Ok=(e,t,n)=>ig(e,t,["width","height"],n&&(r=>Math.round(r))),so=()=>{},Fl=e=>{let t;const n=e?Xh:VE,r=e?ob:HE;return[o=>{r(t),t=n(o,Go(e)?e():e)},()=>r(t)]},uy=(e,t)=>{let n,r,o,s=so;const{v:i,g:c,p:f}=t||{},p=function(y){s(),ob(n),n=r=void 0,s=so,e.apply(this,y)},h=b=>f&&r?f(r,b):b,m=()=>{s!==so&&p(h(o)||o)},v=function(){const y=Wi(arguments),x=Go(i)?i():i;if(Va(x)&&x>=0){const k=Go(c)?c():c,_=Va(k)&&k>=0,j=x>0?Xh:VE,I=x>0?ob:HE,O=h(y)||y,M=p.bind(0,O);s();const D=j(M,x);s=()=>I(D),_&&!n&&(n=Xh(m,k)),r=o=O}else p(y)};return v.m=m,v},EJ={opacity:1,zindex:1},hp=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},OJ=(e,t)=>!EJ[e.toLowerCase()]&&Va(t)?`${t}px`:t,Mk=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],MJ=(e,t,n)=>{try{const{style:r}=e;fa(r[t])?r.setProperty(t,n):r[t]=OJ(t,n)}catch{}},id=e=>er(e,"direction")==="rtl",Dk=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,i=`${r}right${o}`,c=`${r}bottom${o}`,f=`${r}left${o}`,p=er(e,[s,i,c,f]);return{t:hp(p[s],!0),r:hp(p[i],!0),b:hp(p[c],!0),l:hp(p[f],!0)}},{round:Rk}=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-Rk(n),h:t-Rk(t)}},fs=e=>e.getBoundingClientRect();let mp;const DJ=()=>{if(fa(mp)){mp=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){mp=!0}}))}catch{}}return mp},KE=e=>e.split(" "),RJ=(e,t,n,r)=>{Mt(KE(t),o=>{e.removeEventListener(o,n,r)})},Nn=(e,t,n,r)=>{var o;const s=DJ(),i=(o=s&&r&&r.S)!=null?o:s,c=r&&r.$||!1,f=r&&r.C||!1,p=[],h=s?{passive:i,capture:c}:c;return Mt(KE(t),m=>{const v=f?b=>{e.removeEventListener(m,v,c),n&&n(b)}:n;Lt(p,RJ.bind(null,e,m,v,c)),e.addEventListener(m,v,h)}),js.bind(0,p)},qE=e=>e.stopPropagation(),XE=e=>e.preventDefault(),AJ={x:0,y:0},Iv=e=>{const t=e?fs(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:AJ},Ak=(e,t)=>{Mt(Ko(t)?t:[t],e)},fy=e=>{const t=new Map,n=(s,i)=>{if(s){const c=t.get(s);Ak(f=>{c&&c[f?"delete":"clear"](f)},i)}else t.forEach(c=>{c.clear()}),t.clear()},r=(s,i)=>{if(ni(s)){const p=t.get(s)||new Set;return t.set(s,p),Ak(h=>{Go(h)&&p.add(h)},i),n.bind(0,s,i)}ry(i)&&i&&n();const c=Br(s),f=[];return Mt(c,p=>{const h=s[p];h&&Lt(f,r(p,h))}),js.bind(0,f)},o=(s,i)=>{const c=t.get(s);Mt(Wi(c),f=>{i&&!sy(i)?f.apply(0,i):f()})};return r(e||{}),[r,n,o]},Nk=e=>JSON.stringify(e,(t,n)=>{if(Go(n))throw new Error;return n}),NJ={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"]}},YE=(e,t)=>{const n={},r=Br(t).concat(Br(e));return Mt(r,o=>{const s=e[o],i=t[o];if(ad(s)&&ad(i))cn(n[o]={},YE(s,i)),ay(n[o])&&delete n[o];else if(ag(t,o)&&i!==s){let c=!0;if(Ko(s)||Ko(i))try{Nk(s)===Nk(i)&&(c=!1)}catch{}c&&(n[o]=i)}}),n},QE="os-environment",ZE=`${QE}-flexbox-glue`,TJ=`${ZE}-max`,JE="os-scrollbar-hidden",Ev="data-overlayscrollbars-initialize",Mo="data-overlayscrollbars",eO=`${Mo}-overflow-x`,tO=`${Mo}-overflow-y`,ic="overflowVisible",$J="scrollbarHidden",Tk="scrollbarPressed",Zh="updating",Oa="data-overlayscrollbars-viewport",Ov="arrange",nO="scrollbarHidden",lc=ic,sb="data-overlayscrollbars-padding",LJ=lc,$k="data-overlayscrollbars-content",py="os-size-observer",zJ=`${py}-appear`,FJ=`${py}-listener`,BJ="os-trinsic-observer",HJ="os-no-css-vars",VJ="os-theme-none",Or="os-scrollbar",WJ=`${Or}-rtl`,UJ=`${Or}-horizontal`,GJ=`${Or}-vertical`,rO=`${Or}-track`,hy=`${Or}-handle`,KJ=`${Or}-visible`,qJ=`${Or}-cornerless`,Lk=`${Or}-transitionless`,zk=`${Or}-interaction`,Fk=`${Or}-unusable`,Bk=`${Or}-auto-hidden`,Hk=`${Or}-wheel`,XJ=`${rO}-interactive`,YJ=`${hy}-interactive`,oO={},Ui=()=>oO,QJ=e=>{const t=[];return Mt(Ko(e)?e:[e],n=>{const r=Br(n);Mt(r,o=>{Lt(t,oO[o]=n[o])})}),t},ZJ="__osOptionsValidationPlugin",JJ="__osSizeObserverPlugin",my="__osScrollbarsHidingPlugin",eee="__osClickScrollPlugin";let Mv;const Vk=(e,t,n,r)=>{io(e,t);const o=Lp(t),s=ld(t),i=Qh(n);return r&&bs(t),{x:s.h-o.h+i.h,y:s.w-o.w+i.w}},tee=e=>{let t=!1;const n=Js(e,JE);try{t=er(e,_J("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},nee=(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}},ree=(e,t)=>{const n=Js(e,ZE),r=fs(e),o=fs(t),s=Ok(o,r,!0),i=Js(e,TJ),c=fs(e),f=fs(t),p=Ok(f,c,!0);return n(),i(),s&&p},oee=()=>{const{body:e}=document,n=BE(`<div class="${QE}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=fy(),[i,c]=Oo({o:Vk(e,n,r),u:GE},Vk.bind(0,e,n,r,!0)),[f]=c(),p=tee(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({},NJ),b=cn.bind(0,{},v),y=cn.bind(0,{},m),x={k:f,A:h,I:p,L:er(n,"zIndex")==="-1",B:nee(n,r),V:ree(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:y,q:_=>cn(m,_)&&y(),F:b,G:_=>cn(v,_)&&b(),X:cn({},m),U:cn({},v)},w=window.addEventListener,k=uy(_=>s(_?"z":"r"),{v:33,g:99});if(yr(n,"style"),bs(n),w("resize",k.bind(0,!1)),!p&&(!h.x||!h.y)){let _;w("resize",()=>{const j=Ui()[my];_=_||j&&j.R(),_&&_(x,i,k.bind(0,!0))})}return x},Mr=()=>(Mv||(Mv=oee()),Mv),gy=(e,t)=>Go(t)?t.apply(0,e):t,see=(e,t,n,r)=>{const o=fa(r)?n:r;return gy(e,o)||t.apply(0,e)},sO=(e,t,n,r)=>{const o=fa(r)?n:r,s=gy(e,o);return!!s&&(Kh(s)?s:t.apply(0,e))},aee=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:i}=Mr(),{nativeScrollbarsOverlaid:c,body:f}=t,p=r??c,h=fa(o)?f:o,m=(s.x||s.y)&&p,v=e&&(rg(h)?!i:h);return!!m||!!v},vy=new WeakMap,iee=(e,t)=>{vy.set(e,t)},lee=e=>{vy.delete(e)},aO=e=>vy.get(e),Wk=(e,t)=>e?t.split(".").reduce((n,r)=>n&&ag(n,r)?n[r]:void 0,e):void 0,ab=(e,t,n)=>r=>[Wk(e,r),n||Wk(t,r)!==void 0],iO=e=>{let t=e;return[()=>t,n=>{t=cn({},t,n)}]},gp="tabindex",vp=Ei.bind(0,""),Dv=e=>{io(ra(e),iy(e)),bs(e)},cee=e=>{const t=Mr(),{N:n,I:r}=t,o=Ui()[my],s=o&&o.T,{elements:i}=n(),{host:c,padding:f,viewport:p,content:h}=i,m=Kh(e),v=m?{}:e,{elements:b}=v,{host:y,padding:x,viewport:w,content:k}=b||{},_=m?e:v.target,j=qh(_,"textarea"),I=_.ownerDocument,E=I.documentElement,O=_===I.body,M=I.defaultView,D=see.bind(0,[_]),A=sO.bind(0,[_]),R=gy.bind(0,[_]),T=D.bind(0,vp,p),q=A.bind(0,vp,h),B=T(w),G=B===_,Y=G&&O,V=!G&&q(k),L=!G&&Kh(B)&&B===V,X=L&&!!R(h),z=X?T():B,K=X?V:q(),Q=Y?E:L?z:B,ie=j?D(vp,c,y):_,oe=Y?Q:ie,W=L?K:V,U=I.activeElement,ee=!G&&M.top===M&&U===_,se={W:_,Z:oe,J:Q,K:!G&&A(vp,f,x),tt:W,nt:!G&&!r&&s&&s(t),ot:Y?E:Q,st:Y?I:Q,et:M,ct:I,rt:j,it:O,lt:m,ut:G,dt:L,ft:(Xe,tt)=>bJ(Q,G?Mo:Oa,G?tt:Xe),_t:(Xe,tt,ve)=>Ii(Q,G?Mo:Oa,G?tt:Xe,ve)},re=Br(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=[()=>{yr(me,Mo),yr(me,Ev),yr(de,Ev),O&&(yr(E,Mo),yr(E,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,Mo,G?"viewport":"host"),Jn(ye,sb,""),Jn(ue,$k,""),G||Jn(he,Oa,"");const Xe=O&&!G?Js(ra(_),JE):so;if(Be&&(Ik(de,me),Lt(je,()=>{Ik(me,de),bs(me)})),io(Ue,rt),io(me,ye),io(ye||me,!G&&he),io(he,ue),Lt(je,()=>{Xe(),yr(ye,sb),yr(ue,$k),yr(he,eO),yr(he,tO),yr(he,Oa),fe(ue)&&Dv(ue),fe(he)&&Dv(he),fe(ye)&&Dv(ye)}),r&&!G&&(Ii(he,Oa,nO,!0),Lt(je,yr.bind(0,he,Oa))),De&&(CJ(he,De),Lt(je,bs.bind(0,De))),ee){const tt=Jn(he,gp);Jn(he,gp,"-1"),he.focus();const ve=()=>tt?Jn(he,gp,tt):yr(he,gp),Re=Nn(I,"pointerdown keydown",()=>{ve(),Re()});Lt(je,[ve,Re])}else U&&U.focus&&U.focus();rt=0},js.bind(0,je)]},uee=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=Mr(),{ht:i}=r(),{vt:c}=o,f=(n||!s)&&c;return f&&er(n,{height:i?"":"100%"}),{gt:f,wt:f}}},dee=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,ut:c}=e,[f,p]=Oo({u:IJ,o:Dk()},Dk.bind(0,o,"padding",""));return(h,m,v)=>{let[b,y]=p(v);const{I:x,V:w}=Mr(),{bt:k}=n(),{gt:_,wt:j,yt:I}=h,[E,O]=m("paddingAbsolute");(_||y||!w&&j)&&([b,y]=f(v));const D=!c&&(O||I||y);if(D){const A=!E||!s&&!x,R=b.r+b.l,T=b.t+b.b,q={marginRight:A&&!k?-R:0,marginBottom:A?-T:0,marginLeft:A&&k?-R:0,top:A?-b.t:0,right:A?k?-b.r:"auto":0,left:A?k?"auto":-b.l:0,width:A?`calc(100% + ${R}px)`:""},B={paddingTop:A?b.t:0,paddingRight:A?b.r:0,paddingBottom:A?b.b:0,paddingLeft:A?b.l:0};er(s||i,q),er(i,B),r({K:b,St:!A,P:s?B:cn({},q,B)})}return{xt:D}}},{max:ib}=Math,Ma=ib.bind(0,0),lO="visible",Uk="hidden",fee=42,bp={u:UE,o:{w:0,h:0}},pee={u:GE,o:{x:Uk,y:Uk}},hee=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Ma(e.w-t.w),h:Ma(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},xp=e=>e.indexOf(lO)===0,mee=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,nt:c,ut:f,_t:p,it:h,et:m}=e,{k:v,V:b,I:y,A:x}=Mr(),w=Ui()[my],k=!f&&!y&&(x.x||x.y),_=h&&f,[j,I]=Oo(bp,Qh.bind(0,i)),[E,O]=Oo(bp,Yh.bind(0,i)),[M,D]=Oo(bp),[A,R]=Oo(bp),[T]=Oo(pee),q=(X,z)=>{if(er(i,{height:""}),z){const{St:K,K:ne}=n(),{$t:Q,D:ie}=X,oe=Qh(o),W=Lp(o),U=er(i,"boxSizing")==="content-box",ee=K||U?ne.b+ne.t:0,se=!(x.x&&U);er(i,{height:W.h+oe.h+(Q.x&&se?ie.x:0)-ee})}},B=(X,z)=>{const K=!y&&!X?fee:0,ne=(fe,de,me)=>{const ye=er(i,fe),ue=(z?z[fe]:ye)==="scroll";return[ye,ue,ue&&!y?de?K:me:0,de&&!!K]},[Q,ie,oe,W]=ne("overflowX",x.x,v.x),[U,ee,se,re]=ne("overflowY",x.y,v.y);return{Ct:{x:Q,y:U},$t:{x:ie,y:ee},D:{x:oe,y:se},M:{x:W,y:re}}},G=(X,z,K,ne)=>{const Q=(ee,se)=>{const re=xp(ee),fe=se&&re&&ee.replace(`${lO}-`,"")||"";return[se&&!re?ee:"",xp(fe)?"hidden":fe]},[ie,oe]=Q(K.x,z.x),[W,U]=Q(K.y,z.y);return ne.overflowX=oe&&W?oe:ie,ne.overflowY=U&&ie?U:W,B(X,ne)},Y=(X,z,K,ne)=>{const{D:Q,M:ie}=X,{x:oe,y:W}=ie,{x:U,y:ee}=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% + ${ee+-1*de}px)`,ne[re]=-ee+de,ne.marginBottom=-U+me,K&&(ne[fe]=ye+(W?ee:0),ne.paddingBottom=he+(oe?U:0))},[V,L]=w?w.H(k,b,i,c,n,B,Y):[()=>k,()=>[so]];return(X,z,K)=>{const{gt:ne,Ot:Q,wt:ie,xt:oe,vt:W,yt:U}=X,{ht:ee,bt:se}=n(),[re,fe]=z("showNativeOverlaidScrollbars"),[de,me]=z("overflow"),ye=re&&x.x&&x.y,he=!f&&!b&&(ne||ie||Q||fe||W),ue=xp(de.x),De=xp(de.y),je=ue||De;let Be=I(K),rt=O(K),Ue=D(K),Ct=R(K),Xe;if(fe&&y&&p(nO,$J,!ye),he&&(Xe=B(ye),q(Xe,ee)),ne||oe||ie||U||fe){je&&p(lc,ic,!1);const[ke,ze]=L(ye,se,Xe),[Le,We]=Be=j(K),[ct,vn]=rt=E(K),_t=Lp(i);let jt=ct,sr=_t;ke(),(vn||We||fe)&&ze&&!ye&&V(ze,ct,Le,se)&&(sr=Lp(i),jt=Yh(i));const In={w:Ma(ib(ct.w,jt.w)+Le.w),h:Ma(ib(ct.h,jt.h)+Le.h)},fn={w:Ma((_?m.innerWidth:sr.w+Ma(_t.w-ct.w))+Le.w),h:Ma((_?m.innerHeight+Le.h:sr.h+Ma(_t.h-ct.h))+Le.h)};Ct=A(fn),Ue=M(hee(In,fn),K)}const[tt,ve]=Ct,[Re,st]=Ue,[mt,ge]=rt,[Ye,ot]=Be,lt={x:Re.w>0,y:Re.h>0},Oe=ue&&De&&(lt.x||lt.y)||ue&<.x&&!lt.y||De&<.y&&!lt.x;if(oe||U||ot||ge||ve||st||me||fe||he){const ke={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},ze=G(ye,lt,de,ke),Le=V(ze,mt,Ye,se);f||Y(ze,se,Le,ke),he&&q(ze,ee),f?(Jn(o,eO,ke.overflowX),Jn(o,tO,ke.overflowY)):er(i,ke)}Ii(o,Mo,ic,Oe),Ii(s,sb,LJ,Oe),f||Ii(i,Oa,lc,je);const[$e,Rt]=T(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}}},Gk=(e,t,n)=>{const r={},o=t||{},s=Br(e).concat(Br(o));return Mt(s,i=>{const c=e[i],f=o[i];r[i]=!!(n||c||f)}),r},gee=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:i,A:c,V:f}=Mr(),p=!i&&(c.x||c.y),h=[uee(e,t),dee(e,t),mee(e,t)];return(m,v,b)=>{const y=Gk(cn({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},v),{},b),x=p||!f,w=x&&zo(r),k=x&&Zs(r);o("",Zh,!0);let _=y;return Mt(h,j=>{_=Gk(_,j(_,m,!!b)||{},b)}),zo(r,w),Zs(r,k),o("",Zh),s||(zo(n,0),Zs(n,0)),_}},vee=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},i=c=>{if(n){const f=n.reduce((p,h)=>{if(h){const[m,v]=h,b=v&&m&&(c?c(m):FE(m,e));b&&b.length&&v&&ni(v)&&Lt(p,[b,v.trim()],!0)}return p},[]);Mt(f,p=>Mt(p[0],h=>{const m=p[1],v=r.get(h)||[];if(e.contains(h)){const y=Nn(h,m,x=>{o?(y(),r.delete(h)):t(x)});r.set(h,Lt(v,y))}else js(v),r.delete(h)}))}};return n&&(r=new WeakMap,i()),[s,i]},Kk=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:i,Dt:c,Mt:f,Rt:p,kt:h}=r||{},m=uy(()=>{o&&n(!0)},{v:33,g:99}),[v,b]=vee(e,m,c),y=s||[],x=i||[],w=y.concat(x),k=(j,I)=>{const E=p||so,O=h||so,M=new Set,D=new Set;let A=!1,R=!1;if(Mt(j,T=>{const{attributeName:q,target:B,type:G,oldValue:Y,addedNodes:V,removedNodes:L}=T,X=G==="attributes",z=G==="childList",K=e===B,ne=X&&ni(q)?Jn(B,q):0,Q=ne!==0&&Y!==ne,ie=oy(x,q)>-1&&Q;if(t&&(z||!K)){const oe=!X,W=X&&Q,U=W&&f&&qh(B,f),se=(U?!E(B,q,Y,ne):oe||W)&&!O(T,!!U,e,r);Mt(V,re=>M.add(re)),Mt(L,re=>M.add(re)),R=R||se}!t&&K&&Q&&!E(B,q,Y,ne)&&(D.add(q),A=A||ie)}),M.size>0&&b(T=>Wi(M).reduce((q,B)=>(Lt(q,FE(T,B)),qh(B,T)?Lt(q,B):q),[])),t)return!I&&R&&n(!1),[!1];if(D.size>0||A){const T=[Wi(D),A];return!I&&n.apply(0,T),T}},_=new jJ(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),cO=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Ui()[JJ],{B:i}=Mr(),f=BE(`<div class="${py}"><div class="${FJ}"></div></div>`)[0],p=f.firstChild,h=id.bind(0,e),[m]=Oo({o:void 0,_:!0,u:(x,w)=>!(!x||!Cp(x)&&Cp(w))}),v=x=>{const w=Ko(x)&&x.length>0&&ad(x[0]),k=!w&&ry(x[0]);let _=!1,j=!1,I=!0;if(w){const[E,,O]=m(x.pop().contentRect),M=Cp(E),D=Cp(O);_=!O||!M,j=!D&&M,I=!_}else k?[,I]=x:j=x===!0;if(r&&I){const E=k?x[0]:id(f);zo(f,E?i.n?-yp:i.i?0:yp:yp),Zs(f,yp)}_||t({gt:!k,Yt:k?x:void 0,Vt:!!j})},b=[];let y=o?v:!1;return[()=>{js(b),bs(f)},()=>{if(Kl){const x=new Kl(v);x.observe(p),Lt(b,()=>{x.disconnect()})}else if(s){const[x,w]=s.O(p,v,o);y=x,Lt(b,w)}if(r){const[x]=Oo({o:void 0},h);Lt(b,Nn(f,"scroll",w=>{const k=x(),[_,j,I]=k;j&&(cy(p,"ltr rtl"),_?Js(p,"rtl"):Js(p,"ltr"),v([!!_,j,I])),qE(w)}))}y&&(Js(f,zJ),Lt(b,Nn(f,"animationstart",y,{C:!!Kl}))),(Kl||s)&&io(e,f)}]},bee=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,xee=(e,t)=>{let n;const r=Ei(BJ),o=[],[s]=Oo({o:!1}),i=(f,p)=>{if(f){const h=s(bee(f)),[,m]=h;if(m)return!p&&t(h),[h]}},c=(f,p)=>{if(f&&f.length>0)return i(f.pop(),p)};return[()=>{js(o),bs(r)},()=>{if(Ek)n=new Ek(f=>c(f),{root:e}),n.observe(r),Lt(o,()=>{n.disconnect()});else{const f=()=>{const m=ld(r);i(m)},[p,h]=cO(r,f);Lt(o,p),h(),f()}io(e,r)},()=>{if(n)return c(n.takeRecords(),!0)}]},qk=`[${Mo}]`,yee=`[${Oa}]`,Rv=["tabindex"],Xk=["wrap","cols","rows"],Av=["id","class","style","open"],Cee=(e,t,n)=>{let r,o,s;const{Z:i,J:c,tt:f,rt:p,ut:h,ft:m,_t:v}=e,{V:b}=Mr(),[y]=Oo({u:UE,o:{w:0,h:0}},()=>{const G=m(lc,ic),Y=m(Ov,""),V=Y&&zo(c),L=Y&&Zs(c);v(lc,ic),v(Ov,""),v("",Zh,!0);const X=Yh(f),z=Yh(c),K=Qh(c);return v(lc,ic,G),v(Ov,"",Y),v("",Zh),zo(c,V),Zs(c,L),{w:z.w+X.w+K.w,h:z.h+X.h+K.h}}),x=p?Xk:Av.concat(Xk),w=uy(n,{v:()=>r,g:()=>o,p(G,Y){const[V]=G,[L]=Y;return[Br(V).concat(Br(L)).reduce((X,z)=>(X[z]=V[z]||L[z],X),{})]}}),k=G=>{Mt(G||Rv,Y=>{if(oy(Rv,Y)>-1){const V=Jn(i,Y);ni(V)?Jn(c,Y,V):yr(c,Y)}})},_=(G,Y)=>{const[V,L]=G,X={vt:L};return t({ht:V}),!Y&&n(X),X},j=({gt:G,Yt:Y,Vt:V})=>{const L=!G||V?n:w;let X=!1;if(Y){const[z,K]=Y;X=K,t({bt:z})}L({gt:G,yt:X})},I=(G,Y)=>{const[,V]=y(),L={wt:V};return V&&!Y&&(G?n:w)(L),L},E=(G,Y,V)=>{const L={Ot:Y};return Y?!V&&w(L):h||k(G),L},[O,M,D]=f||!b?xee(i,_):[so,so,so],[A,R]=h?[so,so]:cO(i,j,{Vt:!0,Bt:!0}),[T,q]=Kk(i,!1,E,{Pt:Av,Ht:Av.concat(Rv)}),B=h&&Kl&&new Kl(j.bind(0,{gt:!0}));return B&&B.observe(i),k(),[()=>{O(),A(),s&&s[0](),B&&B.disconnect(),T()},()=>{R(),M()},()=>{const G={},Y=q(),V=D(),L=s&&s[1]();return Y&&cn(G,E.apply(0,Lt(Y,!0))),V&&cn(G,_.apply(0,Lt(V,!0))),L&&cn(G,I.apply(0,Lt(L,!0))),G},G=>{const[Y]=G("update.ignoreMutation"),[V,L]=G("update.attributes"),[X,z]=G("update.elementEvents"),[K,ne]=G("update.debounce"),Q=z||L,ie=oe=>Go(Y)&&Y(oe);if(Q&&(s&&(s[1](),s[0]()),s=Kk(f||c,!0,I,{Ht:x.concat(V||[]),Dt:X,Mt:qk,kt:(oe,W)=>{const{target:U,attributeName:ee}=oe;return(!W&&ee&&!h?yJ(U,qk,yee):!1)||!!Gl(U,`.${Or}`)||!!ie(oe)}})),ne)if(w.m(),Ko(K)){const oe=K[0],W=K[1];r=Va(oe)&&oe,o=Va(W)&&W}else Va(K)?(r=K,o=!1):(r=!1,o=!1)}]},Yk={x:0,y:0},wee=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:Yk,Tt:Yk,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:id(e.Z)}),See=(e,t)=>{const n=ab(t,{}),[r,o,s]=fy(),[i,c,f]=cee(e),p=iO(wee(i)),[h,m]=p,v=gee(i,p),b=(j,I,E)=>{const M=Br(j).some(D=>j[D])||!ay(I)||E;return M&&s("u",[j,I,E]),M},[y,x,w,k]=Cee(i,m,j=>b(v(n,j),{},!1)),_=h.bind(0);return _.jt=j=>r("u",j),_.Nt=()=>{const{W:j,J:I}=i,E=zo(j),O=Zs(j);x(),c(),zo(I,E),Zs(I,O)},_.qt=i,[(j,I)=>{const E=ab(t,j,I);return k(E),b(v(E,w(),I),j,!!I)},_,()=>{o(),y(),f()}]},{round:Qk}=Math,kee=e=>{const{width:t,height:n}=fs(e),{w:r,h:o}=ld(e);return{x:Qk(t)/r||1,y:Qk(n)/o||1}},_ee=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:i}=e,{pointers:c}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(c||[]).includes(i)},jee=(e,t)=>Nn(e,"mousedown",Nn.bind(0,t,"click",qE,{C:!0,$:!0}),{$:!0}),Zk="pointerup pointerleave pointercancel lostpointercapture",Pee=(e,t,n,r,o,s,i)=>{const{B:c}=Mr(),{Ft:f,Gt:p,Xt:h}=r,m=`scroll${i?"Left":"Top"}`,v=`client${i?"X":"Y"}`,b=i?"width":"height",y=i?"left":"top",x=i?"w":"h",w=i?"x":"y",k=(_,j)=>I=>{const{Tt:E}=s(),O=ld(p)[x]-ld(f)[x],D=j*I/O*E[w],R=id(h)&&i?c.n||c.i?1:-1:1;o[m]=_+D*R};return Nn(p,"pointerdown",_=>{const j=Gl(_.target,`.${hy}`)===f,I=j?f:p;if(Ii(t,Mo,Tk,!0),_ee(_,e,j)){const E=!j&&_.shiftKey,O=()=>fs(f),M=()=>fs(p),D=(z,K)=>(z||O())[y]-(K||M())[y],A=k(o[m]||0,1/kee(o)[w]),R=_[v],T=O(),q=M(),B=T[b],G=D(T,q)+B/2,Y=R-q[y],V=j?0:Y-G,L=z=>{js(X),I.releasePointerCapture(z.pointerId)},X=[Ii.bind(0,t,Mo,Tk),Nn(n,Zk,L),Nn(n,"selectstart",z=>XE(z),{S:!1}),Nn(p,Zk,L),Nn(p,"pointermove",z=>{const K=z[v]-R;(j||E)&&A(V+K)})];if(E)A(V);else if(!j){const z=Ui()[eee];z&&Lt(X,z.O(A,D,V,B,Y))}I.setPointerCapture(_.pointerId)}})},Iee=(e,t)=>(n,r,o,s,i,c)=>{const{Xt:f}=n,[p,h]=Fl(333),m=!!i.scrollBy;let v=!0;return js.bind(0,[Nn(f,"pointerenter",()=>{r(zk,!0)}),Nn(f,"pointerleave pointercancel",()=>{r(zk)}),Nn(f,"wheel",b=>{const{deltaX:y,deltaY:x,deltaMode:w}=b;m&&v&&w===0&&ra(f)===s&&i.scrollBy({left:y,top:x,behavior:"smooth"}),v=!1,r(Hk,!0),p(()=>{v=!0,r(Hk)}),XE(b)},{S:!1,$:!0}),jee(f,o),Pee(e,s,o,n,i,t,c),h])},{min:lb,max:Jk,abs:Eee,round:Oee}=Math,uO=(e,t,n,r)=>{if(r){const c=n?"x":"y",{Tt:f,zt:p}=r,h=p[c],m=f[c];return Jk(0,lb(1,h/(h+m)))}const o=n?"width":"height",s=fs(e)[o],i=fs(t)[o];return Jk(0,lb(1,s/i))},Mee=(e,t,n,r,o,s)=>{const{B:i}=Mr(),c=s?"x":"y",f=s?"Left":"Top",{Tt:p}=r,h=Oee(p[c]),m=Eee(n[`scroll${f}`]),v=s&&o,b=i.i?m:h-m,x=lb(1,(v?b:m)/h),w=uO(e,t,s);return 1/w*(1-w)*x},Dee=(e,t,n)=>{const{N:r,L:o}=Mr(),{scrollbars:s}=r(),{slot:i}=s,{ct:c,W:f,Z:p,J:h,lt:m,ot:v,it:b,ut:y}=t,{scrollbars:x}=m?{}:e,{slot:w}=x||{},k=sO([f,p,h],()=>y&&b?f:p,i,w),_=(V,L,X)=>{const z=X?Js:cy;Mt(V,K=>{z(K.Xt,L)})},j=(V,L)=>{Mt(V,X=>{const[z,K]=L(X);er(z,K)})},I=(V,L,X)=>{j(V,z=>{const{Ft:K,Gt:ne}=z;return[K,{[X?"width":"height"]:`${(100*uO(K,ne,X,L)).toFixed(3)}%`}]})},E=(V,L,X)=>{const z=X?"X":"Y";j(V,K=>{const{Ft:ne,Gt:Q,Xt:ie}=K,oe=Mee(ne,Q,v,L,id(ie),X);return[ne,{transform:oe===oe?`translate${z}(${(100*oe).toFixed(3)}%)`:""}]})},O=[],M=[],D=[],A=(V,L,X)=>{const z=ry(X),K=z?X:!0,ne=z?!X:!0;K&&_(M,V,L),ne&&_(D,V,L)},R=V=>{I(M,V,!0),I(D,V)},T=V=>{E(M,V,!0),E(D,V)},q=V=>{const L=V?UJ:GJ,X=V?M:D,z=sy(X)?Lk:"",K=Ei(`${Or} ${L} ${z}`),ne=Ei(rO),Q=Ei(hy),ie={Xt:K,Gt:ne,Ft:Q};return o||Js(K,HJ),io(K,ne),io(ne,Q),Lt(X,ie),Lt(O,[bs.bind(0,K),n(ie,A,c,p,v,V)]),ie},B=q.bind(0,!0),G=q.bind(0,!1),Y=()=>{io(k,M[0].Xt),io(k,D[0].Xt),Xh(()=>{A(Lk)},300)};return B(),G(),[{Ut:R,Wt:T,Zt:A,Jt:{Kt:M,Qt:B,tn:j.bind(0,M)},nn:{Kt:D,Qt:G,tn:j.bind(0,D)}},Y,js.bind(0,O)]},Ree=(e,t,n,r)=>{let o,s,i,c,f,p=0;const h=iO({}),[m]=h,[v,b]=Fl(),[y,x]=Fl(),[w,k]=Fl(100),[_,j]=Fl(100),[I,E]=Fl(()=>p),[O,M,D]=Dee(e,n.qt,Iee(t,n)),{Z:A,J:R,ot:T,st:q,ut:B,it:G}=n.qt,{Jt:Y,nn:V,Zt:L,Ut:X,Wt:z}=O,{tn:K}=Y,{tn:ne}=V,Q=ee=>{const{Xt:se}=ee,re=B&&!G&&ra(se)===R&&se;return[re,{transform:re?`translate(${zo(T)}px, ${Zs(T)}px)`:""}]},ie=(ee,se)=>{if(E(),ee)L(Bk);else{const re=()=>L(Bk,!0);p>0&&!se?I(re):re()}},oe=()=>{c=s,c&&ie(!0)},W=[k,E,j,x,b,D,Nn(A,"pointerover",oe,{C:!0}),Nn(A,"pointerenter",oe),Nn(A,"pointerleave",()=>{c=!1,s&&ie(!1)}),Nn(A,"pointermove",()=>{o&&v(()=>{k(),ie(!0),_(()=>{o&&ie(!1)})})}),Nn(q,"scroll",ee=>{y(()=>{z(n()),i&&ie(!0),w(()=>{i&&!c&&ie(!1)})}),r(ee),B&&K(Q),B&&ne(Q)})],U=m.bind(0);return U.qt=O,U.Nt=M,[(ee,se,re)=>{const{At:fe,Lt:de,It:me,yt:ye}=re,{A:he}=Mr(),ue=ab(t,ee,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,Oe]=ue("scrollbars.clickScroll"),$e=fe||de||ye,Rt=me||Re,ke=Ue&&he.x&&he.y,ze=(Le,We)=>{const ct=ve==="visible"||ve==="auto"&&Le==="scroll";return L(KJ,ct,We),ct};if(p=ge,Ct&&L(VJ,ke),tt&&(L(f),L(Xe,!0),f=Xe),mt&&(o=st==="move",s=st==="leave",i=st!=="never",ie(!i,!0)),ot&&L(YJ,Ye),Oe&&L(XJ,lt),Rt){const Le=ze(Be.x,!0),We=ze(Be.y,!1);L(qJ,!(Le&&We))}$e&&(X(De),z(De),L(Fk,!je.x,!0),L(Fk,!je.y,!1),L(WJ,rt&&!G))},U,js.bind(0,W)]},dO=(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}=Mr(),c=Ui(),f=Kh(e),p=f?e:e.target,h=aO(p);if(t&&!h){let m=!1;const v=B=>{const G=Ui()[ZJ],Y=G&&G.O;return Y?Y(B,!0):B},b=cn({},r(),v(t)),[y,x,w]=fy(n),[k,_,j]=See(e,b),[I,E,O]=Ree(e,b,_,B=>w("scroll",[q,B])),M=(B,G)=>k(B,!!G),D=M.bind(0,{},!0),A=s(D),R=i(D),T=B=>{lee(p),A(),R(),O(),j(),m=!0,w("destroyed",[q,!!B]),x()},q={options(B,G){if(B){const Y=G?r():{},V=YE(b,cn(Y,v(B)));ay(V)||(cn(b,V),M(V))}return cn({},b)},on:y,off:(B,G)=>{B&&G&&x(B,G)},state(){const{zt:B,Tt:G,Ct:Y,Et:V,K:L,St:X,bt:z}=_();return cn({},{overflowEdge:B,overflowAmount:G,overflowStyle:Y,hasOverflow:V,padding:L,paddingAbsolute:X,directionRTL:z,destroyed:m})},elements(){const{W:B,Z:G,K:Y,J:V,tt:L,ot:X,st:z}=_.qt,{Jt:K,nn:ne}=E.qt,Q=oe=>{const{Ft:W,Gt:U,Xt:ee}=oe;return{scrollbar:ee,track:U,handle:W}},ie=oe=>{const{Kt:W,Qt:U}=oe,ee=Q(W[0]);return cn({},ee,{clone:()=>{const se=Q(U());return I({},!0,{}),se}})};return cn({},{target:B,host:G,padding:Y||V,viewport:V,content:L||V,scrollOffsetElement:X,scrollEventElement:z,scrollbarHorizontal:ie(K),scrollbarVertical:ie(ne)})},update:B=>M({},B),destroy:T.bind(0)};return _.jt((B,G,Y)=>{I(G,Y,B)}),iee(p,q),Mt(Br(c),B=>dO(c[B],0,q)),aee(_.qt.it,o().cancel,!f&&e.cancel)?(T(!0),q):(_.Nt(),E.Nt(),w("initialized",[q]),_.jt((B,G,Y)=>{const{gt:V,yt:L,vt:X,At:z,Lt:K,It:ne,wt:Q,Ot:ie}=B;w("updated",[q,{updateHints:{sizeChanged:V,directionChanged:L,heightIntrinsicChanged:X,overflowEdgeChanged:z,overflowAmountChanged:K,overflowStyleChanged:ne,contentMutation:Q,hostMutation:ie},changedOptions:G,force:Y}])}),q.update(!0),q)}return h};za.plugin=e=>{Mt(QJ(e),t=>dO(t,za))};za.valid=e=>{const t=e&&e.elements,n=Go(t)&&t();return tb(n)&&!!aO(n.target)};za.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:i,U:c,N:f,q:p,F:h,G:m}=Mr();return cn({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:i,staticDefaultOptions:c,getDefaultInitialization:f,setDefaultInitialization:p,getDefaultOptions:h,setDefaultOptions:m})};const Aee=()=>{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,c=r?n.cancelIdleCallback:s,f=()=>{c(e),s(t)};return[(p,h)=>{f(),e=i(r?()=>{f(),t=o(p)}:p,typeof h=="object"?h:{timeout:2233})},f]},fO=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=u.useMemo(Aee,[]),i=u.useRef(null),c=u.useRef(r),f=u.useRef(t),p=u.useRef(n);return u.useEffect(()=>{c.current=r},[r]),u.useEffect(()=>{const{current:h}=i;f.current=t,za.valid(h)&&h.options(t||{},!0)},[t]),u.useEffect(()=>{const{current:h}=i;p.current=n,za.valid(h)&&h.on(n||{},!0)},[n]),u.useEffect(()=>()=>{var h;s(),(h=i.current)==null||h.destroy()},[]),u.useMemo(()=>[h=>{const m=i.current;if(za.valid(m))return;const v=c.current,b=f.current||{},y=p.current||{},x=()=>i.current=za(h,b,y);v?o(x,v):x()},()=>i.current],[])},Nee=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:i,...c}=e,f=n,p=u.useRef(null),h=u.useRef(null),[m,v]=fO({options:r,events:o,defer:s});return u.useEffect(()=>{const{current:b}=p,{current:y}=h;return b&&y&&m({target:b,elements:{viewport:y,content:y}}),()=>{var x;return(x=v())==null?void 0:x.destroy()}},[m,n]),u.useImperativeHandle(t,()=>({osInstance:v,getElement:()=>p.current}),[]),H.createElement(f,{"data-overlayscrollbars-initialize":"",ref:p,...c},H.createElement("div",{ref:h},i))},lg=u.forwardRef(Nee),Tee=e=>{const{boardToDelete:t,setBoardToDelete:n}=e,{t:r}=we(),o=F(_=>_.config.canRestoreDeletedImagesFromBin),{currentData:s,isFetching:i}=lD((t==null?void 0:t.board_id)??Lr.skipToken),c=u.useMemo(()=>ae([be],_=>{const j=(s??[]).map(E=>Ej(_,E));return{imageUsageSummary:{isInitialImage:Do(j,E=>E.isInitialImage),isCanvasImage:Do(j,E=>E.isCanvasImage),isNodesImage:Do(j,E=>E.isNodesImage),isControlNetImage:Do(j,E=>E.isControlNetImage)}}}),[s]),[f,{isLoading:p}]=cD(),[h,{isLoading:m}]=uD(),{imageUsageSummary:v}=F(c),b=u.useCallback(()=>{t&&(f(t.board_id),n(void 0))},[t,f,n]),y=u.useCallback(()=>{t&&(h(t.board_id),n(void 0))},[t,h,n]),x=u.useCallback(()=>{n(void 0)},[n]),w=u.useRef(null),k=u.useMemo(()=>m||p||i,[m,p,i]);return t?a.jsx(Ad,{isOpen:!!t,onClose:x,leastDestructiveRef:w,isCentered:!0,children:a.jsx(Vo,{children:a.jsxs(Nd,{children:[a.jsxs(Ho,{fontSize:"lg",fontWeight:"bold",children:["Delete ",t.board_name]}),a.jsx(Wo,{children:a.jsxs($,{direction:"column",gap:3,children:[i?a.jsx(zm,{children:a.jsx($,{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(xe,{children:"Deleted boards cannot be restored."}),a.jsx(xe,{children:r(o?"gallery.deleteImageBin":"gallery.deleteImagePermanent")})]})}),a.jsx(gs,{children:a.jsxs($,{sx:{justifyContent:"space-between",width:"full",gap:2},children:[a.jsx(it,{ref:w,onClick:x,children:"Cancel"}),a.jsx(it,{colorScheme:"warning",isLoading:k,onClick:b,children:"Delete Board Only"}),a.jsx(it,{colorScheme:"error",isLoading:k,onClick:y,children:"Delete Board and Images"})]})})]})})}):null},$ee=u.memo(Tee),Lee="My Board",zee=()=>{const[e,{isLoading:t}]=dD(),n=u.useCallback(()=>{e(Lee)},[e]);return a.jsx(Te,{icon:a.jsx(nl,{}),isLoading:t,tooltip:"Add Board","aria-label":"Add Board",onClick:n,size:"sm"})},Fee=u.memo(zee);var pO=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"}),Bee=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"}),Hee=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"})})}),Vee=kd({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});const Wee=ae([be],({gallery:e})=>{const{boardSearchText:t}=e;return{boardSearchText:t}},Ce),Uee=()=>{const e=J(),{boardSearchText:t}=F(Wee),n=u.useRef(null),r=u.useCallback(c=>{e($C(c))},[e]),o=u.useCallback(()=>{e($C(""))},[e]),s=u.useCallback(c=>{c.key==="Escape"&&o()},[o]),i=u.useCallback(c=>{r(c.target.value)},[r]);return u.useEffect(()=>{n.current&&n.current.focus()},[]),a.jsxs(P3,{children:[a.jsx(Pm,{ref:n,placeholder:"Search Boards...",value:t,onKeyDown:s,onChange:i}),t&&t.length&&a.jsx(mx,{children:a.jsx(ps,{onClick:o,size:"xs",variant:"ghost","aria-label":"Clear Search",opacity:.5,icon:a.jsx(Bee,{boxSize:2})})})]})},Gee=u.memo(Uee);function hO(e){return fD(e)}function Kee(e){return pD(e)}const mO=(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",c=e.context.boardId;return i!==c}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}},qee=e=>{const{isOver:t,label:n="Drop"}=e,r=u.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($,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[a.jsx($,{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($,{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)},gO=u.memo(qee),Xee=e=>{const{dropLabel:t,data:n,disabled:r}=e,o=u.useRef(Fa()),{isOver:s,setNodeRef:i,active:c}=hO({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:mO(n,c)&&a.jsx(gO,{isOver:s,label:t})})})},by=u.memo(Xee),Yee=({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}}}),xy=u.memo(Yee),Qee=()=>a.jsx($,{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"})}),vO=u.memo(Qee);function yy(e){const[t,n]=u.useState(!1),[r,o]=u.useState(!1),[s,i]=u.useState(!1),[c,f]=u.useState([0,0]),p=u.useRef(null),h=F(v=>v.ui.globalContextMenuCloseTrigger);u.useEffect(()=>{if(t)setTimeout(()=>{o(!0),setTimeout(()=>{i(!0)})});else{i(!1);const v=setTimeout(()=>{o(t)},1e3);return()=>clearTimeout(v)}},[t]),u.useEffect(()=>{n(!1),i(!1),o(!1)},[h]),FL("contextmenu",v=>{var b;(b=p.current)!=null&&b.contains(v.target)||v.target===p.current?(v.preventDefault(),n(!0),f([v.pageX,v.pageY])):n(!1)});const m=u.useCallback(()=>{var v,b;(b=(v=e.menuProps)==null?void 0:v.onClose)==null||b.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:c[0],top:c[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},Zee=({board:e,setBoardToDelete:t})=>{const n=u.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(Hr,{}),onClick:n,children:"Delete Board"})]})},Jee=u.memo(Zee),ete=()=>a.jsx(a.Fragment,{}),tte=u.memo(ete),nte=({board:e,board_id:t,setBoardToDelete:n,children:r})=>{const o=J(),s=u.useMemo(()=>ae(be,({gallery:v,system:b})=>{const y=v.autoAddBoardId===t,x=b.isProcessing,w=v.autoAssignBoardOnClick;return{isAutoAdd:y,isProcessing:x,autoAssignBoardOnClick:w}},Ce),[t]),{isAutoAdd:i,isProcessing:c,autoAssignBoardOnClick:f}=F(s),p=ug(t),h=u.useCallback(()=>{o(fm(t))},[t,o]),m=u.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:gc,onContextMenu:m,children:a.jsxs(wc,{title:p,children:[a.jsx(Ht,{icon:a.jsx(nl,{}),isDisabled:i||c||f,onClick:h,children:"Auto-add to this Board"}),!e&&a.jsx(tte,{}),e&&a.jsx(Jee,{board:e,setBoardToDelete:n})]})}),children:r})},bO=u.memo(nte),rte=({board:e,isSelected:t,setBoardToDelete:n})=>{const r=J(),o=u.useMemo(()=>ae(be,({gallery:R,system:T})=>{const q=e.board_id===R.autoAddBoardId,B=R.autoAssignBoardOnClick,G=T.isProcessing;return{isSelectedForAutoAdd:q,autoAssignBoardOnClick:B,isProcessing:G}},Ce),[e.board_id]),{isSelectedForAutoAdd:s,autoAssignBoardOnClick:i,isProcessing:c}=F(o),[f,p]=u.useState(!1),h=u.useCallback(()=>{p(!0)},[]),m=u.useCallback(()=>{p(!1)},[]),{data:v}=Nj(e.board_id),{data:b}=Tj(e.board_id),y=u.useMemo(()=>{if(!(!v||!b))return`${v} image${v>1?"s":""}, ${b} asset${b>1?"s":""}`},[b,v]),{currentData:x}=fo(e.cover_image_name??Lr.skipToken),{board_name:w,board_id:k}=e,[_,j]=u.useState(w),I=u.useCallback(()=>{r($j(k)),i&&!c&&r(fm(k))},[k,i,c,r]),[E,{isLoading:O}]=hD(),M=u.useMemo(()=>({id:k,actionType:"ADD_TO_BOARD",context:{boardId:k}}),[k]),D=u.useCallback(async R=>{if(!R.trim()){j(w);return}if(R!==w)try{const{board_name:T}=await E({board_id:k,changes:{board_name:R}}).unwrap();j(T)}catch{j(w)}},[k,w,E]),A=u.useCallback(R=>{j(R)},[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx($,{onMouseOver:h,onMouseOut:m,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",w:"full",h:"full"},children:a.jsx(bO,{board:e,board_id:k,setBoardToDelete:n,children:R=>a.jsx(Dt,{label:y,openDelay:1e3,hasArrow:!0,children:a.jsxs($,{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:[x!=null&&x.thumbnail_url?a.jsx(Xi,{src:x==null?void 0:x.thumbnail_url,draggable:!1,sx:{objectFit:"cover",w:"full",h:"full",maxH:"full",borderRadius:"base",borderBottomRadius:"lg"}}):a.jsx($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(An,{boxSize:12,as:zZ,sx:{mt:-6,opacity:.7,color:"base.500",_dark:{color:"base.500"}}})}),s&&a.jsx(vO,{}),a.jsx(xy,{isSelected:t,isHovered:f}),a.jsx($,{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:O,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(by,{data:M,dropLabel:a.jsx(xe,{fontSize:"md",children:"Move"})})]})})})})})},ote=u.memo(rte),ste=ae(be,({gallery:e,system:t})=>{const{autoAddBoardId:n,autoAssignBoardOnClick:r}=e,{isProcessing:o}=t;return{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}},Ce),xO=u.memo(({isSelected:e})=>{const t=J(),{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}=F(ste),s=ug("none"),i=u.useCallback(()=>{t($j("none")),r&&!o&&t(fm("none"))},[t,r,o]),[c,f]=u.useState(!1),p=u.useCallback(()=>{f(!0)},[]),h=u.useCallback(()=>{f(!1)},[]),m=u.useMemo(()=>({id:"no_board",actionType:"REMOVE_FROM_BOARD"}),[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx($,{onMouseOver:p,onMouseOut:h,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"base",w:"full",h:"full"},children:a.jsx(bO,{board_id:"none",children:v=>a.jsxs($,{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($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(Xi,{src:Mj,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(vO,{}),a.jsx($,{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(xy,{isSelected:e,isHovered:c}),a.jsx(by,{data:m,dropLabel:a.jsx(xe,{fontSize:"md",children:"Move"})})]})})})})});xO.displayName="HoverableBoard";const ate=u.memo(xO),ite=ae([be],({gallery:e})=>{const{selectedBoardId:t,boardSearchText:n}=e;return{selectedBoardId:t,boardSearchText:n}},Ce),lte=e=>{const{isOpen:t}=e,{selectedBoardId:n,boardSearchText:r}=F(ite),{data:o}=um(),s=r?o==null?void 0:o.filter(f=>f.board_name.toLowerCase().includes(r.toLowerCase())):o,[i,c]=u.useState();return a.jsxs(a.Fragment,{children:[a.jsx(ym,{in:t,animateOpacity:!0,children:a.jsxs($,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[a.jsxs($,{sx:{gap:2,alignItems:"center"},children:[a.jsx(Gee,{}),a.jsx(Fee,{})]}),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(ate,{isSelected:n==="none"})}),s&&s.map(f=>a.jsx(ed,{sx:{p:1.5},children:a.jsx(ote,{board:f,isSelected:n===f.board_id,setBoardToDelete:c})},f.board_id))]})})]})}),a.jsx($ee,{boardToDelete:i,setBoardToDelete:c})]})},cte=u.memo(lte),ute=ae([be],e=>{const{selectedBoardId:t}=e.gallery;return{selectedBoardId:t}},Ce),dte=e=>{const{isOpen:t,onToggle:n}=e,{selectedBoardId:r}=F(ute),o=ug(r),s=u.useMemo(()=>o.length>20?`${o.substring(0,20)}...`:o,[o]);return a.jsxs($,{as:vc,onClick:n,size:"sm",sx:{position:"relative",gap:2,w:"full",justifyContent:"space-between",alignItems:"center",px:2},children:[a.jsx(xe,{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"}})]})},fte=u.memo(dte),pte=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return a.jsxs($m,{isLazy:o,...s,children:[a.jsx(Dx,{children:t}),a.jsxs(Lm,{shadow:"dark-lg",children:[r&&a.jsx(lP,{}),n]})]})},Wd=u.memo(pte);function hte(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 mte=e=>{const[t,n]=u.useState(!1),{label:r,value:o,min:s=1,max:i=100,step:c=1,onChange:f,tooltipSuffix:p="",withSliderMarks:h=!1,withInput:m=!1,isInteger:v=!1,inputWidth:b=16,withReset:y=!1,hideTooltip:x=!1,isCompact:w=!1,isDisabled:k=!1,sliderMarks:_,handleReset:j,sliderFormControlProps:I,sliderFormLabelProps:E,sliderMarkProps:O,sliderTrackProps:M,sliderThumbProps:D,sliderNumberInputProps:A,sliderNumberInputFieldProps:R,sliderNumberInputStepperProps:T,sliderTooltipProps:q,sliderIAIIconButtonProps:B,...G}=e,Y=J(),{t:V}=we(),[L,X]=u.useState(String(o));u.useEffect(()=>{X(o)},[o]);const z=u.useMemo(()=>A!=null&&A.min?A.min:s,[s,A==null?void 0:A.min]),K=u.useMemo(()=>A!=null&&A.max?A.max:i,[i,A==null?void 0:A.max]),ne=u.useCallback(se=>{f(se)},[f]),Q=u.useCallback(se=>{se.target.value===""&&(se.target.value=String(z));const re=Ri(v?Math.floor(Number(se.target.value)):Number(L),z,K),fe=Eu(re,c);f(fe),X(fe)},[v,L,z,K,f,c]),ie=u.useCallback(se=>{X(se)},[]),oe=u.useCallback(()=>{j&&j()},[j]),W=u.useCallback(se=>{se.target instanceof HTMLDivElement&&se.target.focus()},[]),U=u.useCallback(se=>{se.shiftKey&&Y(Pr(!0))},[Y]),ee=u.useCallback(se=>{se.shiftKey||Y(Pr(!1))},[Y]);return a.jsxs(dn,{onClick:W,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}:{},...E,children:r}),a.jsxs(bx,{w:"100%",gap:2,alignItems:"center",children:[a.jsxs(Ax,{"aria-label":r,value:o,min:s,max:i,step:c,onChange:ne,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:k,...G,children:[h&&!_&&a.jsxs(a.Fragment,{children:[a.jsx(Ll,{value:s,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...O,children:s}),a.jsx(Ll,{value:i,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...O,children:i})]}),h&&_&&a.jsx(a.Fragment,{children:_.map((se,re)=>re===0?a.jsx(Ll,{value:se,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...O,children:se},se):re===_.length-1?a.jsx(Ll,{value:se,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...O,children:se},se):a.jsx(Ll,{value:se,sx:{transform:"translateX(-50%)"},...O,children:se},se))}),a.jsx(Tx,{...M,children:a.jsx($x,{})}),a.jsx(Dt,{hasArrow:!0,placement:"top",isOpen:t,label:`${o}${p}`,hidden:x,...q,children:a.jsx(Nx,{...D,zIndex:0})})]}),m&&a.jsxs(Dm,{min:z,max:K,step:c,value:L,onChange:ie,onBlur:Q,focusInputOnChange:!1,...A,children:[a.jsx(Am,{onKeyDown:U,onKeyUp:ee,minWidth:b,...R}),a.jsxs(Rm,{...T,children:[a.jsx(Tm,{onClick:()=>f(Number(L))}),a.jsx(Nm,{onClick:()=>f(Number(L))})]})]}),y&&a.jsx(Te,{size:"sm","aria-label":V("accessibility.reset"),tooltip:V("accessibility.reset"),icon:a.jsx(hte,{}),isDisabled:k,onClick:oe,...B})]})]})},Ze=u.memo(mte),yO=u.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(Sc,{children:e}),n&&a.jsx(Sc,{size:"xs",color:"base.600",children:n})]})})}));yO.displayName="IAIMantineSelectItemWithTooltip";const ri=u.memo(yO),gte=ae([be],({gallery:e,system:t})=>{const{autoAddBoardId:n,autoAssignBoardOnClick:r}=e,{isProcessing:o}=t;return{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}},Ce),vte=()=>{const e=J(),{autoAddBoardId:t,autoAssignBoardOnClick:n,isProcessing:r}=F(gte),o=u.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}}}),c=u.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:c})},bte=u.memo(vte),xte=e=>{const{label:t,...n}=e,{colorMode:r}=ia();return a.jsx(Cm,{colorScheme:"accent",...n,children:a.jsx(xe,{sx:{fontSize:"sm",color:Ae("base.800","base.200")(r)},children:t})})},ur=u.memo(xte),yte=ae([be],e=>{const{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}=e.gallery;return{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}},Ce),Cte=()=>{const e=J(),{t}=we(),{galleryImageMinimumWidth:n,shouldAutoSwitch:r,autoAssignBoardOnClick:o}=F(yte),s=u.useCallback(f=>{e(LC(f))},[e]),i=u.useCallback(()=>{e(LC(64))},[e]),c=u.useCallback(f=>{e(mD(f.target.checked))},[e]);return a.jsx(Wd,{triggerComponent:a.jsx(Te,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:a.jsx(TE,{})}),children:a.jsxs($,{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:c}),a.jsx(ur,{label:t("gallery.autoAssignBoardOnClick"),isChecked:o,onChange:f=>e(gD(f.target.checked))}),a.jsx(bte,{})]})})},wte=u.memo(Cte),Ste=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($,{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=Vi,boxSize:n=16}=e;return a.jsxs($,{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(xe,{textAlign:"center",children:e.label})]})},dg=0,oi=1,Vc=2,CO=4;function kte(e,t){return n=>e(t(n))}function _te(e,t){return t(e)}function wO(e,t){return n=>e(t,n)}function e_(e,t){return()=>e(t)}function Cy(e,t){return t(e),e}function rl(...e){return e}function jte(e){e()}function t_(e){return()=>e}function Pte(...e){return()=>{e.map(jte)}}function fg(){}function fr(e,t){return e(oi,t)}function Rn(e,t){e(dg,t)}function wy(e){e(Vc)}function pg(e){return e(CO)}function Wt(e,t){return fr(e,wO(t,dg))}function n_(e,t){const n=e(oi,r=>{n(),t(r)});return n}function yn(){const e=[];return(t,n)=>{switch(t){case Vc: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 CO:return t}return n(r,o)}}function Ite(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=fr(e,s),t):(r(),fg);case Vc:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Vu(e){return Cy(yn(),t=>Wt(e,t))}function cc(e,t){return Cy(dt(t),n=>Wt(e,n))}function Ete(...e){return t=>e.reduceRight(_te,t)}function ft(e,...t){const n=Ete(...t);return(r,o)=>{switch(r){case oi:return fr(e,n(o));case Vc:wy(e);return}}}function SO(e,t){return e===t}function Sr(e=SO){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=>kte(t,e)}function Da(e){return t=>()=>t(e)}function wp(e,t){return n=>r=>n(t=e(t,r))}function cb(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 r_(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 c=Math.pow(2,i);fr(s,f=>{const p=n;n=n|c,t[i]=f,p!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const c=()=>s([i].concat(t));n===o?c():r=c}}function o_(...e){return function(t,n){switch(t){case oi:return Pte(...e.map(r=>fr(r,n)));case Vc:return;default:throw new Error(`unrecognized action ${t}`)}}}function Pt(e,t=SO){return ft(e,Sr(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 c=Math.pow(2,i);fr(s,f=>{n[i]=f,r=r|c,r===o&&Rn(t,n)})}),function(s,i){switch(s){case oi:return r===o&&i(n),fr(t,i);case Vc:return wy(t);default:throw new Error(`unrecognized action ${s}`)}}}function Ps(e,t=[],{singleton:n}={singleton:!0}){return{id:Ote(),constructor:e,dependencies:t,singleton:n}}const Ote=()=>Symbol();function Mte(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const c=o(s.map(f=>n(f)));return i&&t.set(r,c),c};return n(e)}function Dte(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 Rte(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),c=H.createContext({});function f(x,w){x.propsReady&&Rn(x.propsReady,!1);for(const k of r){const _=x[t.required[k]];Rn(_,w[k])}for(const k of o)if(k in w){const _=x[t.optional[k]];Rn(_,w[k])}x.propsReady&&Rn(x.propsReady,!0)}function p(x){return s.reduce((w,k)=>(w[k]=_=>{const j=x[t.methods[k]];Rn(j,_)},w),{})}function h(x){return i.reduce((w,k)=>(w[k]=Ite(x[t.events[k]]),w),{})}return{Component:H.forwardRef((x,w)=>{const{children:k,..._}=x,[j]=H.useState(()=>Cy(Mte(e),E=>f(E,_))),[I]=H.useState(e_(h,j));return Sp(()=>{for(const E of i)E in _&&fr(I[E],_[E]);return()=>{Object.values(I).map(wy)}},[_,I,j]),Sp(()=>{f(j,_)}),H.useImperativeHandle(w,t_(p(j))),H.createElement(c.Provider,{value:j},n?H.createElement(n,Dte([...r,...o,...i],_),k):k)}),usePublisher:x=>H.useCallback(wO(Rn,H.useContext(c)[x]),[x]),useEmitterValue:x=>{const k=H.useContext(c)[x],[_,j]=H.useState(e_(pg,k));return Sp(()=>fr(k,I=>{I!==_&&j(t_(I))}),[k,_]),_},useEmitter:(x,w)=>{const _=H.useContext(c)[x];Sp(()=>fr(_,w),[w,_])}}}const Ate=typeof document<"u"?H.useLayoutEffect:H.useEffect,Nte=Ate;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 Tte={0:"debug",1:"log",2:"warn",3:"error"},$te=()=>typeof globalThis>"u"?window:globalThis,kO=Ps(()=>{const e=dt(3);return{log:dt((n,r,o=1)=>{var s;const i=(s=$te().VIRTUOSO_LOG_LEVEL)!=null?s:pg(e);o>=i&&console[Tte[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function _O(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 _O(e,t).callbackRef}function Jh(e,t){return Math.round(e.getBoundingClientRect()[t])}function jO(e,t){return Math.abs(e-t)<1.01}function PO(e,t,n,r=fg,o){const s=H.useRef(null),i=H.useRef(null),c=H.useRef(null),f=H.useCallback(m=>{const v=m.target,b=v===window||v===document,y=b?window.pageYOffset||document.documentElement.scrollTop:v.scrollTop,x=b?document.documentElement.scrollHeight:v.scrollHeight,w=b?window.innerHeight:v.offsetHeight,k=()=>{e({scrollTop:Math.max(y,0),scrollHeight:x,viewportHeight:w})};m.suppressFlushSync?k():vD.flushSync(k),i.current!==null&&(y===i.current||y<=0||y===x-w)&&(i.current=null,t(!0),c.current&&(clearTimeout(c.current),c.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 b=m.behavior==="smooth";let y,x,w;v===window?(x=Math.max(Jh(document.documentElement,"height"),document.documentElement.scrollHeight),y=window.innerHeight,w=document.documentElement.scrollTop):(x=v.scrollHeight,y=Jh(v,"height"),w=v.scrollTop);const k=x-y;if(m.top=Math.ceil(Math.max(Math.min(k,m.top),0)),jO(y,x)||m.top===w){e({scrollTop:w,scrollHeight:x,viewportHeight:y}),b&&t(!0);return}b?(i.current=m.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.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(),c=dt(0),f=dt(0),p=dt(0),h=dt(0),m=yn(),v=yn(),b=dt(!1);return Wt(ft(e,en(({scrollTop:y})=>y)),t),Wt(ft(e,en(({scrollHeight:y})=>y)),i),Wt(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:c,fixedHeaderHeight:f,fixedFooterHeight:p,footerHeight:h,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:m,scrollBy:v,statefulScrollTop:o,deviation:n,scrollingInProgress:b}},[],{singleton:!0}),Lte=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function zte(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Lte)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const em="up",Wu="down",Fte="none",Bte={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},Hte=0,IO=Ps(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=dt(!1),c=dt(!0),f=yn(),p=yn(),h=dt(4),m=dt(Hte),v=cc(ft(o_(ft(Pt(t),cb(1),Da(!0)),ft(Pt(t),cb(1),Da(!1),r_(100))),Sr()),!1),b=cc(ft(o_(ft(s,Da(!0)),ft(s,Da(!1),r_(200))),Sr()),!1);Wt(ft(qs(Pt(t),Pt(m)),en(([_,j])=>_<=j),Sr()),c),Wt(ft(c,Du(50)),p);const y=Vu(ft(qs(e,Pt(n),Pt(r),Pt(o),Pt(h)),wp((_,[{scrollTop:j,scrollHeight:I},E,O,M,D])=>{const A=j+E-I>-D,R={viewportHeight:E,scrollTop:j,scrollHeight:I};if(A){let q,B;return j>_.state.scrollTop?(q="SCROLLED_DOWN",B=_.state.scrollTop-j):(q="SIZE_DECREASED",B=_.state.scrollTop-j||_.scrollTopDelta),{atBottom:!0,state:R,atBottomBecause:q,scrollTopDelta:B}}let T;return R.scrollHeight>_.state.scrollHeight?T="SIZE_INCREASED":E<_.state.viewportHeight?T="VIEWPORT_HEIGHT_DECREASING":j<_.state.scrollTop?T="SCROLLING_UPWARDS":T="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:T,state:R}},Bte),Sr((_,j)=>_&&_.atBottom===j.atBottom))),x=cc(ft(e,wp((_,{scrollTop:j,scrollHeight:I,viewportHeight:E})=>{if(jO(_.scrollHeight,I))return{scrollTop:j,scrollHeight:I,jump:0,changed:!1};{const O=I-(j+E)<1;return _.scrollTop!==j&&O?{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);Wt(ft(y,en(_=>_.atBottom)),i),Wt(ft(i,Du(50)),f);const w=dt(Wu);Wt(ft(e,en(({scrollTop:_})=>_),Sr(),wp((_,j)=>pg(b)?{direction:_.direction,prevScrollTop:j}:{direction:j<_.prevScrollTop?em:Wu,prevScrollTop:j},{direction:Wu,prevScrollTop:0}),en(_=>_.direction)),w),Wt(ft(e,Du(50),Da(Fte)),w);const k=dt(0);return Wt(ft(v,Un(_=>!_),Da(0)),k),Wt(ft(t,Du(100),cs(v),Un(([_,j])=>!!j),wp(([_,j],[I])=>[j,I],[0,0]),en(([_,j])=>j-_)),k),{isScrolling:v,isAtTop:c,isAtBottom:i,atBottomState:y,atTopStateChange:p,atBottomStateChange:f,scrollDirection:w,atBottomThreshold:h,atTopThreshold:m,scrollVelocity:k,lastJumpDueToItemResize:x}},rl(mg)),Vte=Ps(([{log:e}])=>{const t=dt(!1),n=Vu(ft(t,Un(r=>r),Sr()));return fr(t,r=>{r&&pg(e)("props updated",{},Sy.DEBUG)}),{propsReady:t,didMount:n}},rl(kO),{singleton:!0});function EO(e,t){e==0?t():requestAnimationFrame(()=>EO(e-1,t))}function Wte(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}function ub(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function Ute(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const tm="top",nm="bottom",s_="none";function a_(e,t,n){return typeof e=="number"?n===em&&t===tm||n===Wu&&t===nm?e:0:n===em?t===tm?e.main:e.reverse:t===nm?e.main:e.reverse}function i_(e,t){return typeof e=="number"?e:e[t]||0}const Gte=Ps(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=yn(),i=dt(0),c=dt(0),f=dt(0),p=cc(ft(qs(Pt(e),Pt(t),Pt(r),Pt(s,ub),Pt(f),Pt(i),Pt(o),Pt(n),Pt(c)),en(([h,m,v,[b,y],x,w,k,_,j])=>{const I=h-_,E=w+k,O=Math.max(v-I,0);let M=s_;const D=i_(j,tm),A=i_(j,nm);return b-=_,b+=v+k,y+=v+k,y-=_,b>h+E-D&&(M=em),y<h-O+m+A&&(M=Wu),M!==s_?[Math.max(I-v-a_(x,tm,M)-D,0),I-O-k+m+a_(x,nm,M)+A]:null}),Un(h=>h!=null),Sr(ub)),[0,0]);return{listBoundary:s,overscan:f,topListHeight:i,increaseViewportBy:c,visibleRange:p}},rl(mg),{singleton:!0}),Kte=Ps(([{scrollVelocity:e}])=>{const t=dt(!1),n=yn(),r=dt(!1);return Wt(ft(e,cs(r,t,n),Un(([o,s])=>!!s),en(([o,s,i,c])=>{const{exit:f,enter:p}=s;if(i){if(f(o,c))return!1}else if(p(o,c))return!0;return i}),Sr()),t),fr(ft(qs(t,e,n),cs(r)),([[o,s,i],c])=>o&&c&&c.change&&c.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},rl(IO),{singleton:!0});function qte(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const Xte=Ps(([{scrollTo:e,scrollContainerState:t}])=>{const n=yn(),r=yn(),o=yn(),s=dt(!1),i=dt(void 0);return Wt(ft(qs(n,r),en(([{viewportHeight:c,scrollTop:f,scrollHeight:p},{offsetTop:h}])=>({scrollTop:Math.max(0,f-h),scrollHeight:p,viewportHeight:c}))),t),Wt(ft(e,cs(r),en(([c,{offsetTop:f}])=>({...c,top:c.top+f}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},rl(mg)),Nv="-webkit-sticky",l_="sticky",OO=qte(()=>{if(typeof document>"u")return l_;const e=document.createElement("div");return e.style.position=Nv,e.style.position===Nv?Nv:l_});function Yte(e,t){const n=H.useRef(null),r=H.useCallback(c=>{if(c===null||!c.offsetParent)return;const f=c.getBoundingClientRect(),p=f.width;let h,m;if(t){const v=t.getBoundingClientRect(),b=f.top-v.top;h=v.height-Math.max(0,b),m=b+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}=_O(r),i=H.useCallback(()=>{r(s.current)},[r,s]);return H.useEffect(()=>{if(t){t.addEventListener("scroll",i);const c=new ResizeObserver(i);return c.observe(t),()=>{t.removeEventListener("scroll",i),c.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 MO=H.createContext(void 0);function Qte(e){return e}OO();const Zte={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},DO={width:"100%",height:"100%",position:"absolute",top:0};OO();function Oi(e,t){if(typeof e!="string")return{context:t}}function Jte({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...c}){const f=e("scrollContainerState"),p=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("scrollerRef"),v=n("context"),{scrollerRef:b,scrollByCallback:y,scrollToCallback:x}=PO(f,h,p,m);return t("scrollTo",x),t("scrollBy",y),H.createElement(p,{ref:b,style:{...Zte,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...c,...Oi(p,v)},i)})}function ene({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...c}){const f=e("windowScrollContainerState"),p=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("totalListHeight"),v=n("deviation"),b=n("customScrollParent"),y=n("context"),{scrollerRef:x,scrollByCallback:w,scrollToCallback:k}=PO(f,h,p,fg,b);return Nte(()=>(x.current=b||window,()=>{x.current=null}),[x,b]),t("windowScrollTo",k),t("scrollBy",w),H.createElement(p,{style:{position:"relative",...s,...m!==0?{height:m+v}:{}},"data-virtuoso-scroller":!0,...c,...Oi(p,y)},i)})}const c_={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},tne={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:u_,ceil:d_,floor:rm,min:Tv,max:Uu}=Math;function nne(e){return{...tne,items:e}}function f_(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 rne(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 one=Ps(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:c,scrollContainerState:f,footerHeight:p,headerHeight:h},m,v,{propsReady:b,didMount:y},{windowViewportRect:x,useWindowScroll:w,customScrollParent:k,windowScrollContainerState:_,windowScrollTo:j},I])=>{const E=dt(0),O=dt(0),M=dt(c_),D=dt({height:0,width:0}),A=dt({height:0,width:0}),R=yn(),T=yn(),q=dt(0),B=dt(null),G=dt({row:0,column:0}),Y=yn(),V=yn(),L=dt(!1),X=dt(0),z=dt(!0),K=dt(!1);fr(ft(y,cs(X),Un(([U,ee])=>!!ee)),()=>{Rn(z,!1),Rn(O,0)}),fr(ft(qs(y,z,A,D,X,K),Un(([U,ee,se,re,,fe])=>U&&!ee&&se.height!==0&&re.height!==0&&!fe)),([,,,,U])=>{Rn(K,!0),EO(1,()=>{Rn(R,U)}),n_(ft(r),()=>{Rn(n,[0,0]),Rn(z,!0)})}),Wt(ft(V,Un(U=>U!=null&&U.scrollTop>0),Da(0)),O),fr(ft(y,cs(V),Un(([,U])=>U!=null)),([,U])=>{U&&(Rn(D,U.viewport),Rn(A,U==null?void 0:U.item),Rn(G,U.gap),U.scrollTop>0&&(Rn(L,!0),n_(ft(r,cb(1)),ee=>{Rn(L,!1)}),Rn(i,{top:U.scrollTop})))}),Wt(ft(D,en(({height:U})=>U)),o),Wt(ft(qs(Pt(D,kp),Pt(A,kp),Pt(G,(U,ee)=>U&&U.column===ee.column&&U.row===ee.row),Pt(r)),en(([U,ee,se,re])=>({viewport:U,item:ee,gap:se,scrollTop:re}))),Y),Wt(ft(qs(Pt(E),t,Pt(G,rne),Pt(A,kp),Pt(D,kp),Pt(B),Pt(O),Pt(L),Pt(z),Pt(X)),Un(([,,,,,,,U])=>!U),en(([U,[ee,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&&(U===0||Ue===0))return c_;if(rt===0){const ot=Wte(ue,U),lt=ot===0?Math.max(ye-1,0):ot;return nne(f_(ot,lt,me))}const Ct=RO(Ue,rt,je);let Xe,tt;he?ee===0&&se===0&&ye>0?(Xe=0,tt=ye-1):(Xe=Ct*rm((ee+De)/(Be+De)),tt=Ct*d_((se+De)/(Be+De))-1,tt=Tv(U-1,Uu(tt,Ct-1)),Xe=Tv(tt,Uu(0,Xe))):(Xe=0,tt=-1);const ve=f_(Xe,tt,me),{top:Re,bottom:st}=p_(de,re,fe,ve),mt=d_(U/Ct),Ye=mt*Be+(mt-1)*De-st;return{items:ve,offsetTop:Re,offsetBottom:Ye,top:Re,bottom:st,itemHeight:Be,itemWidth:rt}})),M),Wt(ft(B,Un(U=>U!==null),en(U=>U.length)),E),Wt(ft(qs(D,A,M,G),Un(([U,ee,{items:se}])=>se.length>0&&ee.height!==0&&U.height!==0),en(([U,ee,{items:se},re])=>{const{top:fe,bottom:de}=p_(U,re,ee,se);return[fe,de]}),Sr(ub)),n);const ne=dt(!1);Wt(ft(r,cs(ne),en(([U,ee])=>ee||U!==0)),ne);const Q=Vu(ft(Pt(M),Un(({items:U})=>U.length>0),cs(E,ne),Un(([{items:U},ee,se])=>se&&U[U.length-1].index===ee-1),en(([,U])=>U-1),Sr())),ie=Vu(ft(Pt(M),Un(({items:U})=>U.length>0&&U[0].index===0),Da(0),Sr())),oe=Vu(ft(Pt(M),cs(L),Un(([{items:U},ee])=>U.length>0&&!ee),en(([{items:U}])=>({startIndex:U[0].index,endIndex:U[U.length-1].index})),Sr(Ute),Du(0)));Wt(oe,v.scrollSeekRangeChanged),Wt(ft(R,cs(D,A,E,G),en(([U,ee,se,re,fe])=>{const de=zte(U),{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=db(ee,fe,se,ue);return me==="end"?De=u_(De-ee.height+se.height):me==="center"&&(De=u_(De-ee.height/2+se.height/2)),he&&(De+=he),{top:De,behavior:ye}})),i);const W=cc(ft(M,en(U=>U.offsetBottom+U.bottom)),0);return Wt(ft(x,en(U=>({width:U.visibleWidth,height:U.visibleHeight}))),D),{data:B,totalCount:E,viewportDimensions:D,itemDimensions:A,scrollTop:r,scrollHeight:T,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:R,smoothScrollTargetReached:c,windowViewportRect:x,windowScrollTo:j,useWindowScroll:w,customScrollParent:k,windowScrollContainerState:_,deviation:q,scrollContainerState:f,footerHeight:p,headerHeight:h,initialItemCount:O,gap:G,restoreStateFrom:V,...v,initialTopMostItemIndex:X,gridState:M,totalListHeight:W,...m,startReached:ie,endReached:Q,rangeChanged:oe,stateChanged:Y,propsReady:b,stateRestoreInProgress:L,...I}},rl(Gte,mg,IO,Kte,Vte,Xte,kO));function p_(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=db(e,t,n,r[0].index),i=db(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function db(e,t,n,r){const o=RO(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 RO(e,t,n){return Uu(1,rm((e+n)/(rm(t)+n)))}const sne=Ps(()=>{const e=dt(p=>`Item ${p}`),t=dt({}),n=dt(null),r=dt("virtuoso-grid-item"),o=dt("virtuoso-grid-list"),s=dt(Qte),i=dt("div"),c=dt(fg),f=(p,h=null)=>cc(ft(t,en(m=>m[p]),Sr()),h);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:c,FooterComponent:f("Footer"),HeaderComponent:f("Header"),ListComponent:f("List","div"),ItemComponent:f("Item","div"),ScrollerComponent:f("Scroller","div"),ScrollSeekPlaceholder:f("ScrollSeekPlaceholder","div")}}),ane=Ps(([e,t])=>({...e,...t}),rl(one,sne)),ine=H.memo(function(){const t=ln("gridState"),n=ln("listClassName"),r=ln("itemClassName"),o=ln("itemContent"),s=ln("computeItemKey"),i=ln("isSeeking"),c=Fo("scrollHeight"),f=ln("ItemComponent"),p=ln("ListComponent"),h=ln("ScrollSeekPlaceholder"),m=ln("context"),v=Fo("itemDimensions"),b=Fo("gap"),y=ln("log"),x=ln("stateRestoreInProgress"),w=hg(k=>{const _=k.parentElement.parentElement.scrollHeight;c(_);const j=k.firstChild;if(j){const{width:I,height:E}=j.getBoundingClientRect();v({width:I,height:E})}b({row:h_("row-gap",getComputedStyle(k).rowGap,y),column:h_("column-gap",getComputedStyle(k).columnGap,y)})});return x?null:H.createElement(p,{ref:w,className:n,...Oi(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:_,...Oi(h,m),index:k.index,height:t.itemHeight,width:t.itemWidth}):H.createElement(f,{...Oi(f,m),className:r,"data-index":k.index,key:_},o(k.index,k.data,m))}))}),lne=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,Oi(t,s))):null}),cne=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,Oi(t,s))):null}),une=({children:e})=>{const t=H.useContext(MO),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:DO,ref:o},e)},dne=({children:e})=>{const t=H.useContext(MO),n=Fo("windowViewportRect"),r=Fo("itemDimensions"),o=ln("customScrollParent"),s=Yte(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:DO},e)},fne=H.memo(function({...t}){const n=ln("useWindowScroll"),r=ln("customScrollParent"),o=r||n?mne:hne,s=r||n?dne:une;return H.createElement(o,{...t},H.createElement(s,null,H.createElement(lne,null),H.createElement(ine,null),H.createElement(cne,null)))}),{Component:pne,usePublisher:Fo,useEmitterValue:ln,useEmitter:AO}=Rte(ane,{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"}},fne),hne=Jte({usePublisher:Fo,useEmitterValue:ln,useEmitter:AO}),mne=ene({usePublisher:Fo,useEmitterValue:ln,useEmitter:AO});function h_(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 gne=pne,vne=e=>{const t=F(s=>s.gallery.galleryView),{data:n}=Nj(e),{data:r}=Tj(e),o=u.useMemo(()=>t==="images"?n:r,[t,r,n]);return{totalImages:n,totalAssets:r,currentViewTotal:o}},bne=({imageDTO:e})=>a.jsx($,{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]})}),xne=u.memo(bne),ky=({postUploadAction:e,isDisabled:t})=>{const n=F(f=>f.gallery.autoAddBoardId),[r]=Ij(),o=u.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:c}=Fx({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:o,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:s,getUploadInputProps:i,openUploader:c}},gg=()=>{const e=J(),t=Ji(),{t:n}=we(),r=u.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),o=u.useCallback(()=>{t({title:n("toast.parameterNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),s=u.useCallback(()=>{t({title:n("toast.parametersSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),i=u.useCallback(()=>{t({title:n("toast.parametersNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),c=u.useCallback((O,M,D,A)=>{if(Hf(O)||Vf(M)||bu(D)||W0(A)){Hf(O)&&e($u(O)),Vf(M)&&e(Lu(M)),bu(D)&&e(zu(D)),bu(A)&&e(Fu(A)),r();return}o()},[e,r,o]),f=u.useCallback(O=>{if(!Hf(O)){o();return}e($u(O)),r()},[e,r,o]),p=u.useCallback(O=>{if(!Vf(O)){o();return}e(Lu(O)),r()},[e,r,o]),h=u.useCallback(O=>{if(!bu(O)){o();return}e(zu(O)),r()},[e,r,o]),m=u.useCallback(O=>{if(!W0(O)){o();return}e(Fu(O)),r()},[e,r,o]),v=u.useCallback(O=>{if(!zC(O)){o();return}e(Hp(O)),r()},[e,r,o]),b=u.useCallback(O=>{if(!U0(O)){o();return}e(Vp(O)),r()},[e,r,o]),y=u.useCallback(O=>{if(!FC(O)){o();return}e(n1(O)),r()},[e,r,o]),x=u.useCallback(O=>{if(!G0(O)){o();return}e(r1(O)),r()},[e,r,o]),w=u.useCallback(O=>{if(!K0(O)){o();return}e(Wp(O)),r()},[e,r,o]),k=u.useCallback(O=>{if(!BC(O)){o();return}e(Ai(O)),r()},[e,r,o]),_=u.useCallback(O=>{if(!HC(O)){o();return}e(Ni(O)),r()},[e,r,o]),j=u.useCallback(O=>{if(!VC(O)){o();return}e(Up(O)),r()},[e,r,o]),I=u.useCallback(O=>{e(pm(O))},[e]),E=u.useCallback(O=>{if(!O){i();return}const{cfg_scale:M,height:D,model:A,positive_prompt:R,negative_prompt:T,scheduler:q,seed:B,steps:G,width:Y,strength:V,positive_style_prompt:L,negative_style_prompt:X,refiner_model:z,refiner_cfg_scale:K,refiner_steps:ne,refiner_scheduler:Q,refiner_positive_aesthetic_score:ie,refiner_negative_aesthetic_score:oe,refiner_start:W}=O;U0(M)&&e(Vp(M)),FC(A)&&e(n1(A)),Hf(R)&&e($u(R)),Vf(T)&&e(Lu(T)),G0(q)&&e(r1(q)),zC(B)&&e(Hp(B)),K0(G)&&e(Wp(G)),BC(Y)&&e(Ai(Y)),HC(D)&&e(Ni(D)),VC(V)&&e(Up(V)),bu(L)&&e(zu(L)),W0(X)&&e(Fu(X)),bD(z)&&e(Lj(z)),K0(ne)&&e(o1(ne)),U0(K)&&e(s1(K)),G0(Q)&&e(zj(Q)),xD(ie)&&e(a1(ie)),yD(oe)&&e(i1(oe)),CD(W)&&e(l1(W)),s()},[i,s,e]);return{recallBothPrompts:c,recallPositivePrompt:f,recallNegativePrompt:p,recallSDXLPositiveStylePrompt:h,recallSDXLNegativeStylePrompt:m,recallSeed:v,recallCfgScale:b,recallModel:y,recallScheduler:x,recallSteps:w,recallWidth:k,recallHeight:_,recallStrength:j,recallAllParameters:E,sendToImageToImage:I}},NO=()=>{const e=Ji(),{t}=we(),n=u.useMemo(()=>!!navigator.clipboard&&!!window.ClipboardItem,[]),r=u.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 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:"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 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:"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 wne(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 Sne(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 TO(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)}$b("gallery/requestedBoardImagesDeletion");const kne=$b("gallery/sentImageToCanvas"),$O=$b("gallery/sentImageToImg2Img"),_ne=e=>{const{imageDTO:t}=e,n=J(),{t:r}=we(),o=Ji(),s=qt("unifiedCanvas").isFeatureEnabled,{metadata:i,workflow:c,isLoading:f}=Lb(t,{selectFromResult:T=>{var q,B;return{isLoading:T.isFetching,metadata:(q=T==null?void 0:T.currentData)==null?void 0:q.metadata,workflow:(B=T==null?void 0:T.currentData)==null?void 0:B.workflow}}}),[p]=zb(),[h]=Fb(),{isClipboardAPIAvailable:m,copyImageToClipboard:v}=NO(),b=u.useCallback(()=>{t&&n(hm([t]))},[n,t]),{recallBothPrompts:y,recallSeed:x,recallAllParameters:w}=gg(),k=u.useCallback(()=>{y(i==null?void 0:i.positive_prompt,i==null?void 0:i.negative_prompt,i==null?void 0:i.positive_style_prompt,i==null?void 0:i.negative_style_prompt)},[i==null?void 0:i.negative_prompt,i==null?void 0:i.positive_prompt,i==null?void 0:i.positive_style_prompt,i==null?void 0:i.negative_style_prompt,y]),_=u.useCallback(()=>{x(i==null?void 0:i.seed)},[i==null?void 0:i.seed,x]),j=u.useCallback(()=>{c&&n(Bb(c))},[n,c]),I=u.useCallback(()=>{n($O()),n(pm(t))},[n,t]),E=u.useCallback(()=>{n(kne()),n(Fj(t)),n(Ra("unifiedCanvas")),o({title:r("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},[n,t,r,o]),O=u.useCallback(()=>{w(i)},[i,w]),M=u.useCallback(()=>{n(Bj([t])),n(Tb(!0))},[n,t]),D=u.useCallback(()=>{v(t.image_url)},[v,t.image_url]),A=u.useCallback(()=>{t&&p({imageDTOs:[t]})},[p,t]),R=u.useCallback(()=>{t&&h({imageDTOs:[t]})},[h,t]);return a.jsxs(a.Fragment,{children:[a.jsx(Ht,{as:"a",href:t.image_url,target:"_blank",icon:a.jsx(jE,{}),children:r("common.openInNewTab")}),m&&a.jsx(Ht,{icon:a.jsx(Hc,{}),onClickCapture:D,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:f?a.jsx(_p,{}):a.jsx(vg,{}),onClickCapture:j,isDisabled:f||!c,children:r("nodes.loadWorkflow")}),a.jsx(Ht,{icon:f?a.jsx(_p,{}):a.jsx(DE,{}),onClickCapture:k,isDisabled:f||(i==null?void 0:i.positive_prompt)===void 0&&(i==null?void 0:i.negative_prompt)===void 0,children:r("parameters.usePrompt")}),a.jsx(Ht,{icon:f?a.jsx(_p,{}):a.jsx(RE,{}),onClickCapture:_,isDisabled:f||(i==null?void 0:i.seed)===void 0,children:r("parameters.useSeed")}),a.jsx(Ht,{icon:f?a.jsx(_p,{}):a.jsx(wE,{}),onClickCapture:O,isDisabled:f||!i,children:r("parameters.useAll")}),a.jsx(Ht,{icon:a.jsx(Sk,{}),onClickCapture:I,id:"send-to-img2img",children:r("parameters.sendToImg2Img")}),s&&a.jsx(Ht,{icon:a.jsx(Sk,{}),onClickCapture:E,id:"send-to-canvas",children:r("parameters.sendToUnifiedCanvas")}),a.jsx(Ht,{icon:a.jsx(PE,{}),onClickCapture:M,children:"Change Board"}),t.starred?a.jsx(Ht,{icon:a.jsx(jy,{}),onClickCapture:R,children:"Unstar Image"}):a.jsx(Ht,{icon:a.jsx(_y,{}),onClickCapture:A,children:"Star Image"}),a.jsx(Ht,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Hr,{}),onClickCapture:b,children:r("gallery.deleteImage")})]})},LO=u.memo(_ne),_p=()=>a.jsx($,{w:"14px",alignItems:"center",justifyContent:"center",children:a.jsx(Ki,{size:"xs"})}),jne=()=>{const e=J(),t=F(h=>h.gallery.selection),[n]=zb(),[r]=Fb(),o=u.useCallback(()=>{e(Bj(t)),e(Tb(!0))},[e,t]),s=u.useCallback(()=>{e(hm(t))},[e,t]),i=u.useCallback(()=>{n({imageDTOs:t})},[n,t]),c=u.useCallback(()=>{r({imageDTOs:t})},[r,t]),f=u.useMemo(()=>t.every(h=>h.starred),[t]),p=u.useMemo(()=>t.every(h=>!h.starred),[t]);return a.jsxs(a.Fragment,{children:[f&&a.jsx(Ht,{icon:a.jsx(_y,{}),onClickCapture:c,children:"Unstar All"}),(p||!f&&!p)&&a.jsx(Ht,{icon:a.jsx(jy,{}),onClickCapture:i,children:"Star All"}),a.jsx(Ht,{icon:a.jsx(PE,{}),onClickCapture:o,children:"Change Board"}),a.jsx(Ht,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Hr,{}),onClickCapture:s,children:"Delete Selection"})]})},Pne=u.memo(jne),Ine=ae([be],({gallery:e})=>({selectionCount:e.selection.length}),Ce),Ene=({imageDTO:e,children:t})=>{const{selectionCount:n}=F(Ine),r=u.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:gc,onContextMenu:r,children:a.jsx(Pne,{})}):a.jsx(Ga,{sx:{visibility:"visible !important"},motionProps:gc,onContextMenu:r,children:a.jsx(LO,{imageDTO:e})}):null,children:t})},One=u.memo(Ene),Mne=e=>{const{data:t,disabled:n,...r}=e,o=u.useRef(Fa()),{attributes:s,listeners:i,setNodeRef:c}=Kee({id:o.current,disabled:n,data:t});return a.jsx(Ie,{ref:c,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,...s,...i,...r})},Dne=u.memo(Mne),Rne=a.jsx(An,{as:ng,sx:{boxSize:16}}),Ane=a.jsx(tr,{icon:Vi}),Nne=e=>{const{imageDTO:t,onError:n,onClick:r,withMetadataOverlay:o=!1,isDropDisabled:s=!1,isDragDisabled:i=!1,isUploadDisabled:c=!1,minSize:f=24,postUploadAction:p,imageSx:h,fitContainer:m=!1,droppableData:v,draggableData:b,dropLabel:y,isSelected:x=!1,thumbnail:w=!1,noContentFallback:k=Ane,uploadElement:_=Rne,useThumbailFallback:j,withHoverOverlay:I=!1,children:E,onMouseOver:O,onMouseOut:M}=e,{colorMode:D}=ia(),[A,R]=u.useState(!1),T=u.useCallback(V=>{O&&O(V),R(!0)},[O]),q=u.useCallback(V=>{M&&M(V),R(!1)},[M]),{getUploadButtonProps:B,getUploadInputProps:G}=ky({postUploadAction:p,isDisabled:c}),Y=c?{}:{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(One,{imageDTO:t,children:V=>a.jsxs($,{ref:V,onMouseOver:T,onMouseOut:q,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($,{sx:{w:"full",h:"full",position:m?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[a.jsx(Xi,{src:w?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallbackSrc:j?t.thumbnail_url:void 0,fallback:j?void 0:a.jsx(Ste,{image:t}),onError:n,draggable:!1,sx:{w:t.width,objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",...h}}),o&&a.jsx(xne,{imageDTO:t}),a.jsx(xy,{isSelected:x,isHovered:I?A:!1})]}),!t&&!c&&a.jsx(a.Fragment,{children:a.jsxs($,{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",{...G()}),_]})}),!t&&c&&k,t&&!i&&a.jsx(Dne,{data:b,disabled:i||!t,onClick:r}),E,!s&&a.jsx(by,{data:v,disabled:s,dropLabel:y})]})})},Ya=u.memo(Nne),Tne=()=>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"}})}),$ne=u.memo(Tne),Lne=ae([be,Hb],({gallery:e},t)=>{const n=e.selection;return{queryArgs:t,selection:n}},Ce),zne=e=>{const t=J(),{queryArgs:n,selection:r}=F(Lne),{imageDTOs:o}=Hj(n,{selectFromResult:p=>({imageDTOs:p.data?wD.selectAll(p.data):[]})}),s=qt("multiselect").isFeatureEnabled,i=u.useCallback(p=>{var h;if(e){if(!s){t(xu([e]));return}if(p.shiftKey){const m=e.image_name,v=(h=r[r.length-1])==null?void 0:h.image_name,b=o.findIndex(x=>x.image_name===v),y=o.findIndex(x=>x.image_name===m);if(b>-1&&y>-1){const x=Math.min(b,y),w=Math.max(b,y),k=o.slice(x,w+1);t(xu(Cw(r.concat(k))))}}else p.ctrlKey||p.metaKey?r.some(m=>m.image_name===e.image_name)&&r.length>1?t(xu(r.filter(m=>m.image_name!==e.image_name))):t(xu(Cw(r.concat(e)))):t(xu([e]))}},[t,e,o,r,s]),c=u.useMemo(()=>e?r.some(p=>p.image_name===e.image_name):!1,[e,r]),f=u.useMemo(()=>r.length,[r.length]);return{selection:r,selectionCount:f,isSelected:c,handleClick:i}},Fne=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}})},uc=u.memo(Fne),Bne=e=>{const t=J(),{imageName:n}=e,{currentData:r}=fo(n),o=F(j=>j.hotkeys.shift),{handleClick:s,isSelected:i,selection:c,selectionCount:f}=zne(r),p=u.useCallback(j=>{j.stopPropagation(),r&&t(hm([r]))},[t,r]),h=u.useMemo(()=>{if(f>1)return{id:"gallery-image",payloadType:"IMAGE_DTOS",payload:{imageDTOs:c}};if(r)return{id:"gallery-image",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r,c,f]),[m]=zb(),[v]=Fb(),b=u.useCallback(()=>{r&&(r.starred&&v({imageDTOs:[r]}),r.starred||m({imageDTOs:[r]}))},[m,v,r]),[y,x]=u.useState(!1),w=u.useCallback(()=>{x(!0)},[]),k=u.useCallback(()=>{x(!1)},[]),_=u.useMemo(()=>{if(r!=null&&r.starred)return a.jsx(jy,{size:"20"});if(!(r!=null&&r.starred)&&y)return a.jsx(_y,{size:"20"})},[r==null?void 0:r.starred,y]);return r?a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none"},children:a.jsx($,{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(uc,{onClick:b,icon:_,tooltip:r.starred?"Unstar":"Star"}),y&&o&&a.jsx(uc,{onClick:p,icon:a.jsx(Hr,{}),tooltip:"Delete",styleOverrides:{bottom:2,top:"auto"}})]})})})}):a.jsx($ne,{})},Hne=u.memo(Bne),Vne=Pe((e,t)=>a.jsx(Ie,{className:"item-container",ref:t,p:1.5,children:e.children})),Wne=u.memo(Vne),Une=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})}),Gne=u.memo(Une),Kne={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},qne=()=>{const{t:e}=we(),t=u.useRef(null),[n,r]=u.useState(null),[o,s]=fO(Kne),i=F(w=>w.gallery.selectedBoardId),{currentViewTotal:c}=vne(i),f=F(Hb),{currentData:p,isFetching:h,isSuccess:m,isError:v}=Hj(f),[b]=Vj(),y=u.useMemo(()=>!p||!c?!1:p.ids.length<c,[p,c]),x=u.useCallback(()=>{y&&b({...f,offset:(p==null?void 0:p.ids.length)??0,limit:Wj})},[y,b,f,p==null?void 0:p.ids.length]);return u.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($,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(tr,{label:e("gallery.noImagesInGallery"),icon:Vi})}):m&&p?a.jsxs(a.Fragment,{children:[a.jsx(Ie,{ref:t,"data-overlayscrollbars":"",h:"100%",children:a.jsx(gne,{style:{height:"100%"},data:p.ids,endReached:x,components:{Item:Wne,List:Gne},scrollerRef:r,itemContent:(w,k)=>a.jsx(Hne,{imageName:k},k)})}),a.jsx(it,{onClick:x,isDisabled:!y,isLoading:h,loadingText:"Loading",flexShrink:0,children:`Load More (${p.ids.length} of ${c})`})]}):v?a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsx(tr,{label:"Unable to load Gallery",icon:mZ})}):null:a.jsx($,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(tr,{label:"Loading...",icon:Vi})})},Xne=u.memo(qne),Yne=ae([be],e=>{const{galleryView:t}=e.gallery;return{galleryView:t}},Ce),Qne=()=>{const e=u.useRef(null),t=u.useRef(null),{galleryView:n}=F(Yne),r=J(),{isOpen:o,onToggle:s}=Ir({defaultIsOpen:!0}),i=u.useCallback(()=>{r(WC("images"))},[r]),c=u.useCallback(()=>{r(WC("assets"))},[r]);return a.jsxs(D3,{layerStyle:"first",sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base",p:2},children:[a.jsxs(Ie,{sx:{w:"full"},children:[a.jsxs($,{ref:e,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[a.jsx(fte,{isOpen:o,onToggle:s}),a.jsx(wte,{})]}),a.jsx(Ie,{children:a.jsx(cte,{isOpen:o})})]}),a.jsxs($,{ref:t,direction:"column",gap:2,h:"full",w:"full",children:[a.jsx($,{sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:a.jsx(Qi,{index:n==="images"?0:1,variant:"unstyled",size:"sm",sx:{w:"full"},children:a.jsx(Zi,{children:a.jsxs(hn,{isAttached:!0,sx:{w:"full"},children:[a.jsx(jr,{as:it,size:"sm",isChecked:n==="images",onClick:i,sx:{w:"full"},leftIcon:a.jsx(_Z,{}),children:"Images"}),a.jsx(jr,{as:it,size:"sm",isChecked:n==="assets",onClick:c,sx:{w:"full"},leftIcon:a.jsx(NZ,{}),children:"Assets"})]})})})}),a.jsx(Xne,{})]})]})},Zne=u.memo(Qne),Jne=ae(go,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}}),ere=e=>{const t=J(),{btnGroupWidth:n="auto",asIconButton:r=!1,...o}=e,{isProcessing:s,isConnected:i,isCancelable:c,cancelType:f,isCancelScheduled:p,sessionId:h}=F(Jne),m=u.useCallback(()=>{if(h){if(f==="scheduled"){t(SD());return}t(kD({session_id:h}))}},[t,h,f]),{t:v}=we(),b=u.useCallback(w=>{const k=Array.isArray(w)?w[0]:w;t(_D(k))},[t]);Qe("shift+x",()=>{(i||s)&&c&&m()},[i,s,c]);const y=u.useMemo(()=>v(p?"parameters.cancel.isScheduled":f==="immediate"?"parameters.cancel.immediate":"parameters.cancel.schedule"),[v,f,p]),x=u.useMemo(()=>p?a.jsx(Qp,{}):f==="immediate"?a.jsx(Sne,{}):a.jsx(yne,{}),[f,p]);return a.jsxs(hn,{isAttached:!0,width:n,children:[r?a.jsx(Te,{icon:x,tooltip:y,"aria-label":y,isDisabled:!i||!s||!c,onClick:m,colorScheme:"error",id:"cancel-button",...o}):a.jsx(it,{leftIcon:x,tooltip:y,"aria-label":y,isDisabled:!i||!s||!c,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(Vee,{w:"1em",h:"1em"}),paddingX:0,paddingY:0,colorScheme:"error",minWidth:5,...o}),a.jsx(Ga,{minWidth:"240px",children:a.jsxs(Y3,{value:f,title:"Cancel Type",type:"radio",onChange:b,children:[a.jsx(rh,{value:"immediate",children:v("parameters.cancel.immediate")}),a.jsx(rh,{value:"scheduled",children:v("parameters.cancel.schedule")})]})})]})]})},zO=u.memo(ere),tre=ae([be,wn],(e,t)=>{const{generation:n,system:r,nodes:o}=e,{initialImage:s,model:i}=n,{isProcessing:c,isConnected:f}=r,p=[];return c&&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=jD([h],o.edges);Tn(h.data.inputs,b=>{const y=m.inputs[b.name],x=v.some(w=>w.target===h.id&&w.targetHandle===b.name);if(!y){p.push("Missing field template");return}if(y.required&&b.value===void 0&&!x){p.push(`${h.data.label||m.title} -> ${b.label||y.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:c,reasons:p}},Ce),Ud=()=>{const{isReady:e,isProcessing:t,reasons:n}=F(tre);return{isReady:e,isProcessing:t,reasons:n}},nre=ae(go,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:kt}}),rre=()=>{const{t:e}=we(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=F(nre),s=n?Math.round(n*100/r):0;return a.jsx(fP,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!o,height:"full",colorScheme:"accent"})},ore=u.memo(rre);function FO(e){const{asIconButton:t=!1,sx:n,...r}=e,o=J(),{isReady:s,isProcessing:i}=Ud(),c=F(wn),f=u.useCallback(()=>{o(xd()),o(mm(c))},[o,c]),{t:p}=we();return Qe(["ctrl+enter","meta+enter"],f,{enabled:()=>s,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[s,c]),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(ore,{})}),t?a.jsx(Te,{"aria-label":p("parameters.invoke"),type:"submit",icon:a.jsx(wk,{}),isDisabled:!s,onClick:f,tooltip:a.jsx(fb,{}),colorScheme:"accent",isLoading:i,id:"invoke-button","data-progress":i,sx:{w:"full",flexGrow:1,...n},...r}):a.jsx(it,{tooltip:a.jsx(fb,{}),"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(wk,{}),isLoading:i,loadingText:p("parameters.invoke"),sx:{w:"full",flexGrow:1,fontWeight:700,...n},...r,children:"Invoke"})]})})}const sre=ae([be],({gallery:e})=>{const{autoAddBoardId:t}=e;return{autoAddBoardId:t}},Ce),fb=u.memo(()=>{const{isReady:e,reasons:t}=Ud(),{autoAddBoardId:n}=F(sre),r=ug(n);return a.jsxs($,{flexDir:"column",gap:1,children:[a.jsx(xe,{fontWeight:600,children:e?"Ready to Invoke":"Unable to Invoke"}),t.length>0&&a.jsx(Id,{children:t.map((o,s)=>a.jsx(Ao,{children:a.jsx(xe,{fontWeight:400,children:o})},`${o}.${s}`))}),a.jsx(zr,{opacity:.2,borderColor:"base.50",_dark:{borderColor:"base.900"}}),a.jsxs(xe,{fontWeight:400,fontStyle:"oblique 10deg",children:["Adding images to"," ",a.jsx(xe,{as:"span",fontWeight:600,children:r||"Uncategorized"})]})]})});fb.displayName="InvokeButtonTooltipContent";const are=()=>a.jsxs($,{layerStyle:"first",sx:{gap:2,borderRadius:"base",p:2},children:[a.jsx(FO,{}),a.jsx(zO,{})]}),BO=u.memo(are),{createElement:Ic,createContext:ire,forwardRef:HO,useCallback:Ls,useContext:VO,useEffect:ea,useImperativeHandle:WO,useLayoutEffect:lre,useMemo:cre,useRef:Tr,useState:Gu}=Nb,m_=Nb["useId".toString()],Ku=lre,ure=typeof m_=="function"?m_:()=>null;let dre=0;function Py(e=null){const t=ure(),n=Tr(e||t||null);return n.current===null&&(n.current=""+dre++),n.current}const bg=ire(null);bg.displayName="PanelGroupContext";function UO({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:i=null,maxSize:c=null,minSize:f,onCollapse:p=null,onResize:h=null,order:m=null,style:v={},tagName:b="div"}){const y=VO(bg);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const x=Py(i),{collapsePanel:w,expandPanel:k,getPanelSize:_,getPanelStyle:j,registerPanel:I,resizePanel:E,units:O,unregisterPanel:M}=y;f==null&&(O==="percentages"?f=10:f=0);const D=Tr({onCollapse:p,onResize:h});ea(()=>{D.current.onCollapse=p,D.current.onResize=h});const A=j(x,o),R=Tr({size:g_(A)}),T=Tr({callbacksRef:D,collapsedSize:n,collapsible:r,defaultSize:o,id:x,idWasAutoGenerated:i==null,maxSize:c,minSize:f,order:m});return Ku(()=>{R.current.size=g_(A),T.current.callbacksRef=D,T.current.collapsedSize=n,T.current.collapsible=r,T.current.defaultSize=o,T.current.id=x,T.current.idWasAutoGenerated=i==null,T.current.maxSize=c,T.current.minSize=f,T.current.order=m}),Ku(()=>(I(x,T),()=>{M(x)}),[m,x,I,M]),WO(s,()=>({collapse:()=>w(x),expand:()=>k(x),getCollapsed(){return R.current.size===0},getId(){return x},getSize(q){return _(x,q)},resize:(q,B)=>E(x,q,B)}),[w,k,_,x,E]),Ic(b,{children:e,className:t,"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-id":x,"data-panel-size":parseFloat(""+A.flexGrow).toFixed(1),id:`data-panel-id-${x}`,style:{...A,...v}})}const Wa=HO((e,t)=>Ic(UO,{...e,forwardedRef:t}));UO.displayName="Panel";Wa.displayName="forwardRef(Panel)";function g_(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const Gi=10;function Ru(e,t,n,r,o,s,i,c){const{id:f,panels:p,units:h}=t,m=h==="pixels"?Aa(f):NaN,{sizes:v}=c||{},b=v||s,y=wr(p),x=b.concat();let w=0;{const j=o<0?r:n,I=y.findIndex(D=>D.current.id===j),E=y[I],O=b[I],M=pb(h,m,E,O,O+Math.abs(o),e);if(O===M)return b;M===0&&O>0&&i.set(j,O),o=o<0?O-M:M-O}let k=o<0?n:r,_=y.findIndex(j=>j.current.id===k);for(;;){const j=y[_],I=b[_],E=Math.abs(o)-Math.abs(w),O=pb(h,m,j,I,I-E,e);if(I!==O&&(O===0&&I>0&&i.set(j.current.id,I),w+=I-O,x[_]=O,w.toPrecision(Gi).localeCompare(Math.abs(o).toPrecision(Gi),void 0,{numeric:!0})>=0))break;if(o<0){if(--_<0)break}else if(++_>=y.length)break}return w===0?b:(k=o<0?r:n,_=y.findIndex(j=>j.current.id===k),x[_]=b[_]+w,x)}function Rl(e,t,n){t.forEach((r,o)=>{const s=e[o];if(!s)return;const{callbacksRef:i,collapsedSize:c,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===c)&&r!==c?m(!1):h!==c&&r===c&&m(!0))}})}function fre({groupId:e,panels:t,units:n}){const r=n==="pixels"?Aa(e):NaN,o=wr(t),s=Array(o.length);let i=0,c=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,c-=s[f])}for(let f=0;f<o.length;f++){const p=o[f];let{defaultSize:h,id:m,maxSize:v,minSize:b}=p.current;if(h!=null)continue;n==="pixels"&&(b=b/r*100,v!=null&&(v=v/r*100));const y=o.length-i,x=Math.min(v??100,Math.max(b,c/y));s[f]=x,i++,c-=x}if(c!==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]+c));if(v!==s[f]&&(c-=v-s[f],s[f]=v,Math.abs(c).toFixed(3)==="0.000"))break}return Math.abs(c).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=Iy(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 GO(e,t,n){if(e.size===1)return"100";const o=wr(e).findIndex(i=>i.current.id===t),s=n[o];return s==null?"0":s.toPrecision(Gi)}function pre(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 xg(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function hre(e){return KO().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function KO(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function Iy(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function Ey(e,t,n){var f,p,h,m;const r=xg(t),o=Iy(e),s=r?o.indexOf(r):-1,i=((p=(f=n[s])==null?void 0:f.current)==null?void 0:p.id)??null,c=((m=(h=n[s+1])==null?void 0:h.current)==null?void 0:m.id)??null;return[i,c]}function wr(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 pb(e,t,n,r,o,s=null){var h;let{collapsedSize:i,collapsible:c,maxSize:f,minSize:p}=n.current;if(e==="pixels"&&(i=i/t*100,f!=null&&(f=f/t*100),p=p/t*100),c){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 mre(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=wr(t),i=o==="pixels"?Aa(e):NaN;let c=0;for(let f=0;f<s.length;f++){const p=s[f],h=r[f],m=n[f],v=pb(o,i,p,h,m);m!=v&&(c+=m-v,n[f]=v)}if(c.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]+c));if(v!==n[f]&&(c-=v-n[f],n[f]=v,Math.abs(c).toFixed(3)==="0.000"))break}return c.toFixed(3),n}function qO(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function gre({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){ea(()=>{const{direction:i,panels:c}=e.current,f=cd(t);qO(f!=null,`No group found for id "${t}"`);const{height:p,width:h}=f.getBoundingClientRect(),v=Iy(t).map(b=>{const y=b.getAttribute("data-panel-resize-handle-id"),x=wr(c),[w,k]=Ey(t,y,x);if(w==null||k==null)return()=>{};let _=0,j=100,I=0,E=0;x.forEach(T=>{const{id:q,maxSize:B,minSize:G}=T.current;q===w?(_=G,j=B??100):(I+=G,E+=B??100)});const O=Math.min(j,100-I),M=Math.max(_,(x.length-1)*100-E),D=GO(c,w,o);b.setAttribute("aria-valuemax",""+Math.round(O)),b.setAttribute("aria-valuemin",""+Math.round(M)),b.setAttribute("aria-valuenow",""+Math.round(parseInt(D)));const A=T=>{if(!T.defaultPrevented)switch(T.key){case"Enter":{T.preventDefault();const q=x.findIndex(B=>B.current.id===w);if(q>=0){const B=x[q],G=o[q];if(G!=null){let Y=0;G.toPrecision(Gi)<=B.current.minSize.toPrecision(Gi)?Y=i==="horizontal"?h:p:Y=-(i==="horizontal"?h:p);const V=Ru(T,e.current,w,k,Y,o,s.current,null);o!==V&&r(V)}}break}}};b.addEventListener("keydown",A);const R=pre(w);return R!=null&&b.setAttribute("aria-controls",R.id),()=>{b.removeAttribute("aria-valuemax"),b.removeAttribute("aria-valuemin"),b.removeAttribute("aria-valuenow"),b.removeEventListener("keydown",A),R!=null&&b.removeAttribute("aria-controls")}});return()=>{v.forEach(b=>b())}},[e,t,n,s,r,o])}function vre({disabled:e,handleId:t,resizeHandler:n}){ea(()=>{if(e||n==null)return;const r=xg(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=KO(),c=hre(t);qO(c!==null);const f=s.shiftKey?c>0?c-1:i.length-1:c+1<i.length?c+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 XO(e,t,n,r=0,o=null){const s=n==="horizontal";let i=0;if(hb(e))i=s?e.clientX:e.clientY;else if(mb(e)){const h=e.touches[0];i=s?h.screenX:h.screenY}else return 0;const c=xg(t),f=o||c.getBoundingClientRect(),p=s?f.left:f.top;return i-p-r}function bre(e,t,n,r,o,s,i){const{dragOffset:c=0,dragHandleRect:f,sizes:p}=i||{},h=p||s;if(xre(e)){const m=o==="horizontal",b=cd(t).getBoundingClientRect(),y=m?b.width:b.height,x=e.shiftKey?10:100,w=y/x;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=y;break;case"Home":k=-y;break}const[_,j]=Ey(t,n,r),I=k<0?_:j,E=r.findIndex(M=>M.current.id===I),O=r[E];if(O.current.collapsible){const M=h[E];(M===0||M.toPrecision(Gi)===O.current.minSize.toPrecision(Gi))&&(k=k<0?-O.current.minSize*y:O.current.minSize*y)}return k}else return XO(e,n,o,c,f)}function xre(e){return e.type==="keydown"}function hb(e){return e.type.startsWith("mouse")}function mb(e){return e.type.startsWith("touch")}let gb=null,wi=null;function YO(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 yre(){wi!==null&&(document.head.removeChild(wi),gb=null,wi=null)}function Fv(e){if(gb===e)return;gb=e;const t=YO(e);wi===null&&(wi=document.createElement("style"),document.head.appendChild(wi)),wi.innerHTML=`*{cursor: ${t}!important;}`}function Cre(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function QO(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 ZO(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 wre(e,t,n){const r=ZO(e,n);if(r){const o=QO(t);return r[o]??null}return null}function Sre(e,t,n,r){const o=QO(t),s=ZO(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(i){console.error(i)}}const Bv={};function v_(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=>(v_(Au),Au.getItem(e)),setItem:(e,t)=>{v_(Au),Au.setItem(e,t)}};function JO({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:i=null,onLayout:c,storage:f=Au,style:p={},tagName:h="div",units:m="percentages"}){const v=Py(i),[b,y]=Gu(null),[x,w]=Gu(new Map),k=Tr(null);Tr({didLogDefaultSizeWarning:!1,didLogIdAndOrderWarning:!1,didLogInvalidLayoutWarning:!1,prevPanelIds:[]});const _=Tr({onLayout:c});ea(()=>{_.current.onLayout=c});const j=Tr({}),[I,E]=Gu([]),O=Tr(new Map),M=Tr(0),D=Tr({direction:r,id:v,panels:x,sizes:I,units:m});WO(s,()=>({getId:()=>v,getLayout:z=>{const{sizes:K,units:ne}=D.current;if((z??ne)==="pixels"){const ie=Aa(v);return K.map(oe=>oe/100*ie)}else return K},setLayout:(z,K)=>{const{id:ne,panels:Q,sizes:ie,units:oe}=D.current;if((K||oe)==="pixels"){const se=Aa(ne);z=z.map(re=>re/se*100)}const W=j.current,U=wr(Q),ee=Lv({groupId:ne,panels:Q,nextSizes:z,prevSizes:ie,units:oe});zv(ie,ee)||(E(ee),Rl(U,ee,W))}}),[v]),Ku(()=>{D.current.direction=r,D.current.id=v,D.current.panels=x,D.current.sizes=I,D.current.units=m}),gre({committedValuesRef:D,groupId:v,panels:x,setSizes:E,sizes:I,panelSizeBeforeCollapse:O}),ea(()=>{const{onLayout:z}=_.current,{panels:K,sizes:ne}=D.current;if(ne.length>0){z&&z(ne);const Q=j.current,ie=wr(K);Rl(ie,ne,Q)}},[I]),Ku(()=>{const{id:z,sizes:K,units:ne}=D.current;if(K.length===x.size)return;let Q=null;if(e){const ie=wr(x);Q=wre(e,ie,f)}if(Q!=null){const ie=Lv({groupId:z,panels:x,nextSizes:Q,prevSizes:Q,units:ne});E(ie)}else{const ie=fre({groupId:z,panels:x,units:ne});E(ie)}},[e,x,f]),ea(()=>{if(e){if(I.length===0||I.length!==x.size)return;const z=wr(x);Bv[e]||(Bv[e]=Cre(Sre,100)),Bv[e](e,z,I,f)}},[e,x,I,f]),Ku(()=>{if(m==="pixels"){const z=new ResizeObserver(()=>{const{panels:K,sizes:ne}=D.current,Q=Lv({groupId:v,panels:K,nextSizes:ne,prevSizes:ne,units:m});zv(ne,Q)||E(Q)});return z.observe(cd(v)),()=>{z.disconnect()}}},[v,m]);const A=Ls((z,K)=>{const{panels:ne,units:Q}=D.current,oe=wr(ne).findIndex(ee=>ee.current.id===z),W=I[oe];if((K??Q)==="pixels"){const ee=Aa(v);return W/100*ee}else return W},[v,I]),R=Ls((z,K)=>{const{panels:ne}=D.current;return ne.size===0?{flexBasis:0,flexGrow:K??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:GO(ne,z,I),flexShrink:1,overflow:"hidden",pointerEvents:o&&b!==null?"none":void 0}},[b,o,I]),T=Ls((z,K)=>{const{units:ne}=D.current;mre(ne,K),w(Q=>{if(Q.has(z))return Q;const ie=new Map(Q);return ie.set(z,K),ie})},[]),q=Ls(z=>ne=>{ne.preventDefault();const{direction:Q,panels:ie,sizes:oe}=D.current,W=wr(ie),[U,ee]=Ey(v,z,W);if(U==null||ee==null)return;let se=bre(ne,v,z,W,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,U,ee,ye,oe,O.current,k.current),ue=!zv(oe,he);if((hb(ne)||mb(ne))&&M.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;E(he),Rl(W,he,De)}M.current=ye},[v]),B=Ls(z=>{w(K=>{if(!K.has(z))return K;const ne=new Map(K);return ne.delete(z),ne})},[]),G=Ls(z=>{const{panels:K,sizes:ne}=D.current,Q=K.get(z);if(Q==null)return;const{collapsedSize:ie,collapsible:oe}=Q.current;if(!oe)return;const W=wr(K),U=W.indexOf(Q);if(U<0)return;const ee=ne[U];if(ee===ie)return;O.current.set(z,ee);const[se,re]=$v(z,W);if(se==null||re==null)return;const de=U===W.length-1?ee:ie-ee,me=Ru(null,D.current,se,re,de,ne,O.current,null);if(ne!==me){const ye=j.current;E(me),Rl(W,me,ye)}},[]),Y=Ls(z=>{const{panels:K,sizes:ne}=D.current,Q=K.get(z);if(Q==null)return;const{collapsedSize:ie,minSize:oe}=Q.current,W=O.current.get(z)||oe;if(!W)return;const U=wr(K),ee=U.indexOf(Q);if(ee<0||ne[ee]!==ie)return;const[re,fe]=$v(z,U);if(re==null||fe==null)return;const me=ee===U.length-1?ie-W:W,ye=Ru(null,D.current,re,fe,me,ne,O.current,null);if(ne!==ye){const he=j.current;E(ye),Rl(U,ye,he)}},[]),V=Ls((z,K,ne)=>{const{id:Q,panels:ie,sizes:oe,units:W}=D.current;if((ne||W)==="pixels"){const rt=Aa(Q);K=K/rt*100}const U=ie.get(z);if(U==null)return;let{collapsedSize:ee,collapsible:se,maxSize:re,minSize:fe}=U.current;if(W==="pixels"){const rt=Aa(Q);fe=fe/rt*100,re!=null&&(re=re/rt*100)}const de=wr(ie),me=de.indexOf(U);if(me<0)return;const ye=oe[me];if(ye===K)return;se&&K===ee||(K=Math.min(re??100,Math.max(fe,K)));const[he,ue]=$v(z,de);if(he==null||ue==null)return;const je=me===de.length-1?ye-K:K-ye,Be=Ru(null,D.current,he,ue,je,oe,O.current,null);if(oe!==Be){const rt=j.current;E(Be),Rl(de,Be,rt)}},[]),L=cre(()=>({activeHandleId:b,collapsePanel:G,direction:r,expandPanel:Y,getPanelSize:A,getPanelStyle:R,groupId:v,registerPanel:T,registerResizeHandle:q,resizePanel:V,startDragging:(z,K)=>{if(y(z),hb(K)||mb(K)){const ne=xg(z);k.current={dragHandleRect:ne.getBoundingClientRect(),dragOffset:XO(K,z,r),sizes:D.current.sizes}}},stopDragging:()=>{yre(),y(null),k.current=null},units:m,unregisterPanel:B}),[b,G,r,Y,A,R,v,T,q,V,m,B]),X={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Ic(bg.Provider,{children:Ic(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=HO((e,t)=>Ic(JO,{...e,forwardedRef:t}));JO.displayName="PanelGroup";yg.displayName="forwardRef(PanelGroup)";function vb({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:i="div"}){const c=Tr(null),f=Tr({onDragging:o});ea(()=>{f.current.onDragging=o});const p=VO(bg);if(p===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:h,direction:m,groupId:v,registerResizeHandle:b,startDragging:y,stopDragging:x}=p,w=Py(r),k=h===w,[_,j]=Gu(!1),[I,E]=Gu(null),O=Ls(()=>{c.current.blur(),x();const{onDragging:A}=f.current;A&&A(!1)},[x]);ea(()=>{if(n)E(null);else{const D=b(w);E(()=>D)}},[n,w,b]),ea(()=>{if(n||I==null||!k)return;const D=q=>{I(q)},A=q=>{I(q)},T=c.current.ownerDocument;return T.body.addEventListener("contextmenu",O),T.body.addEventListener("mousemove",D),T.body.addEventListener("touchmove",D),T.body.addEventListener("mouseleave",A),window.addEventListener("mouseup",O),window.addEventListener("touchend",O),()=>{T.body.removeEventListener("contextmenu",O),T.body.removeEventListener("mousemove",D),T.body.removeEventListener("touchmove",D),T.body.removeEventListener("mouseleave",A),window.removeEventListener("mouseup",O),window.removeEventListener("touchend",O)}},[m,n,k,I,O]),vre({disabled:n,handleId:w,resizeHandler:I});const M={cursor:YO(m),touchAction:"none",userSelect:"none"};return Ic(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=>{y(w,D.nativeEvent);const{onDragging:A}=f.current;A&&A(!0)},onMouseUp:O,onTouchCancel:O,onTouchEnd:O,onTouchStart:D=>{y(w,D.nativeEvent);const{onDragging:A}=f.current;A&&A(!0)},ref:c,role:"separator",style:{...M,...s},tabIndex:0})}vb.displayName="PanelResizeHandle";const kre=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(vb,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx($,{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(vb,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx($,{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=u.memo(kre),Oy=()=>{const e=J(),t=F(o=>o.ui.panels),n=u.useCallback(o=>t[o]??"",[t]),r=u.useCallback((o,s)=>{e(PD({name:o,value:s}))},[e]);return{getItem:n,setItem:r}};const _re=e=>{const{label:t,data:n,fileName:r,withDownload:o=!0,withCopy:s=!0}=e,i=u.useMemo(()=>ID(n)?n:JSON.stringify(n,null,2),[n]),c=u.useCallback(()=>{navigator.clipboard.writeText(i)},[i]),f=u.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($,{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($,{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:c})})]})]})},Mi=u.memo(_re),jre=ae(be,({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),Pre=()=>{const{data:e}=F(jre);return e?a.jsx(Mi,{data:e,label:"Node Data"}):a.jsx(tr,{label:"No node selected",icon:null})},Ire=u.memo(Pre),Ere=e=>a.jsx($,{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})})}),My=u.memo(Ere),Ore=({output:e})=>{const{image:t}=e,{data:n}=fo(t.image_name);return a.jsx(Ya,{imageDTO:n})},Mre=u.memo(Ore),Dre=ae(be,({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),Rre=()=>{const{node:e,template:t,nes:n}=F(Dre);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(My,{children:a.jsx($,{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(Mre,{output:r},Nre(r,o))):a.jsx(Mi,{data:n.outputs,label:"Node Outputs"})})})})},Are=u.memo(Rre),Nre=(e,t)=>`${e.type}-${t}`,Tre=ae(be,({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),$re=()=>{const{template:e}=F(Tre);return e?a.jsx(Mi,{data:e,label:"Node Template"}):a.jsx(tr,{label:"No node selected",icon:null})},Lre=u.memo($re),zre=()=>a.jsx($,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(Qi,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(Zi,{children:[a.jsx(jr,{children:"Outputs"}),a.jsx(jr,{children:"Data"}),a.jsx(jr,{children:"Template"})]}),a.jsxs(zc,{children:[a.jsx(uo,{children:a.jsx(Are,{})}),a.jsx(uo,{children:a.jsx(Ire,{})}),a.jsx(uo,{children:a.jsx(Lre,{})})]})]})}),Fre=u.memo(zre),Dy=e=>{e.stopPropagation()},Bre={display:"flex",flexDirection:"row",alignItems:"center",gap:10},Hre=e=>{const{label:t="",labelPos:n="top",isDisabled:r=!1,isInvalid:o,formControlProps:s,...i}=e,c=J(),f=u.useCallback(h=>{h.shiftKey&&c(Pr(!0))},[c]),p=u.useCallback(h=>{h.shiftKey||c(Pr(!1))},[c]);return a.jsxs(dn,{isInvalid:o,isDisabled:r,...s,style:n==="side"?Bre:void 0,children:[t!==""&&a.jsx(Gn,{children:t}),a.jsx(Pm,{...i,onPaste:Dy,onKeyDown:f,onKeyUp:p})]})},ao=u.memo(Hre),Vre=Pe((e,t)=>{const n=J(),r=u.useCallback(s=>{s.shiftKey&&n(Pr(!0))},[n]),o=u.useCallback(s=>{s.shiftKey||n(Pr(!1))},[n]);return a.jsx(EP,{ref:t,onPaste:Dy,onKeyDown:r,onKeyUp:o,...e})}),oa=u.memo(Vre),Wre=ae(be,({nodes:e})=>{const{author:t,name:n,description:r,tags:o,version:s,contact:i,notes:c}=e.workflow;return{name:n,author:t,description:r,tags:o,version:s,contact:i,notes:c}},Ce),Ure=()=>{const{author:e,name:t,description:n,tags:r,version:o,contact:s,notes:i}=F(Wre),c=J(),f=u.useCallback(x=>{c(ED(x.target.value))},[c]),p=u.useCallback(x=>{c(OD(x.target.value))},[c]),h=u.useCallback(x=>{c(MD(x.target.value))},[c]),m=u.useCallback(x=>{c(DD(x.target.value))},[c]),v=u.useCallback(x=>{c(RD(x.target.value))},[c]),b=u.useCallback(x=>{c(AD(x.target.value))},[c]),y=u.useCallback(x=>{c(ND(x.target.value))},[c]);return a.jsx(My,{children:a.jsxs($,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:[a.jsxs($,{sx:{gap:2,w:"full"},children:[a.jsx(ao,{label:"Name",value:t,onChange:f}),a.jsx(ao,{label:"Version",value:o,onChange:m})]}),a.jsxs($,{sx:{gap:2,w:"full"},children:[a.jsx(ao,{label:"Author",value:e,onChange:p}),a.jsx(ao,{label:"Contact",value:s,onChange:h})]}),a.jsx(ao,{label:"Tags",value:r,onChange:b}),a.jsxs(dn,{as:$,sx:{flexDir:"column"},children:[a.jsx(Gn,{children:"Short Description"}),a.jsx(oa,{onChange:v,value:n,fontSize:"sm",sx:{resize:"none"}})]}),a.jsxs(dn,{as:$,sx:{flexDir:"column",h:"full"},children:[a.jsx(Gn,{children:"Notes"}),a.jsx(oa,{onChange:y,value:i,fontSize:"sm",sx:{h:"full",resize:"none"}})]})]})})},Gre=u.memo(Ure);function Kre(e,t,n){var r=this,o=u.useRef(null),s=u.useRef(0),i=u.useRef(null),c=u.useRef([]),f=u.useRef(),p=u.useRef(),h=u.useRef(e),m=u.useRef(!0);u.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 b=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,x="maxWait"in n,w=x?Math.max(+n.maxWait||0,t):null;u.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var k=u.useMemo(function(){var _=function(D){var A=c.current,R=f.current;return c.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||x&&D-s.current>=w},E=function(D){return i.current=null,y&&c.current?_(D):(c.current=f.current=null,p.current)},O=function D(){var A=Date.now();if(I(A))return E(A);if(m.current){var R=t-(A-o.current),T=x?Math.min(R,w-(A-s.current)):R;j(D,T)}},M=function(){var D=Date.now(),A=I(D);if(c.current=[].slice.call(arguments),f.current=r,o.current=D,A){if(!i.current&&m.current)return s.current=o.current,j(O,t),b?_(o.current):p.current;if(x)return j(O,t),_(o.current)}return i.current||j(O,t),p.current};return M.cancel=function(){i.current&&(v?cancelAnimationFrame(i.current):clearTimeout(i.current)),s.current=0,c.current=o.current=f.current=i.current=null},M.isPending=function(){return!!i.current},M.flush=function(){return i.current?E(Date.now()):p.current},M},[b,x,t,w,y,v]);return k}function qre(e,t){return e===t}function b_(e){return typeof e=="function"?function(){return e}:e}function Xre(e,t,n){var r,o,s=n&&n.equalityFn||qre,i=(r=u.useState(b_(e)),o=r[1],[r[0],u.useCallback(function(m){return o(b_(m))},[])]),c=i[0],f=i[1],p=Kre(u.useCallback(function(m){return f(m)},[f]),t,n),h=u.useRef(e);return s(h.current,e)||(p(e),h.current=e),[c,p]}const eM=()=>{const e=F(r=>r.nodes),[t]=Xre(e,300);return u.useMemo(()=>TD(t),[t])},Yre=()=>{const e=eM();return a.jsx($,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:a.jsx(Mi,{data:e,label:"Workflow"})})},Qre=u.memo(Yre),Zre=({isSelected:e,isHovered:t})=>{const n=u.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.light";if(e)return"nodeSelected.light";if(t)return"nodeHovered.light"},[t,e]),r=u.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}}})},tM=u.memo(Zre),nM=e=>{const t=J(),n=u.useMemo(()=>ae(be,({nodes:i})=>i.mouseOverNode===e,Ce),[e]),r=F(n),o=u.useCallback(()=>{!r&&t(UC(e))},[t,e,r]),s=u.useCallback(()=>{r&&t(UC(null))},[t,r]);return{isMouseOverNode:r,handleMouseOver:o,handleMouseOut:s}},rM=(e,t)=>{const n=u.useMemo(()=>ae(be,({nodes:o})=>{var i;const s=o.nodes.find(c=>c.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)},oM=(e,t,n)=>{const r=u.useMemo(()=>ae(be,({nodes:s})=>{var f;const i=s.nodes.find(p=>p.id===e);if(!Cn(i))return;const c=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return(f=c==null?void 0:c[Vb[n]][t])==null?void 0:f.title},Ce),[t,n,e]);return F(r)},sM=(e,t)=>{const n=u.useMemo(()=>ae(be,({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=u.useMemo(()=>ae(be,({nodes:s})=>{const i=s.nodes.find(f=>f.id===e);if(!Cn(i))return;const c=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return c==null?void 0:c[Vb[n]][t]},Ce),[t,n,e]);return F(r)},Jre=({nodeId:e,fieldName:t,kind:n})=>{const r=sM(e,t),o=Cg(e,t,n),s=$D(o),i=u.useMemo(()=>LD(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($,{sx:{flexDir:"column"},children:[a.jsx(xe,{sx:{fontWeight:600},children:i}),o&&a.jsx(xe,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:o.description}),o&&a.jsxs(xe,{children:["Type: ",yd[o.type].title]}),s&&a.jsxs(xe,{children:["Input: ",zD(o.input)]})]})},Ry=u.memo(Jre),eoe=Pe((e,t)=>{const{nodeId:n,fieldName:r,kind:o,isMissingInput:s=!1,withTooltip:i=!1}=e,c=rM(n,r),f=oM(n,r,o),p=J(),[h,m]=u.useState(c||f||"Unknown Field"),v=u.useCallback(async y=>{y&&(y===c||y===f)||(m(y||f||"Unknown Field"),p(FD({nodeId:n,fieldName:r,label:y})))},[c,f,p,n,r]),b=u.useCallback(y=>{m(y)},[]);return u.useEffect(()=>{m(c||f||"Unknown Field")},[c,f]),a.jsx(Dt,{label:i?a.jsx(Ry,{nodeId:n,fieldName:r,kind:"input"}):void 0,openDelay:gm,placement:"top",hasArrow:!0,children:a.jsx($,{ref:t,sx:{position:"relative",overflow:"hidden",alignItems:"center",justifyContent:"flex-start",gap:1,h:"full"},children:a.jsxs(km,{value:h,onChange:b,onSubmit:v,as:$,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(iM,{})]})})})}),aM=u.memo(eoe),iM=u.memo(()=>{const{isEditing:e,getEditButtonProps:t}=F5(),n=u.useCallback(r=>{const{onClick:o}=t();o&&(o(r),r.preventDefault())},[t]);return e?null:a.jsx($,{onClick:n,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,cursor:"text"})});iM.displayName="EditableControls";const toe=e=>{const{nodeId:t,field:n}=e,r=J(),o=u.useCallback(s=>{r(BD({nodeId:t,fieldName:n.name,value:s.target.checked}))},[r,n.name,t]);return a.jsx(Lx,{className:"nodrag",onChange:o,isChecked:n.value})},noe=u.memo(toe);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 lM(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 bb(e){var t=u.useRef(e),n=u.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Ec=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},xb=function(e){return e&&e.ownerDocument.defaultView||self},x_=function(e,t,n){var r=e.getBoundingClientRect(),o=qu(t)?function(s,i){for(var c=0;c<s.length;c++)if(s[c].identifier===i)return s[c];return s[0]}(t.touches,n):t;return{left:Ec((o.pageX-(r.left+xb(e).pageXOffset))/r.width),top:Ec((o.pageY-(r.top+xb(e).pageYOffset))/r.height)}},y_=function(e){!qu(e)&&e.preventDefault()},Ay=H.memo(function(e){var t=e.onMove,n=e.onKey,r=lM(e,["onMove","onKey"]),o=u.useRef(null),s=bb(t),i=bb(n),c=u.useRef(null),f=u.useRef(!1),p=u.useMemo(function(){var b=function(w){y_(w),(qu(w)?w.touches.length>0:w.buttons>0)&&o.current?s(x_(o.current,w,c.current)):x(!1)},y=function(){return x(!1)};function x(w){var k=f.current,_=xb(o.current),j=w?_.addEventListener:_.removeEventListener;j(k?"touchmove":"mousemove",b),j(k?"touchend":"mouseup",y)}return[function(w){var k=w.nativeEvent,_=o.current;if(_&&(y_(k),!function(I,E){return E&&!qu(I)}(k,f.current)&&_)){if(qu(k)){f.current=!0;var j=k.changedTouches||[];j.length&&(c.current=j[0].identifier)}_.focus(),s(x_(_,k,c.current)),x(!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}))},x]},[i,s]),h=p[0],m=p[1],v=p[2];return u.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(" ")},Ny=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},cM=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)}},yb=function(e){var t=cM(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Hv=function(e){var t=cM(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},roe=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),c=r*(1-(t-s)*n),f=r*(1-(1-t+s)*n),p=s%6;return{r:dr(255*[r,c,i,i,f,r][p]),g:dr(255*[f,r,r,c,i,i][p]),b:dr(255*[i,i,f,r,r,c][p]),a:dr(o,2)}},ooe=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),c=i?s===t?(n-r)/i:s===n?2+(r-t)/i:4+(t-n)/i:0;return{h:dr(60*(c<0?c+6:c)),s:dr(s?i/s*100:0),v:dr(s/255*100),a:o}},soe=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(Ay,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Ec(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":dr(t),"aria-valuemax":"360","aria-valuemin":"0"},H.createElement(Ny,{className:"react-colorful__hue-pointer",left:t/360,color:yb({h:t,s:100,v:100,a:1})})))}),aoe=H.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:yb({h:t.h,s:100,v:100,a:1})};return H.createElement("div",{className:"react-colorful__saturation",style:r},H.createElement(Ay,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Ec(t.s+100*o.left,0,100),v:Ec(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+dr(t.s)+"%, Brightness "+dr(t.v)+"%"},H.createElement(Ny,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:yb(t)})))}),uM=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function ioe(e,t,n){var r=bb(n),o=u.useState(function(){return e.toHsva(t)}),s=o[0],i=o[1],c=u.useRef({color:t,hsva:s});u.useEffect(function(){if(!e.equal(t,c.current.color)){var p=e.toHsva(t);c.current={hsva:p,color:t},i(p)}},[t,e]),u.useEffect(function(){var p;uM(s,c.current.hsva)||e.equal(p=e.fromHsva(s),c.current.color)||(c.current={hsva:s,color:p},r(p))},[s,e,r]);var f=u.useCallback(function(p){i(function(h){return Object.assign({},h,p)})},[]);return[s,f]}var loe=typeof window<"u"?u.useLayoutEffect:u.useEffect,coe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},C_=new Map,uoe=function(e){loe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!C_.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}`,C_.set(t,n);var r=coe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},doe=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(Ay,{onMove:function(c){r({a:c.left})},onKey:function(c){r({a:Ec(n.a+c.left)})},"aria-label":"Alpha","aria-valuetext":i+"%","aria-valuenow":i,"aria-valuemin":"0","aria-valuemax":"100"},H.createElement(Ny,{className:"react-colorful__alpha-pointer",left:n.a,color:Hv(n)})))},foe=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,i=lM(e,["className","colorModel","color","onChange"]),c=u.useRef(null);uoe(c);var f=ioe(n,o,s),p=f[0],h=f[1],m=Sg(["react-colorful",t]);return H.createElement("div",wg({},i,{ref:c,className:m}),H.createElement(aoe,{hsva:p,onChange:h}),H.createElement(soe,{hue:p.h,onChange:h}),H.createElement(doe,{hsva:p,onChange:h,className:"react-colorful__last-control"}))},poe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:ooe,fromHsva:roe,equal:uM},dM=function(e){return H.createElement(foe,wg({},e,{colorModel:poe}))};const hoe=e=>{const{nodeId:t,field:n}=e,r=J(),o=u.useCallback(s=>{r(HD({nodeId:t,fieldName:n.name,value:s}))},[r,n.name,t]);return a.jsx(dM,{className:"nodrag",color:n.value,onChange:o})},moe=u.memo(hoe),fM=e=>{const t=qi("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},goe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=J(),{data:s}=Wb(),i=u.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]),c=u.useMemo(()=>{if(!s)return[];const p=[];return Tn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:un[h.base_model]})}),p},[s]),f=u.useCallback(p=>{if(!p)return;const h=fM(p);h&&o(WD({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx($n,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:c,onChange:f,sx:{width:"100%"}})},voe=u.memo(goe),boe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=J(),s=u.useCallback(i=>{o(UD({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return a.jsx(mP,{className:"nowheel nodrag",onChange:s,value:n.value,children:r.options.map(i=>a.jsx("option",{children:i},i))})},xoe=u.memo(boe),yoe=e=>{var p;const{nodeId:t,field:n}=e,r=J(),{currentData:o}=fo(((p=n.value)==null?void 0:p.image_name)??Lr.skipToken),s=u.useCallback(()=>{r(GD({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),i=u.useMemo(()=>{if(o)return{id:`node-${t}-${n.name}`,payloadType:"IMAGE_DTO",payload:{imageDTO:o}}},[n.name,o,t]),c=u.useMemo(()=>({id:`node-${t}-${n.name}`,actionType:"SET_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}}),[n.name,t]),f=u.useMemo(()=>({type:"SET_NODES_IMAGE",nodeId:t,fieldName:n.name}),[t,n.name]);return a.jsx($,{className:"nodrag",sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Ya,{imageDTO:o,droppableData:c,draggableData:i,postUploadAction:f,useThumbailFallback:!0,uploadElement:a.jsx(pM,{}),dropLabel:a.jsx(hM,{}),minSize:8,children:a.jsx(uc,{onClick:s,icon:o?a.jsx(tg,{}):void 0,tooltip:"Reset Image"})})})},Coe=u.memo(yoe),pM=u.memo(()=>a.jsx(xe,{fontSize:16,fontWeight:600,children:"Drop or Upload"}));pM.displayName="UploadElement";const hM=u.memo(()=>a.jsx(xe,{fontSize:16,fontWeight:600,children:"Drop"}));hM.displayName="DropLabel";const woe=e=>{const t=qi("models"),[n,r,o]=e.split("/"),s=KD.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},Soe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=J(),{data:s}=vm(),i=u.useMemo(()=>{if(!s)return[];const p=[];return Tn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:un[h.base_model]})}),p.sort((h,m)=>h.disabled&&!m.disabled?1:-1)},[s]),c=u.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=u.useCallback(p=>{if(!p)return;const h=woe(p);h&&o(qD({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return(s==null?void 0:s.ids.length)===0?a.jsx($,{sx:{justifyContent:"center",p:2},children:a.jsx(xe,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(Gt,{className:"nowheel nodrag",value:(c==null?void 0:c.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:!c,onChange:f,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},koe=u.memo(Soe),kg=e=>{const t=qi("models"),[n,r,o]=e.split("/"),s=XD.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 Wc(e){const{iconMode:t=!1,...n}=e,r=J(),{t:o}=we(),[s,{isLoading:i}]=YD(),c=()=>{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(NE,{}),tooltip:o("modelManager.syncModels"),"aria-label":o("modelManager.syncModels"),isLoading:i,onClick:c,size:"sm",...n}):a.jsx(it,{isLoading:i,onClick:c,minW:"max-content",...n,children:"Sync Models"})}const _oe=e=>{var b,y;const{nodeId:t,field:n}=e,r=J(),o=qt("syncModels").isFeatureEnabled,{data:s,isLoading:i}=Xu(GC),{data:c,isLoading:f}=Bo(GC),p=u.useMemo(()=>i||f,[i,f]),h=u.useMemo(()=>{if(!c)return[];const x=[];return Tn(c.entities,(w,k)=>{w&&x.push({value:k,label:w.model_name,group:un[w.base_model]})}),s&&Tn(s.entities,(w,k)=>{w&&x.push({value:k,label:w.model_name,group:un[w.base_model]})}),x},[c,s]),m=u.useMemo(()=>{var x,w,k,_;return((c==null?void 0:c.entities[`${(x=n.value)==null?void 0:x.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},[(b=n.value)==null?void 0:b.base_model,(y=n.value)==null?void 0:y.model_name,c==null?void 0:c.entities,s==null?void 0:s.entities]),v=u.useCallback(x=>{if(!x)return;const w=kg(x);w&&r(Uj({nodeId:t,fieldName:n.name,value:w}))},[r,n.name,t]);return a.jsxs($,{sx:{w:"full",alignItems:"center",gap:2},children:[p?a.jsx(xe,{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(Wc,{className:"nodrag",iconMode:!0})]})},joe=u.memo(_oe),sm=/^-?(0\.)?\.?$/,Poe=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:i,min:c,max:f,isInteger:p=!0,formControlProps:h,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:b,tooltipProps:y,...x}=e,w=J(),[k,_]=u.useState(String(s));u.useEffect(()=>{!k.match(sm)&&s!==Number(k)&&_(String(s))},[s,k]);const j=M=>{_(M),M.match(sm)||i(p?Math.floor(Number(M)):Number(M))},I=M=>{const D=Ri(p?Math.floor(Number(M.target.value)):Number(M.target.value),c,f);_(String(D)),i(D)},E=u.useCallback(M=>{M.shiftKey&&w(Pr(!0))},[w]),O=u.useCallback(M=>{M.shiftKey||w(Pr(!1))},[w]);return a.jsx(Dt,{...y,children:a.jsxs(dn,{isDisabled:n,isInvalid:o,...h,children:[t&&a.jsx(Gn,{...m,children:t}),a.jsxs(Dm,{value:k,min:c,max:f,keepWithinRange:!0,clampValueOnBlur:!1,onChange:j,onBlur:I,...x,onPaste:Dy,children:[a.jsx(Am,{...v,onKeyDown:E,onKeyUp:O}),r&&a.jsxs(Rm,{children:[a.jsx(Tm,{...b}),a.jsx(Nm,{...b})]})]})]})})},Uc=u.memo(Poe),Ioe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=J(),[s,i]=u.useState(String(n.value)),c=u.useMemo(()=>r.type==="integer",[r.type]),f=p=>{i(p),p.match(sm)||o(QD({nodeId:t,fieldName:n.name,value:c?Math.floor(Number(p)):Number(p)}))};return u.useEffect(()=>{!s.match(sm)&&n.value!==Number(s)&&i(String(n.value))},[n.value,s]),a.jsxs(Dm,{onChange:f,value:s,step:c?1:.1,precision:c?0:3,children:[a.jsx(Am,{className:"nodrag"}),a.jsxs(Rm,{children:[a.jsx(Tm,{}),a.jsx(Nm,{})]})]})},Eoe=u.memo(Ioe),Ooe=e=>{var m,v;const{nodeId:t,field:n}=e,r=J(),{t:o}=we(),s=qt("syncModels").isFeatureEnabled,{data:i,isLoading:c}=Bo(Ub),f=u.useMemo(()=>{if(!i)return[];const b=[];return Tn(i.entities,(y,x)=>{y&&b.push({value:x,label:y.model_name,group:un[y.base_model]})}),b},[i]),p=u.useMemo(()=>{var b,y;return(i==null?void 0:i.entities[`${(b=n.value)==null?void 0:b.base_model}/main/${(y=n.value)==null?void 0:y.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=u.useCallback(b=>{if(!b)return;const y=kg(b);y&&r(ZD({nodeId:t,fieldName:n.name,value:y}))},[r,n.name,t]);return c?a.jsx(Gt,{label:o("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs($,{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(Wc,{className:"nodrag",iconMode:!0})]})},Moe=u.memo(Ooe),Doe=e=>{var v,b;const{nodeId:t,field:n}=e,r=J(),{t:o}=we(),s=qt("syncModels").isFeatureEnabled,{data:i}=Xu(KC),{data:c,isLoading:f}=Bo(KC),p=u.useMemo(()=>{if(!c)return[];const y=[];return Tn(c.entities,(x,w)=>{!x||x.base_model!=="sdxl"||y.push({value:w,label:x.model_name,group:un[x.base_model]})}),i&&Tn(i.entities,(x,w)=>{!x||x.base_model!=="sdxl"||y.push({value:w,label:x.model_name,group:un[x.base_model]})}),y},[c,i]),h=u.useMemo(()=>{var y,x,w,k;return((c==null?void 0:c.entities[`${(y=n.value)==null?void 0:y.base_model}/main/${(x=n.value)==null?void 0:x.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,(b=n.value)==null?void 0:b.model_name,c==null?void 0:c.entities,i==null?void 0:i.entities]),m=u.useCallback(y=>{if(!y)return;const x=kg(y);x&&r(Uj({nodeId:t,fieldName:n.name,value:x}))},[r,n.name,t]);return f?a.jsx(Gt,{label:o("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs($,{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(Wc,{className:"nodrag",iconMode:!0})]})},Roe=u.memo(Doe),Aoe=ae([be],({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),Noe=e=>{const{nodeId:t,field:n}=e,r=J(),{data:o}=F(Aoe),s=u.useCallback(i=>{i&&r(JD({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})},Toe=u.memo(Noe),$oe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=J(),s=u.useCallback(i=>{o(eR({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(ao,{onChange:s,value:n.value})},Loe=u.memo($oe),mM=e=>{const t=qi("models"),[n,r,o]=e.split("/"),s=tR.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},zoe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=J(),{data:s}=Gj(),i=u.useMemo(()=>{if(!s)return[];const p=[{value:"default",label:"Default",group:"Default"}];return Tn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:un[h.base_model]})}),p.sort((h,m)=>h.disabled&&!m.disabled?1:-1)},[s]),c=u.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=u.useCallback(p=>{if(!p)return;const h=mM(p);h&&o(nR({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx(Gt,{className:"nowheel nodrag",itemComponent:ri,tooltip:c==null?void 0:c.description,value:(c==null?void 0:c.id)??"default",placeholder:"Default",data:i,onChange:f,disabled:i.length===0,error:!c,clearable:!0,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},Foe=u.memo(zoe),Boe=e=>{const t=qi("models"),[n,r,o]=e.split("/"),s=rR.safeParse({base_model:n,model_name:o});if(!s.success){t.error({ipAdapterModelId:e,errors:s.error.format()},"Failed to parse IP-Adapter model id");return}return s.data},Hoe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=J(),{data:s}=oR(),i=u.useMemo(()=>(s==null?void 0:s.entities[`${r==null?void 0:r.base_model}/ip_adapter/${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]),c=u.useMemo(()=>{if(!s)return[];const p=[];return Tn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:un[h.base_model]})}),p},[s]),f=u.useCallback(p=>{if(!p)return;const h=Boe(p);h&&o(sR({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx($n,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:c,onChange:f,sx:{width:"100%"}})},Voe=u.memo(Hoe),Woe=({nodeId:e,fieldName:t})=>{const n=sM(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(Loe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="boolean"&&(r==null?void 0:r.type)==="boolean"?a.jsx(noe,{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(Eoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="enum"&&(r==null?void 0:r.type)==="enum"?a.jsx(xoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ImageField"&&(r==null?void 0:r.type)==="ImageField"?a.jsx(Coe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="MainModelField"&&(r==null?void 0:r.type)==="MainModelField"?a.jsx(joe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLRefinerModelField"&&(r==null?void 0:r.type)==="SDXLRefinerModelField"?a.jsx(Moe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="VaeModelField"&&(r==null?void 0:r.type)==="VaeModelField"?a.jsx(Foe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="LoRAModelField"&&(r==null?void 0:r.type)==="LoRAModelField"?a.jsx(koe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ControlNetModelField"&&(r==null?void 0:r.type)==="ControlNetModelField"?a.jsx(voe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="IPAdapterModelField"&&(r==null?void 0:r.type)==="IPAdapterModelField"?a.jsx(Voe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ColorField"&&(r==null?void 0:r.type)==="ColorField"?a.jsx(moe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLMainModelField"&&(r==null?void 0:r.type)==="SDXLMainModelField"?a.jsx(Roe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="Scheduler"&&(r==null?void 0:r.type)==="Scheduler"?a.jsx(Toe,{nodeId:e,field:n,fieldTemplate:r}):n&&r?null:a.jsx(Ie,{p:1,children:a.jsxs(xe,{sx:{fontSize:"sm",fontWeight:600,color:"error.400",_dark:{color:"error.300"}},children:["Unknown field type: ",n==null?void 0:n.type]})})},gM=u.memo(Woe),Uoe=({nodeId:e,fieldName:t})=>{const n=J(),{isMouseOverNode:r,handleMouseOut:o,handleMouseOver:s}=nM(e),i=u.useCallback(()=>{n(Kj({nodeId:e,fieldName:t}))},[n,t,e]);return a.jsxs($,{onMouseEnter:s,onMouseLeave:o,layerStyle:"second",sx:{position:"relative",borderRadius:"base",w:"full",p:2},children:[a.jsxs(dn,{as:$,sx:{flexDir:"column",gap:1,flexShrink:1},children:[a.jsxs(Gn,{sx:{display:"flex",alignItems:"center",mb:0},children:[a.jsx(aM,{nodeId:e,fieldName:t,kind:"input"}),a.jsx(Za,{}),a.jsx(Dt,{label:a.jsx(Ry,{nodeId:e,fieldName:t,kind:"input"}),openDelay:gm,placement:"top",hasArrow:!0,children:a.jsx($,{h:"full",alignItems:"center",children:a.jsx(An,{as:IE})})}),a.jsx(Te,{"aria-label":"Remove from Linear View",tooltip:"Remove from Linear View",variant:"ghost",size:"sm",onClick:i,icon:a.jsx(Hr,{})})]}),a.jsx(gM,{nodeId:e,fieldName:t})]}),a.jsx(tM,{isSelected:!1,isHovered:r})]})},Goe=u.memo(Uoe),Koe=ae(be,({nodes:e})=>({fields:e.workflow.exposedFields}),Ce),qoe=()=>{const{fields:e}=F(Koe);return a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(My,{children:a.jsx($,{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(Goe,{nodeId:t,fieldName:n},`${t}.${n}`)):a.jsx(tr,{label:"No fields added to Linear View",icon:null})})})})},Xoe=u.memo(qoe),Yoe=()=>a.jsx($,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(Qi,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(Zi,{children:[a.jsx(jr,{children:"Linear"}),a.jsx(jr,{children:"Details"}),a.jsx(jr,{children:"JSON"})]}),a.jsxs(zc,{children:[a.jsx(uo,{children:a.jsx(Xoe,{})}),a.jsx(uo,{children:a.jsx(Gre,{})}),a.jsx(uo,{children:a.jsx(Qre,{})})]})]})}),Qoe=u.memo(Yoe),Zoe=()=>{const[e,t]=u.useState(!1),[n,r]=u.useState(!1),o=u.useRef(null),s=Oy(),i=u.useCallback(()=>{o.current&&o.current.setLayout([50,50])},[]);return a.jsxs($,{sx:{flexDir:"column",gap:2,height:"100%",width:"100%"},children:[a.jsx(BO,{}),a.jsxs(yg,{ref:o,id:"workflow-panel-group",direction:"vertical",style:{height:"100%",width:"100%"},storage:s,children:[a.jsx(Wa,{id:"workflow",collapsible:!0,onCollapse:t,minSize:25,children:a.jsx(Qoe,{})}),a.jsx(om,{direction:"vertical",onDoubleClick:i,collapsedDirection:e?"top":n?"bottom":void 0}),a.jsx(Wa,{id:"inspector",collapsible:!0,onCollapse:r,minSize:25,children:a.jsx(Fre,{})})]})]})},Joe=u.memo(Zoe),w_=(e,t)=>{const n=u.useRef(null),[r,o]=u.useState(()=>{var p;return!!((p=n.current)!=null&&p.getCollapsed())}),s=u.useCallback(()=>{var p;(p=n.current)!=null&&p.getCollapsed()?oo.flushSync(()=>{var h;(h=n.current)==null||h.expand()}):oo.flushSync(()=>{var h;(h=n.current)==null||h.collapse()})},[]),i=u.useCallback(()=>{oo.flushSync(()=>{var p;(p=n.current)==null||p.expand()})},[]),c=u.useCallback(()=>{oo.flushSync(()=>{var p;(p=n.current)==null||p.collapse()})},[]),f=u.useCallback(()=>{oo.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:c}},ese=({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($,{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(wne,{}),sx:{p:0,px:3,h:48,borderStartEndRadius:0,borderEndEndRadius:0,shadow:"2xl"}})})}):null},tse=u.memo(ese),Vv={borderStartStartRadius:0,borderEndStartRadius:0,shadow:"2xl"},nse=({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($,{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:Vv,icon:a.jsx(AE,{})}),a.jsx(FO,{asIconButton:!0,sx:Vv}),a.jsx(zO,{sx:Vv,asIconButton:!0})]})}):null},rse=u.memo(nse),ose=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:i}=Ir({defaultIsOpen:o}),{colorMode:c}=ia();return a.jsxs(Ie,{children:[a.jsxs($,{onClick:i,sx:{alignItems:"center",p:2,px:4,gap:2,borderTopRadius:"base",borderBottomRadius:s?0:"base",bg:Ae("base.250","base.750")(c),color:Ae("base.900","base.100")(c),_hover:{bg:Ae("base.300","base.700")(c)},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(xe,{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})})]})},pr=u.memo(ose),sse=ae(be,e=>{const{combinatorial:t,isEnabled:n}=e.dynamicPrompts;return{combinatorial:t,isDisabled:!n}},Ce),ase=()=>{const{combinatorial:e,isDisabled:t}=F(sse),n=J(),r=u.useCallback(()=>{n(aR())},[n]);return a.jsx(Ut,{isDisabled:t,label:"Combinatorial Generation",isChecked:e,onChange:r})},ise=u.memo(ase),lse=ae(be,e=>{const{isEnabled:t}=e.dynamicPrompts;return{isEnabled:t}},Ce),cse=()=>{const e=J(),{isEnabled:t}=F(lse),n=u.useCallback(()=>{e(iR())},[e]);return a.jsx(Ut,{label:"Enable Dynamic Prompts",isChecked:t,onChange:n})},use=u.memo(cse),dse=ae(be,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),fse=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=F(dse),s=J(),i=u.useCallback(f=>{s(lR(f))},[s]),c=u.useCallback(()=>{s(cR())},[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:c})},pse=u.memo(fse),hse=ae(be,e=>{const{isEnabled:t}=e.dynamicPrompts;return{activeLabel:t?"Enabled":void 0}},Ce),mse=()=>{const{activeLabel:e}=F(hse);return qt("dynamicPrompting").isFeatureEnabled?a.jsx(pr,{label:"Dynamic Prompts",activeLabel:e,children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(use,{}),a.jsx(ise,{}),a.jsx(pse,{})]})}):null},Gc=u.memo(mse),gse=e=>{const t=J(),{lora:n}=e,r=u.useCallback(i=>{t(uR({id:n.id,weight:i}))},[t,n.id]),o=u.useCallback(()=>{t(dR(n.id))},[t,n.id]),s=u.useCallback(()=>{t(fR(n.id))},[t,n.id]);return a.jsxs($,{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(Hr,{}),colorScheme:"error"})]})},vse=u.memo(gse),bse=ae(be,({lora:e})=>({lorasArray:rr(e.loras)}),Ce),xse=()=>{const{lorasArray:e}=F(bse);return a.jsx(a.Fragment,{children:e.map((t,n)=>a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[n>0&&a.jsx(zr,{pt:1}),a.jsx(vse,{lora:t})]},t.model_name))})},yse=u.memo(xse),Cse=ae(be,({lora:e})=>({loras:e.loras}),Ce),wse=()=>{const e=J(),{loras:t}=F(Cse),{data:n}=vm(),r=F(i=>i.generation.model),o=u.useMemo(()=>{if(!n)return[];const i=[];return Tn(n.entities,(c,f)=>{if(!c||f in t)return;const p=(r==null?void 0:r.base_model)!==c.base_model;i.push({value:f,label:c.model_name,disabled:p,group:un[c.base_model],tooltip:p?`Incompatible base model: ${c.base_model}`:void 0})}),i.sort((c,f)=>c.label&&!f.label?1:-1),i.sort((c,f)=>c.disabled&&!f.disabled?1:-1)},[t,n,r==null?void 0:r.base_model]),s=u.useCallback(i=>{if(!i)return;const c=n==null?void 0:n.entities[i];c&&e(pR(c))},[e,n==null?void 0:n.entities]);return(n==null?void 0:n.ids.length)===0?a.jsx($,{sx:{justifyContent:"center",p:2},children:a.jsx(xe,{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,c)=>{var f;return((f=c.label)==null?void 0:f.toLowerCase().includes(i.toLowerCase().trim()))||c.value.toLowerCase().includes(i.toLowerCase().trim())},onChange:s})},Sse=u.memo(wse),kse=ae(be,e=>{const t=qj(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},Ce),_se=()=>{const{activeLabel:e}=F(kse);return qt("lora").isFeatureEnabled?a.jsx(pr,{label:"LoRA",activeLabel:e,children:a.jsxs($,{sx:{flexDir:"column",gap:2},children:[a.jsx(Sse,{}),a.jsx(yse,{})]})}):null},Kc=u.memo(_se),jse=ae(be,({generation:e})=>{const{model:t}=e;return{mainModel:t}},Ce),Pse=e=>{const{controlNetId:t,model:n,isEnabled:r}=e.controlNet,o=J(),s=F(Pn),{mainModel:i}=F(jse),{data:c}=Wb(),f=u.useMemo(()=>{if(!c)return[];const m=[];return Tn(c.entities,(v,b)=>{if(!v)return;const y=(v==null?void 0:v.base_model)!==(i==null?void 0:i.base_model);m.push({value:b,label:v.model_name,group:un[v.base_model],disabled:y,tooltip:y?`Incompatible base model: ${v.base_model}`:void 0})}),m},[c,i==null?void 0:i.base_model]),p=u.useMemo(()=>(c==null?void 0:c.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,c==null?void 0:c.entities]),h=u.useCallback(m=>{if(!m)return;const v=fM(m);v&&o(Xj({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})},Ise=u.memo(Pse),Ese=e=>{const{weight:t,isEnabled:n,controlNetId:r}=e.controlNet,o=J(),s=u.useCallback(i=>{o(hR({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]})},Ose=u.memo(Ese),Mse=ae(be,({controlNet:e,gallery:t})=>{const{pendingControlImages:n}=e,{autoAddBoardId:r}=t;return{pendingControlImages:n,autoAddBoardId:r}},Ce),Dse=({isSmall:e,controlNet:t})=>{const{controlImage:n,processedControlImage:r,processorType:o,isEnabled:s,controlNetId:i}=t,c=J(),{pendingControlImages:f,autoAddBoardId:p}=F(Mse),h=F(wn),[m,v]=u.useState(!1),{currentData:b}=fo(n??Lr.skipToken),{currentData:y}=fo(r??Lr.skipToken),[x]=mR(),[w]=gR(),[k]=vR(),_=u.useCallback(()=>{c(bR({controlNetId:i,controlImage:null}))},[i,c]),j=u.useCallback(async()=>{y&&(await x({imageDTO:y,is_intermediate:!1}).unwrap(),p!=="none"?w({imageDTO:y,board_id:p}):k({imageDTO:y}))},[y,x,p,w,k]),I=u.useCallback(()=>{b&&(h==="unifiedCanvas"?c(Ro({width:b.width,height:b.height})):(c(Ai(b.width)),c(Ni(b.height))))},[b,h,c]),E=u.useCallback(()=>{v(!0)},[]),O=u.useCallback(()=>{v(!1)},[]),M=u.useMemo(()=>{if(b)return{id:i,payloadType:"IMAGE_DTO",payload:{imageDTO:b}}},[b,i]),D=u.useMemo(()=>({id:i,actionType:"SET_CONTROLNET_IMAGE",context:{controlNetId:i}}),[i]),A=u.useMemo(()=>({type:"SET_CONTROLNET_IMAGE",controlNetId:i}),[i]),R=b&&y&&!m&&!f.includes(i)&&o!=="none";return a.jsxs($,{onMouseEnter:E,onMouseLeave:O,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:M,droppableData:D,imageDTO:b,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:M,droppableData:D,imageDTO:y,isUploadDisabled:!0,isDropDisabled:!s})}),a.jsxs(a.Fragment,{children:[a.jsx(uc,{onClick:_,icon:b?a.jsx(tg,{}):void 0,tooltip:"Reset Control Image"}),a.jsx(uc,{onClick:j,icon:b?a.jsx(eg,{size:16}):void 0,tooltip:"Save Control Image",styleOverrides:{marginTop:6}}),a.jsx(uc,{onClick:I,icon:b?a.jsx(RZ,{size:16}):void 0,tooltip:"Set Control Image Dimensions To W/H",styleOverrides:{marginTop:12}})]}),f.includes(i)&&a.jsx($,{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"}}})})]})},S_=u.memo(Dse),qo=()=>{const e=J();return u.useCallback((n,r)=>{e(xR({controlNetId:n,changes:r}))},[e])};function Xo(e){return a.jsx($,{sx:{flexDirection:"column",gap:2},children:e.children})}const k_=mo.canny_image_processor.default,Rse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{low_threshold:o,high_threshold:s}=n,i=F(Pn),c=qo(),f=u.useCallback(v=>{c(t,{low_threshold:v})},[t,c]),p=u.useCallback(()=>{c(t,{low_threshold:k_.low_threshold})},[t,c]),h=u.useCallback(v=>{c(t,{high_threshold:v})},[t,c]),m=u.useCallback(()=>{c(t,{high_threshold:k_.high_threshold})},[t,c]);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})]})},Ase=u.memo(Rse),_u=mo.content_shuffle_image_processor.default,Nse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,w:i,h:c,f}=n,p=qo(),h=F(Pn),m=u.useCallback(E=>{p(t,{detect_resolution:E})},[t,p]),v=u.useCallback(()=>{p(t,{detect_resolution:_u.detect_resolution})},[t,p]),b=u.useCallback(E=>{p(t,{image_resolution:E})},[t,p]),y=u.useCallback(()=>{p(t,{image_resolution:_u.image_resolution})},[t,p]),x=u.useCallback(E=>{p(t,{w:E})},[t,p]),w=u.useCallback(()=>{p(t,{w:_u.w})},[t,p]),k=u.useCallback(E=>{p(t,{h:E})},[t,p]),_=u.useCallback(()=>{p(t,{h:_u.h})},[t,p]),j=u.useCallback(E=>{p(t,{f:E})},[t,p]),I=u.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:b,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Ze,{label:"W",value:i,onChange:x,handleReset:w,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Ze,{label:"H",value:c,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})]})},Tse=u.memo(Nse),__=mo.hed_image_processor.default,$se=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o},isEnabled:s}=e,i=F(Pn),c=qo(),f=u.useCallback(b=>{c(t,{detect_resolution:b})},[t,c]),p=u.useCallback(b=>{c(t,{image_resolution:b})},[t,c]),h=u.useCallback(b=>{c(t,{scribble:b.target.checked})},[t,c]),m=u.useCallback(()=>{c(t,{detect_resolution:__.detect_resolution})},[t,c]),v=u.useCallback(()=>{c(t,{image_resolution:__.image_resolution})},[t,c]);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})]})},Lse=u.memo($se),j_=mo.lineart_anime_image_processor.default,zse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=qo(),c=F(Pn),f=u.useCallback(v=>{i(t,{detect_resolution:v})},[t,i]),p=u.useCallback(v=>{i(t,{image_resolution:v})},[t,i]),h=u.useCallback(()=>{i(t,{detect_resolution:j_.detect_resolution})},[t,i]),m=u.useCallback(()=>{i(t,{image_resolution:j_.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:c||!r}),a.jsx(Ze,{label:"Image Resolution",value:o,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:c||!r})]})},Fse=u.memo(zse),P_=mo.lineart_image_processor.default,Bse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,coarse:i}=n,c=qo(),f=F(Pn),p=u.useCallback(y=>{c(t,{detect_resolution:y})},[t,c]),h=u.useCallback(y=>{c(t,{image_resolution:y})},[t,c]),m=u.useCallback(()=>{c(t,{detect_resolution:P_.detect_resolution})},[t,c]),v=u.useCallback(()=>{c(t,{image_resolution:P_.image_resolution})},[t,c]),b=u.useCallback(y=>{c(t,{coarse:y.target.checked})},[t,c]);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:b,isDisabled:f||!r})]})},Hse=u.memo(Bse),I_=mo.mediapipe_face_processor.default,Vse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{max_faces:o,min_confidence:s}=n,i=qo(),c=F(Pn),f=u.useCallback(v=>{i(t,{max_faces:v})},[t,i]),p=u.useCallback(v=>{i(t,{min_confidence:v})},[t,i]),h=u.useCallback(()=>{i(t,{max_faces:I_.max_faces})},[t,i]),m=u.useCallback(()=>{i(t,{min_confidence:I_.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:c||!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:c||!r})]})},Wse=u.memo(Vse),E_=mo.midas_depth_image_processor.default,Use=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{a_mult:o,bg_th:s}=n,i=qo(),c=F(Pn),f=u.useCallback(v=>{i(t,{a_mult:v})},[t,i]),p=u.useCallback(v=>{i(t,{bg_th:v})},[t,i]),h=u.useCallback(()=>{i(t,{a_mult:E_.a_mult})},[t,i]),m=u.useCallback(()=>{i(t,{bg_th:E_.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:c||!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:c||!r})]})},Gse=u.memo(Use),jp=mo.mlsd_image_processor.default,Kse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,thr_d:i,thr_v:c}=n,f=qo(),p=F(Pn),h=u.useCallback(_=>{f(t,{detect_resolution:_})},[t,f]),m=u.useCallback(_=>{f(t,{image_resolution:_})},[t,f]),v=u.useCallback(_=>{f(t,{thr_d:_})},[t,f]),b=u.useCallback(_=>{f(t,{thr_v:_})},[t,f]),y=u.useCallback(()=>{f(t,{detect_resolution:jp.detect_resolution})},[t,f]),x=u.useCallback(()=>{f(t,{image_resolution:jp.image_resolution})},[t,f]),w=u.useCallback(()=>{f(t,{thr_d:jp.thr_d})},[t,f]),k=u.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:y,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(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:c,onChange:b,handleReset:k,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:p||!r})]})},qse=u.memo(Kse),O_=mo.normalbae_image_processor.default,Xse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=qo(),c=F(Pn),f=u.useCallback(v=>{i(t,{detect_resolution:v})},[t,i]),p=u.useCallback(v=>{i(t,{image_resolution:v})},[t,i]),h=u.useCallback(()=>{i(t,{detect_resolution:O_.detect_resolution})},[t,i]),m=u.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:c||!r}),a.jsx(Ze,{label:"Image Resolution",value:o,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:c||!r})]})},Yse=u.memo(Xse),M_=mo.openpose_image_processor.default,Qse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,hand_and_face:i}=n,c=qo(),f=F(Pn),p=u.useCallback(y=>{c(t,{detect_resolution:y})},[t,c]),h=u.useCallback(y=>{c(t,{image_resolution:y})},[t,c]),m=u.useCallback(()=>{c(t,{detect_resolution:M_.detect_resolution})},[t,c]),v=u.useCallback(()=>{c(t,{image_resolution:M_.image_resolution})},[t,c]),b=u.useCallback(y=>{c(t,{hand_and_face:y.target.checked})},[t,c]);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:b,isDisabled:f||!r})]})},Zse=u.memo(Qse),D_=mo.pidi_image_processor.default,Jse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,scribble:i,safe:c}=n,f=qo(),p=F(Pn),h=u.useCallback(w=>{f(t,{detect_resolution:w})},[t,f]),m=u.useCallback(w=>{f(t,{image_resolution:w})},[t,f]),v=u.useCallback(()=>{f(t,{detect_resolution:D_.detect_resolution})},[t,f]),b=u.useCallback(()=>{f(t,{image_resolution:D_.image_resolution})},[t,f]),y=u.useCallback(w=>{f(t,{scribble:w.target.checked})},[t,f]),x=u.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:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Ut,{label:"Scribble",isChecked:i,onChange:y}),a.jsx(Ut,{label:"Safe",isChecked:c,onChange:x,isDisabled:p||!r})]})},eae=u.memo(Jse),tae=e=>null,nae=u.memo(tae),rae=e=>{const{controlNetId:t,isEnabled:n,processorNode:r}=e.controlNet;return r.type==="canny_image_processor"?a.jsx(Ase,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="hed_image_processor"?a.jsx(Lse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_image_processor"?a.jsx(Hse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="content_shuffle_image_processor"?a.jsx(Tse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_anime_image_processor"?a.jsx(Fse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mediapipe_face_processor"?a.jsx(Wse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="midas_depth_image_processor"?a.jsx(Gse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mlsd_image_processor"?a.jsx(qse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="normalbae_image_processor"?a.jsx(Yse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="openpose_image_processor"?a.jsx(Zse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="pidi_image_processor"?a.jsx(eae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="zoe_depth_image_processor"?a.jsx(nae,{controlNetId:t,processorNode:r,isEnabled:n}):null},oae=u.memo(rae),sae=e=>{const{controlNetId:t,isEnabled:n,shouldAutoConfig:r}=e.controlNet,o=J(),s=F(Pn),i=u.useCallback(()=>{o(yR({controlNetId:t}))},[t,o]);return a.jsx(Ut,{label:"Auto configure processor","aria-label":"Auto configure processor",isChecked:r,onChange:i,isDisabled:s||!n})},aae=u.memo(sae),iae=e=>{const{controlNet:t}=e,n=J(),r=u.useCallback(()=>{n(CR({controlNet:t}))},[t,n]),o=u.useCallback(()=>{n(wR({controlNet:t}))},[t,n]);return a.jsxs($,{sx:{gap:2},children:[a.jsx(Te,{size:"sm",icon:a.jsx(Vi,{}),tooltip:"Import Image From Canvas","aria-label":"Import Image From Canvas",onClick:r}),a.jsx(Te,{size:"sm",icon:a.jsx(ME,{}),tooltip:"Import Mask From Canvas","aria-label":"Import Mask From Canvas",onClick:o})]})},lae=u.memo(iae),R_=e=>`${Math.round(e*100)}%`,cae=e=>{const{beginStepPct:t,endStepPct:n,isEnabled:r,controlNetId:o}=e.controlNet,s=J(),i=u.useCallback(c=>{s(SR({controlNetId:o,beginStepPct:c[0]})),s(kR({controlNetId:o,endStepPct:c[1]}))},[o,s]);return a.jsxs(dn,{isDisabled:!r,children:[a.jsx(Gn,{children:"Begin / End Step Percentage"}),a.jsx(bx,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(kP,{"aria-label":["Begin Step %","End Step %"],value:[t,n],onChange:i,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!r,children:[a.jsx(_P,{children:a.jsx(jP,{})}),a.jsx(Dt,{label:R_(t),placement:"top",hasArrow:!0,children:a.jsx(T1,{index:0})}),a.jsx(Dt,{label:R_(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%"})]})})]})},uae=u.memo(cae),dae=[{label:"Balanced",value:"balanced"},{label:"Prompt",value:"more_prompt"},{label:"Control",value:"more_control"},{label:"Mega Control",value:"unbalanced"}];function fae(e){const{controlMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=J(),s=u.useCallback(i=>{o(_R({controlNetId:r,controlMode:i}))},[r,o]);return a.jsx($n,{disabled:!n,label:"Control Mode",data:dae,value:String(t),onChange:s})}const pae=e=>e.config,hae=ae(pae,e=>rr(mo,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),mae=e=>{const t=J(),{controlNetId:n,isEnabled:r,processorNode:o}=e.controlNet,s=F(Pn),i=F(hae),c=u.useCallback(f=>{t(jR({controlNetId:n,processorType:f}))},[n,t]);return a.jsx(Gt,{label:"Processor",value:o.type??"canny_image_processor",data:i,onChange:c,disabled:s||!r})},gae=u.memo(mae),vae=[{label:"Resize",value:"just_resize"},{label:"Crop",value:"crop_resize"},{label:"Fill",value:"fill_resize"}];function bae(e){const{resizeMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=J(),s=u.useCallback(i=>{o(PR({controlNetId:r,resizeMode:i}))},[r,o]);return a.jsx($n,{disabled:!n,label:"Resize Mode",data:vae,value:String(t),onChange:s})}const xae=e=>{const{controlNet:t}=e,{controlNetId:n}=t,r=J(),o=F(wn),s=ae(be,({controlNet:b})=>{const y=b.controlNets[n];if(!y)return{isEnabled:!1,shouldAutoConfig:!1};const{isEnabled:x,shouldAutoConfig:w}=y;return{isEnabled:x,shouldAutoConfig:w}},Ce),{isEnabled:i,shouldAutoConfig:c}=F(s),[f,p]=WZ(!1),h=u.useCallback(()=>{r(IR({controlNetId:n}))},[n,r]),m=u.useCallback(()=>{r(ER({sourceControlNetId:n,newControlNetId:Fa()}))},[n,r]),v=u.useCallback(()=>{r(OR({controlNetId:n}))},[n,r]);return a.jsxs($,{sx:{flexDir:"column",gap:3,p:2,borderRadius:"base",position:"relative",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsxs($,{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(Ise,{controlNet:t})}),o==="unifiedCanvas"&&a.jsx(lae,{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(Hr,{})}),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"}}})}),!c&&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($,{sx:{w:"full",flexDirection:"column",gap:3},children:[a.jsxs($,{sx:{gap:4,w:"full",alignItems:"center"},children:[a.jsxs($,{sx:{flexDir:"column",gap:3,h:28,w:"full",paddingInlineStart:1,paddingInlineEnd:f?1:0,pb:2,justifyContent:"space-between"},children:[a.jsx(Ose,{controlNet:t}),a.jsx(uae,{controlNet:t})]}),!f&&a.jsx($,{sx:{alignItems:"center",justifyContent:"center",h:28,w:28,aspectRatio:"1/1"},children:a.jsx(S_,{controlNet:t,isSmall:!0})})]}),a.jsxs($,{sx:{gap:2},children:[a.jsx(fae,{controlNet:t}),a.jsx(bae,{controlNet:t})]}),a.jsx(gae,{controlNet:t})]}),f&&a.jsxs(a.Fragment,{children:[a.jsx(S_,{controlNet:t}),a.jsx(aae,{controlNet:t}),a.jsx(oae,{controlNet:t})]})]})},yae=u.memo(xae),Cae=ae(be,e=>{const{isEnabled:t}=e.controlNet;return{isEnabled:t}},Ce),wae=()=>{const{isEnabled:e}=F(Cae),t=J(),n=u.useCallback(()=>{t(MR())},[t]);return a.jsx(Ut,{label:"Enable ControlNet",isChecked:e,onChange:n,formControlProps:{width:"100%"}})},Sae=u.memo(wae),kae=ae([be],({controlNet:e})=>{const{controlNets:t,isEnabled:n}=e,r=DR(t),o=n&&r.length>0?`${r.length} Active`:void 0;return{controlNetsArray:rr(t),activeLabel:o}},Ce),_ae=()=>{const{controlNetsArray:e,activeLabel:t}=F(kae),n=qt("controlNet").isFeatureDisabled,r=J(),{firstModel:o}=Wb(void 0,{selectFromResult:i=>({firstModel:i.data?RR.getSelectors().selectAll(i.data)[0]:void 0})}),s=u.useCallback(()=>{if(!o)return;const i=Fa();r(AR({controlNetId:i})),r(Xj({controlNetId:i,model:o}))},[r,o]);return n?null:a.jsx(pr,{label:"Control Adapters",activeLabel:t,children:a.jsxs($,{sx:{flexDir:"column",gap:2},children:[a.jsxs($,{sx:{w:"100%",gap:2,p:2,ps:3,borderRadius:"base",alignItems:"center",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsx(Sae,{}),a.jsx(Te,{tooltip:"Add ControlNet","aria-label":"Add ControlNet",icon:a.jsx(nl,{}),isDisabled:!o,flexGrow:1,size:"sm",onClick:s})]}),e.map((i,c)=>a.jsxs(u.Fragment,{children:[c>0&&a.jsx(zr,{}),a.jsx(yae,{controlNet:i})]},i.controlNetId))]})})},qc=u.memo(_ae),jae=ae(be,e=>{const{shouldUseNoiseSettings:t,shouldUseCpuNoise:n}=e.generation;return{isDisabled:!t,shouldUseCpuNoise:n}},Ce),Pae=()=>{const e=J(),{isDisabled:t,shouldUseCpuNoise:n}=F(jae),r=o=>e(NR(o.target.checked));return a.jsx(Ut,{isDisabled:t,label:"Use CPU Noise",isChecked:n,onChange:r})},Iae=ae(be,e=>{const{shouldUseNoiseSettings:t,threshold:n}=e.generation;return{isDisabled:!t,threshold:n}},Ce);function Eae(){const e=J(),{threshold:t,isDisabled:n}=F(Iae),{t:r}=we();return a.jsx(Ze,{isDisabled:n,label:r("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:o=>e(qC(o)),handleReset:()=>e(qC(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const Oae=()=>{const e=J(),t=F(r=>r.generation.shouldUseNoiseSettings),n=r=>e(TR(r.target.checked));return a.jsx(Ut,{label:"Enable Noise Settings",isChecked:t,onChange:n})},Mae=ae(be,e=>{const{shouldUseNoiseSettings:t,perlin:n}=e.generation;return{isDisabled:!t,perlin:n}},Ce);function Dae(){const e=J(),{perlin:t,isDisabled:n}=F(Mae),{t:r}=we();return a.jsx(Ze,{isDisabled:n,label:r("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:o=>e(XC(o)),handleReset:()=>e(XC(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const Rae=ae(be,e=>{const{shouldUseNoiseSettings:t}=e.generation;return{activeLabel:t?"Enabled":void 0}},Ce),Aae=()=>{const{t:e}=we(),t=qt("noise").isFeatureEnabled,n=qt("perlinNoise").isFeatureEnabled,r=qt("noiseThreshold").isFeatureEnabled,{activeLabel:o}=F(Rae);return t?a.jsx(pr,{label:e("parameters.noiseSettings"),activeLabel:o,children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(Oae,{}),a.jsx(Pae,{}),n&&a.jsx(Dae,{}),r&&a.jsx(Eae,{})]})}):null},Gd=u.memo(Aae),Vr=e=>e.generation,Nae=ae(Vr,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},Ce),Tae=()=>{const{t:e}=we(),{seamlessXAxis:t}=F(Nae),n=J(),r=u.useCallback(o=>{n($R(o.target.checked))},[n]);return a.jsx(Ut,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},$ae=u.memo(Tae),Lae=ae(Vr,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},Ce),zae=()=>{const{t:e}=we(),{seamlessYAxis:t}=F(Lae),n=J(),r=u.useCallback(o=>{n(LR(o.target.checked))},[n]);return a.jsx(Ut,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},Fae=u.memo(zae),Bae=(e,t)=>{if(e&&t)return"X & Y";if(e)return"X";if(t)return"Y"},Hae=ae(Vr,e=>{const{seamlessXAxis:t,seamlessYAxis:n}=e;return{activeLabel:Bae(t,n)}},Ce),Vae=()=>{const{t:e}=we(),{activeLabel:t}=F(Hae);return qt("seamless").isFeatureEnabled?a.jsx(pr,{label:e("parameters.seamlessTiling"),activeLabel:t,children:a.jsxs($,{sx:{gap:5},children:[a.jsx(Ie,{flexGrow:1,children:a.jsx($ae,{})}),a.jsx(Ie,{flexGrow:1,children:a.jsx(Fae,{})})]})}):null},Xc=u.memo(Vae),Wae=e=>{const{onClick:t}=e;return a.jsx(Te,{size:"sm","aria-label":"Add Embedding",tooltip:"Add Embedding",icon:a.jsx(kE,{}),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=u.memo(Wae),Uae="28rem",Gae=e=>{const{onSelect:t,isOpen:n,onClose:r,children:o}=e,{data:s}=zR(),i=u.useRef(null),c=F(h=>h.generation.model),f=u.useMemo(()=>{if(!s)return[];const h=[];return Tn(s.entities,(m,v)=>{if(!m)return;const b=(c==null?void 0:c.base_model)!==m.base_model;h.push({value:m.model_name,label:m.model_name,group:un[m.base_model],disabled:b,tooltip:b?`Incompatible base model: ${m.base_model}`:void 0})}),h.sort((m,v)=>{var b;return m.label&&v.label?(b=m.label)!=null&&b.localeCompare(v.label)?-1:1:-1}),h.sort((m,v)=>m.disabled&&!v.disabled?1:-1)},[s,c==null?void 0:c.base_model]),p=u.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(Dx,{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(Rx,{sx:{p:0,w:`calc(${Uae} - 2rem )`},children:f.length===0?a.jsx($,{sx:{justifyContent:"center",p:2,fontSize:"sm",color:"base.500",_dark:{color:"base.700"}},children:a.jsx(xe,{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=u.memo(Gae),Kae=()=>{const e=F(m=>m.generation.negativePrompt),t=u.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Ir(),s=J(),{t:i}=we(),c=u.useCallback(m=>{s(Lu(m.target.value))},[s]),f=u.useCallback(m=>{m.key==="<"&&o()},[o]),p=u.useCallback(m=>{if(!t.current)return;const v=t.current.selectionStart;if(v===void 0)return;let b=e.slice(0,v);b[b.length-1]!=="<"&&(b+="<"),b+=`${m}>`;const y=b.length;b+=e.slice(v),oo.flushSync(()=>{s(Lu(b))}),t.current.selectionEnd=y,r()},[s,r,e]),h=qt("embedding").isFeatureEnabled;return a.jsxs(dn,{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:c,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})})]})},vM=u.memo(Kae),qae=ae([be,wn],({generation:e},t)=>({prompt:e.positivePrompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:kt}}),Xae=()=>{const e=J(),{prompt:t,activeTabName:n}=F(qae),r=Ud(),o=u.useRef(null),{isOpen:s,onClose:i,onOpen:c}=Ir(),{t:f}=we(),p=u.useCallback(b=>{e($u(b.target.value))},[e]);Qe("alt+a",()=>{var b;(b=o.current)==null||b.focus()},[]);const h=u.useCallback(b=>{if(!o.current)return;const y=o.current.selectionStart;if(y===void 0)return;let x=t.slice(0,y);x[x.length-1]!=="<"&&(x+="<"),x+=`${b}>`;const w=x.length;x+=t.slice(y),oo.flushSync(()=>{e($u(x))}),o.current.selectionStart=w,o.current.selectionEnd=w,i()},[e,i,t]),m=qt("embedding").isFeatureEnabled,v=u.useCallback(b=>{b.key==="Enter"&&b.shiftKey===!1&&r&&(b.preventDefault(),e(xd()),e(mm(n))),m&&b.key==="<"&&c()},[r,e,n,c,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(dn,{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:c})})]})},bM=u.memo(Xae);function Yae(){const e=F(r=>r.sdxl.shouldConcatSDXLStylePrompt),t=J(),n=()=>{t(FR(!e))};return a.jsx(Te,{"aria-label":"Concatenate Prompt & Style",tooltip:"Concatenate Prompt & Style",variant:"outline",isChecked:e,onClick:n,icon:a.jsx(EE,{}),size:"xs",sx:{position:"absolute",insetInlineEnd:1,top:6,border:"none",color:e?"accent.500":"base.500",_hover:{bg:"none"}}})}const A_={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 xM(){return a.jsxs($,{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",...A_,_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(EE,{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",...A_,_dark:{borderColor:"accent.500"}}})]})}const Qae=ae([be,wn],({sdxl:e},t)=>{const{negativeStylePrompt:n,shouldConcatSDXLStylePrompt:r}=e;return{prompt:n,shouldConcatSDXLStylePrompt:r,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:kt}}),Zae=()=>{const e=J(),t=Ud(),n=u.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Ir(),{prompt:i,activeTabName:c,shouldConcatSDXLStylePrompt:f}=F(Qae),p=u.useCallback(b=>{e(Fu(b.target.value))},[e]),h=u.useCallback(b=>{if(!n.current)return;const y=n.current.selectionStart;if(y===void 0)return;let x=i.slice(0,y);x[x.length-1]!=="<"&&(x+="<"),x+=`${b}>`;const w=x.length;x+=i.slice(y),oo.flushSync(()=>{e(Fu(x))}),n.current.selectionStart=w,n.current.selectionEnd=w,o()},[e,o,i]),m=qt("embedding").isFeatureEnabled,v=u.useCallback(b=>{b.key==="Enter"&&b.shiftKey===!1&&t&&(b.preventDefault(),e(xd()),e(mm(c))),m&&b.key==="<"&&s()},[t,e,c,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(xM,{})})}),a.jsx(dn,{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})})]})},Jae=u.memo(Zae),eie=ae([be,wn],({sdxl:e},t)=>{const{positiveStylePrompt:n,shouldConcatSDXLStylePrompt:r}=e;return{prompt:n,shouldConcatSDXLStylePrompt:r,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:kt}}),tie=()=>{const e=J(),t=Ud(),n=u.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Ir(),{prompt:i,activeTabName:c,shouldConcatSDXLStylePrompt:f}=F(eie),p=u.useCallback(b=>{e(zu(b.target.value))},[e]),h=u.useCallback(b=>{if(!n.current)return;const y=n.current.selectionStart;if(y===void 0)return;let x=i.slice(0,y);x[x.length-1]!=="<"&&(x+="<"),x+=`${b}>`;const w=x.length;x+=i.slice(y),oo.flushSync(()=>{e(zu(x))}),n.current.selectionStart=w,n.current.selectionEnd=w,o()},[e,o,i]),m=qt("embedding").isFeatureEnabled,v=u.useCallback(b=>{b.key==="Enter"&&b.shiftKey===!1&&t&&(b.preventDefault(),e(xd()),e(mm(c))),m&&b.key==="<"&&s()},[t,e,c,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(xM,{})})}),a.jsx(dn,{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})})]})},nie=u.memo(tie);function Ty(){return a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsx(bM,{}),a.jsx(Yae,{}),a.jsx(nie,{}),a.jsx(vM,{}),a.jsx(Jae,{})]})}const ol=()=>{const{isRefinerAvailable:e}=Bo(Ub,{selectFromResult:({data:t})=>({isRefinerAvailable:t?t.ids.length>0:!1})});return e},rie=ae([be],({sdxl:e,ui:t,hotkeys:n})=>{const{refinerCFGScale:r}=e,{shouldUseSliders:o}=t,{shift:s}=n;return{refinerCFGScale:r,shouldUseSliders:o,shift:s}},Ce),oie=()=>{const{refinerCFGScale:e,shouldUseSliders:t,shift:n}=F(rie),r=ol(),o=J(),{t:s}=we(),i=u.useCallback(f=>o(s1(f)),[o]),c=u.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:c,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})},sie=u.memo(oie),aie=e=>{const t=qi("models"),[n,r,o]=e.split("/"),s=BR.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},iie=ae(be,e=>({model:e.sdxl.refinerModel}),Ce),lie=()=>{const e=J(),t=qt("syncModels").isFeatureEnabled,{model:n}=F(iie),{data:r,isLoading:o}=Bo(Ub),s=u.useMemo(()=>{if(!r)return[];const f=[];return Tn(r.entities,(p,h)=>{p&&f.push({value:h,label:p.model_name,group:un[p.base_model]})}),f},[r]),i=u.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]),c=u.useCallback(f=>{if(!f)return;const p=aie(f);p&&e(Lj(p))},[e]);return o?a.jsx(Gt,{label:"Refiner Model",placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs($,{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:c,w:"100%"}),t&&a.jsx(Ie,{mt:7,children:a.jsx(Wc,{iconMode:!0})})]})},cie=u.memo(lie),uie=ae([be],({sdxl:e,hotkeys:t})=>{const{refinerNegativeAestheticScore:n}=e,{shift:r}=t;return{refinerNegativeAestheticScore:n,shift:r}},Ce),die=()=>{const{refinerNegativeAestheticScore:e,shift:t}=F(uie),n=ol(),r=J(),o=u.useCallback(i=>r(i1(i)),[r]),s=u.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})},fie=u.memo(die),pie=ae([be],({sdxl:e,hotkeys:t})=>{const{refinerPositiveAestheticScore:n}=e,{shift:r}=t;return{refinerPositiveAestheticScore:n,shift:r}},Ce),hie=()=>{const{refinerPositiveAestheticScore:e,shift:t}=F(pie),n=ol(),r=J(),o=u.useCallback(i=>r(a1(i)),[r]),s=u.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})},mie=u.memo(hie),gie=ae(be,({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),vie=()=>{const e=J(),{t}=we(),{refinerScheduler:n,data:r}=F(gie),o=ol(),s=u.useCallback(i=>{i&&e(zj(i))},[e]);return a.jsx(Gt,{w:"100%",label:t("parameters.scheduler"),value:n,data:r,onChange:s,disabled:!o})},bie=u.memo(vie),xie=ae([be],({sdxl:e})=>{const{refinerStart:t}=e;return{refinerStart:t}},Ce),yie=()=>{const{refinerStart:e}=F(xie),t=J(),n=ol(),r=u.useCallback(s=>t(l1(s)),[t]),o=u.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})},Cie=u.memo(yie),wie=ae([be],({sdxl:e,ui:t})=>{const{refinerSteps:n}=e,{shouldUseSliders:r}=t;return{refinerSteps:n,shouldUseSliders:r}},Ce),Sie=()=>{const{refinerSteps:e,shouldUseSliders:t}=F(wie),n=ol(),r=J(),{t:o}=we(),s=u.useCallback(c=>{r(o1(c))},[r]),i=u.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})},kie=u.memo(Sie);function _ie(){const e=F(o=>o.sdxl.shouldUseSDXLRefiner),t=ol(),n=J(),r=o=>{n(HR(o.target.checked))};return a.jsx(Ut,{label:"Use Refiner",isChecked:e,onChange:r,isDisabled:!t})}const jie=ae(be,e=>{const{shouldUseSDXLRefiner:t}=e.sdxl,{shouldUseSliders:n}=e.ui;return{activeLabel:t?"Enabled":void 0,shouldUseSliders:n}},Ce),Pie=()=>{const{activeLabel:e,shouldUseSliders:t}=F(jie);return a.jsx(pr,{label:"Refiner",activeLabel:e,children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(_ie,{}),a.jsx(cie,{}),a.jsxs($,{gap:2,flexDirection:t?"column":"row",children:[a.jsx(kie,{}),a.jsx(sie,{})]}),a.jsx(bie,{}),a.jsx(mie,{}),a.jsx(fie,{}),a.jsx(Cie,{})]})})},$y=u.memo(Pie),Iie=ae([be],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:c}=t.sd.guidance,{cfgScale:f}=e,{shouldUseSliders:p}=n,{shift:h}=r;return{cfgScale:f,initial:o,min:s,sliderMax:i,inputMax:c,shouldUseSliders:p,shift:h}},Ce),Eie=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:i}=F(Iie),c=J(),{t:f}=we(),p=u.useCallback(m=>c(Vp(m)),[c]),h=u.useCallback(()=>c(Vp(t)),[c,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"}})},xs=u.memo(Eie),Oie=ae([be],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:i}=e.config.sd.iterations,{iterations:c}=e.generation,{shouldUseSliders:f}=e.ui,p=e.dynamicPrompts.isEnabled&&e.dynamicPrompts.combinatorial,h=e.hotkeys.shift?s:i;return{iterations:c,initial:t,min:n,sliderMax:r,inputMax:o,step:h,shouldUseSliders:f,isDisabled:p}},Ce),Mie=()=>{const{iterations:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i,isDisabled:c}=F(Oie),f=J(),{t:p}=we(),h=u.useCallback(v=>{f(YC(v))},[f]),m=u.useCallback(()=>{f(YC(t))},[f,t]);return i?a.jsx(Ze,{isDisabled:c,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:c,label:p("parameters.images"),step:s,min:n,max:o,onChange:h,value:e,numberInputFieldProps:{textAlign:"center"}})},ys=u.memo(Mie),Die=ae(be,e=>({model:e.generation.model}),Ce),Rie=()=>{const e=J(),{t}=we(),{model:n}=F(Die),r=qt("syncModels").isFeatureEnabled,{data:o,isLoading:s}=Bo(QC),{data:i,isLoading:c}=Xu(QC),f=F(wn),p=u.useMemo(()=>{if(!o)return[];const v=[];return Tn(o.entities,(b,y)=>{b&&v.push({value:y,label:b.model_name,group:un[b.base_model]})}),Tn(i==null?void 0:i.entities,(b,y)=>{!b||f==="unifiedCanvas"||f==="img2img"||v.push({value:y,label:b.model_name,group:un[b.base_model]})}),v},[o,i,f]),h=u.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=u.useCallback(v=>{if(!v)return;const b=kg(v);b&&e(n1(b))},[e]);return s||c?a.jsx(Gt,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs($,{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(Wc,{iconMode:!0})})]})},Aie=u.memo(Rie),Nie=ae(be,({generation:e})=>{const{model:t,vae:n}=e;return{model:t,vae:n}},Ce),Tie=()=>{const e=J(),{t}=we(),{model:n,vae:r}=F(Nie),{data:o}=Gj(),s=u.useMemo(()=>{if(!o)return[];const f=[{value:"default",label:"Default",group:"Default"}];return Tn(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:un[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=u.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]),c=u.useCallback(f=>{if(!f||f==="default"){e(ZC(null));return}const p=mM(f);p&&e(ZC(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:c,disabled:s.length===0,clearable:!0})},$ie=u.memo(Tie),Lie=ae([Gb,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),zie=()=>{const e=J(),{t}=we(),{scheduler:n,data:r}=F(Lie),o=u.useCallback(s=>{s&&e(r1(s))},[e]);return a.jsx(Gt,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})},Fie=u.memo(zie),Bie=ae(be,({generation:e})=>{const{vaePrecision:t}=e;return{vaePrecision:t}},Ce),Hie=["fp16","fp32"],Vie=()=>{const e=J(),{vaePrecision:t}=F(Bie),n=u.useCallback(r=>{r&&e(VR(r))},[e]);return a.jsx($n,{label:"VAE Precision",value:t,data:Hie,onChange:n})},Wie=u.memo(Vie),Uie=()=>{const e=qt("vae").isFeatureEnabled;return a.jsxs($,{gap:3,w:"full",flexWrap:e?"wrap":"nowrap",children:[a.jsx(Ie,{w:"full",children:a.jsx(Aie,{})}),a.jsx(Ie,{w:"full",children:a.jsx(Fie,{})}),e&&a.jsxs($,{w:"full",gap:3,children:[a.jsx($ie,{}),a.jsx(Wie,{})]})]})},Cs=u.memo(Uie),yM=[{name:"Free",value:null},{name:"2:3",value:2/3},{name:"16:9",value:16/9},{name:"1:1",value:1/1}],CM=yM.map(e=>e.value);function wM(){const e=F(o=>o.generation.aspectRatio),t=J(),n=F(o=>o.generation.shouldFitToWidthHeight),r=F(wn);return a.jsx($,{gap:2,flexGrow:1,children:a.jsx(hn,{isAttached:!0,children:yM.map(o=>a.jsx(it,{size:"sm",isChecked:e===o.value,isDisabled:r==="img2img"?!n:!1,onClick:()=>{t(Eo(o.value)),t(Yu(!1))},children:o.name},o.name))})})}const Gie=ae([be],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:c}=n.sd.height,{model:f,height:p}=e,{aspectRatio:h}=e,m=t.shift?i:c;return{model:f,height:p,min:r,sliderMax:o,inputMax:s,step:m,aspectRatio:h}},Ce),Kie=e=>{const{model:t,height:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:c}=F(Gie),f=J(),{t:p}=we(),h=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,m=u.useCallback(b=>{if(f(Ni(b)),c){const y=No(b*c,8);f(Ai(y))}},[f,c]),v=u.useCallback(()=>{if(f(Ni(h)),c){const b=No(h*c,8);f(Ai(b))}},[f,h,c]);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})},qie=u.memo(Kie),Xie=ae([be],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:c}=n.sd.width,{model:f,width:p,aspectRatio:h}=e,m=t.shift?i:c;return{model:f,width:p,min:r,sliderMax:o,inputMax:s,step:m,aspectRatio:h}},Ce),Yie=e=>{const{model:t,width:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:c}=F(Xie),f=J(),{t:p}=we(),h=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,m=u.useCallback(b=>{if(f(Ai(b)),c){const y=No(b/c,8);f(Ni(y))}},[f,c]),v=u.useCallback(()=>{if(f(Ai(h)),c){const b=No(h/c,8);f(Ni(b))}},[f,h,c]);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})},Qie=u.memo(Yie),Zie=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 Oc(){const{t:e}=we(),t=J(),{activeTabName:n,shouldFitToWidthHeight:r,shouldLockAspectRatio:o,width:s,height:i}=F(Zie),c=u.useCallback(()=>{o?(t(Yu(!1)),CM.includes(s/i)?t(Eo(s/i)):t(Eo(null))):(t(Yu(!0)),t(Eo(s/i)))},[o,s,i,t]),f=u.useCallback(()=>{t(WR()),t(Eo(null)),o&&t(Eo(i/s))},[t,o,s,i]);return a.jsxs($,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsxs($,{alignItems:"center",gap:2,children:[a.jsx(xe,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:e("parameters.aspectRatio")}),a.jsx(Za,{}),a.jsx(wM,{}),a.jsx(Te,{tooltip:e("ui.swapSizes"),"aria-label":e("ui.swapSizes"),size:"sm",icon:a.jsx(TO,{}),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:c})]}),a.jsx($,{gap:2,alignItems:"center",children:a.jsxs($,{gap:2,flexDirection:"column",width:"full",children:[a.jsx(Qie,{isDisabled:n==="img2img"?!r:!1}),a.jsx(qie,{isDisabled:n==="img2img"?!r:!1})]})})]})}const Jie=ae([be],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:c,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:c,step:v,shouldUseSliders:m}},Ce),ele=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i}=F(Jie),c=J(),{t:f}=we(),p=u.useCallback(v=>{c(Wp(v))},[c]),h=u.useCallback(()=>{c(Wp(t))},[c,t]),m=u.useCallback(()=>{c(xd())},[c]);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=u.memo(ele);function SM(){const e=J(),t=F(o=>o.generation.shouldFitToWidthHeight),n=o=>e(UR(o.target.checked)),{t:r}=we();return a.jsx(Ut,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function tle(){const e=F(i=>i.generation.seed),t=F(i=>i.generation.shouldRandomizeSeed),n=F(i=>i.generation.shouldGenerateVariations),{t:r}=we(),o=J(),s=i=>o(Hp(i));return a.jsx(Uc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:Yj,max:Qj,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e})}const nle=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function rle(){const e=J(),t=F(o=>o.generation.shouldRandomizeSeed),{t:n}=we(),r=()=>e(Hp(nle(Yj,Qj)));return a.jsx(Te,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:a.jsx(MZ,{})})}const ole=()=>{const e=J(),{t}=we(),n=F(o=>o.generation.shouldRandomizeSeed),r=o=>e(GR(o.target.checked));return a.jsx(Ut,{label:t("common.random"),isChecked:n,onChange:r})},sle=u.memo(ole),ale=()=>a.jsxs($,{sx:{gap:3,alignItems:"flex-end"},children:[a.jsx(tle,{}),a.jsx(rle,{}),a.jsx(sle,{})]}),Ss=u.memo(ale),kM=e=>a.jsxs($,{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(xe,{fontSize:"sm",fontWeight:"bold",sx:{color:"base.600",_dark:{color:"base.300"}},children:e.label}),e.children]});kM.displayName="SubSettingsWrapper";const Mc=u.memo(kM),ile=ae([be],({sdxl:e})=>{const{sdxlImg2ImgDenoisingStrength:t}=e;return{sdxlImg2ImgDenoisingStrength:t}},Ce),lle=()=>{const{sdxlImg2ImgDenoisingStrength:e}=F(ile),t=J(),{t:n}=we(),r=u.useCallback(s=>t(JC(s)),[t]),o=u.useCallback(()=>{t(JC(.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})})},_M=u.memo(lle),cle=ae([Gb,Vr],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),ule=()=>{const{shouldUseSliders:e,activeLabel:t}=F(cle);return a.jsx(pr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]}),a.jsx(_M,{}),a.jsx(SM,{})]})})},dle=u.memo(ule),fle=()=>a.jsxs(a.Fragment,{children:[a.jsx(Ty,{}),a.jsx(dle,{}),a.jsx($y,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(Xc,{})]}),ple=u.memo(fle),hle=ae(be,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),mle=()=>{const{shouldUseSliders:e,activeLabel:t}=F(hle);return a.jsx(pr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsx($,{sx:{flexDirection:"column",gap:3},children:e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]})})})},jM=u.memo(mle),gle=()=>a.jsxs(a.Fragment,{children:[a.jsx(Ty,{}),a.jsx(jM,{}),a.jsx($y,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(Xc,{})]}),vle=u.memo(gle),ble=[{label:"Unmasked",value:"unmasked"},{label:"Mask",value:"mask"},{label:"Mask Edge",value:"edge"}],xle=()=>{const e=J(),t=F(o=>o.generation.canvasCoherenceMode),{t:n}=we(),r=o=>{o&&e(KR(o))};return a.jsx($n,{label:n("parameters.coherenceMode"),data:ble,value:t,onChange:r})},yle=u.memo(xle),Cle=()=>{const e=J(),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(ew(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(ew(20))}})},wle=u.memo(Cle),Sle=()=>{const e=J(),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(tw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(tw(.3))}})},kle=u.memo(Sle);function _le(){const e=J(),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(nw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(nw(16))}})}const jle=[{label:"Box Blur",value:"box"},{label:"Gaussian Blur",value:"gaussian"}];function Ple(){const e=F(o=>o.generation.maskBlurMethod),t=J(),{t:n}=we(),r=o=>{o&&t(qR(o))};return a.jsx($n,{value:e,onChange:r,label:n("parameters.maskBlurMethod"),data:jle})}const Ile=()=>{const{t:e}=we();return a.jsx(pr,{label:e("parameters.compositingSettingsHeader"),children:a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsxs(Mc,{label:e("parameters.coherencePassHeader"),children:[a.jsx(yle,{}),a.jsx(wle,{}),a.jsx(kle,{})]}),a.jsx(zr,{}),a.jsxs(Mc,{label:e("parameters.maskAdjustmentsHeader"),children:[a.jsx(_le,{}),a.jsx(Ple,{})]})]})})},PM=u.memo(Ile),Ele=ae([be],({generation:e})=>{const{infillMethod:t}=e;return{infillMethod:t}},Ce),Ole=()=>{const e=J(),{infillMethod:t}=F(Ele),{data:n,isLoading:r}=Rj(),o=n==null?void 0:n.infill_methods,{t:s}=we(),i=u.useCallback(c=>{e(XR(c))},[e]);return a.jsx($n,{disabled:(o==null?void 0:o.length)===0,placeholder:r?"Loading...":void 0,label:s("parameters.infillMethod"),value:t,data:o??[],onChange:i})},Mle=u.memo(Ole),Dle=ae([Vr],e=>{const{infillPatchmatchDownscaleSize:t,infillMethod:n}=e;return{infillPatchmatchDownscaleSize:t,infillMethod:n}},Ce),Rle=()=>{const e=J(),{infillPatchmatchDownscaleSize:t,infillMethod:n}=F(Dle),{t:r}=we(),o=u.useCallback(i=>{e(rw(i))},[e]),s=u.useCallback(()=>{e(rw(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})},Ale=u.memo(Rle),Nle=ae([Vr],e=>{const{infillTileSize:t,infillMethod:n}=e;return{infillTileSize:t,infillMethod:n}},Ce),Tle=()=>{const e=J(),{infillTileSize:t,infillMethod:n}=F(Nle),{t:r}=we(),o=u.useCallback(i=>{e(ow(i))},[e]),s=u.useCallback(()=>{e(ow(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})},$le=u.memo(Tle),Lle=ae([Vr],e=>{const{infillMethod:t}=e;return{infillMethod:t}},Ce);function zle(){const{infillMethod:e}=F(Lle);return a.jsxs($,{children:[e==="tile"&&a.jsx($le,{}),e==="patchmatch"&&a.jsx(Ale,{})]})}const $t=e=>e.canvas,bo=ae([$t,wn,go],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Fle=ae([$t],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},Ce),Ble=()=>{const e=J(),{boundingBoxScale:t}=F(Fle),{t:n}=we(),r=o=>{e(QR(o))};return a.jsx(Gt,{label:n("parameters.scaleBeforeProcessing"),data:YR,value:t,onChange:r})},Hle=u.memo(Ble),Vle=ae([Vr,$t],(e,t)=>{const{scaledBoundingBoxDimensions:n,boundingBoxScaleMethod:r}=t,{model:o}=e;return{model:o,scaledBoundingBoxDimensions:n,isManual:r==="manual"}},Ce),Wle=()=>{const e=J(),{model:t,isManual:n,scaledBoundingBoxDimensions:r}=F(Vle),o=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:s}=we(),i=f=>{e(Gp({...r,height:Math.floor(f)}))},c=()=>{e(Gp({...r,height:Math.floor(o)}))};return a.jsx(Ze,{isDisabled:!n,label:s("parameters.scaledHeight"),min:64,max:1536,step:64,value:r.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:c})},Ule=u.memo(Wle),Gle=ae([$t,Vr],(e,t)=>{const{boundingBoxScaleMethod:n,scaledBoundingBoxDimensions:r}=e,{model:o}=t;return{model:o,scaledBoundingBoxDimensions:r,isManual:n==="manual"}},Ce),Kle=()=>{const e=J(),{model:t,isManual:n,scaledBoundingBoxDimensions:r}=F(Gle),o=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:s}=we(),i=f=>{e(Gp({...r,width:Math.floor(f)}))},c=()=>{e(Gp({...r,width:Math.floor(o)}))};return a.jsx(Ze,{isDisabled:!n,label:s("parameters.scaledWidth"),min:64,max:1536,step:64,value:r.width,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:c})},qle=u.memo(Kle),Xle=()=>{const{t:e}=we();return a.jsx(pr,{label:e("parameters.infillScalingHeader"),children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsxs(Mc,{children:[a.jsx(Mle,{}),a.jsx(zle,{})]}),a.jsx(zr,{}),a.jsxs(Mc,{children:[a.jsx(Hle,{}),a.jsx(qle,{}),a.jsx(Ule,{})]})]})})},IM=u.memo(Xle),Yle=ae([be,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=J(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=F(Yle),{t:s}=we(),i=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,c=p=>{if(e(Ro({...n,height:Math.floor(p)})),o){const h=No(p*o,64);e(Ro({width:h,height:Math.floor(p)}))}},f=()=>{if(e(Ro({...n,height:Math.floor(i)})),o){const p=No(i*o,64);e(Ro({width:p,height:Math.floor(i)}))}};return a.jsx(Ze,{label:s("parameters.boundingBoxHeight"),min:64,max:1536,step:64,value:n.height,onChange:c,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:f})},Zle=u.memo(Qle),Jle=ae([be,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),ece=()=>{const e=J(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=F(Jle),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=we(),c=p=>{if(e(Ro({...n,width:Math.floor(p)})),o){const h=No(p/o,64);e(Ro({width:Math.floor(p),height:h}))}},f=()=>{if(e(Ro({...n,width:Math.floor(s)})),o){const p=No(s/o,64);e(Ro({width:Math.floor(s),height:p}))}};return a.jsx(Ze,{label:i("parameters.boundingBoxWidth"),min:64,max:1536,step:64,value:n.width,onChange:c,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:f})},tce=u.memo(ece),nce=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=J(),{t}=we(),{shouldLockAspectRatio:n,boundingBoxDimensions:r}=F(nce),o=u.useCallback(()=>{n?(e(Yu(!1)),CM.includes(r.width/r.height)?e(Eo(r.width/r.height)):e(Eo(null))):(e(Yu(!0)),e(Eo(r.width/r.height)))},[n,r,e]),s=u.useCallback(()=>{e(ZR()),e(Eo(null)),n&&e(Eo(r.height/r.width))},[e,n,r]);return a.jsxs($,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.100",_dark:{bg:"base.750"}},children:[a.jsxs($,{alignItems:"center",gap:2,children:[a.jsx(xe,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:t("parameters.aspectRatio")}),a.jsx(Za,{}),a.jsx(wM,{}),a.jsx(Te,{tooltip:t("ui.swapSizes"),"aria-label":t("ui.swapSizes"),size:"sm",icon:a.jsx(TO,{}),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(tce,{}),a.jsx(Zle,{})]})}const rce=ae(be,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),oce=()=>{const{shouldUseSliders:e,activeLabel:t}=F(rce);return a.jsx(pr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}),a.jsx(_M,{})]})})},sce=u.memo(oce);function ace(){return a.jsxs(a.Fragment,{children:[a.jsx(Ty,{}),a.jsx(sce,{}),a.jsx($y,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(IM,{}),a.jsx(PM,{}),a.jsx(Xc,{})]})}function ice(){const e=F(f=>f.generation.clipSkip),{model:t}=F(f=>f.generation),n=J(),{t:r}=we(),o=u.useCallback(f=>{n(sw(f))},[n]),s=u.useCallback(()=>{n(sw(0))},[n]),i=u.useMemo(()=>t?Wf[t.base_model].maxClip:Wf["sd-1"].maxClip,[t]),c=u.useMemo(()=>t?Wf[t.base_model].markers:Wf["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:c,withInput:!0,withReset:!0,handleReset:s})}const lce=ae(be,e=>({activeLabel:e.generation.clipSkip>0?"Clip Skip":void 0}),Ce);function Ly(){const{activeLabel:e}=F(lce);return F(n=>n.generation.shouldShowAdvancedOptions)?a.jsx(pr,{label:"Advanced",activeLabel:e,children:a.jsx($,{sx:{flexDir:"column",gap:2},children:a.jsx(ice,{})})}):null}function zy(){return a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsx(bM,{}),a.jsx(vM,{})]})}function cce(){const e=F(o=>o.generation.horizontalSymmetrySteps),t=F(o=>o.generation.steps),n=J(),{t:r}=we();return a.jsx(Ze,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(aw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(aw(0))})}function uce(){const e=F(o=>o.generation.verticalSymmetrySteps),t=F(o=>o.generation.steps),n=J(),{t:r}=we();return a.jsx(Ze,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(iw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(iw(0))})}function dce(){const e=F(n=>n.generation.shouldUseSymmetry),t=J();return a.jsx(Ut,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(JR(n.target.checked))})}const fce=ae(be,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),Ce),pce=()=>{const{t:e}=we(),{activeLabel:t}=F(fce);return qt("symmetry").isFeatureEnabled?a.jsx(pr,{label:e("parameters.symmetry"),activeLabel:t,children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(dce,{}),a.jsx(cce,{}),a.jsx(uce,{})]})}):null},Fy=u.memo(pce),hce=ae([be],({generation:e,hotkeys:t,config:n})=>{const{initial:r,min:o,sliderMax:s,inputMax:i,fineStep:c,coarseStep:f}=n.sd.img2imgStrength,{img2imgStrength:p}=e,h=t.shift?c:f;return{img2imgStrength:p,initial:r,min:o,sliderMax:s,inputMax:i,step:h}},Ce),mce=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=F(hce),i=J(),{t:c}=we(),f=u.useCallback(h=>i(Up(h)),[i]),p=u.useCallback(()=>{i(Up(t))},[i,t]);return a.jsx(Mc,{children:a.jsx(Ze,{label:`${c("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}})})},EM=u.memo(mce),gce=ae([Gb,Vr],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),vce=()=>{const{shouldUseSliders:e,activeLabel:t}=F(gce);return a.jsx(pr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]}),a.jsx(EM,{}),a.jsx(SM,{})]})})},bce=u.memo(vce),xce=()=>a.jsxs(a.Fragment,{children:[a.jsx(zy,{}),a.jsx(bce,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(Fy,{}),a.jsx(Xc,{}),a.jsx(Ly,{})]}),yce=u.memo(xce),Cce=()=>a.jsxs(a.Fragment,{children:[a.jsx(zy,{}),a.jsx(jM,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Gd,{}),a.jsx(Fy,{}),a.jsx(Xc,{}),a.jsx(Ly,{})]}),wce=u.memo(Cce),Sce=ae(be,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ce),kce=()=>{const{shouldUseSliders:e,activeLabel:t}=F(Sce);return a.jsx(pr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(am,{})]}),a.jsx(EM,{})]})})},_ce=u.memo(kce),jce=()=>a.jsxs(a.Fragment,{children:[a.jsx(zy,{}),a.jsx(_ce,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Gc,{}),a.jsx(Fy,{}),a.jsx(IM,{}),a.jsx(PM,{}),a.jsx(Xc,{}),a.jsx(Ly,{})]}),Pce=u.memo(jce),Ice=()=>{const e=F(wn),t=F(n=>n.generation.model);return e==="txt2img"?a.jsx(zp,{children:t&&t.base_model==="sdxl"?a.jsx(vle,{}):a.jsx(wce,{})}):e==="img2img"?a.jsx(zp,{children:t&&t.base_model==="sdxl"?a.jsx(ple,{}):a.jsx(yce,{})}):e==="unifiedCanvas"?a.jsx(zp,{children:t&&t.base_model==="sdxl"?a.jsx(ace,{}):a.jsx(Pce,{})}):null},Ece=u.memo(Ice),zp=u.memo(e=>a.jsxs($,{sx:{w:"full",h:"full",flexDir:"column",gap:2},children:[a.jsx(BO,{}),a.jsx($,{layerStyle:"first",sx:{w:"full",h:"full",position:"relative",borderRadius:"base",p:2},children:a.jsx($,{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($,{sx:{gap:2,flexDirection:"column",h:"full",w:"full"},children:e.children})})})})})]}));zp.displayName="ParametersPanelWrapper";const Oce=ae([be],e=>{const{initialImage:t}=e.generation;return{initialImage:t,isResetButtonDisabled:!t}},Ce),Mce=()=>{const{initialImage:e}=F(Oce),{currentData:t}=fo((e==null?void 0:e.imageName)??Lr.skipToken),n=u.useMemo(()=>{if(t)return{id:"initial-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t]),r=u.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"})})},Dce=u.memo(Mce),Rce=ae([be],e=>{const{initialImage:t}=e.generation;return{isResetButtonDisabled:!t}},Ce),Ace={type:"SET_INITIAL_IMAGE"},Nce=()=>{const{isResetButtonDisabled:e}=F(Rce),t=J(),{getUploadButtonProps:n,getUploadInputProps:r}=ky({postUploadAction:Ace}),o=u.useCallback(()=>{t(eA())},[t]);return a.jsxs($,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",p:2,gap:4},children:[a.jsxs($,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(xe,{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(Dce,{}),a.jsx("input",{...r()})]})},Tce=u.memo(Nce),$ce=ae([be],({system:e})=>{const{isProcessing:t,isConnected:n}=e;return n&&!t}),Lce=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=we(),o=F($ce);return a.jsx(Te,{onClick:t,icon:a.jsx(Hr,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})},zce=[{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 Fce(){const e=F(r=>r.postprocessing.esrganModelName),t=J(),n=r=>t(tA(r));return a.jsx($n,{label:"ESRGAN Model",value:e,itemComponent:ri,onChange:n,data:zce})}const Bce=e=>{const{imageDTO:t}=e,n=J(),r=F(Pn),{t:o}=we(),{isOpen:s,onOpen:i,onClose:c}=Ir(),f=u.useCallback(()=>{c(),t&&n(Zj({image_name:t.image_name}))},[n,t,c]);return a.jsx(Wd,{isOpen:s,onClose:c,triggerComponent:a.jsx(Te,{onClick:i,icon:a.jsx(vZ,{}),"aria-label":o("parameters.upscale")}),children:a.jsxs($,{sx:{flexDirection:"column",gap:4},children:[a.jsx(Fce,{}),a.jsx(it,{size:"sm",isDisabled:!t||r,onClick:f,children:o("parameters.upscaleImage")})]})})},Hce=u.memo(Bce),Vce=ae([be,wn],({gallery:e,system:t,ui:n},r)=>{const{isProcessing:o,isConnected:s,shouldConfirmOnDelete:i,progressImage:c}=t,{shouldShowImageDetails:f,shouldHidePreview:p,shouldShowProgressInViewer:h}=n,m=e.selection[e.selection.length-1];return{canDeleteImage:s&&!o,shouldConfirmOnDelete:i,isProcessing:o,isConnected:s,shouldDisableToolbarButtons:!!c||!m,shouldShowImageDetails:f,activeTabName:r,shouldHidePreview:p,shouldShowProgressInViewer:h,lastSelectedImage:m}},{memoizeOptions:{resultEqualityCheck:kt}}),Wce=e=>{const t=J(),{isProcessing:n,isConnected:r,shouldDisableToolbarButtons:o,shouldShowImageDetails:s,lastSelectedImage:i,shouldShowProgressInViewer:c}=F(Vce),f=qt("upscaling").isFeatureEnabled,p=Ji(),{t:h}=we(),{recallBothPrompts:m,recallSeed:v,recallAllParameters:b}=gg(),{currentData:y}=fo((i==null?void 0:i.image_name)??Lr.skipToken),{metadata:x,workflow:w,isLoading:k}=Lb(i??Lr.skipToken,{selectFromResult:T=>{var q,B;return{isLoading:T.isFetching,metadata:(q=T==null?void 0:T.currentData)==null?void 0:q.metadata,workflow:(B=T==null?void 0:T.currentData)==null?void 0:B.workflow}}}),_=u.useCallback(()=>{w&&t(Bb(w))},[t,w]),j=u.useCallback(()=>{b(x)},[x,b]);Qe("a",()=>{},[x,b]);const I=u.useCallback(()=>{v(x==null?void 0:x.seed)},[x==null?void 0:x.seed,v]);Qe("s",I,[y]);const E=u.useCallback(()=>{m(x==null?void 0:x.positive_prompt,x==null?void 0:x.negative_prompt,x==null?void 0:x.positive_style_prompt,x==null?void 0:x.negative_style_prompt)},[x==null?void 0:x.negative_prompt,x==null?void 0:x.positive_prompt,x==null?void 0:x.positive_style_prompt,x==null?void 0:x.negative_style_prompt,m]);Qe("p",E,[y]),Qe("w",_,[w]);const O=u.useCallback(()=>{t($O()),t(pm(y))},[t,y]);Qe("shift+i",O,[y]);const M=u.useCallback(()=>{y&&t(Zj({image_name:y.image_name}))},[t,y]),D=u.useCallback(()=>{y&&t(hm([y]))},[t,y]);Qe("Shift+U",()=>{M()},{enabled:()=>!!(f&&!o&&r&&!n)},[f,y,o,r,n]);const A=u.useCallback(()=>t(nA(!s)),[t,s]);Qe("i",()=>{y?A():p({title:h("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[y,s,p]),Qe("delete",()=>{D()},[t,y]);const R=u.useCallback(()=>{t(Aj(!c))},[t,c]);return a.jsx(a.Fragment,{children:a.jsxs($,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},...e,children:[a.jsx(hn,{isAttached:!0,isDisabled:o,children:a.jsxs(Dd,{children:[a.jsx(Rd,{as:Te,"aria-label":`${h("parameters.sendTo")}...`,tooltip:`${h("parameters.sendTo")}...`,isDisabled:!y,icon:a.jsx(TZ,{})}),a.jsx(Ga,{motionProps:gc,children:y&&a.jsx(LO,{imageDTO:y})})]})}),a.jsxs(hn,{isAttached:!0,isDisabled:o,children:[a.jsx(Te,{isLoading:k,icon:a.jsx(vg,{}),tooltip:`${h("nodes.loadWorkflow")} (W)`,"aria-label":`${h("nodes.loadWorkflow")} (W)`,isDisabled:!w,onClick:_}),a.jsx(Te,{isLoading:k,icon:a.jsx(DE,{}),tooltip:`${h("parameters.usePrompt")} (P)`,"aria-label":`${h("parameters.usePrompt")} (P)`,isDisabled:!(x!=null&&x.positive_prompt),onClick:E}),a.jsx(Te,{isLoading:k,icon:a.jsx(RE,{}),tooltip:`${h("parameters.useSeed")} (S)`,"aria-label":`${h("parameters.useSeed")} (S)`,isDisabled:!(x!=null&&x.seed),onClick:I}),a.jsx(Te,{isLoading:k,icon:a.jsx(wE,{}),tooltip:`${h("parameters.useAll")} (A)`,"aria-label":`${h("parameters.useAll")} (A)`,isDisabled:!x,onClick:j})]}),f&&a.jsx(hn,{isAttached:!0,isDisabled:o,children:f&&a.jsx(Hce,{imageDTO:y})}),a.jsx(hn,{isAttached:!0,isDisabled:o,children:a.jsx(Te,{icon:a.jsx(kE,{}),tooltip:`${h("parameters.info")} (I)`,"aria-label":`${h("parameters.info")} (I)`,isChecked:s,onClick:A})}),a.jsx(hn,{isAttached:!0,children:a.jsx(Te,{"aria-label":h("settings.displayInProgress"),tooltip:h("settings.displayInProgress"),icon:a.jsx(kZ,{}),isChecked:c,onClick:R})}),a.jsx(hn,{isAttached:!0,children:a.jsx(Lce,{onClick:D,isDisabled:o})})]})})},Uce=u.memo(Wce),Gce=ae([be,Hb],(e,t)=>{var _,j;const{data:n,status:r}=rA.endpoints.listImages.select(t)(e),{data:o}=e.gallery.galleryView==="images"?lw.endpoints.getBoardImagesTotal.select(t.board_id??"none")(e):lw.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 c={...t,offset:n.ids.length,limit:Wj},f=oA.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),b=(_=p[m])==null?void 0:_.image_name,y=(j=p[v])==null?void 0:j.image_name,x=b?f.selectById(n,b):void 0,w=y?f.selectById(n,y):void 0,k=p.length;return{loadedImagesCount:p.length,currentImageIndex:h,areMoreImagesAvailable:(o??0)>k,isFetching:r==="pending",nextImage:x,prevImage:w,queryArgs:c}},{memoizeOptions:{resultEqualityCheck:kt}}),OM=()=>{const e=J(),{nextImage:t,prevImage:n,areMoreImagesAvailable:r,isFetching:o,queryArgs:s,loadedImagesCount:i,currentImageIndex:c}=F(Gce),f=u.useCallback(()=>{n&&e(cw(n))},[e,n]),p=u.useCallback(()=>{t&&e(cw(t))},[e,t]),[h]=Vj(),m=u.useCallback(()=>{h(s)},[h,s]);return{handlePrevImage:f,handleNextImage:p,isOnFirstImage:c===0,isOnLastImage:c!==void 0&&c===i-1,nextImage:t,prevImage:n,areMoreImagesAvailable:r,handleLoadMoreImages:m,isFetching:o}};function Kce(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 qce=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:i}=we();return t?a.jsxs($,{gap:2,children:[n&&a.jsx(Dt,{label:`Recall ${e}`,children:a.jsx(ps,{"aria-label":i("accessibility.useThisParameter"),icon:a.jsx(Kce,{}),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($,{direction:o?"column":"row",children:[a.jsxs(xe,{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(pO,{mx:"2px"})]}):a.jsx(xe,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},Jr=u.memo(qce),Xce=e=>{const{metadata:t}=e,{recallPositivePrompt:n,recallNegativePrompt:r,recallSeed:o,recallCfgScale:s,recallModel:i,recallScheduler:c,recallSteps:f,recallWidth:p,recallHeight:h,recallStrength:m}=gg(),v=u.useCallback(()=>{n(t==null?void 0:t.positive_prompt)},[t==null?void 0:t.positive_prompt,n]),b=u.useCallback(()=>{r(t==null?void 0:t.negative_prompt)},[t==null?void 0:t.negative_prompt,r]),y=u.useCallback(()=>{o(t==null?void 0:t.seed)},[t==null?void 0:t.seed,o]),x=u.useCallback(()=>{i(t==null?void 0:t.model)},[t==null?void 0:t.model,i]),w=u.useCallback(()=>{p(t==null?void 0:t.width)},[t==null?void 0:t.width,p]),k=u.useCallback(()=>{h(t==null?void 0:t.height)},[t==null?void 0:t.height,h]),_=u.useCallback(()=>{c(t==null?void 0:t.scheduler)},[t==null?void 0:t.scheduler,c]),j=u.useCallback(()=>{f(t==null?void 0:t.steps)},[t==null?void 0:t.steps,f]),I=u.useCallback(()=>{s(t==null?void 0:t.cfg_scale)},[t==null?void 0:t.cfg_scale,s]),E=u.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(Jr,{label:"Created By",value:t.created_by}),t.generation_mode&&a.jsx(Jr,{label:"Generation Mode",value:t.generation_mode}),t.positive_prompt&&a.jsx(Jr,{label:"Positive Prompt",labelPosition:"top",value:t.positive_prompt,onClick:v}),t.negative_prompt&&a.jsx(Jr,{label:"Negative Prompt",labelPosition:"top",value:t.negative_prompt,onClick:b}),t.seed!==void 0&&t.seed!==null&&a.jsx(Jr,{label:"Seed",value:t.seed,onClick:y}),t.model!==void 0&&t.model!==null&&t.model.model_name&&a.jsx(Jr,{label:"Model",value:t.model.model_name,onClick:x}),t.width&&a.jsx(Jr,{label:"Width",value:t.width,onClick:w}),t.height&&a.jsx(Jr,{label:"Height",value:t.height,onClick:k}),t.scheduler&&a.jsx(Jr,{label:"Scheduler",value:t.scheduler,onClick:_}),t.steps&&a.jsx(Jr,{label:"Steps",value:t.steps,onClick:j}),t.cfg_scale!==void 0&&t.cfg_scale!==null&&a.jsx(Jr,{label:"CFG scale",value:t.cfg_scale,onClick:I}),t.strength&&a.jsx(Jr,{label:"Image to image strength",value:t.strength,onClick:E})]})},Yce=u.memo(Xce),Qce=({image:e})=>{const{metadata:t,workflow:n}=Lb(e,{selectFromResult:r=>{var o,s;return{metadata:(o=r==null?void 0:r.currentData)==null?void 0:o.metadata,workflow:(s=r==null?void 0:r.currentData)==null?void 0:s.workflow}}});return a.jsxs($,{layerStyle:"first",sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",borderRadius:"base",position:"absolute",overflow:"hidden"},children:[a.jsxs($,{gap:2,children:[a.jsx(xe,{fontWeight:"semibold",children:"File:"}),a.jsxs(Im,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,a.jsx(pO,{mx:"2px"})]})]}),a.jsx(Yce,{metadata:t}),a.jsxs(Qi,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(Zi,{children:[a.jsx(jr,{children:"Metadata"}),a.jsx(jr,{children:"Image Details"}),a.jsx(jr,{children:"Workflow"})]}),a.jsxs(zc,{children:[a.jsx(uo,{children:t?a.jsx(Mi,{data:t,label:"Metadata"}):a.jsx(tr,{label:"No metadata found"})}),a.jsx(uo,{children:e?a.jsx(Mi,{data:e,label:"Image Details"}):a.jsx(tr,{label:"No image details found"})}),a.jsx(uo,{children:n?a.jsx(Mi,{data:n,label:"Workflow"}):a.jsx(tr,{label:"No workflow found"})})]})]})]})},Zce=u.memo(Qce),Wv={color:"base.100",pointerEvents:"auto"},Jce=()=>{const{t:e}=we(),{handlePrevImage:t,handleNextImage:n,isOnFirstImage:r,isOnLastImage:o,handleLoadMoreImages:s,areMoreImagesAvailable:i,isFetching:c}=OM();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(rZ,{size:64}),variant:"unstyled",onClick:t,boxSize:16,sx:Wv})}),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(oZ,{size:64}),variant:"unstyled",onClick:n,boxSize:16,sx:Wv}),o&&i&&!c&&a.jsx(ps,{"aria-label":e("accessibility.loadMore"),icon:a.jsx(nZ,{size:64}),variant:"unstyled",onClick:s,boxSize:16,sx:Wv}),o&&i&&c&&a.jsx($,{sx:{w:16,h:16,alignItems:"center",justifyContent:"center"},children:a.jsx(Ki,{opacity:.5,size:"xl"})})]})]})},MM=u.memo(Jce),eue=ae([be,sA],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{progressImage:i,shouldAntialiasProgressImage:c}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n==null?void 0:n.image_name,progressImage:i,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:c}},{memoizeOptions:{resultEqualityCheck:kt}}),tue=()=>{const{shouldShowImageDetails:e,imageName:t,progressImage:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=F(eue),{handlePrevImage:s,handleNextImage:i,isOnLastImage:c,handleLoadMoreImages:f,areMoreImagesAvailable:p,isFetching:h}=OM();Qe("left",()=>{s()},[s]),Qe("right",()=>{if(c&&p&&!h){f();return}c||i()},[c,p,f,h,i]);const{currentData:m}=fo(t??Lr.skipToken),v=u.useMemo(()=>{if(m)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:m}}},[m]),b=u.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]),[y,x]=u.useState(!1),w=u.useRef(0),k=u.useCallback(()=>{x(!0),window.clearTimeout(w.current)},[]),_=u.useCallback(()=>{w.current=window.setTimeout(()=>{x(!1)},500)},[]);return a.jsxs($,{onMouseOver:k,onMouseOut:_,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n&&r?a.jsx(Xi,{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:b,draggableData:v,isUploadDisabled:!0,fitContainer:!0,useThumbailFallback:!0,dropLabel:"Set as Current Image",noContentFallback:a.jsx(tr,{icon:Vi,label:"No image selected"})}),e&&m&&a.jsx(Ie,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base"},children:a.jsx(Zce,{image:m})}),a.jsx(nr,{children:!e&&m&&y&&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(MM,{})},"nextPrevButtons")})]})},nue=u.memo(tue),rue=()=>a.jsxs($,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[a.jsx(Uce,{}),a.jsx(nue,{})]}),oue=u.memo(rue),sue=()=>a.jsx(Ie,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:2,borderRadius:"base"},children:a.jsx($,{sx:{width:"100%",height:"100%"},children:a.jsx(oue,{})})}),DM=u.memo(sue),aue=()=>{const e=u.useRef(null),t=u.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(Wa,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:a.jsx(Tce,{})}),a.jsx(om,{onDoubleClick:t}),a.jsx(Wa,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,children:a.jsx(DM,{})})]})})},iue=u.memo(aue);var lue=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 N_=Dc(lue);function Cb(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 cue=Object.defineProperty,T_=Object.getOwnPropertySymbols,uue=Object.prototype.hasOwnProperty,due=Object.prototype.propertyIsEnumerable,$_=(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)&&$_(e,n,t[n]);if(T_)for(var n of T_(t))due.call(t,n)&&$_(e,n,t[n]);return e};function RM(e,t){if(t===null||typeof t!="object")return{};const n=fue({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const pue="__MANTINE_FORM_INDEX__";function L_(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${pue}`)):!1:!1}function z_(e,t,n){typeof n.value=="object"&&(n.value=ql(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function ql(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(ql(i))})):s==="[object Map]"?(o=new Map,e.forEach(function(i,c){o.set(ql(c),ql(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(ql(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++)z_(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]||z_(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function AM(e){return typeof e!="string"?[]:e.split(".")}function Pg(e,t,n){const r=AM(e);if(r.length===0)return n;const o=ql(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 Ws(e,t){const n=AM(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 F_(e){const t=Cb(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function wb(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,s)=>{const i=e[s],c=`${n===""?"":`${n}.`}${s}`,f=Ws(c,t);let p=!1;return typeof i=="function"&&(o[c]=i(f,t,c)),typeof i=="object"&&Array.isArray(f)&&(p=!0,f.forEach((h,m)=>wb(i,t,`${c}.${m}`,o))),typeof i=="object"&&typeof f=="object"&&f!==null&&(p||wb(i,t,c,o)),o},r)}function Sb(e,t){return F_(typeof e=="function"?e(t):wb(e,t))}function Pp(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=Sb(t,n),o=Object.keys(r.errors).find(s=>e.split(".").every((i,c)=>i===s.split(".")[c]));return{hasError:!!o,error:o?r.errors[o]:null}}function hue(e,{from:t,to:n},r){const o=Ws(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 mue=Object.defineProperty,B_=Object.getOwnPropertySymbols,gue=Object.prototype.hasOwnProperty,vue=Object.prototype.propertyIsEnumerable,H_=(e,t,n)=>t in e?mue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bue=(e,t)=>{for(var n in t||(t={}))gue.call(t,n)&&H_(e,n,t[n]);if(B_)for(var n of B_(t))vue.call(t,n)&&H_(e,n,t[n]);return e};function xue(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,i=bue({},r);return Object.keys(r).every(c=>{let f,p;if(c.startsWith(o)&&(f=c,p=c.replace(o,s)),c.startsWith(s)&&(f=c.replace(s,o),p=c),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 yue(e,t,n){const r=Ws(e,n);return Array.isArray(r)?Pg(e,r.filter((o,s)=>s!==t),n):n}var Cue=Object.defineProperty,V_=Object.getOwnPropertySymbols,wue=Object.prototype.hasOwnProperty,Sue=Object.prototype.propertyIsEnumerable,W_=(e,t,n)=>t in e?Cue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kue=(e,t)=>{for(var n in t||(t={}))wue.call(t,n)&&W_(e,n,t[n]);if(V_)for(var n of V_(t))Sue.call(t,n)&&W_(e,n,t[n]);return e};function U_(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function G_(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=RM(`${o}.${t}`,s));const i=kue({},s),c=new Set;return Object.entries(s).filter(([f])=>{if(!f.startsWith(`${o}.`))return!1;const p=U_(f,o);return Number.isNaN(p)?!1:p>=t}).forEach(([f,p])=>{const h=U_(f,o),m=f.replace(`${o}.${h}`,`${o}.${h+r}`);i[m]=p,c.add(m),c.has(f)||delete i[f]}),i}function _ue(e,t,n,r){const o=Ws(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 K_(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 jue(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 Pue=Object.defineProperty,Iue=Object.defineProperties,Eue=Object.getOwnPropertyDescriptors,q_=Object.getOwnPropertySymbols,Oue=Object.prototype.hasOwnProperty,Mue=Object.prototype.propertyIsEnumerable,X_=(e,t,n)=>t in e?Pue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ia=(e,t)=>{for(var n in t||(t={}))Oue.call(t,n)&&X_(e,n,t[n]);if(q_)for(var n of q_(t))Mue.call(t,n)&&X_(e,n,t[n]);return e},Uv=(e,t)=>Iue(e,Eue(t));function sl({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:s=!1,validateInputOnBlur:i=!1,transformValues:c=p=>p,validate:f}={}){const[p,h]=u.useState(r),[m,v]=u.useState(n),[b,y]=u.useState(e),[x,w]=u.useState(Cb(t)),k=u.useRef(e),_=W=>{k.current=W},j=u.useCallback(()=>h({}),[]),I=W=>{const U=W?Ia(Ia({},b),W):b;_(U),v({})},E=u.useCallback(W=>w(U=>Cb(typeof W=="function"?W(U):W)),[]),O=u.useCallback(()=>w({}),[]),M=u.useCallback(()=>{y(e),O(),_(e),v({}),j()},[]),D=u.useCallback((W,U)=>E(ee=>Uv(Ia({},ee),{[W]:U})),[]),A=u.useCallback(W=>E(U=>{if(typeof W!="string")return U;const ee=Ia({},U);return delete ee[W],ee}),[]),R=u.useCallback(W=>v(U=>{if(typeof W!="string")return U;const ee=RM(W,U);return delete ee[W],ee}),[]),T=u.useCallback((W,U)=>{const ee=L_(W,s);R(W),h(se=>Uv(Ia({},se),{[W]:!0})),y(se=>{const re=Pg(W,U,se);if(ee){const fe=Pp(W,f,re);fe.hasError?D(W,fe.error):A(W)}return re}),!ee&&o&&D(W,null)},[]),q=u.useCallback(W=>{y(U=>{const ee=typeof W=="function"?W(U):W;return Ia(Ia({},U),ee)}),o&&O()},[]),B=u.useCallback((W,U)=>{R(W),y(ee=>hue(W,U,ee)),w(ee=>xue(W,U,ee))},[]),G=u.useCallback((W,U)=>{R(W),y(ee=>yue(W,U,ee)),w(ee=>G_(W,U,ee,-1))},[]),Y=u.useCallback((W,U,ee)=>{R(W),y(se=>_ue(W,U,ee,se)),w(se=>G_(W,ee,se,1))},[]),V=u.useCallback(()=>{const W=Sb(f,b);return w(W.errors),W},[b,f]),L=u.useCallback(W=>{const U=Pp(W,f,b);return U.hasError?D(W,U.error):A(W),U},[b,f]),X=(W,{type:U="input",withError:ee=!0,withFocus:se=!0}={})=>{const fe={onChange:jue(de=>T(W,de))};return ee&&(fe.error=x[W]),U==="checkbox"?fe.checked=Ws(W,b):fe.value=Ws(W,b),se&&(fe.onFocus=()=>h(de=>Uv(Ia({},de),{[W]:!0})),fe.onBlur=()=>{if(L_(W,i)){const de=Pp(W,f,b);de.hasError?D(W,de.error):A(W)}}),fe},z=(W,U)=>ee=>{ee==null||ee.preventDefault();const se=V();se.hasErrors?U==null||U(se.errors,b,ee):W==null||W(c(b),ee)},K=W=>c(W||b),ne=u.useCallback(W=>{W.preventDefault(),M()},[]),Q=W=>{if(W){const ee=Ws(W,m);if(typeof ee=="boolean")return ee;const se=Ws(W,b),re=Ws(W,k.current);return!N_(se,re)}return Object.keys(m).length>0?K_(m):!N_(b,k.current)},ie=u.useCallback(W=>K_(p,W),[p]),oe=u.useCallback(W=>W?!Pp(W,f,b).hasError:!Sb(f,b).hasErrors,[b,f]);return{values:b,errors:x,setValues:q,setErrors:E,setFieldValue:T,setFieldError:D,clearFieldError:A,clearErrors:O,reset:M,validate:V,validateField:L,reorderListItem:B,removeListItem:G,insertListItem:Y,getInputProps:X,onSubmit:z,onReset:ne,isDirty:Q,isTouched:ie,setTouched:h,setDirty:v,resetTouched:j,resetDirty:I,isValid:oe,getTransformedValues:K}}function mn(e){const{...t}=e,{base50:n,base100:r,base200:o,base300:s,base800:i,base700:c,base900:f,accent500:p,accent300:h}=Bd(),{colorMode:m}=ia();return a.jsx(hE,{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(c,s)(m),fontWeight:"normal",marginBottom:4}}),...t})}const Due=[{value:"sd-1",label:un["sd-1"]},{value:"sd-2",label:un["sd-2"]},{value:"sdxl",label:un.sdxl},{value:"sdxl-refiner",label:un["sdxl-refiner"]}];function Kd(e){const{...t}=e,{t:n}=we();return a.jsx($n,{label:n("modelManager.baseModel"),data:Due,...t})}function NM(e){const{data:t}=Jj(),{...n}=e;return a.jsx($n,{label:"Config File",placeholder:"Select A Config File",data:t||[],...n})}const Rue=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function Ig(e){const{...t}=e,{t:n}=we();return a.jsx($n,{label:n("modelManager.variant"),data:Rue,...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 TM(e){const{t}=we(),n=J(),{model_path:r}=e,o=sl({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]=e5(),[i,c]=u.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($,{flexDirection:"column",gap:2,children:[a.jsx(mn,{label:"Model Name",required:!0,...o.getInputProps("model_name")}),a.jsx(Kd,{...o.getInputProps("base_model")}),a.jsx(mn,{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(mn,{label:"Description",...o.getInputProps("description")}),a.jsx(mn,{label:"VAE Location",...o.getInputProps("vae")}),a.jsx(Ig,{...o.getInputProps("variant")}),a.jsxs($,{flexDirection:"column",width:"100%",gap:2,children:[i?a.jsx(mn,{required:!0,label:"Custom Config File Location",...o.getInputProps("config")}):a.jsx(NM,{required:!0,width:"100%",...o.getInputProps("config")}),a.jsx(ur,{isChecked:i,onChange:()=>c(!i),label:"Use Custom Config"}),a.jsx(it,{mt:2,type:"submit",children:t("modelManager.addModel")})]})]})})}function $M(e){const{t}=we(),n=J(),{model_path:r}=e,[o]=e5(),s=sl({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=c=>{o({body:c}).unwrap().then(f=>{n(Nt(zt({title:`Model Added: ${c.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(c=>i(c)),style:{width:"100%"},children:a.jsxs($,{flexDirection:"column",gap:2,children:[a.jsx(mn,{required:!0,label:"Model Name",...s.getInputProps("model_name")}),a.jsx(Kd,{...s.getInputProps("base_model")}),a.jsx(mn,{required:!0,label:"Model Location",placeholder:"Provide the path to a local folder where your Diffusers Model is stored",...s.getInputProps("path"),onBlur:c=>{if(s.values.model_name===""){const f=im(c.currentTarget.value,!1);f&&s.setFieldValue("model_name",f)}}}),a.jsx(mn,{label:"Description",...s.getInputProps("description")}),a.jsx(mn,{label:"VAE Location",...s.getInputProps("vae")}),a.jsx(Ig,{...s.getInputProps("variant")}),a.jsx(it,{mt:2,type:"submit",children:t("modelManager.addModel")})]})})}const LM=[{label:"Diffusers",value:"diffusers"},{label:"Checkpoint / Safetensors",value:"checkpoint"}];function Aue(){const[e,t]=u.useState("diffusers");return a.jsxs($,{flexDirection:"column",gap:4,width:"100%",children:[a.jsx($n,{label:"Model Type",value:e,data:LM,onChange:n=>{n&&t(n)}}),a.jsxs($,{sx:{p:4,borderRadius:4,bg:"base.300",_dark:{bg:"base.850"}},children:[e==="diffusers"&&a.jsx($M,{}),e==="checkpoint"&&a.jsx(TM,{})]})]})}const Nue=[{label:"None",value:"none"},{label:"v_prediction",value:"v_prediction"},{label:"epsilon",value:"epsilon"},{label:"sample",value:"sample"}];function Tue(){const e=J(),{t}=we(),n=F(c=>c.system.isProcessing),[r,{isLoading:o}]=t5(),s=sl({initialValues:{location:"",prediction_type:void 0}}),i=c=>{const f={location:c.location,prediction_type:c.prediction_type==="none"?void 0:c.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(c=>i(c)),style:{width:"100%"},children:a.jsxs($,{flexDirection:"column",width:"100%",gap:4,children:[a.jsx(mn,{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($n,{label:"Prediction Type (for Stable Diffusion 2.x Models only)",data:Nue,defaultValue:"none",...s.getInputProps("prediction_type")}),a.jsx(it,{type:"submit",isLoading:o,isDisabled:o||n,children:t("modelManager.addModel")})]})})}function $ue(){const[e,t]=u.useState("simple");return a.jsxs($,{flexDirection:"column",width:"100%",overflow:"scroll",maxHeight:window.innerHeight-250,gap:4,children:[a.jsxs(hn,{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($,{sx:{p:4,borderRadius:4,background:"base.200",_dark:{background:"base.800"}},children:[e==="simple"&&a.jsx(Tue,{}),e==="advanced"&&a.jsx(Aue,{})]})]})}function Lue(e){const{...t}=e;return a.jsx(iI,{w:"100%",...t,children:e.children})}function zue(){const e=F(x=>x.modelmanager.searchFolder),[t,n]=u.useState(""),{data:r}=Bo(Ci),{foundModels:o,alreadyInstalled:s,filteredModels:i}=n5({search_path:e||""},{selectFromResult:({data:x})=>{const w=xN(r==null?void 0:r.entities),k=rr(w,"path"),_=vN(x,k),j=kN(x,k);return{foundModels:x,alreadyInstalled:Y_(j,t),filteredModels:Y_(_,t)}}}),[c,{isLoading:f}]=t5(),p=J(),{t:h}=we(),m=u.useCallback(x=>{const w=x.currentTarget.id.split("\\").splice(-1)[0];c({body:{location:x.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,c]),v=u.useCallback(x=>{n(x.target.value)},[]),b=({models:x,showActions:w=!0})=>x.map(k=>a.jsxs($,{sx:{p:4,gap:4,alignItems:"center",borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs($,{w:"100%",sx:{flexDirection:"column",minW:"25%"},children:[a.jsx(xe,{sx:{fontWeight:600},children:k.split("\\").slice(-1)[0]}),a.jsx(xe,{sx:{fontSize:"sm",color:"base.600",_dark:{color:"base.400"}},children:k})]}),w?a.jsxs($,{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(xe,{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($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",height:96,userSelect:"none",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(xe,{variant:"subtext",children:"No Models Found"})}):a.jsxs($,{sx:{flexDirection:"column",gap:2,w:"100%",minW:"50%"},children:[a.jsx(ao,{onChange:v,label:h("modelManager.search"),labelPos:"side"}),a.jsxs($,{p:2,gap:2,children:[a.jsxs(xe,{sx:{fontWeight:600},children:["Models Found: ",o.length]}),a.jsxs(xe,{sx:{fontWeight:600,color:"accent.500",_dark:{color:"accent.200"}},children:["Not Installed: ",i.length]})]}),a.jsx(Lue,{offsetScrollbars:!0,children:a.jsxs($,{gap:2,flexDirection:"column",children:[b({models:i}),b({models:s,showActions:!1})]})})]}):null)()}const Y_=(e,t)=>{const n=[];return Tn(e,r=>{if(!r)return null;r.includes(t)&&n.push(r)}),n};function Fue(){const e=F(i=>i.modelmanager.advancedAddScanModel),[t,n]=u.useState("diffusers"),[r,o]=u.useState(!0);u.useEffect(()=>{e&&[".ckpt",".safetensors",".pth",".pt"].some(i=>e.endsWith(i))?n("checkpoint"):n("diffusers")},[e,n,r]);const s=J();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($,{justifyContent:"space-between",alignItems:"center",children:[a.jsx(xe,{size:"xl",fontWeight:600,children:r||t==="checkpoint"?"Add Checkpoint Model":"Add Diffusers Model"}),a.jsx(Te,{icon:a.jsx(LZ,{}),"aria-label":"Close Advanced",onClick:()=>s(Cd(null)),size:"sm"})]}),a.jsx($n,{label:"Model Type",value:t,data:LM,onChange:i=>{i&&(n(i),o(i==="checkpoint"))}}),r?a.jsx(TM,{model_path:e},e):a.jsx($M,{model_path:e},e)]}):null}function Bue(){const e=J(),{t}=we(),n=F(c=>c.modelmanager.searchFolder),{refetch:r}=n5({search_path:n||""}),o=sl({initialValues:{folder:""}}),s=u.useCallback(c=>{e(uw(c.folder))},[e]),i=()=>{r()};return a.jsx("form",{onSubmit:o.onSubmit(c=>s(c)),style:{width:"100%"},children:a.jsxs($,{sx:{w:"100%",gap:2,borderRadius:4,alignItems:"center"},children:[a.jsxs($,{w:"100%",alignItems:"center",gap:4,minH:12,children:[a.jsx(xe,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",minW:"max-content",_dark:{color:"base.300"}},children:"Folder"}),n?a.jsx($,{sx:{w:"100%",p:2,px:4,bg:"base.300",borderRadius:4,fontSize:"sm",fontWeight:"bold",_dark:{bg:"base.700"}},children:n}):a.jsx(ao,{w:"100%",size:"md",...o.getInputProps("folder")})]}),a.jsxs($,{gap:2,children:[n?a.jsx(Te,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:a.jsx(NE,{}),onClick:i,fontSize:18,size:"sm"}):a.jsx(Te,{"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),icon:a.jsx(AZ,{}),fontSize:18,size:"sm",type:"submit"}),a.jsx(Te,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:a.jsx(Hr,{}),size:"sm",onClick:()=>{e(uw(null)),e(Cd(null))},isDisabled:!n,colorScheme:"red"})]})]})})}const Hue=u.memo(Bue);function Vue(){return a.jsxs($,{flexDirection:"column",w:"100%",gap:4,children:[a.jsx(Hue,{}),a.jsxs($,{gap:4,children:[a.jsx($,{sx:{maxHeight:window.innerHeight-300,overflow:"scroll",gap:4,w:"100%"},children:a.jsx(zue,{})}),a.jsx(Fue,{})]})]})}function Wue(){const[e,t]=u.useState("add"),{t:n}=we();return a.jsxs($,{flexDirection:"column",gap:4,children:[a.jsxs(hn,{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($ue,{}),e=="scan"&&a.jsx(Vue,{})]})}const Uue=[{label:"Stable Diffusion 1",value:"sd-1"},{label:"Stable Diffusion 2",value:"sd-2"}];function Gue(){var L,X;const{t:e}=we(),t=J(),{data:n}=Bo(Ci),[r,{isLoading:o}]=aA(),[s,i]=u.useState("sd-1"),c=xw(n==null?void 0:n.entities,(z,K)=>(z==null?void 0:z.model_format)==="diffusers"&&(z==null?void 0:z.base_model)==="sd-1"),f=xw(n==null?void 0:n.entities,(z,K)=>(z==null?void 0:z.model_format)==="diffusers"&&(z==null?void 0:z.base_model)==="sd-2"),p=u.useMemo(()=>({"sd-1":c,"sd-2":f}),[c,f]),[h,m]=u.useState(((L=Object.keys(p[s]))==null?void 0:L[0])??null),[v,b]=u.useState(((X=Object.keys(p[s]))==null?void 0:X[1])??null),[y,x]=u.useState(null),[w,k]=u.useState(""),[_,j]=u.useState(.5),[I,E]=u.useState("weighted_sum"),[O,M]=u.useState("root"),[D,A]=u.useState(""),[R,T]=u.useState(!1),q=Object.keys(p[s]).filter(z=>z!==v&&z!==y),B=Object.keys(p[s]).filter(z=>z!==h&&z!==y),G=Object.keys(p[s]).filter(z=>z!==h&&z!==v),Y=z=>{i(z),m(null),b(null)},V=()=>{const z=[];let K=[h,v,y];K=K.filter(Q=>Q!==null),K.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:O==="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($,{flexDirection:"column",rowGap:4,children:[a.jsxs($,{sx:{flexDirection:"column",rowGap:1},children:[a.jsx(xe,{children:e("modelManager.modelMergeHeaderHelp1")}),a.jsx(xe,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),a.jsxs($,{columnGap:4,children:[a.jsx($n,{label:"Model Type",w:"100%",data:Uue,value:s,onChange:Y}),a.jsx(Gt,{label:e("modelManager.modelOne"),w:"100%",value:h,placeholder:e("modelManager.selectModel"),data:q,onChange:z=>m(z)}),a.jsx(Gt,{label:e("modelManager.modelTwo"),w:"100%",placeholder:e("modelManager.selectModel"),value:v,data:B,onChange:z=>b(z)}),a.jsx(Gt,{label:e("modelManager.modelThree"),data:G,w:"100%",placeholder:e("modelManager.selectModel"),clearable:!0,onChange:z=>{z?(x(z),E("weighted_sum")):(x(null),E("add_difference"))}})]}),a.jsx(ao,{label:e("modelManager.mergedModelName"),value:w,onChange:z=>k(z.target.value)}),a.jsxs($,{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(xe,{variant:"subtext",fontSize:"sm",children:e("modelManager.modelMergeAlphaHelp")})]}),a.jsxs($,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(xe,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),a.jsx(oh,{value:I,onChange:z=>E(z),children:a.jsx($,{columnGap:4,children:y===null?a.jsxs(a.Fragment,{children:[a.jsx(zs,{value:"weighted_sum",children:a.jsx(xe,{fontSize:"sm",children:e("modelManager.weightedSum")})}),a.jsx(zs,{value:"sigmoid",children:a.jsx(xe,{fontSize:"sm",children:e("modelManager.sigmoid")})}),a.jsx(zs,{value:"inv_sigmoid",children:a.jsx(xe,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):a.jsx(zs,{value:"add_difference",children:a.jsx(Dt,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:a.jsx(xe,{fontSize:"sm",children:e("modelManager.addDifference")})})})})})]}),a.jsxs($,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.900"}},children:[a.jsxs($,{columnGap:4,children:[a.jsx(xe,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:e("modelManager.mergedModelSaveLocation")}),a.jsx(oh,{value:O,onChange:z=>M(z),children:a.jsxs($,{columnGap:4,children:[a.jsx(zs,{value:"root",children:a.jsx(xe,{fontSize:"sm",children:e("modelManager.invokeAIFolder")})}),a.jsx(zs,{value:"custom",children:a.jsx(xe,{fontSize:"sm",children:e("modelManager.custom")})})]})})]}),O==="custom"&&a.jsx(ao,{label:e("modelManager.mergedModelCustomSaveLocation"),value:D,onChange:z=>A(z.target.value)})]}),a.jsx(ur,{label:e("modelManager.ignoreMismatch"),isChecked:R,onChange:z=>T(z.target.checked),fontWeight:"500"}),a.jsx(it,{onClick:V,isLoading:o,isDisabled:h===null||v===null,children:e("modelManager.merge")})]})}const Kue=Pe((e,t)=>{const{t:n}=we(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:i,children:c,title:f,triggerComponent:p}=e,{isOpen:h,onOpen:m,onClose:v}=Ir(),b=u.useRef(null),y=()=>{o(),v()},x=()=>{i&&i(),v()};return a.jsxs(a.Fragment,{children:[u.cloneElement(p,{onClick:m,ref:t}),a.jsx(Ad,{isOpen:h,leastDestructiveRef:b,onClose:v,isCentered:!0,children:a.jsx(Vo,{children:a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:f}),a.jsx(Wo,{children:c}),a.jsxs(gs,{children:[a.jsx(it,{ref:b,onClick:x,children:s}),a.jsx(it,{colorScheme:"error",onClick:y,ml:3,children:r})]})]})})})]})}),By=u.memo(Kue);function que(e){const{model:t}=e,n=J(),{t:r}=we(),[o,{isLoading:s}]=iA(),[i,c]=u.useState("InvokeAIRoot"),[f,p]=u.useState("");u.useEffect(()=>{c("InvokeAIRoot")},[t]);const h=()=>{c("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(By,{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($,{flexDirection:"column",rowGap:4,children:[a.jsx(xe,{children:r("modelManager.convertToDiffusersHelpText1")}),a.jsxs(Id,{children:[a.jsx(Ao,{children:r("modelManager.convertToDiffusersHelpText2")}),a.jsx(Ao,{children:r("modelManager.convertToDiffusersHelpText3")}),a.jsx(Ao,{children:r("modelManager.convertToDiffusersHelpText4")}),a.jsx(Ao,{children:r("modelManager.convertToDiffusersHelpText5")})]}),a.jsx(xe,{children:r("modelManager.convertToDiffusersHelpText6")})]}),a.jsxs($,{flexDir:"column",gap:2,children:[a.jsxs($,{marginTop:4,flexDir:"column",gap:2,children:[a.jsx(xe,{fontWeight:"600",children:r("modelManager.convertToDiffusersSaveLocation")}),a.jsx(oh,{value:i,onChange:v=>c(v),children:a.jsxs($,{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($,{flexDirection:"column",rowGap:2,children:[a.jsx(xe,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:r("modelManager.customSaveLocation")}),a.jsx(ao,{value:f,onChange:v=>{p(v.target.value)},width:"full"})]})]})]})}function Xue(e){const t=F(Pn),{model:n}=e,[r,{isLoading:o}]=r5(),{data:s}=Jj(),[i,c]=u.useState(!1);u.useEffect(()=>{s!=null&&s.includes(n.config)||c(!0)},[s,n.config]);const f=J(),{t:p}=we(),h=sl({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=u.useCallback(v=>{const b={base_model:n.base_model,model_name:n.model_name,body:v};r(b).unwrap().then(y=>{h.setValues(y),f(Nt(zt({title:p("modelManager.modelUpdated"),status:"success"})))}).catch(y=>{h.reset(),f(Nt(zt({title:p("modelManager.modelUpdateFailed"),status:"error"})))})},[h,f,n.base_model,n.model_name,p,r]);return a.jsxs($,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs($,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs($,{flexDirection:"column",children:[a.jsx(xe,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(xe,{fontSize:"sm",color:"base.400",children:[un[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(que,{model:n})]}),a.jsx(zr,{}),a.jsx($,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",children:a.jsx("form",{onSubmit:h.onSubmit(v=>m(v)),children:a.jsxs($,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(mn,{label:p("modelManager.name"),...h.getInputProps("model_name")}),a.jsx(mn,{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(mn,{required:!0,label:p("modelManager.modelLocation"),...h.getInputProps("path")}),a.jsx(mn,{label:p("modelManager.vaeLocation"),...h.getInputProps("vae")}),a.jsxs($,{flexDirection:"column",gap:2,children:[i?a.jsx(mn,{required:!0,label:p("modelManager.config"),...h.getInputProps("config")}):a.jsx(NM,{required:!0,...h.getInputProps("config")}),a.jsx(ur,{isChecked:i,onChange:()=>c(!i),label:"Use Custom Config"})]}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:p("modelManager.updateModel")})]})})})]})}function Yue(e){const t=F(Pn),{model:n}=e,[r,{isLoading:o}]=r5(),s=J(),{t:i}=we(),c=sl({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=u.useCallback(p=>{const h={base_model:n.base_model,model_name:n.model_name,body:p};r(h).unwrap().then(m=>{c.setValues(m),s(Nt(zt({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{c.reset(),s(Nt(zt({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[c,s,n.base_model,n.model_name,i,r]);return a.jsxs($,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs($,{flexDirection:"column",children:[a.jsx(xe,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(xe,{fontSize:"sm",color:"base.400",children:[un[n.base_model]," Model"]})]}),a.jsx(zr,{}),a.jsx("form",{onSubmit:c.onSubmit(p=>f(p)),children:a.jsxs($,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(mn,{label:i("modelManager.name"),...c.getInputProps("model_name")}),a.jsx(mn,{label:i("modelManager.description"),...c.getInputProps("description")}),a.jsx(Kd,{required:!0,...c.getInputProps("base_model")}),a.jsx(Ig,{required:!0,...c.getInputProps("variant")}),a.jsx(mn,{required:!0,label:i("modelManager.modelLocation"),...c.getInputProps("path")}),a.jsx(mn,{label:i("modelManager.vaeLocation"),...c.getInputProps("vae")}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})]})}function Que(e){const t=F(Pn),{model:n}=e,[r,{isLoading:o}]=lA(),s=J(),{t:i}=we(),c=sl({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=u.useCallback(p=>{const h={base_model:n.base_model,model_name:n.model_name,body:p};r(h).unwrap().then(m=>{c.setValues(m),s(Nt(zt({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{c.reset(),s(Nt(zt({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[s,c,n.base_model,n.model_name,i,r]);return a.jsxs($,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs($,{flexDirection:"column",children:[a.jsx(xe,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(xe,{fontSize:"sm",color:"base.400",children:[un[n.base_model]," Model ⋅"," ",cA[n.model_format]," format"]})]}),a.jsx(zr,{}),a.jsx("form",{onSubmit:c.onSubmit(p=>f(p)),children:a.jsxs($,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(mn,{label:i("modelManager.name"),...c.getInputProps("model_name")}),a.jsx(mn,{label:i("modelManager.description"),...c.getInputProps("description")}),a.jsx(Kd,{...c.getInputProps("base_model")}),a.jsx(mn,{label:i("modelManager.modelLocation"),...c.getInputProps("path")}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})]})}function Zue(e){const t=F(Pn),{t:n}=we(),r=J(),[o]=uA(),[s]=dA(),{model:i,isSelected:c,setSelectedModelId:f}=e,p=u.useCallback(()=>{f(i.id)},[i.id,f]),h=u.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($,{sx:{gap:2,alignItems:"center",w:"full"},children:[a.jsx($,{as:it,isChecked:c,sx:{justifyContent:"start",p:2,borderRadius:"base",w:"full",alignItems:"center",bg:c?"accent.400":"base.100",color:c?"base.50":"base.800",_hover:{bg:c?"accent.500":"base.300",color:c?"base.50":"base.800"},_dark:{color:c?"base.50":"base.100",bg:c?"accent.600":"base.850",_hover:{color:c?"base.50":"base.100",bg:c?"accent.550":"base.700"}}},onClick:p,children:a.jsxs($,{gap:4,alignItems:"center",children:[a.jsx(ua,{minWidth:14,p:.5,fontSize:"sm",variant:"solid",children:fA[i.base_model]}),a.jsx(Dt,{label:i.description,hasArrow:!0,placement:"bottom",children:a.jsx(xe,{sx:{fontWeight:500},children:i.model_name})})]})}),a.jsx(By,{title:n("modelManager.deleteModel"),acceptCallback:h,acceptButtonText:n("modelManager.delete"),triggerComponent:a.jsx(Te,{icon:a.jsx(Hee,{}),"aria-label":n("modelManager.deleteConfig"),isDisabled:t,colorScheme:"error"}),children:a.jsxs($,{rowGap:4,flexDirection:"column",children:[a.jsx("p",{style:{fontWeight:"bold"},children:n("modelManager.deleteMsg1")}),a.jsx("p",{children:n("modelManager.deleteMsg2")})]})})]})}const Jue=e=>{const{selectedModelId:t,setSelectedModelId:n}=e,{t:r}=we(),[o,s]=u.useState(""),[i,c]=u.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:b}=vm(void 0,{selectFromResult:({data:j,isLoading:I})=>({filteredLoraModels:ju(j,"lora",void 0,o),isLoadingLoraModels:I})}),{filteredOnnxModels:y,isLoadingOnnxModels:x}=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})}),_=u.useCallback(j=>{s(j.target.value)},[]);return a.jsx($,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:a.jsxs($,{flexDirection:"column",gap:4,paddingInlineEnd:4,children:[a.jsxs(hn,{isAttached:!0,children:[a.jsx(it,{onClick:()=>c("all"),isChecked:i==="all",size:"sm",children:r("modelManager.allModels")}),a.jsx(it,{size:"sm",onClick:()=>c("diffusers"),isChecked:i==="diffusers",children:r("modelManager.diffusersModels")}),a.jsx(it,{size:"sm",onClick:()=>c("checkpoint"),isChecked:i==="checkpoint",children:r("modelManager.checkpointModels")}),a.jsx(it,{size:"sm",onClick:()=>c("onnx"),isChecked:i==="onnx",children:r("modelManager.onnxModels")}),a.jsx(it,{size:"sm",onClick:()=>c("olive"),isChecked:i==="olive",children:r("modelManager.oliveModels")}),a.jsx(it,{size:"sm",onClick:()=>c("lora"),isChecked:i==="lora",children:r("modelManager.loraModels")})]}),a.jsx(ao,{onChange:_,label:r("modelManager.search"),labelPos:"side"}),a.jsxs($,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-280,overflow:"scroll",children:[p&&a.jsx(Hl,{loadingMessage:"Loading Diffusers..."}),["all","diffusers"].includes(i)&&!p&&f.length>0&&a.jsx(Bl,{title:"Diffusers",modelList:f,selected:{selectedModelId:t,setSelectedModelId:n}},"diffusers"),m&&a.jsx(Hl,{loadingMessage:"Loading Checkpoints..."}),["all","checkpoint"].includes(i)&&!m&&h.length>0&&a.jsx(Bl,{title:"Checkpoints",modelList:h,selected:{selectedModelId:t,setSelectedModelId:n}},"checkpoints"),b&&a.jsx(Hl,{loadingMessage:"Loading LoRAs..."}),["all","lora"].includes(i)&&!b&&v.length>0&&a.jsx(Bl,{title:"LoRAs",modelList:v,selected:{selectedModelId:t,setSelectedModelId:n}},"loras"),k&&a.jsx(Hl,{loadingMessage:"Loading Olives..."}),["all","olive"].includes(i)&&!k&&w.length>0&&a.jsx(Bl,{title:"Olives",modelList:w,selected:{selectedModelId:t,setSelectedModelId:n}},"olive"),x&&a.jsx(Hl,{loadingMessage:"Loading ONNX..."}),["all","onnx"].includes(i)&&!x&&y.length>0&&a.jsx(Bl,{title:"ONNX",modelList:y,selected:{selectedModelId:t,setSelectedModelId:n}},"onnx")]})]})})},ede=u.memo(Jue),ju=(e,t,n,r)=>{const o=[];return Tn(e==null?void 0:e.entities,s=>{if(!s)return;const i=s.model_name.toLowerCase().includes(r.toLowerCase()),c=n===void 0||s.model_format===n,f=s.model_type===t;i&&c&&f&&o.push(s)}),o},Hy=u.memo(e=>a.jsx($,{flexDirection:"column",gap:4,borderRadius:4,p:4,sx:{bg:"base.200",_dark:{bg:"base.800"}},children:e.children}));Hy.displayName="StyledModelContainer";const Bl=u.memo(e=>{const{title:t,modelList:n,selected:r}=e;return a.jsx(Hy,{children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(xe,{variant:"subtext",fontSize:"sm",children:t}),n.map(o=>a.jsx(Zue,{model:o,isSelected:r.selectedModelId===o.id,setSelectedModelId:r.setSelectedModelId},o.id))]})})});Bl.displayName="ModelListWrapper";const Hl=u.memo(({loadingMessage:e})=>a.jsx(Hy,{children:a.jsxs($,{justifyContent:"center",alignItems:"center",flexDirection:"column",p:4,gap:8,children:[a.jsx(Ki,{}),a.jsx(xe,{variant:"subtext",children:e||"Fetching..."})]})}));Hl.displayName="FetchingModelsLoader";function tde(){const[e,t]=u.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($,{sx:{gap:8,w:"full",h:"full"},children:[a.jsx(ede,{selectedModelId:e,setSelectedModelId:t}),a.jsx(nde,{model:o})]})}const nde=e=>{const{model:t}=e;return(t==null?void 0:t.model_format)==="checkpoint"?a.jsx(Xue,{model:t},t.id):(t==null?void 0:t.model_format)==="diffusers"?a.jsx(Yue,{model:t},t.id):(t==null?void 0:t.model_type)==="lora"?a.jsx(Que,{model:t},t.id):a.jsx($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",maxH:96,userSelect:"none"},children:a.jsx(xe,{variant:"subtext",children:"No Model Selected"})})};function rde(){const{t:e}=we();return a.jsxs($,{sx:{w:"full",p:4,borderRadius:4,gap:4,justifyContent:"space-between",alignItems:"center",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsx(xe,{sx:{fontWeight:600},children:e("modelManager.syncModels")}),a.jsx(xe,{fontSize:"sm",sx:{_dark:{color:"base.400"}},children:e("modelManager.syncModelsDesc")})]}),a.jsx(Wc,{})]})}function ode(){return a.jsx($,{children:a.jsx(rde,{})})}const Q_=[{id:"modelManager",label:xn.t("modelManager.modelManager"),content:a.jsx(tde,{})},{id:"importModels",label:xn.t("modelManager.importModels"),content:a.jsx(Wue,{})},{id:"mergeModels",label:xn.t("modelManager.mergeModels"),content:a.jsx(Gue,{})},{id:"settings",label:xn.t("modelManager.settings"),content:a.jsx(ode,{})}],sde=()=>a.jsxs(Qi,{isLazy:!0,variant:"line",layerStyle:"first",sx:{w:"full",h:"full",p:4,gap:4,borderRadius:"base"},children:[a.jsx(Zi,{children:Q_.map(e=>a.jsx(jr,{sx:{borderTopRadius:"base"},children:e.label},e.id))}),a.jsx(zc,{sx:{w:"full",h:"full"},children:Q_.map(e=>a.jsx(uo,{sx:{w:"full",h:"full"},children:e.content},e.id))})]}),ade=u.memo(sde),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,IPAdapterField:void 0,IPAdapterModelField:void 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},ide=(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},lde=ae([e=>e.nodes],e=>e.nodeTemplates),Kv={dragHandle:`.${Yi}`},cde=()=>{const e=F(lde),t=Kb();return u.useCallback(n=>{var b;const r=Fa();let o=window.innerWidth/2,s=window.innerHeight/2;const i=(b=document.querySelector("#workflow-editor"))==null?void 0:b.getBoundingClientRect();i&&(o=i.width/2-c1/2,s=i.height/2-c1/2);const{x:c,y:f}=t.project({x:o,y:s});if(n==="current_image")return{...Kv,id:r,type:"current_image",position:{x:c,y:f},data:{id:r,type:"current_image",isOpen:!0,label:"Current Image"}};if(n==="notes")return{...Kv,id:r,type:"notes",position:{x:c,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=dw(p.inputs,(y,x,w)=>{const k=Fa(),_=ide(k,x);return y[w]=_,y},{}),m=dw(p.outputs,(y,x,w)=>{const _={id:Fa(),name:w,type:x.type,fieldKind:"output"};return y[w]=_,y},{});return{...Kv,id:r,type:"invocation",position:{x:c,y:f},data:{id:r,type:n,version:p.version,label:"",notes:"",isOpen:!0,embedWorkflow:!1,isIntermediate:!0,inputs:h,outputs:m}}},[e,t])},zM=u.forwardRef(({label:e,description:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs("div",{children:[a.jsx(xe,{fontWeight:600,children:e}),a.jsx(xe,{size:"xs",sx:{color:"base.600",_dark:{color:"base.500"}},children:t})]})}));zM.displayName="AddNodePopoverSelectItem";const ude=(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))},dde=ae([be],({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),fde=()=>{const e=J(),t=cde(),n=Ji(),{data:r}=F(dde),o=F(v=>v.nodes.isAddNodePopoverOpen),s=u.useRef(null),i=u.useCallback(v=>{const b=t(v);if(!b){n({status:"error",title:`Unknown Invocation type ${v}`});return}e(pA(b))},[e,t,n]),c=u.useCallback(v=>{v&&i(v)},[i]),f=u.useCallback(()=>{e(hA())},[e]),p=u.useCallback(()=>{e(o5())},[e]),h=u.useCallback(v=>{v.preventDefault(),p(),setTimeout(()=>{var b;(b=s.current)==null||b.focus()},0)},[p]),m=u.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(iP,{children:a.jsx($,{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(Rx,{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:zM,filter:ude,onChange:c,hoverOnSearchChange:!0,onDropdownClose:f,sx:{width:"32rem",input:{padding:"0.5rem"}}})})})]})},pde=u.memo(fde);var hde="\0",gi="\0",Z_="",Cr,Si,Nr,fd,dc,fc,to,as,Na,is,Ta,Fs,Bs,pc,hc,Hs,Io,pd,kb,gj;let mde=(gj=class{constructor(t){Jt(this,pd);Jt(this,Cr,!0);Jt(this,Si,!1);Jt(this,Nr,!1);Jt(this,fd,void 0);Jt(this,dc,()=>{});Jt(this,fc,()=>{});Jt(this,to,{});Jt(this,as,{});Jt(this,Na,{});Jt(this,is,{});Jt(this,Ta,{});Jt(this,Fs,{});Jt(this,Bs,{});Jt(this,pc,0);Jt(this,hc,0);Jt(this,Hs,void 0);Jt(this,Io,void 0);t&&(Zr(this,Cr,t.hasOwnProperty("directed")?t.directed:!0),Zr(this,Si,t.hasOwnProperty("multigraph")?t.multigraph:!1),Zr(this,Nr,t.hasOwnProperty("compound")?t.compound:!1)),Se(this,Nr)&&(Zr(this,Hs,{}),Zr(this,Io,{}),Se(this,Io)[gi]={})}isDirected(){return Se(this,Cr)}isMultigraph(){return Se(this,Si)}isCompound(){return Se(this,Nr)}setGraph(t){return Zr(this,fd,t),this}graph(){return Se(this,fd)}setDefaultNodeLabel(t){return Zr(this,dc,t),typeof t!="function"&&Zr(this,dc,()=>t),this}nodeCount(){return Se(this,pc)}nodes(){return Object.keys(Se(this,to))}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,to).hasOwnProperty(t)?(arguments.length>1&&(Se(this,to)[t]=n),this):(Se(this,to)[t]=arguments.length>1?n:Se(this,dc).call(this,t),Se(this,Nr)&&(Se(this,Hs)[t]=gi,Se(this,Io)[t]={},Se(this,Io)[gi][t]=!0),Se(this,as)[t]={},Se(this,Na)[t]={},Se(this,is)[t]={},Se(this,Ta)[t]={},++vu(this,pc)._,this)}node(t){return Se(this,to)[t]}hasNode(t){return Se(this,to).hasOwnProperty(t)}removeNode(t){var n=this;if(Se(this,to).hasOwnProperty(t)){var r=o=>n.removeEdge(Se(n,Fs)[o]);delete Se(this,to)[t],Se(this,Nr)&&(os(this,pd,kb).call(this,t),delete Se(this,Hs)[t],this.children(t).forEach(function(o){n.setParent(o)}),delete Se(this,Io)[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,pc)._}return this}setParent(t,n){if(!Se(this,Nr))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,kb).call(this,t),Se(this,Hs)[t]=n,Se(this,Io)[n][t]=!0,this}parent(t){if(Se(this,Nr)){var n=Se(this,Hs)[t];if(n!==gi)return n}}children(t=gi){if(Se(this,Nr)){var n=Se(this,Io)[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,Cr),multigraph:Se(this,Si),compound:Se(this,Nr)});n.setGraph(this.graph());var r=this;Object.entries(Se(this,to)).forEach(function([i,c]){t(i)&&n.setNode(i,c)}),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 c=r.parent(i);return c===void 0||n.hasNode(c)?(o[i]=c,c):c in o?o[c]:s(c)}return Se(this,Nr)&&n.nodes().forEach(i=>n.setParent(i,s(i))),n}setDefaultEdgeLabel(t){return Zr(this,fc,t),typeof t!="function"&&Zr(this,fc,()=>t),this}edgeCount(){return Se(this,hc)}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 c=Nu(Se(this,Cr),t,n,r);if(Se(this,Bs).hasOwnProperty(c))return s&&(Se(this,Bs)[c]=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)[c]=s?o:Se(this,fc).call(this,t,n,r);var f=gde(Se(this,Cr),t,n,r);return t=f.v,n=f.w,Object.freeze(f),Se(this,Fs)[c]=f,J_(Se(this,Na)[n],t),J_(Se(this,Ta)[t],n),Se(this,as)[n][c]=f,Se(this,is)[t][c]=f,vu(this,hc)._++,this}edge(t,n,r){var o=arguments.length===1?qv(Se(this,Cr),arguments[0]):Nu(Se(this,Cr),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,Cr),arguments[0]):Nu(Se(this,Cr),t,n,r);return Se(this,Bs).hasOwnProperty(o)}removeEdge(t,n,r){var o=arguments.length===1?qv(Se(this,Cr),arguments[0]):Nu(Se(this,Cr),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],ej(Se(this,Na)[n],t),ej(Se(this,Ta)[t],n),delete Se(this,as)[n][o],delete Se(this,is)[t][o],vu(this,hc)._--),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))}},Cr=new WeakMap,Si=new WeakMap,Nr=new WeakMap,fd=new WeakMap,dc=new WeakMap,fc=new WeakMap,to=new WeakMap,as=new WeakMap,Na=new WeakMap,is=new WeakMap,Ta=new WeakMap,Fs=new WeakMap,Bs=new WeakMap,pc=new WeakMap,hc=new WeakMap,Hs=new WeakMap,Io=new WeakMap,pd=new WeakSet,kb=function(t){delete Se(this,Io)[Se(this,Hs)[t]][t]},gj);function J_(e,t){e[t]?e[t]++:e[t]=1}function ej(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+Z_+s+Z_+(r===void 0?hde:r)}function gde(e,t,n,r){var o=""+t,s=""+n;if(!e&&o>s){var i=o;o=s,s=i}var c={v:o,w:s};return r&&(c.name=r),c}function qv(e,t){return Nu(e,t.v,t.w,t.name)}var Vy=mde,vde="2.1.13",bde={Graph:Vy,version:vde},xde=Vy,yde={write:Cde,read:kde};function Cde(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:wde(e),edges:Sde(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function wde(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 Sde(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 kde(e){var t=new xde(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 _de=jde;function jde(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,Vs,hd,_b,md,jb,mc,Fp,vj;let Pde=(vj=class{constructor(){Jt(this,hd);Jt(this,md);Jt(this,mc);Jt(this,Zn,[]);Jt(this,Vs,{})}size(){return Se(this,Zn).length}keys(){return Se(this,Zn).map(function(t){return t.key})}has(t){return Se(this,Vs).hasOwnProperty(t)}priority(t){var n=Se(this,Vs)[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,Vs);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,jb).call(this,s),!0}return!1}removeMin(){os(this,mc,Fp).call(this,0,Se(this,Zn).length-1);var t=Se(this,Zn).pop();return delete Se(this,Vs)[t.key],os(this,hd,_b).call(this,0),t.key}decrease(t,n){var r=Se(this,Vs)[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,jb).call(this,r)}},Zn=new WeakMap,Vs=new WeakMap,hd=new WeakSet,_b=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,mc,Fp).call(this,t,s),os(this,hd,_b).call(this,s)))},md=new WeakSet,jb=function(t){for(var n=Se(this,Zn),r=n[t].priority,o;t!==0&&(o=t>>1,!(n[o].priority<r));)os(this,mc,Fp).call(this,t,o),t=o},mc=new WeakSet,Fp=function(t,n){var r=Se(this,Zn),o=Se(this,Vs),s=r[t],i=r[n];r[t]=i,r[n]=s,o[i.key]=t,o[s.key]=n},vj);var FM=Pde,Ide=FM,BM=Ode,Ede=()=>1;function Ode(e,t,n,r){return Mde(e,String(t),n||Ede,r||function(o){return e.outEdges(o)})}function Mde(e,t,n,r){var o={},s=new Ide,i,c,f=function(p){var h=p.v!==i?p.v:p.w,m=o[h],v=n(p),b=c.distance+v;if(v<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+v);b<m.distance&&(m.distance=b,m.predecessor=i,s.decrease(h,b))};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(),c=o[i],c.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(f);return o}var Dde=BM,Rde=Ade;function Ade(e,t,n){return e.nodes().reduce(function(r,o){return r[o]=Dde(e,o,t,n),r},{})}var HM=Nde;function Nde(e){var t=0,n=[],r={},o=[];function s(i){var c=r[i]={onStack:!0,lowlink:t,index:t++};if(n.push(i),e.successors(i).forEach(function(h){r.hasOwnProperty(h)?r[h].onStack&&(c.lowlink=Math.min(c.lowlink,r[h].index)):(s(h),c.lowlink=Math.min(c.lowlink,r[h].lowlink))}),c.lowlink===c.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 Tde=HM,$de=Lde;function Lde(e){return Tde(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var zde=Bde,Fde=()=>1;function Bde(e,t,n){return Hde(e,t||Fde,n||function(r){return e.outEdges(r)})}function Hde(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 c=i.v===s?i.w:i.v,f=t(i);r[s][c]={distance:f,predecessor:s}})}),o.forEach(function(s){var i=r[s];o.forEach(function(c){var f=r[c];o.forEach(function(p){var h=f[s],m=i[p],v=f[p],b=h.distance+m.distance;b<v.distance&&(v.distance=b,v.predecessor=m.predecessor)})})}),r}function VM(e){var t={},n={},r=[];function o(s){if(n.hasOwnProperty(s))throw new Pb;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 Pb;return r}class Pb extends Error{constructor(){super(...arguments)}}var WM=VM;VM.CycleException=Pb;var tj=WM,Vde=Wde;function Wde(e){try{tj(e)}catch(t){if(t instanceof tj.CycleException)return!1;throw t}return!0}var UM=Ude;function Ude(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?c=>e.successors(c):c=>e.neighbors(c),o=n==="post"?Gde:Kde,s=[],i={};return t.forEach(c=>{if(!e.hasNode(c))throw new Error("Graph does not have node: "+c);o(c,r,i,s)}),s}function Gde(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]),GM(t(s[0]),i=>o.push([i,!1])))}}function Kde(e,t,n,r){for(var o=[e];o.length>0;){var s=o.pop();n.hasOwnProperty(s)||(n[s]=!0,r.push(s),GM(t(s),i=>o.push(i)))}}function GM(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var qde=UM,Xde=Yde;function Yde(e,t){return qde(e,t,"post")}var Qde=UM,Zde=Jde;function Jde(e,t){return Qde(e,t,"pre")}var efe=Vy,tfe=FM,nfe=rfe;function rfe(e,t){var n=new efe,r={},o=new tfe,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 c=!1;o.size()>0;){if(s=o.removeMin(),r.hasOwnProperty(s))n.setEdge(s,r[s]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(s).forEach(i)}return n}var ofe={components:_de,dijkstra:BM,dijkstraAll:Rde,findCycles:$de,floydWarshall:zde,isAcyclic:Vde,postorder:Xde,preorder:Zde,prim:nfe,tarjan:HM,topsort:WM},nj=bde,sfe={Graph:nj.Graph,json:yde,alg:ofe,version:nj.version};const rj=Dc(sfe),afe=()=>{const e=Kb(),t=F(r=>r.nodes.shouldValidateGraph);return u.useCallback(({source:r,sourceHandle:o,target:s,targetHandle:i})=>{var b,y;if(!t)return!0;const c=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=(b=p.data.outputs[o])==null?void 0:b.type,v=(y=h.data.inputs[i])==null?void 0:y.type;if(!m||!v||c.filter(x=>x.target===s&&x.targetHandle===i).find(x=>{x.source===r&&x.sourceHandle})||c.find(x=>x.target===s&&x.targetHandle===i)&&v!=="CollectionItem")return!1;if(m!==v){const x=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 E=s5[v],O=a5[E];return m===E||m===O})(),_=m==="Collection"&&(Us.includes(v)||Gs.includes(v)),j=v==="Collection"&&Us.includes(m);return x||w||k||_||j||m==="integer"&&v==="float"}return KM(r,s,f,c)},[e,t])},KM=(e,t,n,r)=>{const o=new rj.Graph;return n.forEach(s=>{o.setNode(s.id)}),r.forEach(s=>{o.setEdge(s.source,s.target)}),o.setEdge(e,t),rj.alg.isAcyclic(o)},ud=e=>`var(--invokeai-colors-${e.split(".").join("-")})`,ife=ae(be,({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}}),lfe=({fromX:e,fromY:t,fromPosition:n,toX:r,toY:o,toPosition:s})=>{const{stroke:i,className:c}=F(ife),f={sourceX:e,sourceY:t,sourcePosition:n,targetX:r,targetY:o,targetPosition:s},[p]=qb(f);return a.jsx("g",{children:a.jsx("path",{fill:"none",stroke:i,strokeWidth:2,className:c,d:p,style:{opacity:.8}})})},cfe=u.memo(lfe),qM=(e,t,n,r,o)=>ae(be,({nodes:s})=>{var v,b;const i=s.nodes.find(y=>y.id===e),c=s.nodes.find(y=>y.id===n),f=Cn(i)&&Cn(c),p=(i==null?void 0:i.selected)||(c==null?void 0:c.selected)||o,h=f?(b=(v=i==null?void 0:i.data)==null?void 0:v.outputs[t||""])==null?void 0:b.type:void 0,m=h&&s.shouldColorEdges?ud(yd[h].color):ud("base.500");return{isSelected:p,shouldAnimate:s.shouldAnimateEdges&&p,stroke:m}},Ce),ufe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,data:c,selected:f,source:p,target:h,sourceHandleId:m,targetHandleId:v})=>{const b=u.useMemo(()=>qM(p,m,h,v,f),[f,p,m,h,v]),{isSelected:y,shouldAnimate:x}=F(b),[w,k,_]=qb({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s}),{base500:j}=Bd();return a.jsxs(a.Fragment,{children:[a.jsx(i5,{path:w,markerEnd:i,style:{strokeWidth:y?3:2,stroke:j,opacity:y?.8:.5,animation:x?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:x?5:"none"}}),(c==null?void 0:c.count)&&c.count>1&&a.jsx(mA,{children:a.jsx($,{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:y?.8:.5,boxShadow:"base"},children:c.count})})})]})},dfe=u.memo(ufe),ffe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,selected:c,source:f,target:p,sourceHandleId:h,targetHandleId:m})=>{const v=u.useMemo(()=>qM(f,h,p,m,c),[f,h,p,m,c]),{isSelected:b,shouldAnimate:y,stroke:x}=F(v),[w]=qb({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s});return a.jsx(i5,{path:w,markerEnd:i,style:{strokeWidth:b?3:2,stroke:x,opacity:b?.8:.5,animation:y?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:y?5:"none"}})},pfe=u.memo(ffe),hfe=e=>{const{nodeId:t,width:n,children:r,selected:o}=e,{isMouseOverNode:s,handleMouseOut:i,handleMouseOver:c}=nM(t),f=u.useMemo(()=>ae(be,({nodes:_})=>{var j;return((j=_.nodeExecutionStates[t])==null?void 0:j.status)===Ks.IN_PROGRESS}),[t]),p=F(f),[h,m,v,b]=ds("shadows",["nodeInProgress.light","nodeInProgress.dark","shadows.xl","shadows.base"]),y=J(),x=Ti(h,m),w=F(_=>_.nodes.nodeOpacity),k=u.useCallback(_=>{!_.ctrlKey&&!_.altKey&&!_.metaKey&&!_.shiftKey&&y(gA(t)),y(l5())},[y,t]);return a.jsxs(Ie,{onClick:k,onMouseEnter:c,onMouseLeave:i,className:Yi,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}, ${b}, ${b}`,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?x:void 0,zIndex:-1}}),r,a.jsx(tM,{isSelected:o,isHovered:s})]})},Eg=u.memo(hfe),mfe=ae(be,({system:e,gallery:t})=>({imageDTO:t.selection[t.selection.length-1],progressImage:e.progressImage})),gfe=e=>{const{progressImage:t,imageDTO:n}=vA(mfe);return t?a.jsx(Xv,{nodeProps:e,children:a.jsx(Xi,{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,{})})},vfe=u.memo(gfe),Xv=e=>{const[t,n]=u.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($,{onMouseEnter:r,onMouseLeave:o,className:Yi,sx:{position:"relative",flexDirection:"column"},children:[a.jsx($,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",alignItems:"center",justifyContent:"center",h:8},children:a.jsx(xe,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",_dark:{color:"base.200"}},children:"Current Image"})}),a.jsxs($,{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(MM,{})},"nextPrevButtons")]})]})})},bfe=e=>{const t=u.useMemo(()=>ae(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.embedWorkflow:!1},Ce),[e]);return F(t)},XM=e=>{const t=u.useMemo(()=>ae(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?Do(o.data.outputs,s=>bA.includes(s.type)):!1},Ce),[e]);return F(t)},xfe=({nodeId:e})=>{const t=J(),n=XM(e),r=bfe(e),o=u.useCallback(s=>{t(xA({nodeId:e,embedWorkflow:s.target.checked}))},[t,e]);return n?a.jsxs(dn,{as:$,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},yfe=u.memo(xfe),Cfe=e=>{const t=u.useMemo(()=>ae(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.isIntermediate:!1},Ce),[e]);return F(t)},wfe=({nodeId:e})=>{const t=J(),n=XM(e),r=Cfe(e),o=u.useCallback(s=>{t(yA({nodeId:e,isIntermediate:!s.target.checked}))},[t,e]);return n?a.jsxs(dn,{as:$,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},Sfe=u.memo(wfe),kfe=({nodeId:e})=>a.jsxs($,{className:Yi,layerStyle:"nodeFooter",sx:{w:"full",borderBottomRadius:"base",px:2,py:0,h:6,justifyContent:"space-between"},children:[a.jsx(yfe,{nodeId:e}),a.jsx(Sfe,{nodeId:e})]}),_fe=u.memo(kfe),jfe=({nodeId:e,isOpen:t})=>{const n=J(),r=CA(),o=u.useCallback(()=>{n(wA({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"}})})},Wy=u.memo(jfe),YM=e=>{const t=u.useMemo(()=>ae(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.label:!1},Ce),[e]);return F(t)},QM=e=>{const t=u.useMemo(()=>ae(be,({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)},Pfe=({nodeId:e,title:t})=>{const n=J(),r=YM(e),o=QM(e),[s,i]=u.useState(""),c=u.useCallback(async p=>{n(SA({nodeId:e,label:p})),i(p||t||o||"Problem Setting Title")},[n,e,t,o]),f=u.useCallback(p=>{i(p)},[]);return u.useEffect(()=>{i(r||t||o||"Problem Setting Title")},[r,o,t]),a.jsx($,{sx:{overflow:"hidden",w:"full",h:"full",alignItems:"center",justifyContent:"center",cursor:"text"},children:a.jsxs(km,{as:$,value:s,onChange:f,onSubmit:c,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(Ife,{})]})})},ZM=u.memo(Pfe);function Ife(){const{isEditing:e,getEditButtonProps:t}=F5(),n=u.useCallback(r=>{const{onClick:o}=t();o&&o(r)},[t]);return e?null:a.jsx(Ie,{className:Yi,onDoubleClick:n,sx:{position:"absolute",w:"full",h:"full",top:0,cursor:"grab"}})}const Uy=e=>{const t=u.useMemo(()=>ae(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return o==null?void 0:o.data},Ce),[e]);return F(t)},Efe=({nodeId:e})=>{const t=Uy(e),{base400:n,base600:r}=Bd(),o=Ti(n,r),s=u.useMemo(()=>({borderWidth:0,borderRadius:"3px",width:"1rem",height:"1rem",backgroundColor:o,zIndex:-1}),[o]);return Kp(t)?a.jsxs(a.Fragment,{children:[a.jsx(Ou,{type:"target",id:`${t.id}-collapsed-target`,isConnectable:!1,position:Vl.Left,style:{...s,left:"-0.5rem"}}),rr(t.inputs,i=>a.jsx(Ou,{type:"target",id:i.name,isConnectable:!1,position:Vl.Left,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-input-handle`)),a.jsx(Ou,{type:"source",id:`${t.id}-collapsed-source`,isConnectable:!1,position:Vl.Right,style:{...s,right:"-0.5rem"}}),rr(t.outputs,i=>a.jsx(Ou,{type:"source",id:i.name,isConnectable:!1,position:Vl.Right,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-output-handle`))]}):null},Ofe=u.memo(Efe),Mfe=e=>{const t=u.useMemo(()=>ae(be,({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)},Dfe=({nodeId:e})=>{const t=J(),n=Uy(e),r=u.useCallback(o=>{t(kA({nodeId:e,notes:o.target.value}))},[t,e]);return Kp(n)?a.jsxs(dn,{children:[a.jsx(Gn,{children:"Notes"}),a.jsx(oa,{value:n==null?void 0:n.notes,onChange:r,rows:10})]}):null},Rfe=u.memo(Dfe),Afe=e=>{const t=u.useMemo(()=>ae(be,({nodes:r})=>{var i;const o=r.nodes.find(c=>c.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:kj(s.version,o.data.version)===0},Ce),[e]);return F(t)},Nfe=({nodeId:e})=>{const{isOpen:t,onOpen:n,onClose:r}=Ir(),o=YM(e),s=QM(e),i=Afe(e);return a.jsxs(a.Fragment,{children:[a.jsx(Dt,{label:a.jsx(JM,{nodeId:e}),placement:"top",shouldWrapChildren:!0,children:a.jsx($,{className:"nodrag",onClick:n,sx:{alignItems:"center",justifyContent:"center",w:8,h:8,cursor:"pointer"},children:a.jsx(An,{as:IE,sx:{boxSize:4,w:8,color:i?"base.400":"error.400"}})})}),a.jsxs(Fi,{isOpen:t,onClose:r,isCentered:!0,children:[a.jsx(Vo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{children:o||s||"Unknown Node"}),a.jsx(Td,{}),a.jsx(Wo,{children:a.jsx(Rfe,{nodeId:e})}),a.jsx(gs,{})]})]})]})},Tfe=u.memo(Nfe),JM=u.memo(({nodeId:e})=>{const t=Uy(e),n=Mfe(e),r=u.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=u.useMemo(()=>!Kp(t)||!n?null:t.version?n.version?ww(t.version,n.version,"<")?a.jsxs(xe,{as:"span",sx:{color:"error.500"},children:["Version ",t.version," (update node)"]}):ww(t.version,n.version,">")?a.jsxs(xe,{as:"span",sx:{color:"error.500"},children:["Version ",t.version," (update app)"]}):a.jsxs(xe,{as:"span",children:["Version ",t.version]}):a.jsxs(xe,{as:"span",sx:{color:"error.500"},children:["Version ",t.version," (unknown template)"]}):a.jsx(xe,{as:"span",sx:{color:"error.500"},children:"Version unknown"}),[t,n]);return Kp(t)?a.jsxs($,{sx:{flexDir:"column"},children:[a.jsx(xe,{as:"span",sx:{fontWeight:600},children:r}),a.jsx(xe,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:n==null?void 0:n.description}),o,(t==null?void 0:t.notes)&&a.jsx(xe,{children:t.notes})]}):a.jsx(xe,{sx:{fontWeight:600},children:"Unknown Node"})});JM.displayName="TooltipContent";const Yv=3,oj={circle:{transitionProperty:"none",transitionDuration:"0s"},".chakra-progress__track":{stroke:"transparent"}},$fe=({nodeId:e})=>{const t=u.useMemo(()=>ae(be,({nodes:r})=>r.nodeExecutionStates[e]),[e]),n=F(t);return n?a.jsx(Dt,{label:a.jsx(e8,{nodeExecutionState:n}),placement:"top",children:a.jsx($,{className:Yi,sx:{w:5,h:"full",alignItems:"center",justifyContent:"flex-end"},children:a.jsx(t8,{nodeExecutionState:n})})}):null},Lfe=u.memo($fe),e8=u.memo(({nodeExecutionState:e})=>{const{status:t,progress:n,progressImage:r}=e;return t===Ks.PENDING?a.jsx(xe,{children:"Pending"}):t===Ks.IN_PROGRESS?r?a.jsxs($,{sx:{pos:"relative",pt:1.5,pb:.5},children:[a.jsx(Xi,{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(xe,{children:["In Progress (",Math.round(n*100),"%)"]}):a.jsx(xe,{children:"In Progress"}):t===Ks.COMPLETED?a.jsx(xe,{children:"Completed"}):t===Ks.FAILED?a.jsx(xe,{children:"nodeExecutionState.error"}):null});e8.displayName="TooltipLabel";const t8=u.memo(e=>{const{progress:t,status:n}=e.nodeExecutionState;return n===Ks.PENDING?a.jsx(An,{as:pZ,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:oj}):a.jsx(R1,{value:Math.round(t*100),size:"14px",color:"base.500",thickness:14,sx:oj}):n===Ks.COMPLETED?a.jsx(An,{as:SE,sx:{boxSize:Yv,color:"ok.600",_dark:{color:"ok.300"}}}):n===Ks.FAILED?a.jsx(An,{as:gZ,sx:{boxSize:Yv,color:"error.600",_dark:{color:"error.300"}}}):null});t8.displayName="StatusIcon";const zfe=({nodeId:e,isOpen:t})=>a.jsxs($,{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(Wy,{nodeId:e,isOpen:t}),a.jsx(ZM,{nodeId:e}),a.jsxs($,{alignItems:"center",children:[a.jsx(Lfe,{nodeId:e}),a.jsx(Tfe,{nodeId:e})]}),!t&&a.jsx(Ofe,{nodeId:e})]}),Ffe=u.memo(zfe),Bfe=(e,t,n,r)=>ae(be,o=>{if(!r)return"No field type";const{currentConnectionFieldType:s,connectionStartParams:i,nodes:c,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,b=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(x=>x.target===e&&x.targetHandle===t)&&v!=="CollectionItem")return"Input may only have one connection";if(b!==v){const x=b==="CollectionItem"&&!Us.includes(v),w=v==="CollectionItem"&&!Us.includes(b)&&!Gs.includes(b),k=Gs.includes(v)&&(()=>{if(!Gs.includes(v))return!1;const E=s5[v],O=a5[E];return b===E||b===O})(),_=b==="Collection"&&(Us.includes(v)||Gs.includes(v)),j=v==="Collection"&&Us.includes(b);if(!(x||w||k||_||j||b==="integer"&&v==="float"))return"Field types must match"}return KM(p==="source"?h:e,p==="source"?e:h,c,f)?null:"Connection would create a cycle"}),Hfe=(e,t,n)=>{const r=u.useMemo(()=>ae(be,({nodes:s})=>{var c;const i=s.nodes.find(f=>f.id===e);if(Cn(i))return(c=i==null?void 0:i.data[Vb[n]][t])==null?void 0:c.type},Ce),[t,n,e]);return F(r)},Vfe=ae(be,({nodes:e})=>e.currentConnectionFieldType!==null&&e.connectionStartParams!==null),n8=({nodeId:e,fieldName:t,kind:n})=>{const r=Hfe(e,t,n),o=u.useMemo(()=>ae(be,({nodes:v})=>!!v.edges.filter(b=>(n==="input"?b.target:b.source)===e&&(n==="input"?b.targetHandle:b.sourceHandle)===t).length),[t,n,e]),s=u.useMemo(()=>Bfe(e,t,n==="input"?"target":"source",r),[e,t,n,r]),i=u.useMemo(()=>ae(be,({nodes:v})=>{var b,y,x;return((b=v.connectionStartParams)==null?void 0:b.nodeId)===e&&((y=v.connectionStartParams)==null?void 0:y.handleId)===t&&((x=v.connectionStartParams)==null?void 0:x.handleType)==={input:"target",output:"source"}[n]}),[t,n,e]),c=F(o),f=F(Vfe),p=F(i),h=F(s),m=u.useMemo(()=>!!(f&&h&&!p),[h,f,p]);return{isConnected:c,isConnectionInProgress:f,isConnectionStartField:p,connectionError:h,shouldDim:m}},Wfe=e=>{const{fieldTemplate:t,handleType:n,isConnectionInProgress:r,isConnectionStartField:o,connectionError:s}=e,{name:i,type:c}=t,{color:f,title:p}=yd[c],h=u.useMemo(()=>{const v=Us.includes(c),b=Gs.includes(c),y=_A.includes(c),x=ud(f),w={backgroundColor:v||b?"var(--invokeai-colors-base-900)":x,position:"absolute",width:"1rem",height:"1rem",borderWidth:v||b?4:0,borderStyle:"solid",borderColor:x,borderRadius:y?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,c,f]),m=u.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(Ou,{type:n,id:i,position:n==="target"?Vl.Left:Vl.Right,style:h})})},r8=u.memo(Wfe),Ufe=({nodeId:e,fieldName:t})=>{const n=Cg(e,t,"output"),{isConnected:r,isConnectionInProgress:o,isConnectionStartField:s,connectionError:i,shouldDim:c}=n8({nodeId:e,fieldName:t,kind:"output"});return(n==null?void 0:n.fieldKind)!=="output"?a.jsx(Ib,{shouldDim:c,children:a.jsxs(dn,{sx:{color:"error.400",textAlign:"right",fontSize:"sm"},children:["Unknown output: ",t]})}):a.jsxs(Ib,{shouldDim:c,children:[a.jsx(Dt,{label:a.jsx(Ry,{nodeId:e,fieldName:t,kind:"output"}),openDelay:gm,placement:"top",shouldWrapChildren:!0,hasArrow:!0,children:a.jsx(dn,{isDisabled:r,pe:2,children:a.jsx(Gn,{sx:{mb:0,fontWeight:500},children:n==null?void 0:n.title})})}),a.jsx(r8,{fieldTemplate:n,handleType:"source",isConnectionInProgress:o,isConnectionStartField:s,connectionError:i})]})},Gfe=u.memo(Ufe),Ib=u.memo(({shouldDim:e,children:t})=>a.jsx($,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",justifyContent:"flex-end"},children:t}));Ib.displayName="OutputFieldWrapper";const Kfe=(e,t)=>{const n=u.useMemo(()=>ae(be,({nodes:o})=>{var i;const s=o.nodes.find(c=>c.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)},qfe=(e,t)=>{const n=u.useMemo(()=>ae(be,({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)??""],c=i==null?void 0:i.inputs[t];return c==null?void 0:c.input},Ce),[t,e]);return F(n)},Xfe=({nodeId:e,fieldName:t,kind:n,children:r})=>{const o=J(),s=rM(e,t),i=oM(e,t,n),c=qfe(e,t),f=u.useCallback(x=>{x.preventDefault()},[]),p=u.useMemo(()=>ae(be,({nodes:x})=>({isExposed:!!x.workflow.exposedFields.find(k=>k.nodeId===e&&k.fieldName===t)}),Ce),[t,e]),h=u.useMemo(()=>["any","direct"].includes(c??"__UNKNOWN_INPUT__"),[c]),{isExposed:m}=F(p),v=u.useCallback(()=>{o(jA({nodeId:e,fieldName:t}))},[o,t,e]),b=u.useCallback(()=>{o(Kj({nodeId:e,fieldName:t}))},[o,t,e]),y=u.useMemo(()=>{const x=[];return h&&!m&&x.push(a.jsx(Ht,{icon:a.jsx(nl,{}),onClick:v,children:"Add to Linear View"},`${e}.${t}.expose-field`)),h&&m&&x.push(a.jsx(Ht,{icon:a.jsx(EZ,{}),onClick:b,children:"Remove from Linear View"},`${e}.${t}.unexpose-field`)),x},[t,v,b,m,h,e]);return a.jsx(yy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>y.length?a.jsx(Ga,{sx:{visibility:"visible !important"},motionProps:gc,onContextMenu:f,children:a.jsx(wc,{title:s||i||"Unknown Field",children:y})}):null,children:r})},Yfe=u.memo(Xfe),Qfe=({nodeId:e,fieldName:t})=>{const n=Cg(e,t,"input"),r=Kfe(e,t),{isConnected:o,isConnectionInProgress:s,isConnectionStartField:i,connectionError:c,shouldDim:f}=n8({nodeId:e,fieldName:t,kind:"input"}),p=u.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(Eb,{shouldDim:f,children:a.jsxs(dn,{sx:{color:"error.400",textAlign:"left",fontSize:"sm"},children:["Unknown input: ",t]})}):a.jsxs(Eb,{shouldDim:f,children:[a.jsxs(dn,{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(Yfe,{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(aM,{ref:h,nodeId:e,fieldName:t,kind:"input",isMissingInput:p,withTooltip:!0})})}),a.jsx(Ie,{children:a.jsx(gM,{nodeId:e,fieldName:t})})]}),n.input!=="direct"&&a.jsx(r8,{fieldTemplate:n,handleType:"target",isConnectionInProgress:s,isConnectionStartField:i,connectionError:c})]})},sj=u.memo(Qfe),Eb=u.memo(({shouldDim:e,children:t})=>a.jsx($,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",w:"full",h:"full"},children:t}));Eb.displayName="InputFieldWrapper";const Zfe=e=>{const t=u.useMemo(()=>ae(be,({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,c)=>(i.ui_order??0)-(c.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Ce),[e]);return F(t)},Jfe=e=>{const t=u.useMemo(()=>ae(be,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?Do(o.data.outputs,s=>PA.includes(s.type)):!1},Ce),[e]);return F(t)},epe=e=>{const t=u.useMemo(()=>ae(be,({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,c)=>(i.ui_order??0)-(c.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Ce),[e]);return F(t)},tpe=e=>{const t=u.useMemo(()=>ae(be,({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,c)=>(i.ui_order??0)-(c.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Ce),[e]);return F(t)},npe=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>{const s=epe(e),i=tpe(e),c=Zfe(e),f=Jfe(e);return a.jsxs(Eg,{nodeId:e,selected:o,children:[a.jsx(Ffe,{nodeId:e,isOpen:t,label:n,selected:o,type:r}),t&&a.jsxs(a.Fragment,{children:[a.jsx($,{layerStyle:"nodeBody",sx:{flexDirection:"column",w:"full",h:"full",py:2,gap:1,borderBottomRadius:f?0:"base"},children:a.jsxs($,{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(sj,{nodeId:e,fieldName:p})},`${e}.${p}.input-field`)),c.map((p,h)=>a.jsx(ed,{gridColumnStart:2,gridRowStart:h+1,children:a.jsx(Gfe,{nodeId:e,fieldName:p})},`${e}.${p}.output-field`))]}),i.map(p=>a.jsx(sj,{nodeId:e,fieldName:p},`${e}.${p}.input-field`))]})}),f&&a.jsx(_fe,{nodeId:e})]})]})},rpe=u.memo(npe),ope=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>a.jsxs(Eg,{nodeId:e,selected:o,children:[a.jsxs($,{className:Yi,layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",h:8,fontWeight:600,fontSize:"sm"},children:[a.jsx(Wy,{nodeId:e,isOpen:t}),a.jsx(xe,{sx:{w:"full",textAlign:"center",pe:8,color:"error.500",_dark:{color:"error.300"}},children:n?`${n} (${r})`:r})]}),t&&a.jsx($,{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(xe,{as:"span",children:"Unknown node type: "}),a.jsx(xe,{as:"span",fontWeight:600,children:r})]})})]}),spe=u.memo(ope),ape=e=>{const{data:t,selected:n}=e,{id:r,type:o,isOpen:s,label:i}=t,c=u.useMemo(()=>ae(be,({nodes:p})=>!!p.nodeTemplates[o]),[o]);return F(c)?a.jsx(rpe,{nodeId:r,isOpen:s,label:i,type:o,selected:n}):a.jsx(spe,{nodeId:r,isOpen:s,label:i,type:o,selected:n})},ipe=u.memo(ape),lpe=e=>{const{id:t,data:n,selected:r}=e,{notes:o,isOpen:s}=n,i=J(),c=u.useCallback(f=>{i(IA({nodeId:t,value:f.target.value}))},[i,t]);return a.jsxs(Eg,{nodeId:t,selected:r,children:[a.jsxs($,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:s?0:"base",alignItems:"center",justifyContent:"space-between",h:8},children:[a.jsx(Wy,{nodeId:t,isOpen:s}),a.jsx(ZM,{nodeId:t,title:"Notes"}),a.jsx(Ie,{minW:8})]}),s&&a.jsx(a.Fragment,{children:a.jsx($,{layerStyle:"nodeBody",className:"nopan",sx:{cursor:"auto",flexDirection:"column",borderBottomRadius:"base",w:"full",h:"full",p:2,gap:1},children:a.jsx($,{className:"nopan",sx:{flexDir:"column",w:"full",h:"full"},children:a.jsx(oa,{value:o,onChange:c,rows:8,resize:"none",sx:{fontSize:"xs"}})})})})]})},cpe=u.memo(lpe),upe=["Delete","Backspace"],dpe={collapsed:dfe,default:pfe},fpe={invocation:ipe,current_image:vfe,notes:cpe},ppe={hideAttribution:!0},hpe=ae(be,({nodes:e})=>{const{shouldSnapToGrid:t,selectionMode:n}=e;return{shouldSnapToGrid:t,selectionMode:n}},Ce),mpe=()=>{const e=J(),t=F(j=>j.nodes.nodes),n=F(j=>j.nodes.edges),r=F(j=>j.nodes.viewport),{shouldSnapToGrid:o,selectionMode:s}=F(hpe),i=afe(),[c]=ds("radii",["base"]),f=u.useCallback(j=>{e(EA(j))},[e]),p=u.useCallback(j=>{e(OA(j))},[e]),h=u.useCallback((j,I)=>{e(MA(I))},[e]),m=u.useCallback(j=>{e(DA(j))},[e]),v=u.useCallback(()=>{e(RA())},[e]),b=u.useCallback(j=>{e(AA(j))},[e]),y=u.useCallback(j=>{e(NA(j))},[e]),x=u.useCallback(({nodes:j,edges:I})=>{e(TA(j?j.map(E=>E.id):[])),e($A(I?I.map(E=>E.id):[]))},[e]),w=u.useCallback((j,I)=>{e(LA(I))},[e]),k=u.useCallback(()=>{e(l5())},[e]),_=u.useCallback(j=>{zA.set(j),j.fitView()},[]);return Qe(["Ctrl+c","Meta+c"],j=>{j.preventDefault(),e(FA())}),Qe(["Ctrl+a","Meta+a"],j=>{j.preventDefault(),e(BA())}),Qe(["Ctrl+v","Meta+v"],j=>{j.preventDefault(),e(HA())}),a.jsx(VA,{id:"workflow-editor",defaultViewport:r,nodeTypes:fpe,edgeTypes:dpe,nodes:t,edges:n,onInit:_,onNodesChange:f,onEdgesChange:p,onEdgesDelete:b,onNodesDelete:y,onConnectStart:h,onConnect:m,onConnectEnd:v,onMoveEnd:w,connectionLineComponent:cfe,onSelectionChange:x,isValidConnection:i,minZoom:.1,snapToGrid:o,snapGrid:[25,25],connectionRadius:30,proOptions:ppe,style:{borderRadius:c},onPaneClick:k,deleteKeyCode:upe,selectionMode:s,children:a.jsx(qN,{})})},gpe=()=>{const e=J(),t=u.useCallback(()=>{e(o5())},[e]);return a.jsx($,{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(nl,{}),onClick:t})})},vpe=u.memo(gpe),bpe=()=>{const e=J(),t=MP("nodes");return u.useCallback(r=>{if(!r)return;const o=new FileReader;o.onload=async()=>{const s=o.result;try{const i=JSON.parse(String(s)),c=WA.safeParse(i);if(!c.success){const{message:f}=UA(c.error,{prefix:"Workflow Validation Error"});t.error({error:GA(c.error)},f),e(Nt(zt({title:"Unable to Validate Workflow",status:"error",duration:5e3}))),o.abort();return}e(Bb(c.data)),o.abort()}catch{e(Nt(zt({title:"Unable to Load Workflow",status:"error"})))}},o.readAsText(r)},[e,t])},xpe=u.memo(e=>e.error.issues[0]?a.jsx(xe,{children:fw(e.error.issues[0],{prefix:null}).toString()}):a.jsx(Id,{children:e.error.issues.map((t,n)=>a.jsx(Ao,{children:a.jsx(xe,{children:fw(t,{prefix:null}).toString()})},n))}));xpe.displayName="WorkflowValidationErrorContent";const ype=()=>{const{t:e}=we(),t=u.useRef(null),n=bpe();return a.jsx(ZI,{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})})},Cpe=u.memo(ype),wpe=()=>{const{t:e}=we(),t=J(),{isOpen:n,onOpen:r,onClose:o}=Ir(),s=u.useRef(null),i=F(f=>f.nodes.nodes.length),c=u.useCallback(()=>{t(KA()),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(Hr,{}),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(Vo,{}),a.jsxs(Nd,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:e("nodes.resetWorkflow")}),a.jsx(Wo,{py:4,children:a.jsxs($,{flexDir:"column",gap:2,children:[a.jsx(xe,{children:e("nodes.resetWorkflowDesc")}),a.jsx(xe,{variant:"subtext",children:e("nodes.resetWorkflowDesc2")})]})}),a.jsxs(gs,{children:[a.jsx(vc,{ref:s,onClick:o,children:e("common.cancel")}),a.jsx(vc,{colorScheme:"error",ml:3,onClick:c,children:e("common.accept")})]})]})]})]})},Spe=u.memo(wpe),kpe=()=>{const{t:e}=we(),t=eM(),n=u.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})},_pe=u.memo(kpe),jpe=()=>a.jsxs($,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:"50%",transform:"translate(-50%)"},children:[a.jsx(_pe,{}),a.jsx(Cpe,{}),a.jsx(Spe,{})]}),Ppe=u.memo(jpe),Ipe=()=>a.jsx($,{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))}),Epe=u.memo(Ipe),Ope=()=>{const{t:e}=we(),t=J(),n=u.useCallback(()=>{t(qA())},[t]);return a.jsx(it,{leftIcon:a.jsx($Z,{}),tooltip:e("nodes.reloadNodeTemplates"),"aria-label":e("nodes.reloadNodeTemplates"),onClick:n,children:e("nodes.reloadNodeTemplates")})},Mpe=u.memo(Ope),Pu={fontWeight:600},Dpe=ae(be,({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===XA.Full}},Ce),Rpe=Pe((e,t)=>{const{isOpen:n,onOpen:r,onClose:o}=Ir(),s=J(),{shouldAnimateEdges:i,shouldValidateGraph:c,shouldSnapToGrid:f,shouldColorEdges:p,selectionModeIsChecked:h}=F(Dpe),m=u.useCallback(w=>{s(YA(w.target.checked))},[s]),v=u.useCallback(w=>{s(QA(w.target.checked))},[s]),b=u.useCallback(w=>{s(ZA(w.target.checked))},[s]),y=u.useCallback(w=>{s(JA(w.target.checked))},[s]),x=u.useCallback(w=>{s(e9(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(_E,{}),onClick:r}),a.jsxs(Fi,{isOpen:n,onClose:o,size:"2xl",isCentered:!0,children:[a.jsx(Vo,{}),a.jsxs(Bi,{children:[a.jsx(Ho,{children:"Workflow Editor Settings"}),a.jsx(Td,{}),a.jsx(Wo,{children:a.jsxs($,{sx:{flexDirection:"column",gap:4,py:4},children:[a.jsx(ro,{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(zr,{}),a.jsx(Ut,{formLabelProps:Pu,isChecked:f,onChange:b,label:"Snap to Grid",helperText:"Snap nodes to grid when moved"}),a.jsx(zr,{}),a.jsx(Ut,{formLabelProps:Pu,isChecked:p,onChange:y,label:"Color-Code Edges",helperText:"Color-code edges according to their connected fields"}),a.jsx(Ut,{formLabelProps:Pu,isChecked:h,onChange:x,label:"Fully Contain Nodes to Select",helperText:"Nodes must be fully inside the selection box to be selected"}),a.jsx(ro,{size:"sm",pt:4,children:"Advanced"}),a.jsx(Ut,{formLabelProps:Pu,isChecked:c,onChange:m,label:"Validate Connections and Graph",helperText:"Prevent invalid connections from being made, and invalid graphs from being invoked"}),a.jsx(Mpe,{})]})})]})]})]})}),Ape=u.memo(Rpe),Npe=()=>{const e=F(t=>t.nodes.shouldShowFieldTypeLegend);return a.jsxs($,{sx:{gap:2,position:"absolute",top:2,insetInlineEnd:2},children:[a.jsx(Ape,{}),e&&a.jsx(Epe,{})]})},Tpe=u.memo(Npe);function $pe(){const e=J(),t=F(r=>r.nodes.nodeOpacity),n=u.useCallback(r=>{e(t9(r))},[e]);return a.jsx($,{alignItems:"center",children:a.jsxs(Ax,{"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(Tx,{children:a.jsx($x,{})}),a.jsx(Nx,{})]})})}function Lpe(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 zpe(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 Fpe(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 Bpe=()=>{const{t:e}=we(),{zoomIn:t,zoomOut:n,fitView:r}=Kb(),o=J(),s=F(h=>h.nodes.shouldShowMinimapPanel),i=u.useCallback(()=>{t()},[t]),c=u.useCallback(()=>{n()},[n]),f=u.useCallback(()=>{r()},[r]),p=u.useCallback(()=>{o(n9(!s))},[s,o]);return a.jsxs(hn,{isAttached:!0,orientation:"vertical",children:[a.jsx(Te,{tooltip:e("nodes.zoomInNodes"),"aria-label":e("nodes.zoomInNodes"),onClick:i,icon:a.jsx(Fpe,{})}),a.jsx(Te,{tooltip:e("nodes.zoomOutNodes"),"aria-label":e("nodes.zoomOutNodes"),onClick:c,icon:a.jsx(zpe,{})}),a.jsx(Te,{tooltip:e("nodes.fitViewportNodes"),"aria-label":e("nodes.fitViewportNodes"),onClick:f,icon:a.jsx(bZ,{})}),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(IZ,{})})]})},Hpe=u.memo(Bpe),Vpe=()=>a.jsxs($,{sx:{gap:2,position:"absolute",bottom:2,insetInlineStart:2},children:[a.jsx(Hpe,{}),a.jsx($pe,{})]}),Wpe=u.memo(Vpe),Upe=_e(HN),Gpe=()=>{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($,{sx:{gap:2,position:"absolute",bottom:2,insetInlineEnd:2},children:e&&a.jsx(Upe,{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})})},Kpe=u.memo(Gpe),qpe=()=>{const e=F(t=>t.nodes.isReady);return a.jsxs($,{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(mpe,{}),a.jsx(pde,{}),a.jsx(vpe,{}),a.jsx(Ppe,{}),a.jsx(Tpe,{}),a.jsx(Wpe,{}),a.jsx(Kpe,{})]})}),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($,{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})})})})]})},Xpe=u.memo(qpe),Ype=()=>a.jsx(r9,{children:a.jsx(Xpe,{})}),Qpe=u.memo(Ype),Zpe=()=>a.jsx(DM,{}),Jpe=u.memo(Zpe);var Ob={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=pw;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=pw;e.exports=r.Konva})(Ob,Ob.exports);var ehe=Ob.exports;const dd=Dc(ehe);var o8={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 the=function(t){var n={},r=u,o=Ip,s=Object.assign;function i(l){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+l+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var c=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"),b=Symbol.for("react.provider"),y=Symbol.for("react.context"),x=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"),E=Symbol.iterator;function O(l){return l===null||typeof l!="object"?null:(l=E&&l[E]||l["@@iterator"],typeof l=="function"?l:null)}function M(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){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 l=="object")switch(l.$$typeof){case y:return(l.displayName||"Context")+".Consumer";case b:return(l._context.displayName||"Context")+".Provider";case x:var d=l.render;return l=l.displayName,l||(l=d.displayName||d.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case _:return d=l.displayName||null,d!==null?d:M(l.type)||"Memo";case j:d=l._payload,l=l._init;try{return M(l(d))}catch{}}return null}function D(l){var d=l.type;switch(l.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=d.render,l=l.displayName||l.name||"",d.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return M(d);case 8:return d===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 d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function A(l){var d=l,g=l;if(l.alternate)for(;d.return;)d=d.return;else{l=d;do d=l,d.flags&4098&&(g=d.return),l=d.return;while(l)}return d.tag===3?g:null}function R(l){if(A(l)!==l)throw Error(i(188))}function T(l){var d=l.alternate;if(!d){if(d=A(l),d===null)throw Error(i(188));return d!==l?null:l}for(var g=l,C=d;;){var S=g.return;if(S===null)break;var P=S.alternate;if(P===null){if(C=S.return,C!==null){g=C;continue}break}if(S.child===P.child){for(P=S.child;P;){if(P===g)return R(S),l;if(P===C)return R(S),d;P=P.sibling}throw Error(i(188))}if(g.return!==C.return)g=S,C=P;else{for(var N=!1,Z=S.child;Z;){if(Z===g){N=!0,g=S,C=P;break}if(Z===C){N=!0,C=S,g=P;break}Z=Z.sibling}if(!N){for(Z=P.child;Z;){if(Z===g){N=!0,g=P,C=S;break}if(Z===C){N=!0,C=P,g=S;break}Z=Z.sibling}if(!N)throw Error(i(189))}}if(g.alternate!==C)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?l:d}function q(l){return l=T(l),l!==null?B(l):null}function B(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var d=B(l);if(d!==null)return d;l=l.sibling}return null}function G(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){if(l.tag!==4){var d=G(l);if(d!==null)return d}l=l.sibling}return null}var Y=Array.isArray,V=t.getPublicInstance,L=t.getRootHostContext,X=t.getChildHostContext,z=t.prepareForCommit,K=t.resetAfterCommit,ne=t.createInstance,Q=t.appendInitialChild,ie=t.finalizeInitialChildren,oe=t.prepareUpdate,W=t.shouldSetTextContent,U=t.createTextInstance,ee=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,Oe=t.commitUpdate,$e=t.insertBefore,Rt=t.insertInContainerBefore,ke=t.removeChild,ze=t.removeChildFromContainer,Le=t.resetTextContent,We=t.hideInstance,ct=t.hideTextInstance,vn=t.unhideInstance,_t=t.unhideTextInstance,jt=t.clearContainer,sr=t.cloneInstance,In=t.createContainerChildSet,fn=t.appendChildToContainerChildSet,rn=t.finalizeContainerChildren,Yt=t.replaceContainerChildren,hr=t.cloneHiddenInstance,xo=t.cloneHiddenTextInstance,ar=t.canHydrateInstance,ir=t.canHydrateTextInstance,Is=t.canHydrateSuspenseInstance,Es=t.isSuspenseInstancePending,pa=t.isSuspenseInstanceFallback,ha=t.getSuspenseInstanceFallbackErrorDetails,il=t.registerSuspenseInstanceRetry,ma=t.getNextHydratableSibling,ll=t.getFirstHydratableChild,qe=t.getFirstHydratableChildWithinContainer,At=t.getFirstHydratableChildWithinSuspenseInstance,En=t.hydrateInstance,vt=t.hydrateTextInstance,ga=t.hydrateSuspenseInstance,Dr=t.getNextHydratableInstanceAfterSuspenseInstance,qd=t.commitHydratedContainer,Mg=t.commitHydratedSuspenseInstance,Dg=t.clearSuspenseBoundary,On=t.clearSuspenseBoundaryFromContainer,Os=t.shouldDeleteUnhydratedTailInstances,Xd=t.didNotMatchHydratedContainerTextInstance,cl=t.didNotMatchHydratedTextInstance,Yc;function ai(l){if(Yc===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);Yc=d&&d[1]||""}return`
|
||
`+Yc+l}var Qc=!1;function Zc(l,d){if(!l||Qc)return"";Qc=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(Ee){var C=Ee}Reflect.construct(l,[],d)}else{try{d.call()}catch(Ee){C=Ee}l.call(d.prototype)}else{try{throw Error()}catch(Ee){C=Ee}l()}}catch(Ee){if(Ee&&C&&typeof Ee.stack=="string"){for(var S=Ee.stack.split(`
|
||
`),P=C.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 l.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",l.displayName)),ce}while(1<=N&&0<=Z);break}}}finally{Qc=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?ai(l):""}var Rg=Object.prototype.hasOwnProperty,va=[],Je=-1;function wt(l){return{current:l}}function bt(l){0>Je||(l.current=va[Je],va[Je]=null,Je--)}function St(l,d){Je++,va[Je]=l.current,l.current=d}var Kn={},Vt=wt(Kn),kn=wt(!1),lr=Kn;function ul(l,d){var g=l.type.contextTypes;if(!g)return Kn;var C=l.stateNode;if(C&&C.__reactInternalMemoizedUnmaskedChildContext===d)return C.__reactInternalMemoizedMaskedChildContext;var S={},P;for(P in g)S[P]=d[P];return C&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=S),S}function mr(l){return l=l.childContextTypes,l!=null}function Yd(){bt(kn),bt(Vt)}function Xy(l,d,g){if(Vt.current!==Kn)throw Error(i(168));St(Vt,d),St(kn,g)}function Yy(l,d,g){var C=l.stateNode;if(d=d.childContextTypes,typeof C.getChildContext!="function")return g;C=C.getChildContext();for(var S in C)if(!(S in d))throw Error(i(108,D(l)||"Unknown",S));return s({},g,C)}function Qd(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Kn,lr=Vt.current,St(Vt,l),St(kn,kn.current),!0}function Qy(l,d,g){var C=l.stateNode;if(!C)throw Error(i(169));g?(l=Yy(l,d,lr),C.__reactInternalMemoizedMergedChildContext=l,bt(kn),bt(Vt),St(Vt,l)):bt(kn),St(kn,g)}var yo=Math.clz32?Math.clz32:b8,g8=Math.log,v8=Math.LN2;function b8(l){return l>>>=0,l===0?32:31-(g8(l)/v8|0)|0}var Zd=64,Jd=4194304;function Jc(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function ef(l,d){var g=l.pendingLanes;if(g===0)return 0;var C=0,S=l.suspendedLanes,P=l.pingedLanes,N=g&268435455;if(N!==0){var Z=N&~S;Z!==0?C=Jc(Z):(P&=N,P!==0&&(C=Jc(P)))}else N=g&~S,N!==0?C=Jc(N):P!==0&&(C=Jc(P));if(C===0)return 0;if(d!==0&&d!==C&&!(d&S)&&(S=C&-C,P=d&-d,S>=P||S===16&&(P&4194240)!==0))return d;if(C&4&&(C|=g&16),d=l.entangledLanes,d!==0)for(l=l.entanglements,d&=C;0<d;)g=31-yo(d),S=1<<g,C|=l[g],d&=~S;return C}function x8(l,d){switch(l){case 1:case 2:case 4:return d+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 d+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 y8(l,d){for(var g=l.suspendedLanes,C=l.pingedLanes,S=l.expirationTimes,P=l.pendingLanes;0<P;){var N=31-yo(P),Z=1<<N,ce=S[N];ce===-1?(!(Z&g)||Z&C)&&(S[N]=x8(Z,d)):ce<=d&&(l.expiredLanes|=Z),P&=~Z}}function Ag(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Zy(){var l=Zd;return Zd<<=1,!(Zd&4194240)&&(Zd=64),l}function Ng(l){for(var d=[],g=0;31>g;g++)d.push(l);return d}function eu(l,d,g){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-yo(d),l[d]=g}function C8(l,d){var g=l.pendingLanes&~d;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=d,l.mutableReadLanes&=d,l.entangledLanes&=d,d=l.entanglements;var C=l.eventTimes;for(l=l.expirationTimes;0<g;){var S=31-yo(g),P=1<<S;d[S]=0,C[S]=-1,l[S]=-1,g&=~P}}function Tg(l,d){var g=l.entangledLanes|=d;for(l=l.entanglements;g;){var C=31-yo(g),S=1<<C;S&d|l[C]&d&&(l[C]|=d),g&=~S}}var It=0;function Jy(l){return l&=-l,1<l?4<l?l&268435455?16:536870912:4:1}var $g=o.unstable_scheduleCallback,e2=o.unstable_cancelCallback,w8=o.unstable_shouldYield,S8=o.unstable_requestPaint,Ln=o.unstable_now,Lg=o.unstable_ImmediatePriority,k8=o.unstable_UserBlockingPriority,zg=o.unstable_NormalPriority,_8=o.unstable_IdlePriority,tf=null,Yo=null;function j8(l){if(Yo&&typeof Yo.onCommitFiberRoot=="function")try{Yo.onCommitFiberRoot(tf,l,void 0,(l.current.flags&128)===128)}catch{}}function P8(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var Co=typeof Object.is=="function"?Object.is:P8,Ms=null,nf=!1,Fg=!1;function t2(l){Ms===null?Ms=[l]:Ms.push(l)}function I8(l){nf=!0,t2(l)}function Qo(){if(!Fg&&Ms!==null){Fg=!0;var l=0,d=It;try{var g=Ms;for(It=1;l<g.length;l++){var C=g[l];do C=C(!0);while(C!==null)}Ms=null,nf=!1}catch(S){throw Ms!==null&&(Ms=Ms.slice(l+1)),$g(Lg,Qo),S}finally{It=d,Fg=!1}}return null}var dl=[],fl=0,rf=null,of=0,Wr=[],Ur=0,ii=null,Ds=1,Rs="";function li(l,d){dl[fl++]=of,dl[fl++]=rf,rf=l,of=d}function n2(l,d,g){Wr[Ur++]=Ds,Wr[Ur++]=Rs,Wr[Ur++]=ii,ii=l;var C=Ds;l=Rs;var S=32-yo(C)-1;C&=~(1<<S),g+=1;var P=32-yo(d)+S;if(30<P){var N=S-S%5;P=(C&(1<<N)-1).toString(32),C>>=N,S-=N,Ds=1<<32-yo(d)+S|g<<S|C,Rs=P+l}else Ds=1<<P|g<<S|C,Rs=l}function Bg(l){l.return!==null&&(li(l,1),n2(l,1,0))}function Hg(l){for(;l===rf;)rf=dl[--fl],dl[fl]=null,of=dl[--fl],dl[fl]=null;for(;l===ii;)ii=Wr[--Ur],Wr[Ur]=null,Rs=Wr[--Ur],Wr[Ur]=null,Ds=Wr[--Ur],Wr[Ur]=null}var Rr=null,Gr=null,Qt=!1,tu=!1,wo=null;function r2(l,d){var g=Qr(5,null,null,0);g.elementType="DELETED",g.stateNode=d,g.return=l,d=l.deletions,d===null?(l.deletions=[g],l.flags|=16):d.push(g)}function o2(l,d){switch(l.tag){case 5:return d=ar(d,l.type,l.pendingProps),d!==null?(l.stateNode=d,Rr=l,Gr=ll(d),!0):!1;case 6:return d=ir(d,l.pendingProps),d!==null?(l.stateNode=d,Rr=l,Gr=null,!0):!1;case 13:if(d=Is(d),d!==null){var g=ii!==null?{id:Ds,overflow:Rs}:null;return l.memoizedState={dehydrated:d,treeContext:g,retryLane:1073741824},g=Qr(18,null,null,0),g.stateNode=d,g.return=l,l.child=g,Rr=l,Gr=null,!0}return!1;default:return!1}}function Vg(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Wg(l){if(Qt){var d=Gr;if(d){var g=d;if(!o2(l,d)){if(Vg(l))throw Error(i(418));d=ma(g);var C=Rr;d&&o2(l,d)?r2(C,g):(l.flags=l.flags&-4097|2,Qt=!1,Rr=l)}}else{if(Vg(l))throw Error(i(418));l.flags=l.flags&-4097|2,Qt=!1,Rr=l}}}function s2(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Rr=l}function sf(l){if(!ye||l!==Rr)return!1;if(!Qt)return s2(l),Qt=!0,!1;if(l.tag!==3&&(l.tag!==5||Os(l.type)&&!W(l.type,l.memoizedProps))){var d=Gr;if(d){if(Vg(l))throw a2(),Error(i(418));for(;d;)r2(l,d),d=ma(d)}}if(s2(l),l.tag===13){if(!ye)throw Error(i(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));Gr=Dr(l)}else Gr=Rr?ma(l.stateNode):null;return!0}function a2(){for(var l=Gr;l;)l=ma(l)}function pl(){ye&&(Gr=Rr=null,tu=Qt=!1)}function Ug(l){wo===null?wo=[l]:wo.push(l)}var E8=c.ReactCurrentBatchConfig;function af(l,d){if(Co(l,d))return!0;if(typeof l!="object"||l===null||typeof d!="object"||d===null)return!1;var g=Object.keys(l),C=Object.keys(d);if(g.length!==C.length)return!1;for(C=0;C<g.length;C++){var S=g[C];if(!Rg.call(d,S)||!Co(l[S],d[S]))return!1}return!0}function O8(l){switch(l.tag){case 5:return ai(l.type);case 16:return ai("Lazy");case 13:return ai("Suspense");case 19:return ai("SuspenseList");case 0:case 2:case 15:return l=Zc(l.type,!1),l;case 11:return l=Zc(l.type.render,!1),l;case 1:return l=Zc(l.type,!0),l;default:return""}}function So(l,d){if(l&&l.defaultProps){d=s({},d),l=l.defaultProps;for(var g in l)d[g]===void 0&&(d[g]=l[g]);return d}return d}var lf=wt(null),cf=null,hl=null,Gg=null;function Kg(){Gg=hl=cf=null}function i2(l,d,g){fe?(St(lf,d._currentValue),d._currentValue=g):(St(lf,d._currentValue2),d._currentValue2=g)}function qg(l){var d=lf.current;bt(lf),fe?l._currentValue=d:l._currentValue2=d}function Xg(l,d,g){for(;l!==null;){var C=l.alternate;if((l.childLanes&d)!==d?(l.childLanes|=d,C!==null&&(C.childLanes|=d)):C!==null&&(C.childLanes&d)!==d&&(C.childLanes|=d),l===g)break;l=l.return}}function ml(l,d){cf=l,Gg=hl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&(l.lanes&d&&(gr=!0),l.firstContext=null)}function Kr(l){var d=fe?l._currentValue:l._currentValue2;if(Gg!==l)if(l={context:l,memoizedValue:d,next:null},hl===null){if(cf===null)throw Error(i(308));hl=l,cf.dependencies={lanes:0,firstContext:l}}else hl=hl.next=l;return d}var ci=null;function Yg(l){ci===null?ci=[l]:ci.push(l)}function l2(l,d,g,C){var S=d.interleaved;return S===null?(g.next=g,Yg(d)):(g.next=S.next,S.next=g),d.interleaved=g,Zo(l,C)}function Zo(l,d){l.lanes|=d;var g=l.alternate;for(g!==null&&(g.lanes|=d),g=l,l=l.return;l!==null;)l.childLanes|=d,g=l.alternate,g!==null&&(g.childLanes|=d),g=l,l=l.return;return g.tag===3?g.stateNode:null}var ba=!1;function Qg(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function c2(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function As(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function xa(l,d,g){var C=l.updateQueue;if(C===null)return null;if(C=C.shared,xt&2){var S=C.pending;return S===null?d.next=d:(d.next=S.next,S.next=d),C.pending=d,Zo(l,g)}return S=C.interleaved,S===null?(d.next=d,Yg(C)):(d.next=S.next,S.next=d),C.interleaved=d,Zo(l,g)}function uf(l,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194240)!==0)){var C=d.lanes;C&=l.pendingLanes,g|=C,d.lanes=g,Tg(l,g)}}function u2(l,d){var g=l.updateQueue,C=l.alternate;if(C!==null&&(C=C.updateQueue,g===C)){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=d:P=P.next=d}else S=P=d;g={baseState:C.baseState,firstBaseUpdate:S,lastBaseUpdate:P,shared:C.shared,effects:C.effects},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=d:l.next=d,g.lastBaseUpdate=d}function df(l,d,g,C){var S=l.updateQueue;ba=!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=l.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((C&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=l,xr=Z;switch(He=d,Kt=g,xr.tag){case 1:if(Ft=xr.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=xr.payload,He=typeof Ft=="function"?Ft.call(Kt,pt,He):Ft,He==null)break e;pt=s({},pt,He);break e;case 2:ba=!0}}Z.callback!==null&&Z.lane!==0&&(l.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,d=S.shared.interleaved,d!==null){S=d;do N|=S.lane,S=S.next;while(S!==d)}else P===null&&(S.shared.lanes=0);di|=N,l.lanes=N,l.memoizedState=pt}}function d2(l,d,g){if(l=d.effects,d.effects=null,l!==null)for(d=0;d<l.length;d++){var C=l[d],S=C.callback;if(S!==null){if(C.callback=null,C=g,typeof S!="function")throw Error(i(191,S));S.call(C)}}}var f2=new r.Component().refs;function Zg(l,d,g,C){d=l.memoizedState,g=g(C,d),g=g==null?d:s({},d,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var ff={isMounted:function(l){return(l=l._reactInternals)?A(l)===l:!1},enqueueSetState:function(l,d,g){l=l._reactInternals;var C=Qn(),S=wa(l),P=As(C,S);P.payload=d,g!=null&&(P.callback=g),d=xa(l,P,S),d!==null&&(Yr(d,l,S,C),uf(d,l,S))},enqueueReplaceState:function(l,d,g){l=l._reactInternals;var C=Qn(),S=wa(l),P=As(C,S);P.tag=1,P.payload=d,g!=null&&(P.callback=g),d=xa(l,P,S),d!==null&&(Yr(d,l,S,C),uf(d,l,S))},enqueueForceUpdate:function(l,d){l=l._reactInternals;var g=Qn(),C=wa(l),S=As(g,C);S.tag=2,d!=null&&(S.callback=d),d=xa(l,S,C),d!==null&&(Yr(d,l,C,g),uf(d,l,C))}};function p2(l,d,g,C,S,P,N){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(C,P,N):d.prototype&&d.prototype.isPureReactComponent?!af(g,C)||!af(S,P):!0}function h2(l,d,g){var C=!1,S=Kn,P=d.contextType;return typeof P=="object"&&P!==null?P=Kr(P):(S=mr(d)?lr:Vt.current,C=d.contextTypes,P=(C=C!=null)?ul(l,S):Kn),d=new d(g,P),l.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=ff,l.stateNode=d,d._reactInternals=l,C&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=S,l.__reactInternalMemoizedMaskedChildContext=P),d}function m2(l,d,g,C){l=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(g,C),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(g,C),d.state!==l&&ff.enqueueReplaceState(d,d.state,null)}function Jg(l,d,g,C){var S=l.stateNode;S.props=g,S.state=l.memoizedState,S.refs=f2,Qg(l);var P=d.contextType;typeof P=="object"&&P!==null?S.context=Kr(P):(P=mr(d)?lr:Vt.current,S.context=ul(l,P)),S.state=l.memoizedState,P=d.getDerivedStateFromProps,typeof P=="function"&&(Zg(l,d,P,g),S.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(d=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),d!==S.state&&ff.enqueueReplaceState(S,S.state,null),df(l,g,S,C),S.state=l.memoizedState),typeof S.componentDidMount=="function"&&(l.flags|=4194308)}function nu(l,d,g){if(l=g.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(i(309));var C=g.stateNode}if(!C)throw Error(i(147,l));var S=C,P=""+l;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===P?d.ref:(d=function(N){var Z=S.refs;Z===f2&&(Z=S.refs={}),N===null?delete Z[P]:Z[P]=N},d._stringRef=P,d)}if(typeof l!="string")throw Error(i(284));if(!g._owner)throw Error(i(290,l))}return l}function pf(l,d){throw l=Object.prototype.toString.call(d),Error(i(31,l==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":l))}function g2(l){var d=l._init;return d(l._payload)}function v2(l){function d(le,te){if(l){var pe=le.deletions;pe===null?(le.deletions=[te],le.flags|=16):pe.push(te)}}function g(le,te){if(!l)return null;for(;te!==null;)d(le,te),te=te.sibling;return null}function C(le,te){for(le=new Map;te!==null;)te.key!==null?le.set(te.key,te):le.set(te.index,te),te=te.sibling;return le}function S(le,te){return le=ka(le,te),le.index=0,le.sibling=null,le}function P(le,te,pe){return le.index=pe,l?(pe=le.alternate,pe!==null?(pe=pe.index,pe<te?(le.flags|=2,te):pe):(le.flags|=2,te)):(le.flags|=1048576,te)}function N(le){return l&&le.alternate===null&&(le.flags|=2),le}function Z(le,te,pe,Ve){return te===null||te.tag!==6?(te=F0(pe,le.mode,Ve),te.return=le,te):(te=S(te,pe),te.return=le,te)}function ce(le,te,pe,Ve){var nt=pe.type;return nt===h?Ke(le,te,pe.props.children,Ve,pe.key):te!==null&&(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===j&&g2(nt)===te.type)?(Ve=S(te,pe.props),Ve.ref=nu(le,te,pe),Ve.return=le,Ve):(Ve=zf(pe.type,pe.key,pe.props,null,le.mode,Ve),Ve.ref=nu(le,te,pe),Ve.return=le,Ve)}function Ee(le,te,pe,Ve){return te===null||te.tag!==4||te.stateNode.containerInfo!==pe.containerInfo||te.stateNode.implementation!==pe.implementation?(te=B0(pe,le.mode,Ve),te.return=le,te):(te=S(te,pe.children||[]),te.return=le,te)}function Ke(le,te,pe,Ve,nt){return te===null||te.tag!==7?(te=mi(pe,le.mode,Ve,nt),te.return=le,te):(te=S(te,pe),te.return=le,te)}function pt(le,te,pe){if(typeof te=="string"&&te!==""||typeof te=="number")return te=F0(""+te,le.mode,pe),te.return=le,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case f:return pe=zf(te.type,te.key,te.props,null,le.mode,pe),pe.ref=nu(le,null,te),pe.return=le,pe;case p:return te=B0(te,le.mode,pe),te.return=le,te;case j:var Ve=te._init;return pt(le,Ve(te._payload),pe)}if(Y(te)||O(te))return te=mi(te,le.mode,pe,null),te.return=le,te;pf(le,te)}return null}function He(le,te,pe,Ve){var nt=te!==null?te.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number")return nt!==null?null:Z(le,te,""+pe,Ve);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case f:return pe.key===nt?ce(le,te,pe,Ve):null;case p:return pe.key===nt?Ee(le,te,pe,Ve):null;case j:return nt=pe._init,He(le,te,nt(pe._payload),Ve)}if(Y(pe)||O(pe))return nt!==null?null:Ke(le,te,pe,Ve,null);pf(le,pe)}return null}function Kt(le,te,pe,Ve,nt){if(typeof Ve=="string"&&Ve!==""||typeof Ve=="number")return le=le.get(pe)||null,Z(te,le,""+Ve,nt);if(typeof Ve=="object"&&Ve!==null){switch(Ve.$$typeof){case f:return le=le.get(Ve.key===null?pe:Ve.key)||null,ce(te,le,Ve,nt);case p:return le=le.get(Ve.key===null?pe:Ve.key)||null,Ee(te,le,Ve,nt);case j:var gt=Ve._init;return Kt(le,te,pe,gt(Ve._payload),nt)}if(Y(Ve)||O(Ve))return le=le.get(pe)||null,Ke(te,le,Ve,nt,null);pf(te,Ve)}return null}function Ft(le,te,pe,Ve){for(var nt=null,gt=null,ht=te,Et=te=0,Bn=null;ht!==null&&Et<pe.length;Et++){ht.index>Et?(Bn=ht,ht=null):Bn=ht.sibling;var Ot=He(le,ht,pe[Et],Ve);if(Ot===null){ht===null&&(ht=Bn);break}l&&ht&&Ot.alternate===null&&d(le,ht),te=P(Ot,te,Et),gt===null?nt=Ot:gt.sibling=Ot,gt=Ot,ht=Bn}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],Ve),ht!==null&&(te=P(ht,te,Et),gt===null?nt=ht:gt.sibling=ht,gt=ht);return Qt&&li(le,Et),nt}for(ht=C(le,ht);Et<pe.length;Et++)Bn=Kt(ht,le,Et,pe[Et],Ve),Bn!==null&&(l&&Bn.alternate!==null&&ht.delete(Bn.key===null?Et:Bn.key),te=P(Bn,te,Et),gt===null?nt=Bn:gt.sibling=Bn,gt=Bn);return l&&ht.forEach(function(_a){return d(le,_a)}),Qt&&li(le,Et),nt}function xr(le,te,pe,Ve){var nt=O(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=te,Et=te=0,Bn=null,Ot=pe.next();ht!==null&&!Ot.done;Et++,Ot=pe.next()){ht.index>Et?(Bn=ht,ht=null):Bn=ht.sibling;var _a=He(le,ht,Ot.value,Ve);if(_a===null){ht===null&&(ht=Bn);break}l&&ht&&_a.alternate===null&&d(le,ht),te=P(_a,te,Et),gt===null?nt=_a:gt.sibling=_a,gt=_a,ht=Bn}if(Ot.done)return g(le,ht),Qt&&li(le,Et),nt;if(ht===null){for(;!Ot.done;Et++,Ot=pe.next())Ot=pt(le,Ot.value,Ve),Ot!==null&&(te=P(Ot,te,Et),gt===null?nt=Ot:gt.sibling=Ot,gt=Ot);return Qt&&li(le,Et),nt}for(ht=C(le,ht);!Ot.done;Et++,Ot=pe.next())Ot=Kt(ht,le,Et,Ot.value,Ve),Ot!==null&&(l&&Ot.alternate!==null&&ht.delete(Ot.key===null?Et:Ot.key),te=P(Ot,te,Et),gt===null?nt=Ot:gt.sibling=Ot,gt=Ot);return l&&ht.forEach(function(a7){return d(le,a7)}),Qt&&li(le,Et),nt}function $s(le,te,pe,Ve){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=te;gt!==null;){if(gt.key===nt){if(nt=pe.type,nt===h){if(gt.tag===7){g(le,gt.sibling),te=S(gt,pe.props.children),te.return=le,le=te;break e}}else if(gt.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===j&&g2(nt)===gt.type){g(le,gt.sibling),te=S(gt,pe.props),te.ref=nu(le,gt,pe),te.return=le,le=te;break e}g(le,gt);break}else d(le,gt);gt=gt.sibling}pe.type===h?(te=mi(pe.props.children,le.mode,Ve,pe.key),te.return=le,le=te):(Ve=zf(pe.type,pe.key,pe.props,null,le.mode,Ve),Ve.ref=nu(le,te,pe),Ve.return=le,le=Ve)}return N(le);case p:e:{for(gt=pe.key;te!==null;){if(te.key===gt)if(te.tag===4&&te.stateNode.containerInfo===pe.containerInfo&&te.stateNode.implementation===pe.implementation){g(le,te.sibling),te=S(te,pe.children||[]),te.return=le,le=te;break e}else{g(le,te);break}else d(le,te);te=te.sibling}te=B0(pe,le.mode,Ve),te.return=le,le=te}return N(le);case j:return gt=pe._init,$s(le,te,gt(pe._payload),Ve)}if(Y(pe))return Ft(le,te,pe,Ve);if(O(pe))return xr(le,te,pe,Ve);pf(le,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"?(pe=""+pe,te!==null&&te.tag===6?(g(le,te.sibling),te=S(te,pe),te.return=le,le=te):(g(le,te),te=F0(pe,le.mode,Ve),te.return=le,le=te),N(le)):g(le,te)}return $s}var gl=v2(!0),b2=v2(!1),ru={},qr=wt(ru),ou=wt(ru),vl=wt(ru);function Jo(l){if(l===ru)throw Error(i(174));return l}function e0(l,d){St(vl,d),St(ou,l),St(qr,ru),l=L(d),bt(qr),St(qr,l)}function bl(){bt(qr),bt(ou),bt(vl)}function x2(l){var d=Jo(vl.current),g=Jo(qr.current);d=X(g,l.type,d),g!==d&&(St(ou,l),St(qr,d))}function t0(l){ou.current===l&&(bt(qr),bt(ou))}var on=wt(0);function hf(l){for(var d=l;d!==null;){if(d.tag===13){var g=d.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Es(g)||pa(g)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var n0=[];function r0(){for(var l=0;l<n0.length;l++){var d=n0[l];fe?d._workInProgressVersionPrimary=null:d._workInProgressVersionSecondary=null}n0.length=0}var mf=c.ReactCurrentDispatcher,o0=c.ReactCurrentBatchConfig,ui=0,sn=null,Mn=null,zn=null,gf=!1,su=!1,au=0,M8=0;function qn(){throw Error(i(321))}function s0(l,d){if(d===null)return!1;for(var g=0;g<d.length&&g<l.length;g++)if(!Co(l[g],d[g]))return!1;return!0}function a0(l,d,g,C,S,P){if(ui=P,sn=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,mf.current=l===null||l.memoizedState===null?N8:T8,l=g(C,S),su){P=0;do{if(su=!1,au=0,25<=P)throw Error(i(301));P+=1,zn=Mn=null,d.updateQueue=null,mf.current=$8,l=g(C,S)}while(su)}if(mf.current=xf,d=Mn!==null&&Mn.next!==null,ui=0,zn=Mn=sn=null,gf=!1,d)throw Error(i(300));return l}function i0(){var l=au!==0;return au=0,l}function es(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zn===null?sn.memoizedState=zn=l:zn=zn.next=l,zn}function Xr(){if(Mn===null){var l=sn.alternate;l=l!==null?l.memoizedState:null}else l=Mn.next;var d=zn===null?sn.memoizedState:zn.next;if(d!==null)zn=d,Mn=l;else{if(l===null)throw Error(i(310));Mn=l,l={memoizedState:Mn.memoizedState,baseState:Mn.baseState,baseQueue:Mn.baseQueue,queue:Mn.queue,next:null},zn===null?sn.memoizedState=zn=l:zn=zn.next=l}return zn}function iu(l,d){return typeof d=="function"?d(l):d}function l0(l){var d=Xr(),g=d.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var C=Mn,S=C.baseQueue,P=g.pending;if(P!==null){if(S!==null){var N=S.next;S.next=P.next,P.next=N}C.baseQueue=S=P,g.pending=null}if(S!==null){P=S.next,C=C.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}),C=Ee.hasEagerState?Ee.eagerState:l(C,Ee.action);else{var pt={lane:Ke,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null};ce===null?(Z=ce=pt,N=C):ce=ce.next=pt,sn.lanes|=Ke,di|=Ke}Ee=Ee.next}while(Ee!==null&&Ee!==P);ce===null?N=C:ce.next=Z,Co(C,d.memoizedState)||(gr=!0),d.memoizedState=C,d.baseState=N,d.baseQueue=ce,g.lastRenderedState=C}if(l=g.interleaved,l!==null){S=l;do P=S.lane,sn.lanes|=P,di|=P,S=S.next;while(S!==l)}else S===null&&(g.lanes=0);return[d.memoizedState,g.dispatch]}function c0(l){var d=Xr(),g=d.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var C=g.dispatch,S=g.pending,P=d.memoizedState;if(S!==null){g.pending=null;var N=S=S.next;do P=l(P,N.action),N=N.next;while(N!==S);Co(P,d.memoizedState)||(gr=!0),d.memoizedState=P,d.baseQueue===null&&(d.baseState=P),g.lastRenderedState=P}return[P,C]}function y2(){}function C2(l,d){var g=sn,C=Xr(),S=d(),P=!Co(C.memoizedState,S);if(P&&(C.memoizedState=S,gr=!0),C=C.queue,u0(k2.bind(null,g,C,l),[l]),C.getSnapshot!==d||P||zn!==null&&zn.memoizedState.tag&1){if(g.flags|=2048,lu(9,S2.bind(null,g,C,S,d),void 0,null),Fn===null)throw Error(i(349));ui&30||w2(g,d,S)}return S}function w2(l,d,g){l.flags|=16384,l={getSnapshot:d,value:g},d=sn.updateQueue,d===null?(d={lastEffect:null,stores:null},sn.updateQueue=d,d.stores=[l]):(g=d.stores,g===null?d.stores=[l]:g.push(l))}function S2(l,d,g,C){d.value=g,d.getSnapshot=C,_2(d)&&j2(l)}function k2(l,d,g){return g(function(){_2(d)&&j2(l)})}function _2(l){var d=l.getSnapshot;l=l.value;try{var g=d();return!Co(l,g)}catch{return!0}}function j2(l){var d=Zo(l,1);d!==null&&Yr(d,l,1,-1)}function P2(l){var d=es();return typeof l=="function"&&(l=l()),d.memoizedState=d.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:iu,lastRenderedState:l},d.queue=l,l=l.dispatch=A8.bind(null,sn,l),[d.memoizedState,l]}function lu(l,d,g,C){return l={tag:l,create:d,destroy:g,deps:C,next:null},d=sn.updateQueue,d===null?(d={lastEffect:null,stores:null},sn.updateQueue=d,d.lastEffect=l.next=l):(g=d.lastEffect,g===null?d.lastEffect=l.next=l:(C=g.next,g.next=l,l.next=C,d.lastEffect=l)),l}function I2(){return Xr().memoizedState}function vf(l,d,g,C){var S=es();sn.flags|=l,S.memoizedState=lu(1|d,g,void 0,C===void 0?null:C)}function bf(l,d,g,C){var S=Xr();C=C===void 0?null:C;var P=void 0;if(Mn!==null){var N=Mn.memoizedState;if(P=N.destroy,C!==null&&s0(C,N.deps)){S.memoizedState=lu(d,g,P,C);return}}sn.flags|=l,S.memoizedState=lu(1|d,g,P,C)}function E2(l,d){return vf(8390656,8,l,d)}function u0(l,d){return bf(2048,8,l,d)}function O2(l,d){return bf(4,2,l,d)}function M2(l,d){return bf(4,4,l,d)}function D2(l,d){if(typeof d=="function")return l=l(),d(l),function(){d(null)};if(d!=null)return l=l(),d.current=l,function(){d.current=null}}function R2(l,d,g){return g=g!=null?g.concat([l]):null,bf(4,4,D2.bind(null,d,l),g)}function d0(){}function A2(l,d){var g=Xr();d=d===void 0?null:d;var C=g.memoizedState;return C!==null&&d!==null&&s0(d,C[1])?C[0]:(g.memoizedState=[l,d],l)}function N2(l,d){var g=Xr();d=d===void 0?null:d;var C=g.memoizedState;return C!==null&&d!==null&&s0(d,C[1])?C[0]:(l=l(),g.memoizedState=[l,d],l)}function T2(l,d,g){return ui&21?(Co(g,d)||(g=Zy(),sn.lanes|=g,di|=g,l.baseState=!0),d):(l.baseState&&(l.baseState=!1,gr=!0),l.memoizedState=g)}function D8(l,d){var g=It;It=g!==0&&4>g?g:4,l(!0);var C=o0.transition;o0.transition={};try{l(!1),d()}finally{It=g,o0.transition=C}}function $2(){return Xr().memoizedState}function R8(l,d,g){var C=wa(l);if(g={lane:C,action:g,hasEagerState:!1,eagerState:null,next:null},L2(l))z2(d,g);else if(g=l2(l,d,g,C),g!==null){var S=Qn();Yr(g,l,C,S),F2(g,d,C)}}function A8(l,d,g){var C=wa(l),S={lane:C,action:g,hasEagerState:!1,eagerState:null,next:null};if(L2(l))z2(d,S);else{var P=l.alternate;if(l.lanes===0&&(P===null||P.lanes===0)&&(P=d.lastRenderedReducer,P!==null))try{var N=d.lastRenderedState,Z=P(N,g);if(S.hasEagerState=!0,S.eagerState=Z,Co(Z,N)){var ce=d.interleaved;ce===null?(S.next=S,Yg(d)):(S.next=ce.next,ce.next=S),d.interleaved=S;return}}catch{}finally{}g=l2(l,d,S,C),g!==null&&(S=Qn(),Yr(g,l,C,S),F2(g,d,C))}}function L2(l){var d=l.alternate;return l===sn||d!==null&&d===sn}function z2(l,d){su=gf=!0;var g=l.pending;g===null?d.next=d:(d.next=g.next,g.next=d),l.pending=d}function F2(l,d,g){if(g&4194240){var C=d.lanes;C&=l.pendingLanes,g|=C,d.lanes=g,Tg(l,g)}}var xf={readContext:Kr,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},N8={readContext:Kr,useCallback:function(l,d){return es().memoizedState=[l,d===void 0?null:d],l},useContext:Kr,useEffect:E2,useImperativeHandle:function(l,d,g){return g=g!=null?g.concat([l]):null,vf(4194308,4,D2.bind(null,d,l),g)},useLayoutEffect:function(l,d){return vf(4194308,4,l,d)},useInsertionEffect:function(l,d){return vf(4,2,l,d)},useMemo:function(l,d){var g=es();return d=d===void 0?null:d,l=l(),g.memoizedState=[l,d],l},useReducer:function(l,d,g){var C=es();return d=g!==void 0?g(d):d,C.memoizedState=C.baseState=d,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:d},C.queue=l,l=l.dispatch=R8.bind(null,sn,l),[C.memoizedState,l]},useRef:function(l){var d=es();return l={current:l},d.memoizedState=l},useState:P2,useDebugValue:d0,useDeferredValue:function(l){return es().memoizedState=l},useTransition:function(){var l=P2(!1),d=l[0];return l=D8.bind(null,l[1]),es().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,g){var C=sn,S=es();if(Qt){if(g===void 0)throw Error(i(407));g=g()}else{if(g=d(),Fn===null)throw Error(i(349));ui&30||w2(C,d,g)}S.memoizedState=g;var P={value:g,getSnapshot:d};return S.queue=P,E2(k2.bind(null,C,P,l),[l]),C.flags|=2048,lu(9,S2.bind(null,C,P,g,d),void 0,null),g},useId:function(){var l=es(),d=Fn.identifierPrefix;if(Qt){var g=Rs,C=Ds;g=(C&~(1<<32-yo(C)-1)).toString(32)+g,d=":"+d+"R"+g,g=au++,0<g&&(d+="H"+g.toString(32)),d+=":"}else g=M8++,d=":"+d+"r"+g.toString(32)+":";return l.memoizedState=d},unstable_isNewReconciler:!1},T8={readContext:Kr,useCallback:A2,useContext:Kr,useEffect:u0,useImperativeHandle:R2,useInsertionEffect:O2,useLayoutEffect:M2,useMemo:N2,useReducer:l0,useRef:I2,useState:function(){return l0(iu)},useDebugValue:d0,useDeferredValue:function(l){var d=Xr();return T2(d,Mn.memoizedState,l)},useTransition:function(){var l=l0(iu)[0],d=Xr().memoizedState;return[l,d]},useMutableSource:y2,useSyncExternalStore:C2,useId:$2,unstable_isNewReconciler:!1},$8={readContext:Kr,useCallback:A2,useContext:Kr,useEffect:u0,useImperativeHandle:R2,useInsertionEffect:O2,useLayoutEffect:M2,useMemo:N2,useReducer:c0,useRef:I2,useState:function(){return c0(iu)},useDebugValue:d0,useDeferredValue:function(l){var d=Xr();return Mn===null?d.memoizedState=l:T2(d,Mn.memoizedState,l)},useTransition:function(){var l=c0(iu)[0],d=Xr().memoizedState;return[l,d]},useMutableSource:y2,useSyncExternalStore:C2,useId:$2,unstable_isNewReconciler:!1};function xl(l,d){try{var g="",C=d;do g+=O8(C),C=C.return;while(C);var S=g}catch(P){S=`
|
||
Error generating stack: `+P.message+`
|
||
`+P.stack}return{value:l,source:d,stack:S,digest:null}}function f0(l,d,g){return{value:l,source:null,stack:g??null,digest:d??null}}function p0(l,d){try{console.error(d.value)}catch(g){setTimeout(function(){throw g})}}var L8=typeof WeakMap=="function"?WeakMap:Map;function B2(l,d,g){g=As(-1,g),g.tag=3,g.payload={element:null};var C=d.value;return g.callback=function(){Rf||(Rf=!0,R0=C),p0(l,d)},g}function H2(l,d,g){g=As(-1,g),g.tag=3;var C=l.type.getDerivedStateFromError;if(typeof C=="function"){var S=d.value;g.payload=function(){return C(S)},g.callback=function(){p0(l,d)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(g.callback=function(){p0(l,d),typeof C!="function"&&(ya===null?ya=new Set([this]):ya.add(this));var N=d.stack;this.componentDidCatch(d.value,{componentStack:N!==null?N:""})}),g}function V2(l,d,g){var C=l.pingCache;if(C===null){C=l.pingCache=new L8;var S=new Set;C.set(d,S)}else S=C.get(d),S===void 0&&(S=new Set,C.set(d,S));S.has(g)||(S.add(g),l=Z8.bind(null,l,d,g),d.then(l,l))}function W2(l){do{var d;if((d=l.tag===13)&&(d=l.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return l;l=l.return}while(l!==null);return null}function U2(l,d,g,C,S){return l.mode&1?(l.flags|=65536,l.lanes=S,l):(l===d?l.flags|=65536:(l.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(d=As(-1,1),d.tag=2,xa(g,d,1))),g.lanes|=1),l)}var z8=c.ReactCurrentOwner,gr=!1;function cr(l,d,g,C){d.child=l===null?b2(d,null,g,C):gl(d,l.child,g,C)}function G2(l,d,g,C,S){g=g.render;var P=d.ref;return ml(d,S),C=a0(l,d,g,C,P,S),g=i0(),l!==null&&!gr?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~S,Ns(l,d,S)):(Qt&&g&&Bg(d),d.flags|=1,cr(l,d,C,S),d.child)}function K2(l,d,g,C,S){if(l===null){var P=g.type;return typeof P=="function"&&!z0(P)&&P.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(d.tag=15,d.type=P,q2(l,d,P,C,S)):(l=zf(g.type,null,C,d,d.mode,S),l.ref=d.ref,l.return=d,d.child=l)}if(P=l.child,!(l.lanes&S)){var N=P.memoizedProps;if(g=g.compare,g=g!==null?g:af,g(N,C)&&l.ref===d.ref)return Ns(l,d,S)}return d.flags|=1,l=ka(P,C),l.ref=d.ref,l.return=d,d.child=l}function q2(l,d,g,C,S){if(l!==null){var P=l.memoizedProps;if(af(P,C)&&l.ref===d.ref)if(gr=!1,d.pendingProps=C=P,(l.lanes&S)!==0)l.flags&131072&&(gr=!0);else return d.lanes=l.lanes,Ns(l,d,S)}return h0(l,d,g,C,S)}function X2(l,d,g){var C=d.pendingProps,S=C.children,P=l!==null?l.memoizedState:null;if(C.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null,transitions:null},St(Cl,Ar),Ar|=g;else{if(!(g&1073741824))return l=P!==null?P.baseLanes|g:g,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:l,cachePool:null,transitions:null},d.updateQueue=null,St(Cl,Ar),Ar|=l,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},C=P!==null?P.baseLanes:g,St(Cl,Ar),Ar|=C}else P!==null?(C=P.baseLanes|g,d.memoizedState=null):C=g,St(Cl,Ar),Ar|=C;return cr(l,d,S,g),d.child}function Y2(l,d){var g=d.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(d.flags|=512,d.flags|=2097152)}function h0(l,d,g,C,S){var P=mr(g)?lr:Vt.current;return P=ul(d,P),ml(d,S),g=a0(l,d,g,C,P,S),C=i0(),l!==null&&!gr?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~S,Ns(l,d,S)):(Qt&&C&&Bg(d),d.flags|=1,cr(l,d,g,S),d.child)}function Q2(l,d,g,C,S){if(mr(g)){var P=!0;Qd(d)}else P=!1;if(ml(d,S),d.stateNode===null)Cf(l,d),h2(d,g,C),Jg(d,g,C,S),C=!0;else if(l===null){var N=d.stateNode,Z=d.memoizedProps;N.props=Z;var ce=N.context,Ee=g.contextType;typeof Ee=="object"&&Ee!==null?Ee=Kr(Ee):(Ee=mr(g)?lr:Vt.current,Ee=ul(d,Ee));var Ke=g.getDerivedStateFromProps,pt=typeof Ke=="function"||typeof N.getSnapshotBeforeUpdate=="function";pt||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==C||ce!==Ee)&&m2(d,N,C,Ee),ba=!1;var He=d.memoizedState;N.state=He,df(d,C,N,S),ce=d.memoizedState,Z!==C||He!==ce||kn.current||ba?(typeof Ke=="function"&&(Zg(d,g,Ke,C),ce=d.memoizedState),(Z=ba||p2(d,g,Z,C,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"&&(d.flags|=4194308)):(typeof N.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=C,d.memoizedState=ce),N.props=C,N.state=ce,N.context=Ee,C=Z):(typeof N.componentDidMount=="function"&&(d.flags|=4194308),C=!1)}else{N=d.stateNode,c2(l,d),Z=d.memoizedProps,Ee=d.type===d.elementType?Z:So(d.type,Z),N.props=Ee,pt=d.pendingProps,He=N.context,ce=g.contextType,typeof ce=="object"&&ce!==null?ce=Kr(ce):(ce=mr(g)?lr:Vt.current,ce=ul(d,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)&&m2(d,N,C,ce),ba=!1,He=d.memoizedState,N.state=He,df(d,C,N,S);var Ft=d.memoizedState;Z!==pt||He!==Ft||kn.current||ba?(typeof Kt=="function"&&(Zg(d,g,Kt,C),Ft=d.memoizedState),(Ee=ba||p2(d,g,Ee,C,He,Ft,ce)||!1)?(Ke||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(C,Ft,ce),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(C,Ft,ce)),typeof N.componentDidUpdate=="function"&&(d.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof N.componentDidUpdate!="function"||Z===l.memoizedProps&&He===l.memoizedState||(d.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===l.memoizedProps&&He===l.memoizedState||(d.flags|=1024),d.memoizedProps=C,d.memoizedState=Ft),N.props=C,N.state=Ft,N.context=ce,C=Ee):(typeof N.componentDidUpdate!="function"||Z===l.memoizedProps&&He===l.memoizedState||(d.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===l.memoizedProps&&He===l.memoizedState||(d.flags|=1024),C=!1)}return m0(l,d,g,C,P,S)}function m0(l,d,g,C,S,P){Y2(l,d);var N=(d.flags&128)!==0;if(!C&&!N)return S&&Qy(d,g,!1),Ns(l,d,P);C=d.stateNode,z8.current=d;var Z=N&&typeof g.getDerivedStateFromError!="function"?null:C.render();return d.flags|=1,l!==null&&N?(d.child=gl(d,l.child,null,P),d.child=gl(d,null,Z,P)):cr(l,d,Z,P),d.memoizedState=C.state,S&&Qy(d,g,!0),d.child}function Z2(l){var d=l.stateNode;d.pendingContext?Xy(l,d.pendingContext,d.pendingContext!==d.context):d.context&&Xy(l,d.context,!1),e0(l,d.containerInfo)}function J2(l,d,g,C,S){return pl(),Ug(S),d.flags|=256,cr(l,d,g,C),d.child}var g0={dehydrated:null,treeContext:null,retryLane:0};function v0(l){return{baseLanes:l,cachePool:null,transitions:null}}function eC(l,d,g){var C=d.pendingProps,S=on.current,P=!1,N=(d.flags&128)!==0,Z;if((Z=N)||(Z=l!==null&&l.memoizedState===null?!1:(S&2)!==0),Z?(P=!0,d.flags&=-129):(l===null||l.memoizedState!==null)&&(S|=1),St(on,S&1),l===null)return Wg(d),l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?(d.mode&1?pa(l)?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):(N=C.children,l=C.fallback,P?(C=d.mode,P=d.child,N={mode:"hidden",children:N},!(C&1)&&P!==null?(P.childLanes=0,P.pendingProps=N):P=Ff(N,C,0,null),l=mi(l,C,g,null),P.return=d,l.return=d,P.sibling=l,d.child=P,d.child.memoizedState=v0(g),d.memoizedState=g0,l):b0(d,N));if(S=l.memoizedState,S!==null&&(Z=S.dehydrated,Z!==null))return F8(l,d,N,C,Z,S,g);if(P){P=C.fallback,N=d.mode,S=l.child,Z=S.sibling;var ce={mode:"hidden",children:C.children};return!(N&1)&&d.child!==S?(C=d.child,C.childLanes=0,C.pendingProps=ce,d.deletions=null):(C=ka(S,ce),C.subtreeFlags=S.subtreeFlags&14680064),Z!==null?P=ka(Z,P):(P=mi(P,N,g,null),P.flags|=2),P.return=d,C.return=d,C.sibling=P,d.child=C,C=P,P=d.child,N=l.child.memoizedState,N=N===null?v0(g):{baseLanes:N.baseLanes|g,cachePool:null,transitions:N.transitions},P.memoizedState=N,P.childLanes=l.childLanes&~g,d.memoizedState=g0,C}return P=l.child,l=P.sibling,C=ka(P,{mode:"visible",children:C.children}),!(d.mode&1)&&(C.lanes=g),C.return=d,C.sibling=null,l!==null&&(g=d.deletions,g===null?(d.deletions=[l],d.flags|=16):g.push(l)),d.child=C,d.memoizedState=null,C}function b0(l,d){return d=Ff({mode:"visible",children:d},l.mode,0,null),d.return=l,l.child=d}function yf(l,d,g,C){return C!==null&&Ug(C),gl(d,l.child,null,g),l=b0(d,d.pendingProps.children),l.flags|=2,d.memoizedState=null,l}function F8(l,d,g,C,S,P,N){if(g)return d.flags&256?(d.flags&=-257,C=f0(Error(i(422))),yf(l,d,N,C)):d.memoizedState!==null?(d.child=l.child,d.flags|=128,null):(P=C.fallback,S=d.mode,C=Ff({mode:"visible",children:C.children},S,0,null),P=mi(P,S,N,null),P.flags|=2,C.return=d,P.return=d,C.sibling=P,d.child=C,d.mode&1&&gl(d,l.child,null,N),d.child.memoizedState=v0(N),d.memoizedState=g0,P);if(!(d.mode&1))return yf(l,d,N,null);if(pa(S))return C=ha(S).digest,P=Error(i(419)),C=f0(P,C,void 0),yf(l,d,N,C);if(g=(N&l.childLanes)!==0,gr||g){if(C=Fn,C!==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&(C.suspendedLanes|N)?0:S,S!==0&&S!==P.retryLane&&(P.retryLane=S,Zo(l,S),Yr(C,l,S,-1))}return L0(),C=f0(Error(i(421))),yf(l,d,N,C)}return Es(S)?(d.flags|=128,d.child=l.child,d=J8.bind(null,l),il(S,d),null):(l=P.treeContext,ye&&(Gr=At(S),Rr=d,Qt=!0,wo=null,tu=!1,l!==null&&(Wr[Ur++]=Ds,Wr[Ur++]=Rs,Wr[Ur++]=ii,Ds=l.id,Rs=l.overflow,ii=d)),d=b0(d,C.children),d.flags|=4096,d)}function tC(l,d,g){l.lanes|=d;var C=l.alternate;C!==null&&(C.lanes|=d),Xg(l.return,d,g)}function x0(l,d,g,C,S){var P=l.memoizedState;P===null?l.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:C,tail:g,tailMode:S}:(P.isBackwards=d,P.rendering=null,P.renderingStartTime=0,P.last=C,P.tail=g,P.tailMode=S)}function nC(l,d,g){var C=d.pendingProps,S=C.revealOrder,P=C.tail;if(cr(l,d,C.children,g),C=on.current,C&2)C=C&1|2,d.flags|=128;else{if(l!==null&&l.flags&128)e:for(l=d.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&tC(l,g,d);else if(l.tag===19)tC(l,g,d);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===d)break e;for(;l.sibling===null;){if(l.return===null||l.return===d)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}C&=1}if(St(on,C),!(d.mode&1))d.memoizedState=null;else switch(S){case"forwards":for(g=d.child,S=null;g!==null;)l=g.alternate,l!==null&&hf(l)===null&&(S=g),g=g.sibling;g=S,g===null?(S=d.child,d.child=null):(S=g.sibling,g.sibling=null),x0(d,!1,S,g,P);break;case"backwards":for(g=null,S=d.child,d.child=null;S!==null;){if(l=S.alternate,l!==null&&hf(l)===null){d.child=S;break}l=S.sibling,S.sibling=g,g=S,S=l}x0(d,!0,g,null,P);break;case"together":x0(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Cf(l,d){!(d.mode&1)&&l!==null&&(l.alternate=null,d.alternate=null,d.flags|=2)}function Ns(l,d,g){if(l!==null&&(d.dependencies=l.dependencies),di|=d.lanes,!(g&d.childLanes))return null;if(l!==null&&d.child!==l.child)throw Error(i(153));if(d.child!==null){for(l=d.child,g=ka(l,l.pendingProps),d.child=g,g.return=d;l.sibling!==null;)l=l.sibling,g=g.sibling=ka(l,l.pendingProps),g.return=d;g.sibling=null}return d.child}function B8(l,d,g){switch(d.tag){case 3:Z2(d),pl();break;case 5:x2(d);break;case 1:mr(d.type)&&Qd(d);break;case 4:e0(d,d.stateNode.containerInfo);break;case 10:i2(d,d.type._context,d.memoizedProps.value);break;case 13:var C=d.memoizedState;if(C!==null)return C.dehydrated!==null?(St(on,on.current&1),d.flags|=128,null):g&d.child.childLanes?eC(l,d,g):(St(on,on.current&1),l=Ns(l,d,g),l!==null?l.sibling:null);St(on,on.current&1);break;case 19:if(C=(g&d.childLanes)!==0,l.flags&128){if(C)return nC(l,d,g);d.flags|=128}var S=d.memoizedState;if(S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),St(on,on.current),C)break;return null;case 22:case 23:return d.lanes=0,X2(l,d,g)}return Ns(l,d,g)}function ts(l){l.flags|=4}function rC(l,d){if(l!==null&&l.child===d.child)return!0;if(d.flags&16)return!1;for(l=d.child;l!==null;){if(l.flags&12854||l.subtreeFlags&12854)return!1;l=l.sibling}return!0}var cu,uu,wf,Sf;if(de)cu=function(l,d){for(var g=d.child;g!==null;){if(g.tag===5||g.tag===6)Q(l,g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===d)break;for(;g.sibling===null;){if(g.return===null||g.return===d)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},uu=function(){},wf=function(l,d,g,C,S){if(l=l.memoizedProps,l!==C){var P=d.stateNode,N=Jo(qr.current);g=oe(P,g,l,C,S,N),(d.updateQueue=g)&&ts(d)}},Sf=function(l,d,g,C){g!==C&&ts(d)};else if(me){cu=function(l,d,g,C){for(var S=d.child;S!==null;){if(S.tag===5){var P=S.stateNode;g&&C&&(P=hr(P,S.type,S.memoizedProps,S)),Q(l,P)}else if(S.tag===6)P=S.stateNode,g&&C&&(P=xo(P,S.memoizedProps,S)),Q(l,P);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)P=S.child,P!==null&&(P.return=S),cu(l,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===d)break;for(;S.sibling===null;){if(S.return===null||S.return===d)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};var oC=function(l,d,g,C){for(var S=d.child;S!==null;){if(S.tag===5){var P=S.stateNode;g&&C&&(P=hr(P,S.type,S.memoizedProps,S)),fn(l,P)}else if(S.tag===6)P=S.stateNode,g&&C&&(P=xo(P,S.memoizedProps,S)),fn(l,P);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)P=S.child,P!==null&&(P.return=S),oC(l,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===d)break;for(;S.sibling===null;){if(S.return===null||S.return===d)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};uu=function(l,d){var g=d.stateNode;if(!rC(l,d)){l=g.containerInfo;var C=In(l);oC(C,d,!1,!1),g.pendingChildren=C,ts(d),rn(l,C)}},wf=function(l,d,g,C,S){var P=l.stateNode,N=l.memoizedProps;if((l=rC(l,d))&&N===C)d.stateNode=P;else{var Z=d.stateNode,ce=Jo(qr.current),Ee=null;N!==C&&(Ee=oe(Z,g,N,C,S,ce)),l&&Ee===null?d.stateNode=P:(P=sr(P,Ee,g,N,C,d,l,Z),ie(P,g,C,S,ce)&&ts(d),d.stateNode=P,l?ts(d):cu(P,d,!1,!1))}},Sf=function(l,d,g,C){g!==C?(l=Jo(vl.current),g=Jo(qr.current),d.stateNode=U(C,l,g,d),ts(d)):d.stateNode=l.stateNode}}else uu=function(){},wf=function(){},Sf=function(){};function du(l,d){if(!Qt)switch(l.tailMode){case"hidden":d=l.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var C=null;g!==null;)g.alternate!==null&&(C=g),g=g.sibling;C===null?d||l.tail===null?l.tail=null:l.tail.sibling=null:C.sibling=null}}function Xn(l){var d=l.alternate!==null&&l.alternate.child===l.child,g=0,C=0;if(d)for(var S=l.child;S!==null;)g|=S.lanes|S.childLanes,C|=S.subtreeFlags&14680064,C|=S.flags&14680064,S.return=l,S=S.sibling;else for(S=l.child;S!==null;)g|=S.lanes|S.childLanes,C|=S.subtreeFlags,C|=S.flags,S.return=l,S=S.sibling;return l.subtreeFlags|=C,l.childLanes=g,d}function H8(l,d,g){var C=d.pendingProps;switch(Hg(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xn(d),null;case 1:return mr(d.type)&&Yd(),Xn(d),null;case 3:return g=d.stateNode,bl(),bt(kn),bt(Vt),r0(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(l===null||l.child===null)&&(sf(d)?ts(d):l===null||l.memoizedState.isDehydrated&&!(d.flags&256)||(d.flags|=1024,wo!==null&&(T0(wo),wo=null))),uu(l,d),Xn(d),null;case 5:t0(d),g=Jo(vl.current);var S=d.type;if(l!==null&&d.stateNode!=null)wf(l,d,S,C,g),l.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!C){if(d.stateNode===null)throw Error(i(166));return Xn(d),null}if(l=Jo(qr.current),sf(d)){if(!ye)throw Error(i(175));l=En(d.stateNode,d.type,d.memoizedProps,g,l,d,!tu),d.updateQueue=l,l!==null&&ts(d)}else{var P=ne(S,C,g,l,d);cu(P,d,!1,!1),d.stateNode=P,ie(P,S,C,g,l)&&ts(d)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return Xn(d),null;case 6:if(l&&d.stateNode!=null)Sf(l,d,l.memoizedProps,C);else{if(typeof C!="string"&&d.stateNode===null)throw Error(i(166));if(l=Jo(vl.current),g=Jo(qr.current),sf(d)){if(!ye)throw Error(i(176));if(l=d.stateNode,g=d.memoizedProps,(C=vt(l,g,d,!tu))&&(S=Rr,S!==null))switch(S.tag){case 3:Xd(S.stateNode.containerInfo,l,g,(S.mode&1)!==0);break;case 5:cl(S.type,S.memoizedProps,S.stateNode,l,g,(S.mode&1)!==0)}C&&ts(d)}else d.stateNode=U(C,l,g,d)}return Xn(d),null;case 13:if(bt(on),C=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Qt&&Gr!==null&&d.mode&1&&!(d.flags&128))a2(),pl(),d.flags|=98560,S=!1;else if(S=sf(d),C!==null&&C.dehydrated!==null){if(l===null){if(!S)throw Error(i(318));if(!ye)throw Error(i(344));if(S=d.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(i(317));ga(S,d)}else pl(),!(d.flags&128)&&(d.memoizedState=null),d.flags|=4;Xn(d),S=!1}else wo!==null&&(T0(wo),wo=null),S=!0;if(!S)return d.flags&65536?d:null}return d.flags&128?(d.lanes=g,d):(g=C!==null,g!==(l!==null&&l.memoizedState!==null)&&g&&(d.child.flags|=8192,d.mode&1&&(l===null||on.current&1?Dn===0&&(Dn=3):L0())),d.updateQueue!==null&&(d.flags|=4),Xn(d),null);case 4:return bl(),uu(l,d),l===null&&ue(d.stateNode.containerInfo),Xn(d),null;case 10:return qg(d.type._context),Xn(d),null;case 17:return mr(d.type)&&Yd(),Xn(d),null;case 19:if(bt(on),S=d.memoizedState,S===null)return Xn(d),null;if(C=(d.flags&128)!==0,P=S.rendering,P===null)if(C)du(S,!1);else{if(Dn!==0||l!==null&&l.flags&128)for(l=d.child;l!==null;){if(P=hf(l),P!==null){for(d.flags|=128,du(S,!1),l=P.updateQueue,l!==null&&(d.updateQueue=l,d.flags|=4),d.subtreeFlags=0,l=g,g=d.child;g!==null;)C=g,S=l,C.flags&=14680066,P=C.alternate,P===null?(C.childLanes=0,C.lanes=S,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=P.childLanes,C.lanes=P.lanes,C.child=P.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=P.memoizedProps,C.memoizedState=P.memoizedState,C.updateQueue=P.updateQueue,C.type=P.type,S=P.dependencies,C.dependencies=S===null?null:{lanes:S.lanes,firstContext:S.firstContext}),g=g.sibling;return St(on,on.current&1|2),d.child}l=l.sibling}S.tail!==null&&Ln()>D0&&(d.flags|=128,C=!0,du(S,!1),d.lanes=4194304)}else{if(!C)if(l=hf(P),l!==null){if(d.flags|=128,C=!0,l=l.updateQueue,l!==null&&(d.updateQueue=l,d.flags|=4),du(S,!0),S.tail===null&&S.tailMode==="hidden"&&!P.alternate&&!Qt)return Xn(d),null}else 2*Ln()-S.renderingStartTime>D0&&g!==1073741824&&(d.flags|=128,C=!0,du(S,!1),d.lanes=4194304);S.isBackwards?(P.sibling=d.child,d.child=P):(l=S.last,l!==null?l.sibling=P:d.child=P,S.last=P)}return S.tail!==null?(d=S.tail,S.rendering=d,S.tail=d.sibling,S.renderingStartTime=Ln(),d.sibling=null,l=on.current,St(on,C?l&1|2:l&1),d):(Xn(d),null);case 22:case 23:return $0(),g=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==g&&(d.flags|=8192),g&&d.mode&1?Ar&1073741824&&(Xn(d),de&&d.subtreeFlags&6&&(d.flags|=8192)):Xn(d),null;case 24:return null;case 25:return null}throw Error(i(156,d.tag))}function V8(l,d){switch(Hg(d),d.tag){case 1:return mr(d.type)&&Yd(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return bl(),bt(kn),bt(Vt),r0(),l=d.flags,l&65536&&!(l&128)?(d.flags=l&-65537|128,d):null;case 5:return t0(d),null;case 13:if(bt(on),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(i(340));pl()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return bt(on),null;case 4:return bl(),null;case 10:return qg(d.type._context),null;case 22:case 23:return $0(),null;case 24:return null;default:return null}}var kf=!1,Yn=!1,W8=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function yl(l,d){var g=l.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(C){Zt(l,d,C)}else g.current=null}function y0(l,d,g){try{g()}catch(C){Zt(l,d,C)}}var sC=!1;function U8(l,d){for(z(l.containerInfo),Ge=d;Ge!==null;)if(l=Ge,d=l.child,(l.subtreeFlags&1028)!==0&&d!==null)d.return=l,Ge=d;else for(;Ge!==null;){l=Ge;try{var g=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var C=g.memoizedProps,S=g.memoizedState,P=l.stateNode,N=P.getSnapshotBeforeUpdate(l.elementType===l.type?C:So(l.type,C),S);P.__reactInternalSnapshotBeforeUpdate=N}break;case 3:de&&jt(l.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Z){Zt(l,l.return,Z)}if(d=l.sibling,d!==null){d.return=l.return,Ge=d;break}Ge=l.return}return g=sC,sC=!1,g}function fu(l,d,g){var C=d.updateQueue;if(C=C!==null?C.lastEffect:null,C!==null){var S=C=C.next;do{if((S.tag&l)===l){var P=S.destroy;S.destroy=void 0,P!==void 0&&y0(d,g,P)}S=S.next}while(S!==C)}}function _f(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&l)===l){var C=g.create;g.destroy=C()}g=g.next}while(g!==d)}}function C0(l){var d=l.ref;if(d!==null){var g=l.stateNode;switch(l.tag){case 5:l=V(g);break;default:l=g}typeof d=="function"?d(l):d.current=l}}function aC(l){var d=l.alternate;d!==null&&(l.alternate=null,aC(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&je(d)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function iC(l){return l.tag===5||l.tag===3||l.tag===4}function lC(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||iC(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function w0(l,d,g){var C=l.tag;if(C===5||C===6)l=l.stateNode,d?Rt(g,l,d):Ye(g,l);else if(C!==4&&(l=l.child,l!==null))for(w0(l,d,g),l=l.sibling;l!==null;)w0(l,d,g),l=l.sibling}function S0(l,d,g){var C=l.tag;if(C===5||C===6)l=l.stateNode,d?$e(g,l,d):ge(g,l);else if(C!==4&&(l=l.child,l!==null))for(S0(l,d,g),l=l.sibling;l!==null;)S0(l,d,g),l=l.sibling}var Vn=null,ko=!1;function ns(l,d,g){for(g=g.child;g!==null;)k0(l,d,g),g=g.sibling}function k0(l,d,g){if(Yo&&typeof Yo.onCommitFiberUnmount=="function")try{Yo.onCommitFiberUnmount(tf,g)}catch{}switch(g.tag){case 5:Yn||yl(g,d);case 6:if(de){var C=Vn,S=ko;Vn=null,ns(l,d,g),Vn=C,ko=S,Vn!==null&&(ko?ze(Vn,g.stateNode):ke(Vn,g.stateNode))}else ns(l,d,g);break;case 18:de&&Vn!==null&&(ko?On(Vn,g.stateNode):Dg(Vn,g.stateNode));break;case 4:de?(C=Vn,S=ko,Vn=g.stateNode.containerInfo,ko=!0,ns(l,d,g),Vn=C,ko=S):(me&&(C=g.stateNode.containerInfo,S=In(C),Yt(C,S)),ns(l,d,g));break;case 0:case 11:case 14:case 15:if(!Yn&&(C=g.updateQueue,C!==null&&(C=C.lastEffect,C!==null))){S=C=C.next;do{var P=S,N=P.destroy;P=P.tag,N!==void 0&&(P&2||P&4)&&y0(g,d,N),S=S.next}while(S!==C)}ns(l,d,g);break;case 1:if(!Yn&&(yl(g,d),C=g.stateNode,typeof C.componentWillUnmount=="function"))try{C.props=g.memoizedProps,C.state=g.memoizedState,C.componentWillUnmount()}catch(Z){Zt(g,d,Z)}ns(l,d,g);break;case 21:ns(l,d,g);break;case 22:g.mode&1?(Yn=(C=Yn)||g.memoizedState!==null,ns(l,d,g),Yn=C):ns(l,d,g);break;default:ns(l,d,g)}}function cC(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var g=l.stateNode;g===null&&(g=l.stateNode=new W8),d.forEach(function(C){var S=e7.bind(null,l,C);g.has(C)||(g.add(C),C.then(S,S))})}}function _o(l,d){var g=d.deletions;if(g!==null)for(var C=0;C<g.length;C++){var S=g[C];try{var P=l,N=d;if(de){var Z=N;e:for(;Z!==null;){switch(Z.tag){case 5:Vn=Z.stateNode,ko=!1;break e;case 3:Vn=Z.stateNode.containerInfo,ko=!0;break e;case 4:Vn=Z.stateNode.containerInfo,ko=!0;break e}Z=Z.return}if(Vn===null)throw Error(i(160));k0(P,N,S),Vn=null,ko=!1}else k0(P,N,S);var ce=S.alternate;ce!==null&&(ce.return=null),S.return=null}catch(Ee){Zt(S,d,Ee)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)uC(d,l),d=d.sibling}function uC(l,d){var g=l.alternate,C=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(_o(d,l),rs(l),C&4){try{fu(3,l,l.return),_f(3,l)}catch(He){Zt(l,l.return,He)}try{fu(5,l,l.return)}catch(He){Zt(l,l.return,He)}}break;case 1:_o(d,l),rs(l),C&512&&g!==null&&yl(g,g.return);break;case 5:if(_o(d,l),rs(l),C&512&&g!==null&&yl(g,g.return),de){if(l.flags&32){var S=l.stateNode;try{Le(S)}catch(He){Zt(l,l.return,He)}}if(C&4&&(S=l.stateNode,S!=null)){var P=l.memoizedProps;if(g=g!==null?g.memoizedProps:P,C=l.type,d=l.updateQueue,l.updateQueue=null,d!==null)try{Oe(S,d,C,g,P,l)}catch(He){Zt(l,l.return,He)}}}break;case 6:if(_o(d,l),rs(l),C&4&&de){if(l.stateNode===null)throw Error(i(162));S=l.stateNode,P=l.memoizedProps,g=g!==null?g.memoizedProps:P;try{ot(S,g,P)}catch(He){Zt(l,l.return,He)}}break;case 3:if(_o(d,l),rs(l),C&4){if(de&&ye&&g!==null&&g.memoizedState.isDehydrated)try{qd(d.containerInfo)}catch(He){Zt(l,l.return,He)}if(me){S=d.containerInfo,P=d.pendingChildren;try{Yt(S,P)}catch(He){Zt(l,l.return,He)}}}break;case 4:if(_o(d,l),rs(l),C&4&&me){P=l.stateNode,S=P.containerInfo,P=P.pendingChildren;try{Yt(S,P)}catch(He){Zt(l,l.return,He)}}break;case 13:_o(d,l),rs(l),S=l.child,S.flags&8192&&(P=S.memoizedState!==null,S.stateNode.isHidden=P,!P||S.alternate!==null&&S.alternate.memoizedState!==null||(M0=Ln())),C&4&&cC(l);break;case 22:var N=g!==null&&g.memoizedState!==null;if(l.mode&1?(Yn=(g=Yn)||N,_o(d,l),Yn=g):_o(d,l),rs(l),C&8192){if(g=l.memoizedState!==null,(l.stateNode.isHidden=g)&&!N&&l.mode&1)for(Ge=l,C=l.child;C!==null;){for(d=Ge=C;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:yl(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:yl(N,N.return);break;case 22:if(N.memoizedState!==null){pC(d);continue}}Z!==null?(Z.return=N,Ge=Z):pC(d)}C=C.sibling}if(de){e:if(C=null,de)for(d=l;;){if(d.tag===5){if(C===null){C=d;try{S=d.stateNode,g?We(S):vn(d.stateNode,d.memoizedProps)}catch(He){Zt(l,l.return,He)}}}else if(d.tag===6){if(C===null)try{P=d.stateNode,g?ct(P):_t(P,d.memoizedProps)}catch(He){Zt(l,l.return,He)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===l)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break e;for(;d.sibling===null;){if(d.return===null||d.return===l)break e;C===d&&(C=null),d=d.return}C===d&&(C=null),d.sibling.return=d.return,d=d.sibling}}}break;case 19:_o(d,l),rs(l),C&4&&cC(l);break;case 21:break;default:_o(d,l),rs(l)}}function rs(l){var d=l.flags;if(d&2){try{if(de){e:{for(var g=l.return;g!==null;){if(iC(g)){var C=g;break e}g=g.return}throw Error(i(160))}switch(C.tag){case 5:var S=C.stateNode;C.flags&32&&(Le(S),C.flags&=-33);var P=lC(l);S0(l,P,S);break;case 3:case 4:var N=C.stateNode.containerInfo,Z=lC(l);w0(l,Z,N);break;default:throw Error(i(161))}}}catch(ce){Zt(l,l.return,ce)}l.flags&=-3}d&4096&&(l.flags&=-4097)}function G8(l,d,g){Ge=l,dC(l)}function dC(l,d,g){for(var C=(l.mode&1)!==0;Ge!==null;){var S=Ge,P=S.child;if(S.tag===22&&C){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?hC(S):ce!==null?(ce.return=N,Ge=ce):hC(S);for(;P!==null;)Ge=P,dC(P),P=P.sibling;Ge=S,kf=Z,Yn=Ee}fC(l)}else S.subtreeFlags&8772&&P!==null?(P.return=S,Ge=P):fC(l)}}function fC(l){for(;Ge!==null;){var d=Ge;if(d.flags&8772){var g=d.alternate;try{if(d.flags&8772)switch(d.tag){case 0:case 11:case 15:Yn||_f(5,d);break;case 1:var C=d.stateNode;if(d.flags&4&&!Yn)if(g===null)C.componentDidMount();else{var S=d.elementType===d.type?g.memoizedProps:So(d.type,g.memoizedProps);C.componentDidUpdate(S,g.memoizedState,C.__reactInternalSnapshotBeforeUpdate)}var P=d.updateQueue;P!==null&&d2(d,P,C);break;case 3:var N=d.updateQueue;if(N!==null){if(g=null,d.child!==null)switch(d.child.tag){case 5:g=V(d.child.stateNode);break;case 1:g=d.child.stateNode}d2(d,N,g)}break;case 5:var Z=d.stateNode;g===null&&d.flags&4&<(Z,d.type,d.memoizedProps,d);break;case 6:break;case 4:break;case 12:break;case 13:if(ye&&d.memoizedState===null){var ce=d.alternate;if(ce!==null){var Ee=ce.memoizedState;if(Ee!==null){var Ke=Ee.dehydrated;Ke!==null&&Mg(Ke)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}Yn||d.flags&512&&C0(d)}catch(pt){Zt(d,d.return,pt)}}if(d===l){Ge=null;break}if(g=d.sibling,g!==null){g.return=d.return,Ge=g;break}Ge=d.return}}function pC(l){for(;Ge!==null;){var d=Ge;if(d===l){Ge=null;break}var g=d.sibling;if(g!==null){g.return=d.return,Ge=g;break}Ge=d.return}}function hC(l){for(;Ge!==null;){var d=Ge;try{switch(d.tag){case 0:case 11:case 15:var g=d.return;try{_f(4,d)}catch(ce){Zt(d,g,ce)}break;case 1:var C=d.stateNode;if(typeof C.componentDidMount=="function"){var S=d.return;try{C.componentDidMount()}catch(ce){Zt(d,S,ce)}}var P=d.return;try{C0(d)}catch(ce){Zt(d,P,ce)}break;case 5:var N=d.return;try{C0(d)}catch(ce){Zt(d,N,ce)}}}catch(ce){Zt(d,d.return,ce)}if(d===l){Ge=null;break}var Z=d.sibling;if(Z!==null){Z.return=d.return,Ge=Z;break}Ge=d.return}}var jf=0,Pf=1,If=2,Ef=3,Of=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"),Of=pu("selector.text")}function _0(l){var d=he(l);if(d!=null){if(typeof d.memoizedProps["data-testname"]!="string")throw Error(i(364));return d}if(l=Ct(l),l===null)throw Error(i(362));return l.stateNode.current}function j0(l,d){switch(d.$$typeof){case jf:if(l.type===d.value)return!0;break;case Pf:e:{d=d.value,l=[l,0];for(var g=0;g<l.length;){var C=l[g++],S=l[g++],P=d[S];if(C.tag!==5||!ve(C)){for(;P!=null&&j0(C,P);)S++,P=d[S];if(S===d.length){d=!0;break e}else for(C=C.child;C!==null;)l.push(C,S),C=C.sibling}}d=!1}return d;case If:if(l.tag===5&&Re(l.stateNode,d.value))return!0;break;case Of:if((l.tag===5||l.tag===6)&&(l=tt(l),l!==null&&0<=l.indexOf(d.value)))return!0;break;case Ef:if(l.tag===5&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===d.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function P0(l){switch(l.$$typeof){case jf:return"<"+(M(l.value)||"Unknown")+">";case Pf:return":has("+(P0(l)||"")+")";case If:return'[role="'+l.value+'"]';case Of:return'"'+l.value+'"';case Ef:return'[data-testname="'+l.value+'"]';default:throw Error(i(365))}}function mC(l,d){var g=[];l=[l,0];for(var C=0;C<l.length;){var S=l[C++],P=l[C++],N=d[P];if(S.tag!==5||!ve(S)){for(;N!=null&&j0(S,N);)P++,N=d[P];if(P===d.length)g.push(S);else for(S=S.child;S!==null;)l.push(S,P),S=S.sibling}}return g}function I0(l,d){if(!Ue)throw Error(i(363));l=_0(l),l=mC(l,d),d=[],l=Array.from(l);for(var g=0;g<l.length;){var C=l[g++];if(C.tag===5)ve(C)||d.push(C.stateNode);else for(C=C.child;C!==null;)l.push(C),C=C.sibling}return d}var K8=Math.ceil,Mf=c.ReactCurrentDispatcher,E0=c.ReactCurrentOwner,bn=c.ReactCurrentBatchConfig,xt=0,Fn=null,_n=null,Wn=0,Ar=0,Cl=wt(0),Dn=0,hu=null,di=0,Df=0,O0=0,mu=null,vr=null,M0=0,D0=1/0,Ts=null;function wl(){D0=Ln()+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 xt&6?Ln():Tf!==-1?Tf:Tf=Ln()}function wa(l){return l.mode&1?xt&2&&Wn!==0?Wn&-Wn:E8.transition!==null?($f===0&&($f=Zy()),$f):(l=It,l!==0?l:De()):1}function Yr(l,d,g,C){if(50<gu)throw gu=0,A0=null,Error(i(185));eu(l,g,C),(!(xt&2)||l!==Fn)&&(l===Fn&&(!(xt&2)&&(Df|=g),Dn===4&&Sa(l,Wn)),br(l,C),g===1&&xt===0&&!(d.mode&1)&&(wl(),nf&&Qo()))}function br(l,d){var g=l.callbackNode;y8(l,d);var C=ef(l,l===Fn?Wn:0);if(C===0)g!==null&&e2(g),l.callbackNode=null,l.callbackPriority=0;else if(d=C&-C,l.callbackPriority!==d){if(g!=null&&e2(g),d===1)l.tag===0?I8(vC.bind(null,l)):t2(vC.bind(null,l)),Be?rt(function(){!(xt&6)&&Qo()}):$g(Lg,Qo),g=null;else{switch(Jy(C)){case 1:g=Lg;break;case 4:g=k8;break;case 16:g=zg;break;case 536870912:g=_8;break;default:g=zg}g=jC(g,gC.bind(null,l))}l.callbackPriority=d,l.callbackNode=g}}function gC(l,d){if(Tf=-1,$f=0,xt&6)throw Error(i(327));var g=l.callbackNode;if(hi()&&l.callbackNode!==g)return null;var C=ef(l,l===Fn?Wn:0);if(C===0)return null;if(C&30||C&l.expiredLanes||d)d=Lf(l,C);else{d=C;var S=xt;xt|=2;var P=yC();(Fn!==l||Wn!==d)&&(Ts=null,wl(),fi(l,d));do try{Y8();break}catch(Z){xC(l,Z)}while(1);Kg(),Mf.current=P,xt=S,_n!==null?d=0:(Fn=null,Wn=0,d=Dn)}if(d!==0){if(d===2&&(S=Ag(l),S!==0&&(C=S,d=N0(l,S))),d===1)throw g=hu,fi(l,0),Sa(l,C),br(l,Ln()),g;if(d===6)Sa(l,C);else{if(S=l.current.alternate,!(C&30)&&!q8(S)&&(d=Lf(l,C),d===2&&(P=Ag(l),P!==0&&(C=P,d=N0(l,P))),d===1))throw g=hu,fi(l,0),Sa(l,C),br(l,Ln()),g;switch(l.finishedWork=S,l.finishedLanes=C,d){case 0:case 1:throw Error(i(345));case 2:pi(l,vr,Ts);break;case 3:if(Sa(l,C),(C&130023424)===C&&(d=M0+500-Ln(),10<d)){if(ef(l,0)!==0)break;if(S=l.suspendedLanes,(S&C)!==C){Qn(),l.pingedLanes|=l.suspendedLanes&S;break}l.timeoutHandle=ee(pi.bind(null,l,vr,Ts),d);break}pi(l,vr,Ts);break;case 4:if(Sa(l,C),(C&4194240)===C)break;for(d=l.eventTimes,S=-1;0<C;){var N=31-yo(C);P=1<<N,N=d[N],N>S&&(S=N),C&=~P}if(C=S,C=Ln()-C,C=(120>C?120:480>C?480:1080>C?1080:1920>C?1920:3e3>C?3e3:4320>C?4320:1960*K8(C/1960))-C,10<C){l.timeoutHandle=ee(pi.bind(null,l,vr,Ts),C);break}pi(l,vr,Ts);break;case 5:pi(l,vr,Ts);break;default:throw Error(i(329))}}}return br(l,Ln()),l.callbackNode===g?gC.bind(null,l):null}function N0(l,d){var g=mu;return l.current.memoizedState.isDehydrated&&(fi(l,d).flags|=256),l=Lf(l,d),l!==2&&(d=vr,vr=g,d!==null&&T0(d)),l}function T0(l){vr===null?vr=l:vr.push.apply(vr,l)}function q8(l){for(var d=l;;){if(d.flags&16384){var g=d.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var C=0;C<g.length;C++){var S=g[C],P=S.getSnapshot;S=S.value;try{if(!Co(P(),S))return!1}catch{return!1}}}if(g=d.child,d.subtreeFlags&16384&&g!==null)g.return=d,d=g;else{if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Sa(l,d){for(d&=~O0,d&=~Df,l.suspendedLanes|=d,l.pingedLanes&=~d,l=l.expirationTimes;0<d;){var g=31-yo(d),C=1<<g;l[g]=-1,d&=~C}}function vC(l){if(xt&6)throw Error(i(327));hi();var d=ef(l,0);if(!(d&1))return br(l,Ln()),null;var g=Lf(l,d);if(l.tag!==0&&g===2){var C=Ag(l);C!==0&&(d=C,g=N0(l,C))}if(g===1)throw g=hu,fi(l,0),Sa(l,d),br(l,Ln()),g;if(g===6)throw Error(i(345));return l.finishedWork=l.current.alternate,l.finishedLanes=d,pi(l,vr,Ts),br(l,Ln()),null}function bC(l){Ca!==null&&Ca.tag===0&&!(xt&6)&&hi();var d=xt;xt|=1;var g=bn.transition,C=It;try{if(bn.transition=null,It=1,l)return l()}finally{It=C,bn.transition=g,xt=d,!(xt&6)&&Qo()}}function $0(){Ar=Cl.current,bt(Cl)}function fi(l,d){l.finishedWork=null,l.finishedLanes=0;var g=l.timeoutHandle;if(g!==re&&(l.timeoutHandle=re,se(g)),_n!==null)for(g=_n.return;g!==null;){var C=g;switch(Hg(C),C.tag){case 1:C=C.type.childContextTypes,C!=null&&Yd();break;case 3:bl(),bt(kn),bt(Vt),r0();break;case 5:t0(C);break;case 4:bl();break;case 13:bt(on);break;case 19:bt(on);break;case 10:qg(C.type._context);break;case 22:case 23:$0()}g=g.return}if(Fn=l,_n=l=ka(l.current,null),Wn=Ar=d,Dn=0,hu=null,O0=Df=di=0,vr=mu=null,ci!==null){for(d=0;d<ci.length;d++)if(g=ci[d],C=g.interleaved,C!==null){g.interleaved=null;var S=C.next,P=g.pending;if(P!==null){var N=P.next;P.next=S,C.next=N}g.pending=C}ci=null}return l}function xC(l,d){do{var g=_n;try{if(Kg(),mf.current=xf,gf){for(var C=sn.memoizedState;C!==null;){var S=C.queue;S!==null&&(S.pending=null),C=C.next}gf=!1}if(ui=0,zn=Mn=sn=null,su=!1,au=0,E0.current=null,g===null||g.return===null){Dn=1,hu=d,_n=null;break}e:{var P=l,N=g.return,Z=g,ce=d;if(d=Wn,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=W2(N);if(Kt!==null){Kt.flags&=-257,U2(Kt,N,Z,P,d),Kt.mode&1&&V2(P,Ee,d),d=Kt,ce=Ee;var Ft=d.updateQueue;if(Ft===null){var xr=new Set;xr.add(ce),d.updateQueue=xr}else Ft.add(ce);break e}else{if(!(d&1)){V2(P,Ee,d),L0();break e}ce=Error(i(426))}}else if(Qt&&Z.mode&1){var $s=W2(N);if($s!==null){!($s.flags&65536)&&($s.flags|=256),U2($s,N,Z,P,d),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,d&=-d,P.lanes|=d;var le=B2(P,ce,d);u2(P,le);break e;case 1:Z=ce;var te=P.type,pe=P.stateNode;if(!(P.flags&128)&&(typeof te.getDerivedStateFromError=="function"||pe!==null&&typeof pe.componentDidCatch=="function"&&(ya===null||!ya.has(pe)))){P.flags|=65536,d&=-d,P.lanes|=d;var Ve=H2(P,Z,d);u2(P,Ve);break e}}P=P.return}while(P!==null)}wC(g)}catch(nt){d=nt,_n===g&&g!==null&&(_n=g=g.return);continue}break}while(1)}function yC(){var l=Mf.current;return Mf.current=xf,l===null?xf:l}function L0(){(Dn===0||Dn===3||Dn===2)&&(Dn=4),Fn===null||!(di&268435455)&&!(Df&268435455)||Sa(Fn,Wn)}function Lf(l,d){var g=xt;xt|=2;var C=yC();(Fn!==l||Wn!==d)&&(Ts=null,fi(l,d));do try{X8();break}catch(S){xC(l,S)}while(1);if(Kg(),xt=g,Mf.current=C,_n!==null)throw Error(i(261));return Fn=null,Wn=0,Dn}function X8(){for(;_n!==null;)CC(_n)}function Y8(){for(;_n!==null&&!w8();)CC(_n)}function CC(l){var d=_C(l.alternate,l,Ar);l.memoizedProps=l.pendingProps,d===null?wC(l):_n=d,E0.current=null}function wC(l){var d=l;do{var g=d.alternate;if(l=d.return,d.flags&32768){if(g=V8(g,d),g!==null){g.flags&=32767,_n=g;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Dn=6,_n=null;return}}else if(g=H8(g,d,Ar),g!==null){_n=g;return}if(d=d.sibling,d!==null){_n=d;return}_n=d=l}while(d!==null);Dn===0&&(Dn=5)}function pi(l,d,g){var C=It,S=bn.transition;try{bn.transition=null,It=1,Q8(l,d,g,C)}finally{bn.transition=S,It=C}return null}function Q8(l,d,g,C){do hi();while(Ca!==null);if(xt&6)throw Error(i(327));g=l.finishedWork;var S=l.finishedLanes;if(g===null)return null;if(l.finishedWork=null,l.finishedLanes=0,g===l.current)throw Error(i(177));l.callbackNode=null,l.callbackPriority=0;var P=g.lanes|g.childLanes;if(C8(l,P),l===Fn&&(_n=Fn=null,Wn=0),!(g.subtreeFlags&2064)&&!(g.flags&2064)||Af||(Af=!0,jC(zg,function(){return hi(),null})),P=(g.flags&15990)!==0,g.subtreeFlags&15990||P){P=bn.transition,bn.transition=null;var N=It;It=1;var Z=xt;xt|=4,E0.current=null,U8(l,g),uC(g,l),K(l.containerInfo),l.current=g,G8(g),S8(),xt=Z,It=N,bn.transition=P}else l.current=g;if(Af&&(Af=!1,Ca=l,Nf=S),P=l.pendingLanes,P===0&&(ya=null),j8(g.stateNode),br(l,Ln()),d!==null)for(C=l.onRecoverableError,g=0;g<d.length;g++)S=d[g],C(S.value,{componentStack:S.stack,digest:S.digest});if(Rf)throw Rf=!1,l=R0,R0=null,l;return Nf&1&&l.tag!==0&&hi(),P=l.pendingLanes,P&1?l===A0?gu++:(gu=0,A0=l):gu=0,Qo(),null}function hi(){if(Ca!==null){var l=Jy(Nf),d=bn.transition,g=It;try{if(bn.transition=null,It=16>l?16:l,Ca===null)var C=!1;else{if(l=Ca,Ca=null,Nf=0,xt&6)throw Error(i(331));var S=xt;for(xt|=4,Ge=l.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(aC(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 xr=Ft.child;if(xr!==null){Ft.child=null;do{var $s=xr.sibling;xr.sibling=null,xr=$s}while(xr!==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 te=l.current;for(Ge=te;Ge!==null;){N=Ge;var pe=N.child;if(N.subtreeFlags&2064&&pe!==null)pe.return=N,Ge=pe;else e:for(N=te;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 Ve=Z.sibling;if(Ve!==null){Ve.return=Z.return,Ge=Ve;break e}Ge=Z.return}}if(xt=S,Qo(),Yo&&typeof Yo.onPostCommitFiberRoot=="function")try{Yo.onPostCommitFiberRoot(tf,l)}catch{}C=!0}return C}finally{It=g,bn.transition=d}}return!1}function SC(l,d,g){d=xl(g,d),d=B2(l,d,1),l=xa(l,d,1),d=Qn(),l!==null&&(eu(l,1,d),br(l,d))}function Zt(l,d,g){if(l.tag===3)SC(l,l,g);else for(;d!==null;){if(d.tag===3){SC(d,l,g);break}else if(d.tag===1){var C=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(ya===null||!ya.has(C))){l=xl(g,l),l=H2(d,l,1),d=xa(d,l,1),l=Qn(),d!==null&&(eu(d,1,l),br(d,l));break}}d=d.return}}function Z8(l,d,g){var C=l.pingCache;C!==null&&C.delete(d),d=Qn(),l.pingedLanes|=l.suspendedLanes&g,Fn===l&&(Wn&g)===g&&(Dn===4||Dn===3&&(Wn&130023424)===Wn&&500>Ln()-M0?fi(l,0):O0|=g),br(l,d)}function kC(l,d){d===0&&(l.mode&1?(d=Jd,Jd<<=1,!(Jd&130023424)&&(Jd=4194304)):d=1);var g=Qn();l=Zo(l,d),l!==null&&(eu(l,d,g),br(l,g))}function J8(l){var d=l.memoizedState,g=0;d!==null&&(g=d.retryLane),kC(l,g)}function e7(l,d){var g=0;switch(l.tag){case 13:var C=l.stateNode,S=l.memoizedState;S!==null&&(g=S.retryLane);break;case 19:C=l.stateNode;break;default:throw Error(i(314))}C!==null&&C.delete(d),kC(l,g)}var _C;_C=function(l,d,g){if(l!==null)if(l.memoizedProps!==d.pendingProps||kn.current)gr=!0;else{if(!(l.lanes&g)&&!(d.flags&128))return gr=!1,B8(l,d,g);gr=!!(l.flags&131072)}else gr=!1,Qt&&d.flags&1048576&&n2(d,of,d.index);switch(d.lanes=0,d.tag){case 2:var C=d.type;Cf(l,d),l=d.pendingProps;var S=ul(d,Vt.current);ml(d,g),S=a0(null,d,C,l,S,g);var P=i0();return d.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,mr(C)?(P=!0,Qd(d)):P=!1,d.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Qg(d),S.updater=ff,d.stateNode=S,S._reactInternals=d,Jg(d,C,l,g),d=m0(null,d,C,!0,P,g)):(d.tag=0,Qt&&P&&Bg(d),cr(null,d,S,g),d=d.child),d;case 16:C=d.elementType;e:{switch(Cf(l,d),l=d.pendingProps,S=C._init,C=S(C._payload),d.type=C,S=d.tag=n7(C),l=So(C,l),S){case 0:d=h0(null,d,C,l,g);break e;case 1:d=Q2(null,d,C,l,g);break e;case 11:d=G2(null,d,C,l,g);break e;case 14:d=K2(null,d,C,So(C.type,l),g);break e}throw Error(i(306,C,""))}return d;case 0:return C=d.type,S=d.pendingProps,S=d.elementType===C?S:So(C,S),h0(l,d,C,S,g);case 1:return C=d.type,S=d.pendingProps,S=d.elementType===C?S:So(C,S),Q2(l,d,C,S,g);case 3:e:{if(Z2(d),l===null)throw Error(i(387));C=d.pendingProps,P=d.memoizedState,S=P.element,c2(l,d),df(d,C,null,g);var N=d.memoizedState;if(C=N.element,ye&&P.isDehydrated)if(P={element:C,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},d.updateQueue.baseState=P,d.memoizedState=P,d.flags&256){S=xl(Error(i(423)),d),d=J2(l,d,C,g,S);break e}else if(C!==S){S=xl(Error(i(424)),d),d=J2(l,d,C,g,S);break e}else for(ye&&(Gr=qe(d.stateNode.containerInfo),Rr=d,Qt=!0,wo=null,tu=!1),g=b2(d,null,C,g),d.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(pl(),C===S){d=Ns(l,d,g);break e}cr(l,d,C,g)}d=d.child}return d;case 5:return x2(d),l===null&&Wg(d),C=d.type,S=d.pendingProps,P=l!==null?l.memoizedProps:null,N=S.children,W(C,S)?N=null:P!==null&&W(C,P)&&(d.flags|=32),Y2(l,d),cr(l,d,N,g),d.child;case 6:return l===null&&Wg(d),null;case 13:return eC(l,d,g);case 4:return e0(d,d.stateNode.containerInfo),C=d.pendingProps,l===null?d.child=gl(d,null,C,g):cr(l,d,C,g),d.child;case 11:return C=d.type,S=d.pendingProps,S=d.elementType===C?S:So(C,S),G2(l,d,C,S,g);case 7:return cr(l,d,d.pendingProps,g),d.child;case 8:return cr(l,d,d.pendingProps.children,g),d.child;case 12:return cr(l,d,d.pendingProps.children,g),d.child;case 10:e:{if(C=d.type._context,S=d.pendingProps,P=d.memoizedProps,N=S.value,i2(d,C,N),P!==null)if(Co(P.value,N)){if(P.children===S.children&&!kn.current){d=Ns(l,d,g);break e}}else for(P=d.child,P!==null&&(P.return=d);P!==null;){var Z=P.dependencies;if(Z!==null){N=P.child;for(var ce=Z.firstContext;ce!==null;){if(ce.context===C){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,d),Z.lanes|=g;break}ce=ce.next}}else if(P.tag===10)N=P.type===d.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,d),N=P.sibling}else N=P.child;if(N!==null)N.return=P;else for(N=P;N!==null;){if(N===d){N=null;break}if(P=N.sibling,P!==null){P.return=N.return,N=P;break}N=N.return}P=N}cr(l,d,S.children,g),d=d.child}return d;case 9:return S=d.type,C=d.pendingProps.children,ml(d,g),S=Kr(S),C=C(S),d.flags|=1,cr(l,d,C,g),d.child;case 14:return C=d.type,S=So(C,d.pendingProps),S=So(C.type,S),K2(l,d,C,S,g);case 15:return q2(l,d,d.type,d.pendingProps,g);case 17:return C=d.type,S=d.pendingProps,S=d.elementType===C?S:So(C,S),Cf(l,d),d.tag=1,mr(C)?(l=!0,Qd(d)):l=!1,ml(d,g),h2(d,C,S),Jg(d,C,S,g),m0(null,d,C,!0,l,g);case 19:return nC(l,d,g);case 22:return X2(l,d,g)}throw Error(i(156,d.tag))};function jC(l,d){return $g(l,d)}function t7(l,d,g,C){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=C,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qr(l,d,g,C){return new t7(l,d,g,C)}function z0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function n7(l){if(typeof l=="function")return z0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===x)return 11;if(l===_)return 14}return 2}function ka(l,d){var g=l.alternate;return g===null?(g=Qr(l.tag,d,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=d,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&14680064,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,d=l.dependencies,g.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g}function zf(l,d,g,C,S,P){var N=2;if(C=l,typeof l=="function")z0(l)&&(N=1);else if(typeof l=="string")N=5;else e:switch(l){case h:return mi(g.children,S,P,d);case m:N=8,S|=8;break;case v:return l=Qr(12,g,d,S|2),l.elementType=v,l.lanes=P,l;case w:return l=Qr(13,g,d,S),l.elementType=w,l.lanes=P,l;case k:return l=Qr(19,g,d,S),l.elementType=k,l.lanes=P,l;case I:return Ff(g,S,P,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case b:N=10;break e;case y:N=9;break e;case x:N=11;break e;case _:N=14;break e;case j:N=16,C=null;break e}throw Error(i(130,l==null?l:typeof l,""))}return d=Qr(N,g,d,S),d.elementType=l,d.type=C,d.lanes=P,d}function mi(l,d,g,C){return l=Qr(7,l,C,d),l.lanes=g,l}function Ff(l,d,g,C){return l=Qr(22,l,C,d),l.elementType=I,l.lanes=g,l.stateNode={isHidden:!1},l}function F0(l,d,g){return l=Qr(6,l,null,d),l.lanes=g,l}function B0(l,d,g){return d=Qr(4,l.children!==null?l.children:[],l.key,d),d.lanes=g,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function r7(l,d,g,C,S){this.tag=d,this.containerInfo=l,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=C,this.onRecoverableError=S,ye&&(this.mutableSourceEagerHydrationData=null)}function PC(l,d,g,C,S,P,N,Z,ce){return l=new r7(l,d,g,Z,ce),d===1?(d=1,P===!0&&(d|=8)):d=0,P=Qr(3,null,null,d),l.current=P,P.stateNode=l,P.memoizedState={element:C,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qg(P),l}function IC(l){if(!l)return Kn;l=l._reactInternals;e:{if(A(l)!==l||l.tag!==1)throw Error(i(170));var d=l;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(mr(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(i(171))}if(l.tag===1){var g=l.type;if(mr(g))return Yy(l,g,d)}return d}function EC(l){var d=l._reactInternals;if(d===void 0)throw typeof l.render=="function"?Error(i(188)):(l=Object.keys(l).join(","),Error(i(268,l)));return l=q(d),l===null?null:l.stateNode}function OC(l,d){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<d?g:d}}function Bf(l,d){OC(l,d),(l=l.alternate)&&OC(l,d)}function o7(l){return l=q(l),l===null?null:l.stateNode}function s7(){return null}return n.attemptContinuousHydration=function(l){if(l.tag===13){var d=Zo(l,134217728);if(d!==null){var g=Qn();Yr(d,l,134217728,g)}Bf(l,134217728)}},n.attemptDiscreteHydration=function(l){if(l.tag===13){var d=Zo(l,1);if(d!==null){var g=Qn();Yr(d,l,1,g)}Bf(l,1)}},n.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13){var d=wa(l),g=Zo(l,d);if(g!==null){var C=Qn();Yr(g,l,d,C)}Bf(l,d)}},n.attemptSynchronousHydration=function(l){switch(l.tag){case 3:var d=l.stateNode;if(d.current.memoizedState.isDehydrated){var g=Jc(d.pendingLanes);g!==0&&(Tg(d,g|1),br(d,Ln()),!(xt&6)&&(wl(),Qo()))}break;case 13:bC(function(){var C=Zo(l,1);if(C!==null){var S=Qn();Yr(C,l,1,S)}}),Bf(l,1)}},n.batchedUpdates=function(l,d){var g=xt;xt|=1;try{return l(d)}finally{xt=g,xt===0&&(wl(),nf&&Qo())}},n.createComponentSelector=function(l){return{$$typeof:jf,value:l}},n.createContainer=function(l,d,g,C,S,P,N){return PC(l,d,!1,null,g,C,S,P,N)},n.createHasPseudoClassSelector=function(l){return{$$typeof:Pf,value:l}},n.createHydrationContainer=function(l,d,g,C,S,P,N,Z,ce){return l=PC(g,C,!0,l,S,P,N,Z,ce),l.context=IC(null),g=l.current,C=Qn(),S=wa(g),P=As(C,S),P.callback=d??null,xa(g,P,S),l.current.lanes=S,eu(l,S,C),br(l,C),l},n.createPortal=function(l,d,g){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:C==null?null:""+C,children:l,containerInfo:d,implementation:g}},n.createRoleSelector=function(l){return{$$typeof:If,value:l}},n.createTestNameSelector=function(l){return{$$typeof:Ef,value:l}},n.createTextSelector=function(l){return{$$typeof:Of,value:l}},n.deferredUpdates=function(l){var d=It,g=bn.transition;try{return bn.transition=null,It=16,l()}finally{It=d,bn.transition=g}},n.discreteUpdates=function(l,d,g,C,S){var P=It,N=bn.transition;try{return bn.transition=null,It=1,l(d,g,C,S)}finally{It=P,bn.transition=N,xt===0&&wl()}},n.findAllNodes=I0,n.findBoundingRects=function(l,d){if(!Ue)throw Error(i(363));d=I0(l,d),l=[];for(var g=0;g<d.length;g++)l.push(Xe(d[g]));for(d=l.length-1;0<d;d--){g=l[d];for(var C=g.x,S=C+g.width,P=g.y,N=P+g.height,Z=d-1;0<=Z;Z--)if(d!==Z){var ce=l[Z],Ee=ce.x,Ke=Ee+ce.width,pt=ce.y,He=pt+ce.height;if(C>=Ee&&P>=pt&&S<=Ke&&N<=He){l.splice(d,1);break}else if(C!==Ee||g.width!==ce.width||He<P||pt>N){if(!(P!==pt||g.height!==ce.height||Ke<C||Ee>S)){Ee>C&&(ce.width+=Ee-C,ce.x=C),Ke<S&&(ce.width=S-Ee),l.splice(d,1);break}}else{pt>P&&(ce.height+=pt-P,ce.y=P),He<N&&(ce.height=N-pt),l.splice(d,1);break}}}return l},n.findHostInstance=EC,n.findHostInstanceWithNoPortals=function(l){return l=T(l),l=l!==null?G(l):null,l===null?null:l.stateNode},n.findHostInstanceWithWarning=function(l){return EC(l)},n.flushControlled=function(l){var d=xt;xt|=1;var g=bn.transition,C=It;try{bn.transition=null,It=1,l()}finally{It=C,bn.transition=g,xt=d,xt===0&&(wl(),Qo())}},n.flushPassiveEffects=hi,n.flushSync=bC,n.focusWithin=function(l,d){if(!Ue)throw Error(i(363));for(l=_0(l),d=mC(l,d),d=Array.from(d),l=0;l<d.length;){var g=d[l++];if(!ve(g)){if(g.tag===5&&st(g.stateNode))return!0;for(g=g.child;g!==null;)d.push(g),g=g.sibling}}return!1},n.getCurrentUpdatePriority=function(){return It},n.getFindAllNodesFailureDescription=function(l,d){if(!Ue)throw Error(i(363));var g=0,C=[];l=[_0(l),0];for(var S=0;S<l.length;){var P=l[S++],N=l[S++],Z=d[N];if((P.tag!==5||!ve(P))&&(j0(P,Z)&&(C.push(P0(Z)),N++,N>g&&(g=N)),N<d.length))for(P=P.child;P!==null;)l.push(P,N),P=P.sibling}if(g<d.length){for(l=[];g<d.length;g++)l.push(P0(d[g]));return`findAllNodes was able to match part of the selector:
|
||
`+(C.join(" > ")+`
|
||
|
||
No matching component was found for:
|
||
`)+l.join(" > ")}return null},n.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return V(l.child.stateNode);default:return l.child.stateNode}},n.injectIntoDevTools=function(l){if(l={bundleType:l.bundleType,version:l.version,rendererPackageName:l.rendererPackageName,rendererConfig:l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:c.ReactCurrentDispatcher,findHostInstanceByFiber:o7,findFiberByHostInstance:l.findFiberByHostInstance||s7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)l=!0;else{try{tf=d.inject(l),Yo=d}catch{}l=!!d.checkDCE}}return l},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(l,d,g,C){if(!Ue)throw Error(i(363));l=I0(l,d);var S=mt(l,g,C).disconnect;return{disconnect:function(){S()}}},n.registerMutableSourceForHydration=function(l,d){var g=d._getVersion;g=g(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,g]:l.mutableSourceEagerHydrationData.push(d,g)},n.runWithPriority=function(l,d){var g=It;try{return It=l,d()}finally{It=g}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(l,d,g,C){var S=d.current,P=Qn(),N=wa(S);return g=IC(g),d.context===null?d.context=g:d.pendingContext=g,d=As(P,N),d.payload={element:l},C=C===void 0?null:C,C!==null&&(d.callback=C),l=xa(S,d,N),l!==null&&(Yr(l,S,N,P),uf(l,S,N)),N},n};o8.exports=the;var nhe=o8.exports;const rhe=Dc(nhe);var s8={exports:{}},al={};/**
|
||
* @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.
|
||
*/al.ConcurrentRoot=1;al.ContinuousEventPriority=4;al.DefaultEventPriority=16;al.DiscreteEventPriority=1;al.IdleEventPriority=536870912;al.LegacyRoot=0;s8.exports=al;var a8=s8.exports;const aj={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let ij=!1,lj=!1;const Gy=".react-konva-event",ohe=`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
|
||
`,she=`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
|
||
`,ahe={};function Og(e,t,n=ahe){if(!ij&&"zIndex"in t&&(console.warn(she),ij=!0),!lj&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(ohe),lj=!0)}for(var s in n)if(!aj[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)),e.off(f,n[s])}var p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var h=t._useStrictMode,m={},v=!1;const b={};for(var s in t)if(!aj[s]){var i=s.slice(0,2)==="on",y=n[s]!==t[s];if(i&&y){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[s]&&(b[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 b)e.on(f+Gy,b[f])}function si(e){if(!o9.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const i8={},ihe={};dd.Node.prototype._applyProps=Og;function lhe(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 che(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 c=i.slice(0,2)==="on";c?s[i]=t[i]:o[i]=t[i]}const f=new r(o);return Og(f,s),f}function uhe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function dhe(e,t,n){return!1}function fhe(e){return e}function phe(){return null}function hhe(){return null}function mhe(e,t,n,r){return ihe}function ghe(){}function vhe(e){}function bhe(e,t){return!1}function xhe(){return i8}function yhe(){return i8}const Che=setTimeout,whe=clearTimeout,She=-1;function khe(e,t){return!1}const _he=!1,jhe=!0,Phe=!0;function Ihe(e,t){t.parent===e?t.moveToTop():e.add(t),si(e)}function Ehe(e,t){t.parent===e?t.moveToTop():e.add(t),si(e)}function l8(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),si(e)}function Ohe(e,t,n){l8(e,t,n)}function Mhe(e,t){t.destroy(),t.off(Gy),si(e)}function Dhe(e,t){t.destroy(),t.off(Gy),si(e)}function Rhe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function Ahe(e,t,n){}function Nhe(e,t,n,r,o){Og(e,o,r)}function The(e){e.hide(),si(e)}function $he(e){}function Lhe(e,t){(t.visible==null||t.visible)&&e.show()}function zhe(e,t){}function Fhe(e){}function Bhe(){}const Hhe=()=>a8.DefaultEventPriority,Vhe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Ihe,appendChildToContainer:Ehe,appendInitialChild:lhe,cancelTimeout:whe,clearContainer:Fhe,commitMount:Ahe,commitTextUpdate:Rhe,commitUpdate:Nhe,createInstance:che,createTextInstance:uhe,detachDeletedInstance:Bhe,finalizeInitialChildren:dhe,getChildHostContext:yhe,getCurrentEventPriority:Hhe,getPublicInstance:fhe,getRootHostContext:xhe,hideInstance:The,hideTextInstance:$he,idlePriority:Ip.unstable_IdlePriority,insertBefore:l8,insertInContainerBefore:Ohe,isPrimaryRenderer:_he,noTimeout:She,now:Ip.unstable_now,prepareForCommit:phe,preparePortalMount:hhe,prepareUpdate:mhe,removeChild:Mhe,removeChildFromContainer:Dhe,resetAfterCommit:ghe,resetTextContent:vhe,run:Ip.unstable_runWithPriority,scheduleTimeout:Che,shouldDeprioritizeSubtree:bhe,shouldSetTextContent:khe,supportsMutation:Phe,unhideInstance:Lhe,unhideTextInstance:zhe,warnsIfNotActing:jhe},Symbol.toStringTag,{value:"Module"}));var Whe=Object.defineProperty,Uhe=Object.defineProperties,Ghe=Object.getOwnPropertyDescriptors,cj=Object.getOwnPropertySymbols,Khe=Object.prototype.hasOwnProperty,qhe=Object.prototype.propertyIsEnumerable,uj=(e,t,n)=>t in e?Whe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dj=(e,t)=>{for(var n in t||(t={}))Khe.call(t,n)&&uj(e,n,t[n]);if(cj)for(var n of cj(t))qhe.call(t,n)&&uj(e,n,t[n]);return e},Xhe=(e,t)=>Uhe(e,Ghe(t));function c8(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=c8(r,t,n);if(o)return o;r=t?null:r.sibling}}function u8(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const Ky=u8(u.createContext(null));class d8 extends u.Component{render(){return u.createElement(Ky.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:fj,ReactCurrentDispatcher:pj}=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Yhe(){const e=u.useContext(Ky);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=u.useId();return u.useMemo(()=>{for(const r of[fj==null?void 0:fj.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=c8(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 Qhe(){var e,t;const n=Yhe(),[r]=u.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==Ky&&!r.has(s)&&r.set(s,(t=pj==null?void 0:pj.current)==null?void 0:t.readContext(u8(s))),o=o.return}return r}function Zhe(){const e=Qhe();return u.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>u.createElement(t,null,u.createElement(n.Provider,Xhe(dj({},r),{value:e.get(n)}))),t=>u.createElement(d8,dj({},t))),[e])}function Jhe(e){const t=H.useRef({});return H.useLayoutEffect(()=>{t.current=e}),H.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const eme=e=>{const t=H.useRef(),n=H.useRef(),r=H.useRef(),o=Jhe(e),s=Zhe(),i=c=>{const{forwardedRef:f}=e;f&&(typeof f=="function"?f(c):f.current=c)};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,a8.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),Og(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",f8="Image",tme="Transformer",Tu=rhe(Vhe);Tu.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:H.version,rendererPackageName:"react-konva"});const nme=H.forwardRef((e,t)=>H.createElement(d8,{},H.createElement(eme,{...e,forwardedRef:t}))),rme=ae([$t,bo],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:kt}}),ome=()=>{const e=J(),{tool:t,isStaging:n,isMovingBoundingBox:r}=F(rme);return{handleDragStart:u.useCallback(()=>{(t==="move"||n)&&!r&&e(qp(!0))},[e,r,n,t]),handleDragMove:u.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(c5(s))},[e,r,n,t]),handleDragEnd:u.useCallback(()=>{(t==="move"||n)&&!r&&e(qp(!1))},[e,r,n,t])}},sme=ae([$t,wn,bo],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isMaskEnabled:c,shouldSnapToGrid:f}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isStaging:n,isMaskEnabled:c,shouldSnapToGrid:f}},{memoizeOptions:{resultEqualityCheck:kt}}),ame=()=>{const e=J(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:i}=F(sme),c=u.useRef(null),f=u5(),p=()=>e(d5());Qe(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const h=()=>e(Xb(!s));Qe(["h"],()=>{h()},{enabled:()=>!o,preventDefault:!0},[s]),Qe(["n"],()=>{e(Xp(!i))},{enabled:!0,preventDefault:!0},[i]),Qe("esc",()=>{e(s9())},{enabled:()=>!0,preventDefault:!0}),Qe("shift+h",()=>{e(a9(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),Qe(["space"],m=>{m.repeat||(f==null||f.container().focus(),r!=="move"&&(c.current=r,e(Ql("move"))),r==="move"&&c.current&&c.current!=="move"&&(e(Ql(c.current)),c.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,c])},qy=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}},p8=()=>{const e=J(),t=u1(),n=u5();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=i9.pixelRatio,[s,i,c,f]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;f&&s&&i&&c&&e(l9({r:s,g:i,b:c,a:f}))},commitColorUnderCursor:()=>{e(c9())}}},ime=ae([wn,$t,bo],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:kt}}),lme=e=>{const t=J(),{tool:n,isStaging:r}=F(ime),{commitColorUnderCursor:o}=p8();return u.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=qy(e.current);i&&(s.evt.preventDefault(),t(f5(!0)),t(u9([i.x,i.y])))},[e,n,r,t,o])},cme=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}}),ume=(e,t,n)=>{const r=J(),{isDrawing:o,tool:s,isStaging:i}=F(cme),{updateColorUnderCursor:c}=p8();return u.useCallback(()=>{if(!e.current)return;const f=qy(e.current);if(f){if(r(d9(f)),n.current=f,s==="colorPicker"){c();return}!o||s==="move"||i||(t.current=!0,r(p5([f.x,f.y])))}},[t,r,o,i,n,e,s,c])},dme=()=>{const e=J();return u.useCallback(()=>{e(f9())},[e])},fme=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}}),pme=(e,t)=>{const n=J(),{tool:r,isDrawing:o,isStaging:s}=F(fme);return u.useCallback(()=>{if(r==="move"||s){n(qp(!1));return}if(!t.current&&o&&e.current){const i=qy(e.current);if(!i)return;n(p5([i.x,i.y]))}else t.current=!1;n(f5(!1))},[t,n,o,s,e,r])},hme=ae([$t],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:kt}}),mme=e=>{const t=J(),{isMoveStageKeyHeld:n,stageScale:r}=F(hme);return u.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 c=o.evt.deltaY;o.evt.ctrlKey&&(c=-c);const f=Ri(r*m9**c,h9,p9),p={x:s.x-i.x*f,y:s.y-i.y*f};t(g9(f)),t(c5(p))},[e,n,r,t])},gme=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}}),vme=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=F(gme);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"})]})},bme=u.memo(vme),xme=ae([$t],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:kt}}),yme=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=F(xme),{colorMode:r}=ia(),[o,s]=u.useState([]),[i,c]=ds("colors",["base.800","base.200"]),f=u.useCallback(p=>p/e,[e]);return u.useLayoutEffect(()=>{const{width:p,height:h}=n,{x:m,y:v}=t,b={x1:0,y1:0,x2:p,y2:h,offset:{x:f(m),y:f(v)}},y={x:Math.ceil(f(m)/64)*64,y:Math.ceil(f(v)/64)*64},x={x1:-y.x,y1:-y.y,x2:f(p)-y.x+64,y2:f(h)-y.y+64},k={x1:Math.min(b.x1,x.x1),y1:Math.min(b.y1,x.y1),x2:Math.max(b.x2,x.x2),y2:Math.max(b.y2,x.y2)},_=k.x2-k.x1,j=k.y2-k.y1,I=Math.round(_/64)+1,E=Math.round(j/64)+1,O=yw(0,I).map(D=>a.jsx(lm,{x:k.x1+D*64,y:k.y1,points:[0,0,0,j],stroke:r==="dark"?i:c,strokeWidth:1},`x_${D}`)),M=yw(0,E).map(D=>a.jsx(lm,{x:k.x1,y:k.y1+D*64,points:[0,0,_,0],stroke:r==="dark"?i:c,strokeWidth:1},`y_${D}`));s(O.concat(M))},[e,t,n,f,r,i,c]),a.jsx(sa,{children:o})},Cme=u.memo(yme),wme=ae([go,$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}}),Sme=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=F(wme),[o,s]=u.useState(null);return u.useEffect(()=>{if(!n)return;const i=new Image;i.onload=()=>{s(i)},i.src=n.dataURL},[n]),n&&r&&o?a.jsx(f8,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},kme=u.memo(Sme),Di=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},_me=ae($t,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Di(t)}}),hj=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),jme=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=F(_me),[i,c]=u.useState(null),[f,p]=u.useState(0),h=u.useRef(null),m=u.useCallback(()=>{p(f+1),setTimeout(m,500)},[f]);return u.useEffect(()=>{if(i)return;const v=new Image;v.onload=()=>{c(v)},v.src=hj(n)},[i,n]),u.useEffect(()=>{i&&(i.src=hj(n))},[i,n]),u.useEffect(()=>{const v=setInterval(()=>p(b=>(b+1)%5),50);return()=>clearInterval(v)},[]),!i||!Sl(r.x)||!Sl(r.y)||!Sl(s)||!Sl(o.width)||!Sl(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:Sl(f)?f:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Pme=u.memo(jme),Ime=ae([$t],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:kt}}),Eme=e=>{const{...t}=e,{objects:n}=F(Ime);return a.jsx(sa,{listening:!1,...t,children:n.filter(v9).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))})},Ome=u.memo(Eme);var bi=u,Mme=function(t,n,r){const o=bi.useRef("loading"),s=bi.useRef(),[i,c]=bi.useState(0),f=bi.useRef(),p=bi.useRef(),h=bi.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),bi.useLayoutEffect(function(){if(!t)return;var m=document.createElement("img");function v(){o.current="loaded",s.current=m,c(Math.random())}function b(){o.current="failed",s.current=void 0,c(Math.random())}return m.addEventListener("load",v),m.addEventListener("error",b),n&&(m.crossOrigin=n),r&&(m.referrerPolicy=r),m.src=t,function(){m.removeEventListener("load",v),m.removeEventListener("error",b)}},[t,n,r]),[s.current,o.current]};const Dme=Dc(Mme),Rme=e=>{const{width:t,height:n,x:r,y:o,imageName:s}=e.canvasImage,{currentData:i,isError:c}=fo(s??Lr.skipToken),[f]=Dme((i==null?void 0:i.image_url)??"",b9.get()?"use-credentials":"anonymous");return c?a.jsx(ks,{x:r,y:o,width:t,height:n,fill:"red"}):a.jsx(f8,{x:r,y:o,image:f,listening:!1})},h8=u.memo(Rme),Ame=ae([$t],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:kt}}),Nme=()=>{const{objects:e}=F(Ame);return e?a.jsx(sa,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(x9(t))return a.jsx(h8,{canvasImage:t},n);if(y9(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(C9(t))return a.jsx(ks,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Di(t.color)},n);if(w9(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},Tme=u.memo(Nme),$me=ae([$t],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:{x:o,y:s},boundingBoxDimensions:{width:i,height:c}}=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:c}},{memoizeOptions:{resultEqualityCheck:kt}}),Lme=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:i,width:c,height:f}=F($me);return a.jsxs(sa,{...t,children:[r&&n&&a.jsx(h8,{canvasImage:n}),o&&a.jsxs(sa,{children:[a.jsx(ks,{x:s,y:i,width:c,height:f,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(ks,{x:s,y:i,width:c,height:f,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},zme=u.memo(Lme),Fme=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}}),Bme=()=>{const e=J(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o,sessionId:s}=F(Fme),{t:i}=we(),c=u.useCallback(()=>{e(hw(!0))},[e]),f=u.useCallback(()=>{e(hw(!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=u.useCallback(()=>e(S9()),[e]),h=u.useCallback(()=>e(k9()),[e]),m=u.useCallback(()=>e(_9(s)),[e,s]),{data:v}=fo((r==null?void 0:r.imageName)??Lr.skipToken);return r?a.jsx($,{pos:"absolute",bottom:4,w:"100%",align:"center",justify:"center",onMouseOver:c,onMouseOut:f,children:a.jsxs(hn,{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(sZ,{}),onClick:p,colorScheme:"accent",isDisabled:t}),a.jsx(Te,{tooltip:`${i("unifiedCanvas.next")} (Right)`,"aria-label":`${i("unifiedCanvas.next")} (Right)`,icon:a.jsx(aZ,{}),onClick:h,colorScheme:"accent",isDisabled:n}),a.jsx(Te,{tooltip:`${i("unifiedCanvas.accept")} (Enter)`,"aria-label":`${i("unifiedCanvas.accept")} (Enter)`,icon:a.jsx(SE,{}),onClick:m,colorScheme:"accent"}),a.jsx(Te,{tooltip:i("unifiedCanvas.showHide"),"aria-label":i("unifiedCanvas.showHide"),"data-alert":!o,icon:o?a.jsx(CZ,{}):a.jsx(yZ,{}),onClick:()=>e(j9(!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(P9({imageDTO:v}))},colorScheme:"accent"}),a.jsx(Te,{tooltip:i("unifiedCanvas.discardAll"),"aria-label":i("unifiedCanvas.discardAll"),icon:a.jsx(nl,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(I9()),colorScheme:"error",fontSize:20})]})}):null},Hme=u.memo(Bme),Vme=()=>{const e=F(c=>c.canvas.layerState),t=F(c=>c.canvas.boundingBoxCoordinates),n=F(c=>c.canvas.boundingBoxDimensions),r=F(c=>c.canvas.isMaskEnabled),o=F(c=>c.canvas.shouldPreserveMaskedArea),[s,i]=u.useState();return u.useEffect(()=>{i(void 0)},[e,t,n,r,o]),GZ(async()=>{const c=await E9(e,t,n,r,o);if(!c)return;const{baseImageData:f,maskImageData:p}=c,h=O9(f,p);i(h)},1e3,[e,t,n,r,o]),s},Wme={txt2img:"Text to Image",img2img:"Image to Image",inpaint:"Inpaint",outpaint:"Inpaint"},Ume=()=>{const e=Vme();return a.jsxs(Ie,{children:["Mode: ",e?Wme[e]:"..."]})},Gme=u.memo(Ume),Xl=e=>Math.round(e*100)/100,Kme=ae([$t],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Xl(n)}, ${Xl(r)})`}},{memoizeOptions:{resultEqualityCheck:kt}});function qme(){const{cursorCoordinatesString:e}=F(Kme),{t}=we();return a.jsx(Ie,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Mb="var(--invokeai-colors-warning-500)",Xme=ae([$t],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:i},scaledBoundingBoxDimensions:{width:c,height:f},boundingBoxCoordinates:{x:p,y:h},stageScale:m,shouldShowCanvasDebugInfo:v,layer:b,boundingBoxScaleMethod:y,shouldPreserveMaskedArea:x}=e;let w="inherit";return(y==="none"&&(s<512||i<512)||y==="manual"&&c*f<512*512)&&(w=Mb),{activeLayerColor:b==="mask"?Mb:"inherit",activeLayerString:b.charAt(0).toUpperCase()+b.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${Xl(p)}, ${Xl(h)})`,boundingBoxDimensionsString:`${s}×${i}`,scaledBoundingBoxDimensionsString:`${c}×${f}`,canvasCoordinatesString:`${Xl(r)}×${Xl(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(m*100),shouldShowCanvasDebugInfo:v,shouldShowBoundingBox:y!=="auto",shouldShowScaledBoundingBox:y!=="none",shouldPreserveMaskedArea:x}},{memoizeOptions:{resultEqualityCheck:kt}}),Yme=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:i,canvasCoordinatesString:c,canvasDimensionsString:f,canvasScaleString:p,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:m,shouldPreserveMaskedArea:v}=F(Xme),{t:b}=we();return a.jsxs($,{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(Gme,{}),a.jsx(Ie,{style:{color:e},children:`${b("unifiedCanvas.activeLayer")}: ${t}`}),a.jsx(Ie,{children:`${b("unifiedCanvas.canvasScale")}: ${p}%`}),v&&a.jsx(Ie,{style:{color:Mb},children:"Preserve Masked Area: On"}),m&&a.jsx(Ie,{style:{color:n},children:`${b("unifiedCanvas.boundingBox")}: ${o}`}),i&&a.jsx(Ie,{style:{color:n},children:`${b("unifiedCanvas.scaledBoundingBox")}: ${s}`}),h&&a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:`${b("unifiedCanvas.boundingBoxPosition")}: ${r}`}),a.jsx(Ie,{children:`${b("unifiedCanvas.canvasDimensions")}: ${f}`}),a.jsx(Ie,{children:`${b("unifiedCanvas.canvasPosition")}: ${c}`}),a.jsx(qme,{})]})]})},Qme=u.memo(Yme),Zme=ae([be],({canvas:e,generation:t})=>{const{boundingBoxCoordinates:n,boundingBoxDimensions:r,stageScale:o,isDrawing:s,isTransformingBoundingBox:i,isMovingBoundingBox:c,tool:f,shouldSnapToGrid:p}=e,{aspectRatio:h}=t;return{boundingBoxCoordinates:n,boundingBoxDimensions:r,isDrawing:s,isMovingBoundingBox:c,isTransformingBoundingBox:i,stageScale:o,shouldSnapToGrid:p,tool:f,hitStrokeWidth:20/o,aspectRatio:h}},{memoizeOptions:{resultEqualityCheck:kt}}),Jme=e=>{const{...t}=e,n=J(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:i,isTransformingBoundingBox:c,stageScale:f,shouldSnapToGrid:p,tool:h,hitStrokeWidth:m,aspectRatio:v}=F(Zme),b=u.useRef(null),y=u.useRef(null),[x,w]=u.useState(!1);u.useEffect(()=>{var B;!b.current||!y.current||(b.current.nodes([y.current]),(B=b.current.getLayer())==null||B.batchDraw())},[]);const k=64*f;Qe("N",()=>{n(Xp(!p))});const _=u.useCallback(B=>{if(!p){n(q0({x:Math.floor(B.target.x()),y:Math.floor(B.target.y())}));return}const G=B.target.x(),Y=B.target.y(),V=No(G,64),L=No(Y,64);B.target.x(V),B.target.y(L),n(q0({x:V,y:L}))},[n,p]),j=u.useCallback(()=>{if(!y.current)return;const B=y.current,G=B.scaleX(),Y=B.scaleY(),V=Math.round(B.width()*G),L=Math.round(B.height()*Y),X=Math.round(B.x()),z=Math.round(B.y());if(v){const K=No(V/v,64);n(Ro({width:V,height:K}))}else n(Ro({width:V,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=u.useCallback((B,G,Y)=>{const V=B.x%k,L=B.y%k;return{x:Eu(G.x,k)+V,y:Eu(G.y,k)+L}},[k]),E=()=>{n(X0(!0))},O=()=>{n(X0(!1)),n(Y0(!1)),n(Uf(!1)),w(!1)},M=()=>{n(Y0(!0))},D=()=>{n(X0(!1)),n(Y0(!1)),n(Uf(!1)),w(!1)},A=()=>{w(!0)},R=()=>{!c&&!i&&w(!1)},T=()=>{n(Uf(!0))},q=()=>{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:T,onMouseOver:T,onMouseLeave:q,onMouseOut:q}),a.jsx(ks,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:m,listening:!s&&h==="move",onDragStart:M,onDragEnd:D,onDragMove:_,onMouseDown:M,onMouseOut:R,onMouseOver:A,onMouseEnter:A,onMouseUp:D,onTransform:j,onTransformEnd:O,ref:y,stroke:x?"rgba(255,255,255,0.7)":"white",strokeWidth:(x?8:1)/f,width:o.width,x:r.x,y:r.y}),a.jsx(tme,{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:M,onDragEnd:D,onMouseDown:E,onMouseUp:O,onTransformEnd:O,ref:b,rotateEnabled:!1})]})},ege=u.memo(Jme),tge=ae($t,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:i,layer:c,shouldShowBrush:f,isMovingBoundingBox:p,isTransformingBoundingBox:h,stageScale:m,stageDimensions:v,boundingBoxCoordinates:b,boundingBoxDimensions:y,shouldRestrictStrokesToBox:x}=e,w=x?{clipX:b.x,clipY:b.y,clipWidth:y.width,clipHeight:y.height}:{};return{cursorPosition:t,brushX:t?t.x:v.width/2,brushY:t?t.y:v.height/2,radius:n/2,colorPickerOuterRadius:mw/m,colorPickerInnerRadius:(mw-d1+1)/m,maskColorString:Di({...o,a:.5}),brushColorString:Di(s),colorPickerColorString:Di(r),tool:i,layer:c,shouldShowBrush:f,shouldDrawBrushPreview:!(p||h||!t)&&f,strokeWidth:1.5/m,dotRadius:1.5/m,clip:w}},{memoizeOptions:{resultEqualityCheck:kt}}),nge=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:i,layer:c,shouldDrawBrushPreview:f,dotRadius:p,strokeWidth:h,brushColorString:m,colorPickerColorString:v,colorPickerInnerRadius:b,colorPickerOuterRadius:y,clip:x}=F(tge);return f?a.jsxs(sa,{listening:!1,...x,...t,children:[i==="colorPicker"?a.jsxs(a.Fragment,{children:[a.jsx(vi,{x:n,y:r,radius:y,stroke:m,strokeWidth:d1,strokeScaleEnabled:!1}),a.jsx(vi,{x:n,y:r,radius:b,stroke:v,strokeWidth:d1,strokeScaleEnabled:!1})]}):a.jsxs(a.Fragment,{children:[a.jsx(vi,{x:n,y:r,radius:o,fill:c==="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},rge=u.memo(nge),oge=ae([$t,bo],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:i,isMovingBoundingBox:c,stageDimensions:f,stageCoordinates:p,tool:h,isMovingStage:m,shouldShowIntermediates:v,shouldShowGrid:b,shouldRestrictStrokesToBox:y,shouldAntialias:x}=e;let w="none";return h==="move"||t?m?w="grabbing":w="grab":s?w=void 0:y&&!i&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||c,shouldShowBoundingBox:o,shouldShowGrid:b,stageCoordinates:p,stageCursor:w,stageDimensions:f,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:v,shouldAntialias:x}},Ce),sge=_e(nme,{shouldForwardProp:e=>!["sx"].includes(e)}),age=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:i,stageScale:c,tool:f,isStaging:p,shouldShowIntermediates:h,shouldAntialias:m}=F(oge);ame();const v=J(),b=u.useRef(null),y=u.useRef(null),x=u.useRef(null),w=u.useCallback(q=>{D9(q),y.current=q},[]),k=u.useCallback(q=>{R9(q),x.current=q},[]),_=u.useRef({x:0,y:0}),j=u.useRef(!1),I=mme(y),E=lme(y),O=pme(y,j),M=ume(y,j,_),D=dme(),{handleDragStart:A,handleDragMove:R,handleDragEnd:T}=ome();return u.useEffect(()=>{if(!b.current)return;const q=new ResizeObserver(B=>{for(const G of B)if(G.contentBoxSize){const{width:Y,height:V}=G.contentRect;v(M9({width:Y,height:V}))}});return q.observe(b.current),()=>{q.disconnect()}},[v]),a.jsxs($,{id:"canvas-container",ref:b,sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:[a.jsx(Ie,{sx:{position:"absolute"},children:a.jsxs(sge,{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:c,y:c},onTouchStart:E,onTouchMove:M,onTouchEnd:O,onMouseDown:E,onMouseLeave:D,onMouseMove:M,onMouseUp:O,onDragStart:A,onDragMove:R,onDragEnd:T,onContextMenu:q=>q.evt.preventDefault(),onWheel:I,draggable:(f==="move"||p)&&!t,children:[a.jsx(Iu,{id:"grid",visible:r,children:a.jsx(Cme,{})}),a.jsx(Iu,{id:"base",ref:k,listening:!1,imageSmoothingEnabled:m,children:a.jsx(Tme,{})}),a.jsxs(Iu,{id:"mask",visible:e,listening:!1,children:[a.jsx(Ome,{visible:!0,listening:!1}),a.jsx(Pme,{listening:!1})]}),a.jsx(Iu,{children:a.jsx(bme,{})}),a.jsxs(Iu,{id:"preview",imageSmoothingEnabled:m,children:[!p&&a.jsx(rge,{visible:f!=="move",listening:!1}),a.jsx(zme,{visible:p}),h&&a.jsx(kme,{}),a.jsx(ege,{visible:n&&!p})]})]})}),a.jsx(Qme,{}),a.jsx(Hme,{})]})},ige=u.memo(age);function lge(e,t,n=250){const[r,o]=u.useState(0);return u.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 cge=_e(dM,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),Qv={width:6,height:6,borderColor:"base.100"},uge=e=>{const{styleClass:t="",...n}=e;return a.jsx(cge,{sx:{".react-colorful__hue-pointer":Qv,".react-colorful__saturation-pointer":Qv,".react-colorful__alpha-pointer":Qv},className:t,...n})},m8=u.memo(uge),dge=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}}),fge=()=>{const e=J(),{t}=we(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:i}=F(dge);Qe(["q"],()=>{c()},{enabled:()=>!i,preventDefault:!0},[n]),Qe(["shift+c"],()=>{f()},{enabled:()=>!i,preventDefault:!0},[]),Qe(["h"],()=>{p()},{enabled:()=>!i,preventDefault:!0},[o]);const c=()=>{e(h5(n==="mask"?"base":"mask"))},f=()=>e(d5()),p=()=>e(Xb(!o)),h=async()=>{e(T9())};return a.jsx(Wd,{triggerComponent:a.jsx(hn,{children:a.jsx(Te,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:a.jsx(ME,{}),isChecked:n==="mask",isDisabled:i})}),children:a.jsxs($,{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(A9(m.target.checked))}),a.jsx(m8,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:m=>e(N9(m))}),a.jsx(it,{size:"sm",leftIcon:a.jsx(eg,{}),onClick:h,children:"Save Mask"}),a.jsxs(it,{size:"sm",leftIcon:a.jsx(Hr,{}),onClick:f,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},pge=u.memo(fge),hge=ae([$t,wn,go],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:kt}});function mge(){const e=J(),{canRedo:t,activeTabName:n}=F(hge),{t:r}=we(),o=()=>{e($9())};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(DZ,{}),onClick:o,isDisabled:!t})}const gge=()=>{const e=F(bo),t=J(),{t:n}=we();return a.jsxs(By,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(L9()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:a.jsx(it,{size:"sm",leftIcon:a.jsx(Hr,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),a.jsx("br",{}),a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},vge=u.memo(gge),bge=ae([$t],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:c,shouldRestrictStrokesToBox:f,shouldAntialias:p}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:c,shouldRestrictStrokesToBox:f,shouldAntialias:p}},{memoizeOptions:{resultEqualityCheck:kt}}),xge=()=>{const e=J(),{t}=we(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:i,shouldShowIntermediates:c,shouldSnapToGrid:f,shouldRestrictStrokesToBox:p,shouldAntialias:h}=F(bge);Qe(["n"],()=>{e(Xp(!f))},{enabled:!0,preventDefault:!0},[f]);const m=v=>e(Xp(v.target.checked));return a.jsx(Wd,{isLazy:!1,triggerComponent:a.jsx(Te,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(TE,{})}),children:a.jsxs($,{direction:"column",gap:2,children:[a.jsx(ur,{label:t("unifiedCanvas.showIntermediates"),isChecked:c,onChange:v=>e(z9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.showGrid"),isChecked:i,onChange:v=>e(F9(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(B9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:v=>e(H9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:v=>e(V9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:v=>e(W9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:v=>e(U9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.antialiasing"),isChecked:h,onChange:v=>e(G9(v.target.checked))}),a.jsx(vge,{})]})})},yge=u.memo(xge),Cge=ae([$t,bo,go],(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}}),wge=()=>{const e=J(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=F(Cge),{t:s}=we();Qe(["b"],()=>{i()},{enabled:()=>!o,preventDefault:!0},[]),Qe(["e"],()=>{c()},{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(Ql("brush")),c=()=>e(Ql("eraser")),f=()=>e(Ql("colorPicker")),p=()=>e(K9()),h=()=>e(q9());return a.jsxs(hn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:a.jsx(OZ,{}),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(hZ,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:c}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(wZ,{}),isDisabled:o,onClick:p}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(nl,{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(xZ,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:f}),a.jsx(Wd,{triggerComponent:a.jsx(Te,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:a.jsx(AE,{})}),children:a.jsxs($,{minWidth:60,direction:"column",gap:4,width:"100%",children:[a.jsx($,{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(m8,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:m=>e(Q0(m))})]})})]})},Sge=u.memo(wge),kge=ae([$t,wn,go],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:kt}});function _ge(){const e=J(),{t}=we(),{canUndo:n,activeTabName:r}=F(kge),o=()=>{e(X9())};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 jge=ae([go,$t,bo],(e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:s,layer:i,isMaskEnabled:c}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:c,tool:o,layer:i,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:kt}}),Pge=()=>{const e=J(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s}=F(jge),i=u1(),{t:c}=we(),{isClipboardAPIAvailable:f}=NO(),{getUploadButtonProps:p,getUploadInputProps:h}=ky({postUploadAction:{type:"SET_CANVAS_INITIAL_IMAGE"}});Qe(["v"],()=>{m()},{enabled:()=>!n,preventDefault:!0},[]),Qe(["r"],()=>{b()},{enabled:()=>!0,preventDefault:!0},[i]),Qe(["shift+m"],()=>{x()},{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(Ql("move")),v=lge(()=>b(!1),()=>b(!0)),b=(I=!1)=>{const E=u1();if(!E)return;const O=E.getClientRect({skipTransform:!0});e(Q9({contentRect:O,shouldScaleTo1:I}))},y=()=>{e(Dj())},x=()=>{e(Z9())},w=()=>{e(J9())},k=()=>{f&&e(eN())},_=()=>{e(tN())},j=I=>{const E=I;e(h5(E)),E==="mask"&&!r&&e(Xb(!0))};return a.jsxs($,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[a.jsx(Ie,{w:24,children:a.jsx($n,{tooltip:`${c("unifiedCanvas.layer")} (Q)`,value:o,data:Y9,onChange:j,disabled:n})}),a.jsx(pge,{}),a.jsx(Sge,{}),a.jsxs(hn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${c("unifiedCanvas.move")} (V)`,tooltip:`${c("unifiedCanvas.move")} (V)`,icon:a.jsx(iZ,{}),isChecked:s==="move"||n,onClick:m}),a.jsx(Te,{"aria-label":`${c("unifiedCanvas.resetView")} (R)`,tooltip:`${c("unifiedCanvas.resetView")} (R)`,icon:a.jsx(dZ,{}),onClick:v})]}),a.jsxs(hn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${c("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${c("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(PZ,{}),onClick:x,isDisabled:n}),a.jsx(Te,{"aria-label":`${c("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${c("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(eg,{}),onClick:w,isDisabled:n}),f&&a.jsx(Te,{"aria-label":`${c("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${c("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(Hc,{}),onClick:k,isDisabled:n}),a.jsx(Te,{"aria-label":`${c("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${c("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(Jm,{}),onClick:_,isDisabled:n})]}),a.jsxs(hn,{isAttached:!0,children:[a.jsx(_ge,{}),a.jsx(mge,{})]}),a.jsxs(hn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${c("common.upload")}`,tooltip:`${c("common.upload")}`,icon:a.jsx(ng,{}),isDisabled:n,...p()}),a.jsx("input",{...h()}),a.jsx(Te,{"aria-label":`${c("unifiedCanvas.clearCanvas")}`,tooltip:`${c("unifiedCanvas.clearCanvas")}`,icon:a.jsx(Hr,{}),onClick:y,colorScheme:"error",isDisabled:n})]}),a.jsx(hn,{isAttached:!0,children:a.jsx(yge,{})})]})},Ige=u.memo(Pge),mj={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},Ege=()=>{const{isOver:e,setNodeRef:t,active:n}=hO({id:"unifiedCanvas",data:mj});return a.jsxs($,{layerStyle:"first",ref:t,tabIndex:-1,sx:{flexDirection:"column",alignItems:"center",gap:4,p:2,borderRadius:"base",w:"full",h:"full"},children:[a.jsx(Ige,{}),a.jsx(ige,{}),mO(mj,n)&&a.jsx(gO,{isOver:e,label:"Set Canvas Initial Image"})]})},Oge=u.memo(Ege),Mge=()=>a.jsx(Oge,{}),Dge=u.memo(Mge),Rge=[{id:"txt2img",translationKey:"common.txt2img",icon:a.jsx(An,{as:SZ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Jpe,{})},{id:"img2img",translationKey:"common.img2img",icon:a.jsx(An,{as:Vi,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(iue,{})},{id:"unifiedCanvas",translationKey:"common.unifiedCanvas",icon:a.jsx(An,{as:Cne,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Dge,{})},{id:"nodes",translationKey:"common.nodes",icon:a.jsx(An,{as:vg,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Qpe,{})},{id:"modelManager",translationKey:"modelManager.modelManager",icon:a.jsx(An,{as:fZ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(ade,{})}],Age=ae([be],({config:e})=>{const{disabledTabs:t}=e;return Rge.filter(r=>!t.includes(r.id))},{memoizeOptions:{resultEqualityCheck:kt}}),Nge=448,Tge=448,$ge=360,Lge=["modelManager"],zge=["modelManager"],Fge=()=>{const e=F(nN),t=F(wn),n=F(Age),{t:r}=we(),o=J(),s=u.useCallback(R=>{R.target instanceof HTMLElement&&R.target.blur()},[]),i=u.useMemo(()=>n.map(R=>a.jsx(Dt,{hasArrow:!0,label:String(r(R.translationKey)),placement:"end",children:a.jsxs(jr,{onClick:s,children:[a.jsx(M5,{children:String(r(R.translationKey))}),R.icon]})},R.id)),[n,r,s]),c=u.useMemo(()=>n.map(R=>a.jsx(uo,{children:R.content},R.id)),[n]),f=u.useCallback(R=>{const T=rN[R];T&&o(Ra(T))},[o]),{minSize:p,isCollapsed:h,setIsCollapsed:m,ref:v,reset:b,expand:y,collapse:x,toggle:w}=w_(Nge,"pixels"),{ref:k,minSize:_,isCollapsed:j,setIsCollapsed:I,reset:E,expand:O,collapse:M,toggle:D}=w_($ge,"pixels");Qe("f",()=>{j||h?(O(),y()):(x(),M())},[o,j,h]),Qe(["t","o"],()=>{w()},[o]),Qe("g",()=>{D()},[o]);const A=Oy();return a.jsxs(Qi,{variant:"appTabs",defaultIndex:e,index:e,onChange:f,sx:{flexGrow:1,gap:4},isLazy:!0,children:[a.jsxs(Zi,{sx:{pt:2,gap:4,flexDir:"column"},children:[i,a.jsx(Za,{}),a.jsx(mJ,{})]}),a.jsxs(yg,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},storage:A,units:"pixels",children:[!zge.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(Wa,{order:0,id:"side",ref:v,defaultSize:p,minSize:p,onCollapse:m,collapsible:!0,children:t==="nodes"?a.jsx(Joe,{}):a.jsx(Ece,{})}),a.jsx(om,{onDoubleClick:b,collapsedDirection:h?"left":void 0}),a.jsx(rse,{isSidePanelCollapsed:h,sidePanelRef:v})]}),a.jsx(Wa,{id:"main",order:1,minSize:Tge,children:a.jsx(zc,{style:{height:"100%",width:"100%"},children:c})}),!Lge.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(om,{onDoubleClick:E,collapsedDirection:j?"right":void 0}),a.jsx(Wa,{id:"gallery",ref:k,order:2,defaultSize:_,minSize:_,onCollapse:I,collapsible:!0,children:a.jsx(Zne,{})}),a.jsx(tse,{isGalleryCollapsed:j,galleryPanelRef:k})]})]})]})},Bge=u.memo(Fge),Hge=u.createContext(null),Zv={didCatch:!1,error:null};class Vge extends u.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&&Wge(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 c=t;if(s){const f={error:i,resetErrorBoundary:this.resetErrorBoundary};if(u.isValidElement(o))c=o;else if(typeof n=="function")c=n(f);else if(r)c=u.createElement(r,f);else throw i}return u.createElement(Hge.Provider,{value:{didCatch:s,error:i,resetErrorBoundary:this.resetErrorBoundary}},c)}}function Wge(){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 Uge=()=>{const e=J(),[t,n]=u.useState(),[r,o]=u.useState(),{recallAllParameters:s}=gg(),i=Ji(),{currentData:c}=fo(t??Lr.skipToken),{currentData:f}=oN(r??Lr.skipToken);return{handlePreselectedImage:u.useCallback(h=>{h&&(h.action==="sendToCanvas"&&(n(h==null?void 0:h.imageName),c&&(e(Fj(c)),e(Ra("unifiedCanvas")),i({title:sN("toast.sentToUnifiedCanvas"),status:"info",duration:2500,isClosable:!0}))),h.action==="sendToImg2Img"&&(n(h==null?void 0:h.imageName),c&&e(pm(c))),h.action==="useAllParameters"&&(o(h==null?void 0:h.imageName),f&&s(f.metadata)))},[e,c,f,s,i])}};function Gge(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 Kge=({error:e,resetErrorBoundary:t})=>{const n=S5(),r=u.useCallback(()=>{const s=JSON.stringify(aN(e),null,2);navigator.clipboard.writeText(`\`\`\`
|
||
${s}
|
||
\`\`\``),n({title:"Error Copied"})},[e,n]),o=u.useMemo(()=>Gge({user:"invoke-ai",repo:"InvokeAI",template:"BUG_REPORT.yml",title:`[bug]: ${e.name}: ${e.message}`}),[e.message,e.name]);return a.jsx($,{layerStyle:"body",sx:{w:"100vw",h:"100vh",alignItems:"center",justifyContent:"center",p:4},children:a.jsxs($,{layerStyle:"first",sx:{flexDir:"column",borderRadius:"base",justifyContent:"center",gap:8,p:16},children:[a.jsx(ro,{children:"Something went wrong"}),a.jsx($,{layerStyle:"second",sx:{px:8,py:4,borderRadius:"base",gap:4,justifyContent:"space-between",alignItems:"center"},children:a.jsxs(xe,{sx:{fontWeight:600,color:"error.500",_dark:{color:"error.400"}},children:[e.name,": ",e.message]})}),a.jsxs($,{sx:{gap:4},children:[a.jsx(it,{leftIcon:a.jsx(Lpe,{}),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(jE,{}),children:"Create Issue"})})]})]})})},qge=u.memo(Kge),Xge=ae([be],({hotkeys:e})=>{const{shift:t,ctrl:n,meta:r}=e;return{shift:t,ctrl:n,meta:r}},{memoizeOptions:{resultEqualityCheck:kt}}),Yge=()=>{const e=J(),{shift:t,ctrl:n,meta:r}=F(Xge);return Qe("*",()=>{Tp("shift")?!t&&e(Pr(!0)):t&&e(Pr(!1)),Tp("ctrl")?!n&&e(gw(!0)):n&&e(gw(!1)),Tp("meta")?!r&&e(vw(!0)):r&&e(vw(!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},Qge=u.memo(Yge),Zge={},Jge=({config:e=Zge,headerComponent:t,selectedImage:n})=>{const r=F(OP),o=MP("system"),s=J(),{handlePreselectedImage:i}=Uge(),c=u.useCallback(()=>(localStorage.clear(),location.reload(),!1),[]);return u.useEffect(()=>{xn.changeLanguage(r)},[r]),u.useEffect(()=>{qj(e)&&(o.info({config:e},"Received config"),s(iN(e)))},[s,e,o]),u.useEffect(()=>{s(lN())},[s]),u.useEffect(()=>{i(n)},[i,n]),a.jsxs(Vge,{onReset:c,FallbackComponent:qge,children:[a.jsx(Ua,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:a.jsx(RW,{children:a.jsxs(Ua,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[t||a.jsx(fJ,{}),a.jsx($,{sx:{gap:4,w:"full",h:"full"},children:a.jsx(Bge,{})})]})})}),a.jsx(QQ,{}),a.jsx(GQ,{}),a.jsx(wV,{}),a.jsx(Qge,{})]})},l0e=u.memo(Jge);export{l0e as default};
|