InvokeAI/invokeai/frontend/web/dist/assets/App-879ff07f.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

170 lines
815 KiB
JavaScript
Raw Normal View History

2023-07-19 03:18:46 +00:00
import{t as Hg,r as XI,i as JI,a as pu,b as JC,S as ZC,c as e4,d as t4,e as Wg,f as n4,g as Vg,h as ZI,j as eE,k as tE,l as nE,m as rE,n as oE,o as sE,p as aE,q as iE,s as f,u as et,v as a,I as lo,w as cr,x as Hn,y as He,z as kt,A as hu,B as ht,C as mu,D as ws,E as to,F as no,G as wr,H as lE,J as cE,K as Ha,L as Wc,M as Ni,N as on,O as ga,P as Hp,Q as J0,R as Cl,T as Z0,U as gu,_ as Qn,V as uE,W as N,X as r4,Y as o4,Z as Ab,$ as s4,a0 as Wp,a1 as ev,a2 as Yl,a3 as dE,a4 as fE,a5 as pE,a6 as hE,a7 as a4,a8 as i4,a9 as Vp,aa as bf,ab as mE,ac as gE,ad as Bm,ae as Nb,af as vE,ag as l4,ah as c4,ai as Ql,aj as $b,ak as zb,al as yE,am as bE,an as xE,ao as wE,ap as SE,aq as Fm,ar as rl,as as Hm,at as CE,au as _E,av as kE,aw as tv,ax as Up,ay as xf,az as PE,aA as u4,aB as d4,aC as jE,aD as vu,aE as nv,aF as IE,aG as EE,aH as OE,aI as RE,aJ as ME,aK as DE,aL as TE,aM as Lb,aN as Ne,aO as F,aP as ta,aQ as be,aR as _o,aS as ur,aT as ee,aU as L,aV as Xl,aW as de,aX as f4,aY as p4,aZ as Jl,a_ as ko,a$ as Ve,b0 as Sn,b1 as wf,b2 as AE,b3 as Wa,b4 as rv,b5 as Sf,b6 as h4,b7 as ov,b8 as Rt,b9 as sv,ba as NE,bb as $E,bc as zE,bd as ol,be as gs,bf as m4,bg as LE,bh as BE,bi as yu,bj as it,bk as av,bl as Va,bm as Bb,bn as FE,bo as HE,bp as WE,bq as Cd,br as _d,bs as Vc,bt as Uc,bu as Fb,bv as Cf,bw as Hb,bx as _f,by as Wb,bz as Ug,bA as Vb,bB as Gg,bC as Ub,bD as kf,bE as Gb,bF as Al,bG as qb,bH as Nl,bI as Kb,bJ as Pf,bK as VE,bL as jf,bM as g4,bN as iv,bO as lv,bP as UE,bQ as v4,bR as GE,bS as qE,bT as Gp,bU as vl,bV as KE,bW as df,bX as je,bY as YE,bZ as QE,b_ as XE,b$ as If,c0 as Zl,c1 as y4,c2 as JE,c3 as b4,c4 as Yb,c5 as Qb,c6 as ZE,c7 as Ls,c8 as Xb,c9 as wt,ca as Ef,cb as e8,cc as x4,cd as qr,ce as t8,cf as Xn,cg as Kt,ch as qg,ci as Bs,cj as Ss,ck as vs,cl as w4,cm as n8,cn as S4,co as Jb,cp as r8,cq as o8,cr as s8,cs as a8,ct as vr,cu as C4,cv as i8,cw as l8,cx as c8,cy as u8,cz as d8,cA as cv,cB as qo,cC as _4,cD as k4,cE as f8,cF as Zb,cG as p8,cH as h8,cI as m8,cJ as g8,cK as v8,cL as y8,cM as b8,cN as P4,cO as x8,cP as w8,cQ as S8,cR as C8,cS as _8,cT as k8,cU as Nr,cV as j4,cW as P8,cX as ex,cY as j8,cZ as I8,c_ as E8,c$ as O8,d0 as R8,d1 as M8,d2 as D8,d3 as T8,d4 as I4,d5 as fo,d6 as A8,d7 as N8,d8 as $8,d9 as qp,da as z8,db as uv,dc as E4,dd as L8,de as B8,df as F8,dg as Yo,dh as H8,di as tx,dj as nx,dk as _l,dl as W8,dm as V8,dn as U8,dp as G8,dq as q8,dr as K8,ds as Y8,dt as Q8,du as X8,dv as J8,dw as Z8,dx as dv,dy as fv,dz as e7,dA as rx,dB as t7,dC as ox,dD as Qo,dE as n7,dF as r7,dG as sx,dH as ax,dI as o7,dJ as ix,dK as s7,dL as a7,dM as i7,dN as l7,dO as c7,dP as u7,dQ as O4,dR as R4,dS as M4,dT as D4,dU as T4,dV as bu,dW as lx,dX as d7,dY as _i,dZ as A4,d_ as f7,d$ as N4,e0 as cx,e1 as p7,e2 as ls,e3 as h7,e4 as m7,e5 as $4,e6 as z4,e7 as g7,e8 as L4,e9 as B4,ea as rr,eb as or,ec as xu,ed as F4,ee as H4,ef as ux,eg as v7,eh as dx,ei as y7,ej as W4,ek as b7,el as Kp,em as fx,en as V4,eo as x7,ep as px,eq as U4,er as Ko,es as w7,et as S7,eu as G4,ev as C7,ew as _7,ex as k7,ey as P7,ez as j7,eA as I7,eB as E7,eC as O7,eD as R7,eE as M7,eF as D7,eG as T7,eH as A7,eI as N7,eJ as $7,eK as z7,eL as L7,eM as B7,eN as F7,eO as hx,eP as ff,eQ as H7,eR as en,eS as Of,eT as q4,eU as eu,eV as W7,eW as V7,eX as zs,eY as K4,eZ as pv,e_ as wu,e$ as U7,f0 as G7,f1 as q7,f2 as la,f3 as Y4,f4 as K7,f5 as Y7,f6 as Q4,f7 as Q7,f8 as X7,f9 as J7,fa as Z7,fb as eO,fc as tO,fd as nO,fe as rO,ff as oO,fg as sO,fh as aO,fi as mx,fj as iO,fk as lO,fl as cO,fm as uO,fn as dO,fo as fO,fp as Wm,fq as $s,fr as kd,fs as Vm,ft as Um,fu as Pd,fv as gx,fw as Kg,fx as pO,fy as hO,fz as mO,fA as gO,fB as vO,fC as Rf,fD as X4,fE as J4,fF as yO,fG as bO,fH as Z4,fI as e3,fJ as t3,fK as n3,fL as r3,fM as o3,fN as s3,fO as a3,fP as kl,fQ as Pl,fR as i3,fS as l3,fT as xO,fU as c3,fV as u3,fW as d3,fX as f3,fY as p3,fZ as h3,f_ as m3,f$ as hv,g0 as wO,g1 as SO,g2 as vx,g3 as CO,g4 as _O,g5 as Mf,g6 as yx,g7 as bx,g8 as xx,g9 as wx,ga as kO,gb as PO,gc as jO,gd as IO,ge as EO,gf as OO,gg as RO,gh as MO,gi as DO,gj as TO}from"./index-ba194473.js";import{m
2023-07-19 03:07:31 +00:00
`})}function P9(e){mu({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function $c(e){const{isOpen:t,isDisabled:n}=vv(),{reduceMotion:r}=yv(),o=kt("chakra-accordion__icon",e.className),s=Yp(),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(lo,{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"})})}$c.displayName="AccordionIcon";var zc=et(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...i}=S9(t),d={...Yp().container,overflowAnchor:"none"},p=f.useMemo(()=>i,[i]);return a.jsx(g9,{value:p,children:a.jsx(He.div,{ref:n,...s,className:kt("chakra-accordion__item",o),__css:d,children:typeof r=="function"?r({isExpanded:!!i.isOpen,isDisabled:!!i.isDisabled}):r})})});zc.displayName="AccordionItem";var gi={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Pc={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function Qg(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return Pc.slideRight;case"left":return Pc.slideLeft;case"bottom":return Pc.slideDown;case"top":return Pc.slideUp;default:return Pc.slideRight}}var yi={enter:{duration:.2,ease:gi.easeOut},exit:{duration:.1,ease:gi.easeIn}},cs={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})},j9=e=>e!=null&&parseInt(e.toString(),10)>0,Ix={exit:{height:{duration:.2,ease:gi.ease},opacity:{duration:.3,ease:gi.ease}},enter:{height:{duration:.3,ease:gi.ease},opacity:{duration:.4,ease:gi.ease}}},I9={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:j9(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:cs.exit(Ix.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:cs.enter(Ix.enter,o)}}},Qp=f.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:i="auto",style:u,className:d,transition:p,transitionEnd:h,...m}=e,[v,b]=f.useState(!1);f.useEffect(()=>{const k=setTimeout(()=>{b(!0)});return()=>clearTimeout(k)},[]),mu({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const S=parseFloat(s.toString())>0,w={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:S?"block":"none"}}},C=r?n:!0,_=n||r?"enter":"exit";return a.jsx(ws,{initial:!1,custom:w,children:C&&a.jsx(to.div,{ref:t,...m,className:kt("chakra-collapse",d),style:{overflow:"hidden",display:"block",...u},custom:w,variants:I9,initial:r?"exit":!1,animate:_,exit:"exit"})})});Qp.displayName="Collapse";var E9={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:cs.enter(yi.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:cs.exit(yi.exit,n),transitionEnd:t==null?void 0:t.exi
.`.concat(jD,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(u,"px ").concat(r,`;
}
body {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(s,`px;
padding-right: `).concat(i,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(u,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(hf,` {
right: `).concat(u,"px ").concat(r,`;
}
.`).concat(mf,` {
margin-right: `).concat(u,"px ").concat(r,`;
}
.`).concat(hf," .").concat(hf,` {
right: 0 `).concat(r,`;
}
.`).concat(mf," .").concat(mf,` {
margin-right: 0 `).concat(r,`;
}
body {
`).concat(ID,": ").concat(u,`px;
}
`)},BD=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=f.useMemo(function(){return $D(o)},[o]);return f.createElement(zD,{styles:LD(s,!t,o,n?"":"!important")})},i0=!1;if(typeof window<"u")try{var Ed=Object.defineProperty({},"passive",{get:function(){return i0=!0,!0}});window.addEventListener("test",Ed,Ed),window.removeEventListener("test",Ed,Ed)}catch{i0=!1}var ll=i0?{passive:!1}:!1,FD=function(e){return e.tagName==="TEXTAREA"},$6=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!FD(e)&&n[t]==="visible")},HD=function(e){return $6(e,"overflowY")},WD=function(e){return $6(e,"overflowX")},Ux=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=z6(e,r);if(o){var s=L6(e,r),i=s[1],u=s[2];if(i>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},VD=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},UD=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},z6=function(e,t){return e==="v"?HD(t):WD(t)},L6=function(e,t){return e==="v"?VD(t):UD(t)},GD=function(e,t){return e==="h"&&t==="rtl"?-1:1},qD=function(e,t,n,r,o){var s=GD(e,window.getComputedStyle(t).direction),i=s*r,u=n.target,d=t.contains(u),p=!1,h=i>0,m=0,v=0;do{var b=L6(e,u),S=b[0],w=b[1],C=b[2],_=w-C-s*S;(S||_)&&z6(e,u)&&(m+=_,v+=S),u=u.parentNode}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(h&&(o&&m===0||!o&&i>m)||!h&&(o&&v===0||!o&&-i>v))&&(p=!0),p},Od=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gx=function(e){return[e.deltaX,e.deltaY]},qx=function(e){return e&&"current"in e?e.current:e},KD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YD=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},QD=0,cl=[];function XD(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(QD++)[0],s=f.useState(N6)[0],i=f.useRef(e);f.useEffect(function(){i.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=t0([e.lockRef.current],(e.shards||[]).map(qx),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=f.useCallback(function(w,C){if("touches"in w&&w.touches.length===2)return!i.current.allowPinchZoom;var _=Od(w),k=n.current,j="deltaX"in w?w.deltaX:k[0]-_[0],E="deltaY"in w?w.deltaY:k[1]-_[1],I,O=w.target,R=Math.abs(j)>Math.abs(E)?"h":"v";if("touches"in w&&R==="h"&&O.type==="range")return!1;var T=Ux(R,O);if(!T)return!0;if(T?I=R:(I=R==="v"?"h":"v",T=Ux(R,O)),!T)return!1;if(!r.current&&"changedTouches"in w&&(j||E)&&(r.current=I),!I)return!0;var A=r.current||I;return qD(A,C,w,A==="h"?j:E,!0)},[]),d=f.useCallback(function(w){var C=w;if(!(!cl.length||cl[cl.length-1]!==s)){var _="deltaY"in C?Gx(C):Od(C),k=t.current.filter(function(I){return I.name===C.type&&I.target===C.target&&KD(I.delta,_)})[0];if(k&&k.should){C.cancelable&&C.preventDefault();return}if(!k){var j=(i.current.shards||[]).map(qx).filter(Boolean).filter(function(I){return I.contains(C.target)}),E=j.length>0?u(C,j[0]):!i.current.noIsolation;E&&C.cancelable&&C.preventDefault()}}},[]),p=f.useCallback(function(w,C,_,k){var j={name:w,delta:C,target:_,should:k};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(E){return E!==j})},1)},[]),h=f.useCallback(function(w){n.current=Od(w),r.current=void 0},[]),m=f.useCallback(function(w){p(w.type,Gx(w),w.target,u(w,e.lockRef.current))},[]),v=f.useCallback(function(w){p(w.type,Od(w),w.target,u(w,e.lockRef.current))},[]);f.useEffect(function(){return cl.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",d,ll),document.addEventListener("touchmove",d,ll),document.addEventListener("touchstart",h,ll),function(){cl=cl.filter(function(w){return w!==s}),document.removeEventListener("wheel",d,ll),document.removeEventListener("touchmove",d,ll),document.removeEventListener("touchstart",h,ll)}},[]);var b=e.removeScrollBar,S=e.inert;return f.createElement(f.Fragment,null,S?f.createElement(s,{styles:YD(o)}):null,b?f.createElement(BD,{gapMode:e.gapMode}):null)}const JD=CR(A6,XD);var B6=f.forwardRef(function(e,t){return f.createElement(eh,Ns({},e,{ref:t,sideCar:JD}))});B6.classNames=eh.classNames;const ZD=B6;function eT(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:i,finalFocusRef:u,returnFocusOnClose:d,preserveScrollBarGap:p,lockFocusAcrossFrames:h,isOpen:m}=ji(),[v,b]=mE();f.useEffect(()=>{!v&&b&&setTimeout(b)},[v,b]);const S=D6(r,m);return a.jsx(y6,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:u,restoreFocus:d,contentRef:r,lockFocusAcrossFrames:h,children:a.jsx(ZD,{removeScrollBar:!p,allowPinchZoom:i,enabled:S===1&&s,forwardProps:!0,children:e.children})})}var su=et((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...i}=e,{getDialogProps:u,getDialogContainerProps:d}=ji(),p=u(i,t),h=d(o),m=kt("chakra-modal__content",n),v=rc(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},S={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{motionPreset:w}=ji();return a.jsx(eT,{children:a.jsx(He.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:S,children:a.jsx(M6,{preset:w,motionProps:s,className:m,...p,__css:b,children:r})})})});su.displayName="ModalContent";function Eu(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(ou,{...n,initialFocusRef:t})}var Ou=et((e,t)=>a.jsx(su,{ref:t,role:"alertdialog",...e})),ca=et((e,t)=>{const{className:
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fill:d,fillRule:"evenodd",stroke:p,strokeWidth:h,pointerEvents:"none"})]})})}r5.displayName="MiniMap";var oA=f.memo(r5),us;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(us||(us={}));function sA({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 aA({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const iA={[us.Dots]:"#91919a",[us.Lines]:"#eee",[us.Cross]:"#e2e2e2"},lA={[us.Dots]:1,[us.Lines]:1,[us.Cross]:6},cA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function o5({id:e,variant:t=us.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:u,className:d}){const p=f.useRef(null),{transform:h,patternId:m}=xf(cA,nv),v=i||iA[t],b=r||lA[t],S=t===us.Dots,w=t===us.Cross,C=Array.isArray(n)?n:[n,n],_=[C[0]*h[2]||1,C[1]*h[2]||1],k=b*h[2],j=w?[k,k]:_,E=S?[k/s,k/s]:[j[0]/s,j[1]/s];return a.jsxs("svg",{className:Up(["react-flow__background",d]),style:{...u,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]%_[0],y:h[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:S?a.jsx(aA,{color:v,radius:k/s}):a.jsx(sA,{dimensions:j,color:v,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`})]})}o5.displayName="Background";var uA=f.memo(o5),Gc;(function(e){e.Line="line",e.Handle="handle"})(Gc||(Gc={}));function dA({width:e,prevWidth:t,height:n,prevHeight:r,invertX:o,invertY:s}){const i=e-t,u=n-r,d=[i>0?1:i<0?-1:0,u>0?1:u<0?-1:0];return i&&o&&(d[0]=d[0]*-1),u&&s&&(d[1]=d[1]*-1),d}const s5={width:0,height:0,x:0,y:0},fA={...s5,pointerX:0,pointerY:0,aspectRatio:1};function pA({nodeId:e,position:t,variant:n=Gc.Handle,className:r,style:o={},children:s,color:i,minWidth:u=10,minHeight:d=10,maxWidth:p=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:m=!1,shouldResize:v,onResizeStart:b,onResize:S,onResizeEnd:w}){const C=ME(),_=typeof e=="string"?e:C,k=u4(),j=f.useRef(null),E=f.useRef(fA),I=f.useRef(s5),O=DE(),R=n===Gc.Line?"right":"bottom-right",T=t??R;f.useEffect(()=>{if(!j.current||!_)return;const Z=d4(j.current),B=T.includes("right")||T.includes("left"),H=T.includes("bottom")||T.includes("top"),G=T.includes("left"),Y=T.includes("top"),M=TE().on("start",U=>{const V=k.getState().nodeInternals.get(_),{xSnapped:W,ySnapped:te}=O(U);I.current={width:(V==null?void 0:V.width)??0,height:(V==null?void 0:V.height)??0,x:(V==null?void 0:V.position.x)??0,y:(V==null?void 0:V.position.y)??0},E.current={...I.current,pointerX:W,pointerY:te,aspectRatio:I.current.width/I.current.height},b==null||b(U,{...I.current})}).on("drag",U=>{const{nodeInternals:V,triggerNodeChanges:W}=k.getState(),{xSnapped:te,ySnapped:ve}=O(U),le=V.get(_);if(le){const oe=[],{pointerX:J,pointerY:se,width:ue,height:ye,x:ne,y:me,aspectRatio:fe}=E.current,{x:Ce,y:Me,width:pe,height:Ee}=I.current,st=Math.floor(B?te-J:0),$e=Math.floor(H?ve-se:0);let Ye=Lb(ue+(G?-st:st),u,p),Pt=Lb(ye+(Y?-$e:$e),d,h);if(m){const ze=Ye/Pt,jt=B&&H,Bt=B&&!H,Yt=H&&!B;Ye=ze<=fe&&jt||Yt?Pt*fe:Ye,Pt=ze>fe&&jt||Bt?Ye/fe:Pt,Ye>=p?(Ye=p,Pt=p/fe):Ye<=u&&(Ye=u,Pt=u/fe),Pt>=h?(Pt=h,Ye=h*fe):Pt<=d&&(Pt=d,Ye=d*fe)}const vt=Ye!==pe,Jn=Pt!==Ee;if(G||Y){const ze=G?ne-(Ye-ue):ne,jt=Y?me-(Pt-ye):me,Bt=ze!==Ce&&vt,Yt=jt!==Me&&Jn;if(Bt||Yt){const Pn={id:le.id,type:"position",position:{x:Bt?ze:Ce,y:Yt?jt:Me}};oe.push(Pn),I.current.x=Pn.position.x,I.current.y=Pn.position.y}}if(vt||Jn){const ze={id:_,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:Ye,height:Pt}};oe.push(ze),I.current.width=Ye,I.current.height=Pt}if(oe.length===0)return;const $t=dA({width:I.current.width,prevWidth:pe,height:I.current.height,prevHeight:Ee,invertX:G,invertY:Y}),Dt={...I.current,direction:$t};if((v==null?void 0:v(U,Dt))===!1)return;S==null||S(U,Dt),W(oe)}}).on("end",U=>{const V={id:_,type:"dimensions",resizing:!1};w==null||w(U,{...I.current}),k.getState().tr
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EA(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function OA(e){if(Array.isArray(e))return f0(e)}function Zx(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 e2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zx(Object(n),!0).forEach(function(r){l5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function l5(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function au(e,t){return DA(e)||MA(e,t)||c5(e,t)||RA()}function RA(){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 c5(e,t){if(e){if(typeof e=="string")return f0(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 f0(e,t)}}function f0(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 MA(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,u;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(d){s=!0,u=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function DA(e){if(Array.isArray(e))return e}var TA="file-invalid-type",AA="file-too-large",NA="file-too-small",$A="too-many-files",zA=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:TA,message:"File type must be ".concat(n)}},t2=function(t){return{code:AA,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},n2=function(t){return{code:NA,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},LA={code:$A,message:"Too many files"};function u5(e,t){var n=e.type==="application/x-moz-file"||jA(e,t);return[n,n?null:zA(t)]}function d5(e,t,n){if(hi(e.size))if(hi(t)&&hi(n)){if(e.size>n)return[!1,t2(n)];if(e.size<t)return[!1,n2(t)]}else{if(hi(t)&&e.size<t)return[!1,n2(t)];if(hi(n)&&e.size>n)return[!1,t2(n)]}return[!0,null]}function hi(e){return e!=null}function BA(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(d){var p=u5(d,n),h=au(p,1),m=h[0],v=d5(d,r,o),b=au(v,1),S=b[0],w=u?u(d):null;return m&&S&&!w})}function Lf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Rd(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 r2(e){e.preventDefault()}function FA(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function HA(e){return e.indexOf("Edge/")!==-1}function WA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return FA(e)||HA(e)}function Ds(){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(u){return!Lf(r)&&u&&u.apply(void 0,[r].concat(s)),Lf(r)})}}function VA(){return"showOpenFilePicker"in window}function UA(e){if(hi(e)){var t=Object.entries(e).filter(function(n){var r=au(n,2),o=r[0],s=r[1],i=!0;return f5(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(p5))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=au(r,2),s=o[0],i=o[1];return e2(e2({},n),{},l5({},s,i))},{});return[{description:"Files",accept:t}]}return e}function GA(e){if(hi(e))return Object.entries(e).reduce(function(t,n){var r=au(n,2),o=r[0],s=r[1];return[].concat(Jx(t),[o],Jx(s))},[]).filter(function(t){return f5(t)||p5(t)}).join(",")}function qA(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function KA(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function f5(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function p5(e){return/^.*\.[\w]+$/.test(e)}var YA=["children"],QA=["open"],XA=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDr
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nN(e){if(Array.isArray(e))return p0(e)}function ig(e,t){return sN(e)||oN(e,t)||h5(e,t)||rN()}function rN(){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 h5(e,t){if(e){if(typeof e=="string")return p0(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 p0(e,t)}}function p0(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 oN(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,u;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(d){s=!0,u=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function sN(e){if(Array.isArray(e))return e}function o2(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 tr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o2(Object(n),!0).forEach(function(r){h0(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function h0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bf(e,t){if(e==null)return{};var n=aN(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 aN(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 Bv=f.forwardRef(function(e,t){var n=e.children,r=Bf(e,YA),o=Fv(r),s=o.open,i=Bf(o,QA);return f.useImperativeHandle(t,function(){return{open:s}},[s]),N.createElement(f.Fragment,null,n(tr(tr({},i),{},{open:s})))});Bv.displayName="Dropzone";var m5={disabled:!1,getFilesFromEvent:yA,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};Bv.defaultProps=m5;Bv.propTypes={children:Tn.func,accept:Tn.objectOf(Tn.arrayOf(Tn.string)),multiple:Tn.bool,preventDropOnDocument:Tn.bool,noClick:Tn.bool,noKeyboard:Tn.bool,noDrag:Tn.bool,noDragEventsBubbling:Tn.bool,minSize:Tn.number,maxSize:Tn.number,maxFiles:Tn.number,disabled:Tn.bool,getFilesFromEvent:Tn.func,onFileDialogCancel:Tn.func,onFileDialogOpen:Tn.func,useFsAccessApi:Tn.bool,autoFocus:Tn.bool,onDragEnter:Tn.func,onDragLeave:Tn.func,onDragOver:Tn.func,onDrop:Tn.func,onDropAccepted:Tn.func,onDropRejected:Tn.func,onError:Tn.func,validator:Tn.func};var m0={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Fv(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=tr(tr({},m5),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,u=t.multiple,d=t.maxFiles,p=t.onDragEnter,h=t.onDragLeave,m=t.onDragOver,v=t.onDrop,b=t.onDropAccepted,S=t.onDropRejected,w=t.onFileDialogCancel,C=t.onFileDialogOpen,_=t.useFsAccessApi,k=t.autoFocus,j=t.preventDropOnDocument,E=t.noClick,I=t.noKeyboard,O=t.noDrag,R=t.noDragEventsBubbling,T=t.onError,A=t.validator,z=f.useMemo(function(){return GA(n)},[n]),$=f.useMemo(function(){return UA(n)},[n]),Z=f.useMemo(function(){return typeof C=="function"?C:s2},[C]),B=f.useMemo(function(){return typeof w=="function"?w:s2},[w]),H=f.useRef(null),G=f.useRef(null),Y=f.useReducer(iN,m0),M=ig(Y,2),U=M[0],V=M[1],W=U.isFocused,te=U.isFileDialogActive,ve=f.useRef(typeof window<"u"&&window.isSecureContext&&_&&VA()),le=function(){!ve.current&&te&&setTimeout(function(){if(G.current){var ze=G.current.files;ze.length||(V({type:"closeDialog"}),B())}},300)};f.useEffect(functi
`),status:"error"})},[i,s]),m=f.useCallback(async E=>{n(f4({file:E,image_category:"user",is_intermediate:!1,postUploadAction:{type:"TOAST_UPLOADED"}}))},[n]),v=f.useCallback((E,I)=>{if(I.length>1){s({title:i("toast.uploadFailed"),description:i("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}I.forEach(O=>{h(O)}),E.forEach(O=>{m(O)})},[i,s,m,h]),{getRootProps:b,getInputProps:S,isDragAccept:w,isDragReject:C,isDragActive:_,inputRef:k,open:j}=Fv({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>d(!0),disabled:r,multiple:!1});return f.useEffect(()=>{const E=async I=>{var O,R;k.current&&(O=I.clipboardData)!=null&&O.files&&(k.current.files=I.clipboardData.files,(R=k.current)==null||R.dispatchEvent(new Event("change",{bubbles:!0})))};return p(j),document.addEventListener("paste",E),()=>{document.removeEventListener("paste",E),p(()=>{})}},[k,j,p]),a.jsxs(Ne,{...b({style:{}}),onKeyDown:E=>{E.key},children:[a.jsx("input",{...S()}),t,_&&u&&a.jsx(wN,{isDragAccept:w,isDragReject:C,setIsHandlingUpload:d})]})},_N=f.memo(CN),kN=WO(e=>{e(p4(!0))},300),uo=()=>(e,t)=>{ur(t())==="unifiedCanvas"&&kN(e)};var PN=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),yr=globalThis&&globalThis.__assign||function(){return yr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},yr.apply(this,arguments)},i2={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},l2={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Md={width:"20px",height:"20px",position:"absolute"},jN={top:yr(yr({},i2),{top:"-5px"}),right:yr(yr({},l2),{left:void 0,right:"-5px"}),bottom:yr(yr({},i2),{top:void 0,bottom:"-5px"}),left:yr(yr({},l2),{left:"-5px"}),topRight:yr(yr({},Md),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:yr(yr({},Md),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:yr(yr({},Md),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:yr(yr({},Md),{left:"-10px",top:"-10px",cursor:"nw-resize"})},IN=function(e){PN(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.onMouseDown=function(r){n.props.onResizeStart(r,n.props.direction)},n.onTouchStart=function(r){n.props.onResizeStart(r,n.props.direction)},n}return t.prototype.render=function(){return f.createElement("div",{className:this.props.className||"",style:yr(yr({position:"absolute",userSelect:"none"},jN[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(f.PureComponent),EN=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ts=globalThis&&globalThis.__assign||function(){return Ts=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},Ts.apply(this,arguments)},ON={width:"auto",height:"auto"},Dd=function(e,t,n){return Math.max(Math.min(e,n),t)},c2=function(e,t){return Math.round(e/t)*t},dl=function(e,t){return new RegExp(e,"i").test(t)},Td=function(e){return!!(e.touches&&e.touches.length)},RN=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},u2=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(s,i,u){return Math.abs(i-e)<Math.abs(t[s]-e)?u:s},0),o=Math.abs(t[r]-e);return n===
* OverlayScrollbars
* Version: 2.2.0
*
* Copyright (c) Rene Haas | KingSora.
* https://github.com/KingSora
*
* Released under the MIT license.
*/function vn(e,t){if(ph(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&vn(Object.keys(e),n=>t(e[n],n,e));return e}function Gr(e,t){const n=Za(t);if(bs(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?g2(e,s,t):t.reduce((i,u)=>(i[u]=g2(e,s,u),i),o)}return o}e&&vn(Co(t),o=>U$(e,o,t[o]))}const as=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,i;const u=(h,m)=>{const v=s,b=h,S=m||(r?!r(v,b):v!==b);return(S||o)&&(s=b,i=v),[s,S,i]};return[t?h=>u(t(s,i),h):u,h=>[s,!!h,i]]},Au=()=>typeof window<"u",$5=Au()&&Node.ELEMENT_NODE,{toString:O$,hasOwnProperty:dg}=Object.prototype,ya=e=>e===void 0,fh=e=>e===null,R$=e=>ya(e)||fh(e)?`${e}`:O$.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Ga=e=>typeof e=="number",Za=e=>typeof e=="string",Yv=e=>typeof e=="boolean",ys=e=>typeof e=="function",bs=e=>Array.isArray(e),iu=e=>typeof e=="object"&&!bs(e)&&!fh(e),ph=e=>{const t=!!e&&e.length,n=Ga(t)&&t>-1&&t%1==0;return bs(e)||!ys(e)&&n?t>0&&iu(e)?t-1 in e:!0:!1},v0=e=>{if(!e||!iu(e)||R$(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=dg.call(e,n),i=o&&dg.call(o,"isPrototypeOf");if(r&&!s&&!i)return!1;for(t in e);return ya(t)||dg.call(e,t)},Ff=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===$5:!1},hh=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===$5:!1},Qv=(e,t,n)=>e.indexOf(t,n),En=(e,t,n)=>(!n&&!Za(t)&&ph(t)?Array.prototype.push.apply(e,t):e.push(t),e),Ii=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{En(n,r)}):vn(e,r=>{En(n,r)}),n)},Xv=e=>!!e&&e.length===0,Vs=(e,t,n)=>{vn(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},mh=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Co=e=>e?Object.keys(e):[],nr=(e,t,n,r,o,s,i)=>{const u=[t,n,r,o,s,i];return(typeof e!="object"||fh(e))&&!ys(e)&&(e={}),vn(u,d=>{vn(Co(d),p=>{const h=d[p];if(e===h)return!0;const m=bs(h);if(h&&(v0(h)||m)){const v=e[p];let b=v;m&&!bs(v)?b=[]:!m&&!v0(v)&&(b={}),e[p]=nr(b,h)}else e[p]=h})}),e},Jv=e=>{for(const t in e)return!1;return!0},z5=(e,t,n,r)=>{if(ya(r))return n?n[e]:t;n&&(Za(r)||Ga(r))&&(n[e]=r)},Ur=(e,t,n)=>{if(ya(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},io=(e,t)=>{e&&e.removeAttribute(t)},bi=(e,t,n,r)=>{if(n){const o=Ur(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const i=Ii(s).join(" ").trim();Ur(e,t,i)}},M$=(e,t,n)=>{const r=Ur(e,t)||"";return new Set(r.split(" ")).has(n)},ds=(e,t)=>z5("scrollLeft",0,e,t),ra=(e,t)=>z5("scrollTop",0,e,t),y0=Au()&&Element.prototype,L5=(e,t)=>{const n=[],r=t?hh(t)?t:null:document;return r?En(n,r.querySelectorAll(e)):n},D$=(e,t)=>{const n=t?hh(t)?t:null:document;return n?n.querySelector(e):null},Hf=(e,t)=>hh(e)?(y0.matches||y0.msMatchesSelector).call(e,t):!1,Zv=e=>e?Ii(e.childNodes):[],pa=e=>e?e.parentElement:null,bl=(e,t)=>{if(hh(e)){const n=y0.closest;if(n)return n.call(e,t);do{if(Hf(e,t))return e;e=pa(e)}while(e)}return null},T$=(e,t,n)=>{const r=e&&bl(e,t),o=e&&D$(n,r),s=bl(o,t)===r;return r&&o?r===e||o===e||s&&bl(bl(e,n),t)!==r:!1},e1=(e,t,n)=>{if(n&&e){let r=t,o;ph(n)?(o=document.createDocumentFragment(),vn(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)}},Wo=(e,t)=>{e1(e,null,t)},A$=(e,t)=>{e1(pa(e),e,t)},p2=(e,t)=>{e1(pa(e),e&&e.nextSibling,t)},Fs=e=>{if(ph(e))vn(Ii(e),t=>Fs(t));else if(e){const t=pa(e);t&&t.removeChild(e)}},xi=e=>{const t=document.createElement("div");return e&&Ur(t,"class",e),t},B5=e=>{const t=xi();return t.innerHTML=e.trim(),vn(Zv(t),n=>Fs(n))},b0=e=>e.charAt(0).toUpperCase()+e.slice(1),N$=()=>xi().style,$$=["-webkit-","-moz-","-o-","-ms-"],z$=["WebKit","Moz","O","MS","webkit","moz","o","ms"],fg={},pg={},L$=e=>{let t=pg[e];if(mh(pg,e))return t;const n=b0(e),r=N$();return vn($$,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,b0(s)+n].find(u=>r[u]!==void 0))}),pg[e]=t||""},Nu=e=>{if(Au()){let t=fg[e]||window[e];return mh(fg,e)||(vn(z$,n=>(t=t||window[n+b0(e)],!t)),fg[e]=t),t}},B$=Nu("MutationObserver"),h2=Nu("IntersectionObserver"),xl=Nu("ResizeObserver"),F5=Nu("cancelAnimationFrame"),H
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}}({queryThunk:Be,mutationThunk:mt,api:q,serializeQueryArgs:Ue,context:ie}),_r=wn.buildInitiateQuery,Wn=wn.buildInitiateMutation;return Cr(q.util,{getRunningOperationPromises:wn.getRunningOperationPromises,getRunningOperationPromise:wn.removalWarning,getRunningMutationThunk:wn.getRunningMutationThunk,getRunningMutationsThunk:wn.getRunningMutationsThunk,getRunningQueryThunk:wn.getRunningQueryThunk,getRunningQueriesThunk:wn.getRunningQueriesThunk}),{name:Gs,injectEndpoint:function(gt,bn){var kn,Vn=q;(kn=Vn.endpoints)[gt]!=null||(kn[gt]={}),ne(bn)?Cr(Vn.endpoints[gt],{name:gt,select:Wt(gt,bn),initiate:_r(gt,bn)},Lt(Be,gt)):bn.type===se.mutation&&Cr(Vn.endpoints[gt],{name:gt,select:Qt(),initiate:Wn(gt)},Lt(mt,gt))}}}}},es=nt(wa())})(m_);h_.exports=m_;var Vo=h_.exports;const g_=f.memo(({board:e,isSelected:t})=>{const n=ee(),{currentData:r}=gs(e.cover_image_name??Vo.skipToken),{colorMode:o}=ko(),{board_name:s,board_id:i}=e,{onClickDeleteBoardImages:u}=f.useContext(m4),d=f.useCallback(()=>{n(ov(i))},[i,n]),[p,{isLoading:h}]=LE(),[m,{isLoading:v}]=BE(),b=k=>{p({board_id:i,changes:{board_name:k}})},S=f.useCallback(()=>{m(i)},[i,m]),w=f.useCallback(()=>{},[]),C=f.useCallback(()=>{u(e)},[e,u]),_=f.useMemo(()=>({id:i,actionType:"MOVE_BOARD",context:{boardId:i}}),[i]);return a.jsx(Ne,{sx:{touchAction:"none",height:"full"},children:a.jsx(p_,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>a.jsxs(nc,{sx:{visibility:"visible !important"},children:[e.image_count>0&&a.jsxs(a.Fragment,{children:[a.jsx(Ir,{isDisabled:!e.image_count,icon:a.jsx(R5,{}),onClickCapture:w,children:"Add Board to Batch"}),a.jsx(Ir,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(po,{}),onClickCapture:C,children:"Delete Board and Images"})]}),a.jsx(Ir,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(po,{}),onClickCapture:S,children:"Delete Board"})]}),children:k=>a.jsxs(F,{userSelect:"none",ref:k,sx:{flexDir:"column",justifyContent:"space-between",alignItems:"center",cursor:"pointer",w:"full",h:"full"},children:[a.jsxs(F,{onClick:d,sx:{position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",w:"full",aspectRatio:"1/1",overflow:"hidden",shadow:t?"selected.light":void 0,_dark:{shadow:t?"selected.dark":void 0},flexShrink:0},children:[e.cover_image_name&&(r==null?void 0:r.image_url)&&a.jsx(yu,{src:r==null?void 0:r.image_url,draggable:!1}),!(e.cover_image_name&&(r!=null&&r.image_url))&&a.jsx(Li,{boxSize:8,icon:qc,sx:{border:"2px solid var(--invokeai-colors-base-200)",_dark:{border:"2px solid var(--invokeai-colors-base-800)"}}}),a.jsx(F,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(Ka,{variant:"solid",children:e.image_count})}),a.jsx(d1,{data:_})]}),a.jsx(F,{sx:{width:"full",height:"full",justifyContent:"center",alignItems:"center"},children:a.jsxs(T3,{defaultValue:s,submitOnBlur:!1,onSubmit:j=>{b(j)},children:[a.jsx(R3,{sx:{color:t?_e("base.900","base.50")(o):_e("base.700","base.200")(o),fontWeight:t?600:void 0,fontSize:"xs",textAlign:"center",p:0},noOfLines:1}),a.jsx(O3,{sx:{color:_e("base.900","base.50")(o),fontSize:"xs",borderColor:_e("base.500","base.500")(o),p:0,outline:0}})]})})]},i)})})});g_.displayName="HoverableBoard";const br=e=>{const t=L(i=>i.config.disabledTabs),n=L(i=>i.config.disabledFeatures),r=L(i=>i.config.disabledSDFeatures),o=f.useMemo(()=>n.includes(e)||r.includes(e)||t.includes(e),[n,r,t,e]),s=f.useMemo(()=>!(n.includes(e)||r.includes(e)||t.includes(e)),[n,r,t,e]);return{isFeatureDisabled:o,isFeatureEnabled:s}},sL=be([Rt],({boards:e,gallery:t})=>{const{searchText:n}=e,{selectedBoardId:r}=t;return{selectedBoardId:r,searchText:n}},it),aL=e=>{const{isOpen:t}=e,n=ee(),{selectedBoardId:r,searchText:o}=L(sL),{data:s}=av(),i=br("batches").isFeatureEnabled,u=o?s==null?void 0:s.filter(v=>v.board_name.toLowerCase().includes(o.toLowerCase())):s,[d,p]=f.useState(!1),h=v=>{p(v.length>0),n(Bb(v))},m=()=>{p(!1),n(Bb(""))};return a.jsx(Qp,{in:t,animateOpacity:!0,children:a.jsxs(F,{layerStyl
* @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 Jee=function(t){var n={},r=f,o=ff,s=Object.assign;function i(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g<arguments.length;g++)c+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,d=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"),S=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),I=Symbol.iterator;function O(l){return l===null||typeof l!="object"?null:(l=I&&l[I]||l["@@iterator"],typeof l=="function"?l:null)}function R(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 C:return"Suspense";case _:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case S:return(l.displayName||"Context")+".Consumer";case b:return(l._context.displayName||"Context")+".Provider";case w:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case k:return c=l.displayName||null,c!==null?c:R(l.type)||"Memo";case j:c=l._payload,l=l._init;try{return R(l(c))}catch{}}return null}function T(l){var c=l.type;switch(l.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=c.render,l=l.displayName||l.name||"",c.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return R(c);case 8:return c===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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function A(l){var c=l,g=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,c.flags&4098&&(g=c.return),l=c.return;while(l)}return c.tag===3?g:null}function z(l){if(A(l)!==l)throw Error(i(188))}function $(l){var c=l.alternate;if(!c){if(c=A(l),c===null)throw Error(i(188));return c!==l?null:l}for(var g=l,y=c;;){var x=g.return;if(x===null)break;var P=x.alternate;if(P===null){if(y=x.return,y!==null){g=y;continue}break}if(x.child===P.child){for(P=x.child;P;){if(P===g)return z(x),l;if(P===y)return z(x),c;P=P.sibling}throw Error(i(188))}if(g.return!==y.return)g=x,y=P;else{for(var D=!1,K=x.child;K;){if(K===g){D=!0,g=x,y=P;break}if(K===y){D=!0,y=x,g=P;break}K=K.sibling}if(!D){for(K=P.child;K;){if(K===g){D=!0,g=P,y=x;break}if(K===y){D=!0,y=P,g=x;break}K=K.sibling}if(!D)throw Error(i(189))}}if(g.alternate!==y)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?l:c}function Z(l){return l=$(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 c=B(l);if(c!==null)return c;l=l.sibling}return null}function H(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){if(l.tag!==4){var c=H(l);if(c!==null)return c}l=l.sibling}return null}var G=Array.isArray,Y=t.getPublicInstance,M=t.getRootHostContext,U=t.getChildHostContext,V=t.prepareForCommit,W=t.resetAfterCommit,te=t.createInstance,ve=t.appendInitialChild,le=t.finalizeInitialChildren,oe=t.prepareUpdate,J=t.shouldSetTextContent,se=t.createTextInstance,ue=t.scheduleTimeout,ye=t.cancelTimeout,ne=t.noTimeout,me=t.isPrimaryRenderer,fe=t.supportsMutation,Ce=t.supportsPersistence,Me=t.supportsHydration,pe=t.
`+yt+l}var zt=!1;function Vt(l,c){if(!l||zt)return"";zt=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(Re){var y=Re}Reflect.construct(l,[],c)}else{try{c.call()}catch(Re){y=Re}l.call(c.prototype)}else{try{throw Error()}catch(Re){y=Re}l()}}catch(Re){if(Re&&y&&typeof Re.stack=="string"){for(var x=Re.stack.split(`
`),P=y.stack.split(`
`),D=x.length-1,K=P.length-1;1<=D&&0<=K&&x[D]!==P[K];)K--;for(;1<=D&&0<=K;D--,K--)if(x[D]!==P[K]){if(D!==1||K!==1)do if(D--,K--,0>K||x[D]!==P[K]){var ae=`
`+x[D].replace(" at new "," at ");return l.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",l.displayName)),ae}while(1<=D&&0<=K);break}}}finally{zt=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?_t(l):""}var Lt=Object.prototype.hasOwnProperty,ke=[],dt=-1;function It(l){return{current:l}}function Et(l){0>dt||(l.current=ke[dt],ke[dt]=null,dt--)}function Nt(l,c){dt++,ke[dt]=l.current,l.current=c}var cn={},Wt=It(cn),Qt=It(!1),wn=cn;function _r(l,c){var g=l.type.contextTypes;if(!g)return cn;var y=l.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var x={},P;for(P in g)x[P]=c[P];return y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=x),x}function Wn(l){return l=l.childContextTypes,l!=null}function gt(){Et(Qt),Et(Wt)}function bn(l,c,g){if(Wt.current!==cn)throw Error(i(168));Nt(Wt,c),Nt(Qt,g)}function kn(l,c,g){var y=l.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return g;y=y.getChildContext();for(var x in y)if(!(x in c))throw Error(i(108,T(l)||"Unknown",x));return s({},g,y)}function Vn(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||cn,wn=Wt.current,Nt(Wt,l),Nt(Qt,Qt.current),!0}function sr(l,c,g){var y=l.stateNode;if(!y)throw Error(i(169));g?(l=kn(l,c,wn),y.__reactInternalMemoizedMergedChildContext=l,Et(Qt),Et(Wt),Nt(Wt,l)):Et(Qt),Nt(Qt,g)}var On=Math.clz32?Math.clz32:hn,Rn=Math.log,tn=Math.LN2;function hn(l){return l>>>=0,l===0?32:31-(Rn(l)/tn|0)|0}var xn=64,un=4194304;function dn(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 Fe(l,c){var g=l.pendingLanes;if(g===0)return 0;var y=0,x=l.suspendedLanes,P=l.pingedLanes,D=g&268435455;if(D!==0){var K=D&~x;K!==0?y=dn(K):(P&=D,P!==0&&(y=dn(P)))}else D=g&~x,D!==0?y=dn(D):P!==0&&(y=dn(P));if(y===0)return 0;if(c!==0&&c!==y&&!(c&x)&&(x=y&-y,P=c&-c,x>=P||x===16&&(P&4194240)!==0))return c;if(y&4&&(y|=g&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=y;0<c;)g=31-On(c),x=1<<g,y|=l[g],c&=~x;return y}function bt(l,c){switch(l){case 1:case 2:case 4:return c+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 c+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 pt(l,c){for(var g=l.suspendedLanes,y=l.pingedLanes,x=l.expirationTimes,P=l.pendingLanes;0<P;){var D=31-On(P),K=1<<D,ae=x[D];ae===-1?(!(K&g)||K&y)&&(x[D]=bt(K,c)):ae<=c&&(l.expiredLanes|=K),P&=~K}}function Xe(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function ft(){var l=xn;return xn<<=1,!(xn&4194240)&&(xn=64),l}function Ot(l){for(var c=[],g=0;31>g;g++)c.push(l);return c}function lt(l,c,g){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-On(c),l[c]=g}function qe(l,c){var g=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var y=l.eventTimes;for(l=l.expirationTimes;0<g;){var x=31-On(g),P=1<<x;c[x]=0,y[x]=-1,l[x]=-1,g&=~P}}function Pe(l,c){var g=l.entangledLanes|=c;for(l=l.entanglements;g;){var y=31-On(g),x=1<<y;x&c|l[y]&c&&(l[y]|=c),g&=~x}}var Se=0;function Ie(l){return l&=-l,1<l?4<l?l&268435455?16:536870912:4:1}var De=o.unstable_scheduleCallback,Ge=o.unstable_cancelCallback,St=o.unsta
Error generating stack: `+P.message+`
`+P.stack}return{value:l,source:c,stack:x,digest:null}}function um(l,c,g){return{value:l,source:null,stack:g??null,digest:c??null}}function dm(l,c){try{console.error(c.value)}catch(g){setTimeout(function(){throw g})}}var II=typeof WeakMap=="function"?WeakMap:Map;function Uy(l,c,g){g=Ys(-1,g),g.tag=3,g.payload={element:null};var y=c.value;return g.callback=function(){hd||(hd=!0,Rm=y),dm(l,c)},g}function Gy(l,c,g){g=Ys(-1,g),g.tag=3;var y=l.type.getDerivedStateFromError;if(typeof y=="function"){var x=c.value;g.payload=function(){return y(x)},g.callback=function(){dm(l,c)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(g.callback=function(){dm(l,c),typeof y!="function"&&(ka===null?ka=new Set([this]):ka.add(this));var D=c.stack;this.componentDidCatch(c.value,{componentStack:D!==null?D:""})}),g}function qy(l,c,g){var y=l.pingCache;if(y===null){y=l.pingCache=new II;var x=new Set;y.set(c,x)}else x=y.get(c),x===void 0&&(x=new Set,y.set(c,x));x.has(g)||(x.add(g),l=HI.bind(null,l,c,g),c.then(l,l))}function Ky(l){do{var c;if((c=l.tag===13)&&(c=l.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return l;l=l.return}while(l!==null);return null}function Yy(l,c,g,y,x){return l.mode&1?(l.flags|=65536,l.lanes=x,l):(l===c?l.flags|=65536:(l.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(c=Ys(-1,1),c.tag=2,_a(g,c,1))),g.lanes|=1),l)}var EI=u.ReactCurrentOwner,ro=!1;function Zr(l,c,g,y){c.child=l===null?Sy(c,null,g,y):Qi(c,l.child,g,y)}function Qy(l,c,g,y,x){g=g.render;var P=c.ref;return Yi(c,x),y=om(l,c,g,y,P,x),g=sm(),l!==null&&!ro?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~x,Qs(l,c,x)):(Un&&g&&Lh(c),c.flags|=1,Zr(l,c,y,x),c.child)}function Xy(l,c,g,y,x){if(l===null){var P=g.type;return typeof P=="function"&&!$m(P)&&P.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(c.tag=15,c.type=P,Jy(l,c,P,y,x)):(l=xd(g.type,null,y,c,c.mode,x),l.ref=c.ref,l.return=c,c.child=l)}if(P=l.child,!(l.lanes&x)){var D=P.memoizedProps;if(g=g.compare,g=g!==null?g:Hu,g(D,y)&&l.ref===c.ref)return Qs(l,c,x)}return c.flags|=1,l=Ea(P,y),l.ref=c.ref,l.return=c,c.child=l}function Jy(l,c,g,y,x){if(l!==null){var P=l.memoizedProps;if(Hu(P,y)&&l.ref===c.ref)if(ro=!1,c.pendingProps=y=P,(l.lanes&x)!==0)l.flags&131072&&(ro=!0);else return c.lanes=l.lanes,Qs(l,c,x)}return fm(l,c,g,y,x)}function Zy(l,c,g){var y=c.pendingProps,x=y.children,P=l!==null?l.memoizedState:null;if(y.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(tl,xo),xo|=g;else{if(!(g&1073741824))return l=P!==null?P.baseLanes|g:g,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null,transitions:null},c.updateQueue=null,Nt(tl,xo),xo|=l,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=P!==null?P.baseLanes:g,Nt(tl,xo),xo|=y}else P!==null?(y=P.baseLanes|g,c.memoizedState=null):y=g,Nt(tl,xo),xo|=y;return Zr(l,c,x,g),c.child}function eb(l,c){var g=c.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(c.flags|=512,c.flags|=2097152)}function fm(l,c,g,y,x){var P=Wn(g)?wn:Wt.current;return P=_r(c,P),Yi(c,x),g=om(l,c,g,y,P,x),y=sm(),l!==null&&!ro?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~x,Qs(l,c,x)):(Un&&y&&Lh(c),c.flags|=1,Zr(l,c,g,x),c.child)}function tb(l,c,g,y,x){if(Wn(g)){var P=!0;Vn(c)}else P=!1;if(Yi(c,x),c.stateNode===null)nd(l,c),yy(c,g,y),Xh(c,g,y,x),y=!0;else if(l===null){var D=c.stateNode,K=c.memoizedProps;D.props=K;var ae=D.context,Re=g.contextType;typeof Re=="object"&&Re!==null?Re=Do(Re):(Re=Wn(g)?wn:Wt.current,Re=_r(c,Re));var ct=g.getDerivedStateFromProps,Ft=typeof ct=="function"||typeof D.getSnapshotBeforeUpdate=="function";Ft||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(K!==y||ae!==Re)&&by(c,D,y,Re),Ca=!1;var Je=c.memoizedState;D.state=Je,Gu(c,y,D,x),ae=c.memoizedState,K!==y||Je!==ae||Qt.current||Ca?(typeof ct=="function"&&(Qh(c,g,ct,y),ae=c.memoizedState),(K=Ca||vy(c,g,K,y,Je,ae,Re))?(Ft||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMo
`+(y.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 Y(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:u.ReactCurrentDispatcher,findHostInstanceByFiber:KI,findFiberByHostInstance:l.findFiberByHostInstance||YI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)l=!0;else{try{Ln=c.inject(l),sn=c}catch{}l=!!c.checkDCE}}return l},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(l,c,g,y){if(!vt)throw Error(i(363));l=Pm(l,c);var x=Bt(l,g,y).disconnect;return{disconnect:function(){x()}}},n.registerMutableSourceForHydration=function(l,c){var g=c._getVersion;g=g(c._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[c,g]:l.mutableSourceEagerHydrationData.push(c,g)},n.runWithPriority=function(l,c){var g=Se;try{return Se=l,c()}finally{Se=g}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(l,c,g,y){var x=c.current,P=Vr(),D=ja(x);return g=Mb(g),c.context===null?c.context=g:c.pendingContext=g,c=Ys(P,D),c.payload={element:l},y=y===void 0?null:y,y!==null&&(c.callback=y),l=_a(x,c,D),l!==null&&(No(l,x,D,P),Uu(l,x,D)),D},n};tI.exports=Jee;var Zee=tI.exports;const ete=gu(Zee);var nI={exports:{}},Gi={};/**
* @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.
*/Gi.ConcurrentRoot=1;Gi.ContinuousEventPriority=4;Gi.DefaultEventPriority=16;Gi.DiscreteEventPriority=1;Gi.IdleEventPriority=536870912;Gi.LegacyRoot=0;nI.exports=Gi;var rI=nI.exports;const BC={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let FC=!1,HC=!1;const ry=".react-konva-event",tte=`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
`,nte=`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
`,rte={};function zh(e,t,n=rte){if(!FC&&"zIndex"in t&&(console.warn(nte),FC=!0),!HC&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(tte),HC=!0)}for(var s in n)if(!BC[s]){var i=s.slice(0,2)==="on",u=n[s]!==t[s];if(i&&u){var d=s.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),e.off(d,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(!BC[s]){var i=s.slice(0,2)==="on",S=n[s]!==t[s];if(i&&S){var d=s.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),t[s]&&(b[d]=t[s])}!i&&(t[s]!==n[s]||h&&t[s]!==e.getAttr(s))&&(v=!0,m[s]=t[s])}v&&(e.setAttrs(m),ti(e));for(var d in b)e.on(d+ry,b[d])}function ti(e){if(!H7.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const oI={},ote={};fu.Node.prototype._applyProps=zh;function ste(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),ti(e)}function ate(e,t,n){let r=fu[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=fu.Group);const o={},s={};for(var i in t){var u=i.slice(0,2)==="on";u?s[i]=t[i]:o[i]=t[i]}const d=new r(o);return zh(d,s),d}function ite(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function lte(e,t,n){return!1}function cte(e){return e}function ute(){return null}function dte(){return null}function fte(e,t,n,r){return ote}function pte(){}function hte(e){}function mte(e,t){return!1}function gte(){return oI}function vte(){return oI}const yte=setTimeout,bte=clearTimeout,xte=-1;function wte(e,t){return!1}const Ste=!1,Cte=!0,_te=!0;function kte(e,t){t.parent===e?t.moveToTop():e.add(t),ti(e)}function Pte(e,t){t.parent===e?t.moveToTop():e.add(t),ti(e)}function sI(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),ti(e)}function jte(e,t,n){sI(e,t,n)}function Ite(e,t){t.destroy(),t.off(ry),ti(e)}function Ete(e,t){t.destroy(),t.off(ry),ti(e)}function Ote(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function Rte(e,t,n){}function Mte(e,t,n,r,o){zh(e,o,r)}function Dte(e){e.hide(),ti(e)}function Tte(e){}function Ate(e,t){(t.visible==null||t.visible)&&e.show()}function Nte(e,t){}function $te(e){}function zte(){}const Lte=()=>rI.DefaultEventPriority,Bte=Object.freeze(Object.defineProperty({__proto__:null,appendChild:kte,appendChildToContainer:Pte,appendInitialChild:ste,cancelTimeout:bte,clearContainer:$te,commitMount:Rte,commitTextUpdate:Ote,commitUpdate:Mte,createInstance:ate,createTextInstance:ite,detachDeletedInstance:zte,finalizeInitialChildren:lte,getChildHostContext:vte,getCurrentEventPriority:Lte,getPublicInstance:cte,getRootHostContext:gte,hideInstance:Dte,hideTextInstance:Tte,idlePriority:ff.unstable_IdlePriority,insertBefore:sI,insertInContainerBefore:jte,isPrimaryRenderer:Ste,noTimeout:xte,now:ff.unstable_now,prepareForCommit:ute,preparePortalMount:dte,prepareUpdate:fte,removeChild:Ite,removeChildFromContainer:Ete,resetAfterCommit:pte,resetTextContent:hte,run:ff.unstable_runWithPriority,scheduleTimeout:yte,shouldDeprioritizeSubtree:mte,shouldSetTextContent:wte,supportsMutation:_te,unhideInstance:Ate,unhideTextInstance:Nte,warnsIfNotActing:Cte},Symbol.toStringTag,{value:"Module"}));var Fte=Object.defineProperty,Hte=Object.defineProperties,Wte=Object.getOwnPropertyDescriptors,WC=Object.getOwnPropertySymbols,Vte=Object.prototype.hasOwnProperty,Ute=Object.prototype.propertyIsEnumerable,VC=(e,t,n)=>t in e?Fte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UC=(e,t)=>{for(var n in t||(t={}))Vte.call(t,n)&&VC(e,n,t[n]);if(WC)for(var n of WC(t))Ute.cal
<!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),xne=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=L(bne),[i,u]=f.useState(null),[d,p]=f.useState(0),h=f.useRef(null),m=f.useCallback(()=>{p(d+1),setTimeout(m,500)},[d]);return f.useEffect(()=>{if(i)return;const v=new Image;v.onload=()=>{u(v)},v.src=KC(n)},[i,n]),f.useEffect(()=>{i&&(i.src=KC(n))},[i,n]),f.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(Hs,{ref:h,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:i,fillPatternOffsetY:sl(d)?d:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},wne=be([en],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Kt}}),Sne=e=>{const{...t}=e,{objects:n}=L(wne);return a.jsx(ma,{listening:!1,...t,children:n.filter(tO).map((r,o)=>a.jsx(Bp,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},o))})};var di=f,Cne=function(t,n,r){const o=di.useRef("loading"),s=di.useRef(),[i,u]=di.useState(0),d=di.useRef(),p=di.useRef(),h=di.useRef();return(d.current!==t||p.current!==n||h.current!==r)&&(o.current="loading",s.current=void 0,d.current=t,p.current=n,h.current=r),di.useLayoutEffect(function(){if(!t)return;var m=document.createElement("img");function v(){o.current="loaded",s.current=m,u(Math.random())}function b(){o.current="failed",s.current=void 0,u(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 _ne=gu(Cne),dI=e=>{const{width:t,height:n,x:r,y:o,imageName:s}=e.canvasImage,{currentData:i,isError:u}=gs(s??Vo.skipToken),[d]=_ne((i==null?void 0:i.image_url)??"",nO.get()?"use-credentials":"anonymous");return u?a.jsx(Hs,{x:r,y:o,width:t,height:n,fill:"red"}):a.jsx(cI,{x:r,y:o,image:d,listening:!1})},kne=be([en],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Kt}}),Pne=()=>{const{objects:e}=L(kne);return e?a.jsx(ma,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(rO(t))return a.jsx(dI,{canvasImage:t},n);if(oO(t)){const r=a.jsx(Bp,{points:t.points,stroke:t.color?Ci(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(ma,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(sO(t))return a.jsx(Hs,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Ci(t.color)},n);if(aO(t))return a.jsx(Hs,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},jne=be([en],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:{x:o,y:s},boundingBoxDimensions:{width:i,height:u}}=e,{selectedImageIndex:d,images:p}=t.stagingArea;return{currentStagingAreaImage:p.length>0&&d!==void 0?p[d]:void 0,isOnFirstImage:d===0,isOnLastImage:d===p.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:o,y:s,width:i,height:u}},{memoizeOptions:{resultEqualityCheck:Kt}}),Ine=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:i,width:u,height:d}=L(jne);return a.jsxs(ma,{...t,children:[r&&n&&a.jsx(dI,{canvasImage:n}),o&&a.jsxs(ma,{children:[a.jsx(Hs,{x:s,y:i,width:u,height:d,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(Hs,{x:s,y:i,width:u,height:d,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},Ene=be([en],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n,sessionId:r}},shouldShowSta