mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
189 lines
592 KiB
JavaScript
189 lines
592 KiB
JavaScript
|
import{r as x,f as he,j as l,u as AS,c as oe,a as Ae,b as Pe,w as os,d as fn,o as At,S as Qf,e as mo,g as Ye,h as Dr,k as Jo,i as yc,_ as Ql,l as zS,m as RS,R as ke,n as Av,p as NS,q as Xd,s as ei,t as k1,v as j1,x as FS,y as LS,z as te,A as E1,B as P1,C as bc,D as is,F as B,E as Z,T as Ce,G as BS,H as Hl,I as Zl,J as Qd,K as Zd,L as Jd,U as HS,M as I1,N as M1,O as WS,P as T1,Q as _1,V as VS,W as D1,X as O1,Y as Ho,Z as kn,$ as A1,a0 as as,a1 as US,a2 as $S,a3 as z1,a4 as on,a5 as GS,a6 as vl,a7 as Sc,a8 as qS,a9 as zv,aa as Lo,ab as YS,ac as KS,ad as Da,ae as gl,af as XS,ag as QS,ah as ZS,ai as JS,aj as eC,ak as R1,al as N1,am as ef,an as tf,ao as F1,ap as nf,aq as rf,ar as Rv,as as L1,at as B1,au as H1,av as Wl,aw as Vl,ax as tC,ay as of,az as W1,aA as nC,aB as dd,aC as Nv,aD as V1,aE as U1,aF as af,aG as Wo,aH as rC,aI as oC,aJ as Fv,aK as Lv,aL as iC,aM as aC,aN as sC,aO as $1,aP as G1,aQ as lC,aR as cC,aS as Bv,aT as uC,aU as Hv,aV as dC,aW as fC,aX as hC,aY as pC,aZ as mC,a_ as vC,a$ as gC,b0 as xC,b1 as Wv,b2 as Ul,b3 as yC,b4 as bC,b5 as qa,b6 as Jl,b7 as q1,b8 as ec,b9 as SC,ba as CC,bb as xr,bc as Y1,bd as Zf,be as ss,bf as wC,bg as kC,bh as jC,bi as Sr,bj as K1,bk as EC,bl as PC,bm as X1,bn as IC,bo as MC,bp as TC,bq as _C,br as DC,bs as OC,bt as AC,bu as zC,bv as RC,bw as Vv,bx as NC,by as FC,bz as LC,bA as BC,bB as HC,bC as WC,bD as fd,bE as Na,bF as xl,bG as Uv,bH as hd,bI as pd,bJ as yl,bK as $v,bL as sf,bM as VC,bN as UC,bO as $C,bP as GC,bQ as qC,bR as YC,bS as KC,bT as bl,bU as md,bV as Sl,bW as nr,bX as XC,bY as QC,bZ as Q1,b_ as tc,b$ as Jf,c0 as Z1,c1 as J1,c2 as e2,c3 as ZC,c4 as t2,c5 as n2,c6 as r2,c7 as o2,c8 as i2,c9 as Wi,ca as Vi,cb as a2,cc as s2,cd as l2,ce as c2,cf as u2,cg as JC,ch as e3,ci as Gv,cj as Cl,ck as t3,cl as qv,cm as Yv,cn as Kv,co as Xv,cp as vd,cq as d2,cr as n3,cs as ls,ct as Qv,cu as r3,cv as o3,cw as i3,cx as Vo,cy as f2,cz as Zv,cA as a3,cB as s3,cC as l3,cD as c3,cE as u3,cF as d3,cG as f3,cH as h3,cI as p3,cJ as m3,cK as v3,cL as g3}from"./index-6f7e626f.js";import{I as Jt,u as x3,c as y3,a as Et,b as Ut,A as oa,m as Wr,d as Ui,e as ti,P as eh,f as b3,C as S3,g as O,h as Y,n as h2}from"./scrollbar-a8415a30.js";function th(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 nc="NOT_FOUND";function C3(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:nc},put:function(r,o){t={key:r,value:o}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function w3(e,t){var n=[];function r(u){var f=n.findIndex(function(p){return t(u,p.key)});if(f>-1){var h=n[f];return f>0&&(n.splice(f,1),n.unshift(h)),h.value}return nc}function o(u,f){r(u)===nc&&(n.unshift({key:u,value:f}),n.length>e&&n.pop())}function s(){return n}function c(){n=[]}return{get:r,put:o,getEntries:s,clear:c}}var k3=function(t,n){return t===n};function j3(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function E3(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,o=r===void 0?k3:r,s=n.maxSize,c=s===void 0?1:s,u=n.resultEqualityCheck,f=j3(o),h=c===1?C3(f):w3(c,f);function p(){var g=h.get(arguments);if(g===nc){if(g=e.apply(null,arguments),u){var y=h.getEntries(),S=y.find(function(C){return u(C.value,g)});S&&(g=S.value)}h.put(arguments,g)}return g}return p.clearCache=function(){return h.clear()},p}function P3(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function I3(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];var h=0,p,g={memoizeOptions:void 0},y=u.pop();if(typeof y=="object"&&(g=y,y=u.pop()),typeof y
|
||
|
`})}function ow(e){os({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Ri(e){const{isOpen:t,isDisabled:n}=oh(),{reduceMotion:r}=ah(),o=Ae("chakra-accordion__icon",e.className),s=wc(),c={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return l.jsx(Jt,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:c,...e,children:l.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Ri.displayName="AccordionIcon";var Ni=he(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...c}=ew(t),f={...wc().container,overflowAnchor:"none"},h=x.useMemo(()=>c,[c]);return l.jsx(Y3,{value:h,children:l.jsx(oe.div,{ref:n,...s,className:Ae("chakra-accordion__item",o),__css:f,children:typeof r=="function"?r({isExpanded:!!c.isOpen,isDisabled:!!c.isDisabled}):r})})});Ni.displayName="AccordionItem";var Fi={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Uo={enter:{duration:.2,ease:Fi.easeOut},exit:{duration:.1,ease:Fi.easeIn}},Or={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},iw=e=>e!=null&&parseInt(e.toString(),10)>0,rg={exit:{height:{duration:.2,ease:Fi.ease},opacity:{duration:.3,ease:Fi.ease}},enter:{height:{duration:.3,ease:Fi.ease},opacity:{duration:.4,ease:Fi.ease}}},aw={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:iw(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:Or.exit(rg.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:Or.enter(rg.enter,o)}}},x2=x.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:c="auto",style:u,className:f,transition:h,transitionEnd:p,...g}=e,[y,S]=x.useState(!1);x.useEffect(()=>{const M=setTimeout(()=>{S(!0)});return()=>clearTimeout(M)},[]),os({condition:Boolean(s>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const C=parseFloat(s.toString())>0,w={startingHeight:s,endingHeight:c,animateOpacity:o,transition:y?h:{enter:{duration:0}},transitionEnd:{enter:p==null?void 0:p.enter,exit:r?p==null?void 0:p.exit:{...p==null?void 0:p.exit,display:C?"block":"none"}}},k=r?n:!0,j=n||r?"enter":"exit";return l.jsx(oa,{initial:!1,custom:w,children:k&&l.jsx(Wr.div,{ref:t,...g,className:Ae("chakra-collapse",f),style:{overflow:"hidden",display:"block",...u},custom:w,variants:aw,initial:r?"exit":!1,animate:j,exit:"exit"})})});x2.displayName="Collapse";var sw={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Or.enter(Uo.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:Or.exit(Uo.exit,n),transitionEnd:t==null?void 0:t.exit}}},y2={initial:"exit",animate:"enter",exit:"exit",variants:sw},lw=x.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:c,transitionEnd:u,delay:f,...h}=t,p=o||r?"enter":"exit",g=r?o&&r:!0,y={transition:c,transitionEnd:u,delay:f};return l.jsx(oa,{custom:y,children:g&&l.jsx(Wr.div,{ref:n,className:Ae("chakra-fade",s),custom:y,...y2,animate:p,...h})})});lw.displayName="Fade";var cw={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:Or.exit(Uo.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:Or.enter(Uo.enter,n),transitionEnd:e==null?void 0:e.enter}}},b2={initial:"exit",animate:
|
||
|
.`.concat(Fj,` {
|
||
|
overflow: hidden `).concat(r,`;
|
||
|
padding-right: `).concat(u,"px ").concat(r,`;
|
||
|
}
|
||
|
body {
|
||
|
overflow: hidden `).concat(r,`;
|
||
|
overscroll-behavior: contain;
|
||
|
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
||
|
padding-left: `.concat(o,`px;
|
||
|
padding-top: `).concat(s,`px;
|
||
|
padding-right: `).concat(c,`px;
|
||
|
margin-left:0;
|
||
|
margin-top:0;
|
||
|
margin-right: `).concat(u,"px ").concat(r,`;
|
||
|
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
|
}
|
||
|
|
||
|
.`).concat(ql,` {
|
||
|
right: `).concat(u,"px ").concat(r,`;
|
||
|
}
|
||
|
|
||
|
.`).concat(Yl,` {
|
||
|
margin-right: `).concat(u,"px ").concat(r,`;
|
||
|
}
|
||
|
|
||
|
.`).concat(ql," .").concat(ql,` {
|
||
|
right: 0 `).concat(r,`;
|
||
|
}
|
||
|
|
||
|
.`).concat(Yl," .").concat(Yl,` {
|
||
|
margin-right: 0 `).concat(r,`;
|
||
|
}
|
||
|
|
||
|
body {
|
||
|
`).concat(Lj,": ").concat(u,`px;
|
||
|
}
|
||
|
`)},Qj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=x.useMemo(function(){return Yj(o)},[o]);return x.createElement(Kj,{styles:Xj(s,!t,o,n?"":"!important")})},Pf=!1;if(typeof window<"u")try{var El=Object.defineProperty({},"passive",{get:function(){return Pf=!0,!0}});window.addEventListener("test",El,El),window.removeEventListener("test",El,El)}catch{Pf=!1}var Ii=Pf?{passive:!1}:!1,Zj=function(e){return e.tagName==="TEXTAREA"},Vx=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Zj(e)&&n[t]==="visible")},Jj=function(e){return Vx(e,"overflowY")},eE=function(e){return Vx(e,"overflowX")},Og=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Ux(e,n);if(r){var o=$x(e,n),s=o[1],c=o[2];if(s>c)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},tE=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},nE=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ux=function(e,t){return e==="v"?Jj(t):eE(t)},$x=function(e,t){return e==="v"?tE(t):nE(t)},rE=function(e,t){return e==="h"&&t==="rtl"?-1:1},oE=function(e,t,n,r,o){var s=rE(e,window.getComputedStyle(t).direction),c=s*r,u=n.target,f=t.contains(u),h=!1,p=c>0,g=0,y=0;do{var S=$x(e,u),C=S[0],w=S[1],k=S[2],j=w-k-s*C;(C||j)&&Ux(e,u)&&(g+=j,y+=C),u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&(o&&g===0||!o&&c>g)||!p&&(o&&y===0||!o&&-c>y))&&(h=!0),h},Pl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ag=function(e){return[e.deltaX,e.deltaY]},zg=function(e){return e&&"current"in e?e.current:e},iE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},aE=function(e){return`
|
||
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
|
`)},sE=0,Mi=[];function lE(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),o=x.useState(sE++)[0],s=x.useState(function(){return Wx()})[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=xf([e.lockRef.current],(e.shards||[]).map(zg),!0).filter(Boolean);return w.forEach(function(k){return k.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(w,k){if("touches"in w&&w.touches.length===2)return!c.current.allowPinchZoom;var j=Pl(w),M=n.current,P="deltaX"in w?w.deltaX:M[0]-j[0],I="deltaY"in w?w.deltaY:M[1]-j[1],T,D=w.target,_=Math.abs(P)>Math.abs(I)?"h":"v";if("touches"in w&&_==="h"&&D.type==="range")return!1;var z=Og(_,D);if(!z)return!0;if(z?T=_:(T=_==="v"?"h":"v",z=Og(_,D)),!z)return!1;if(!r.current&&"changedTouches"in w&&(P||I)&&(r.current=T),!T)return!0;var V=r.current||T;return oE(V,k,w,V==="h"?P:I,!0)},[]),f=x.useCallback(function(w){var k=w;if(!(!Mi.length||Mi[Mi.length-1]!==s)){var j="deltaY"in k?Ag(k):Pl(k),M=t.current.filter(function(T){return T.name===k.type&&T.target===k.target&&iE(T.delta,j)})[0];if(M&&M.should){k.cancelable&&k.preventDefault();return}if(!M){var P=(c.current.shards||[]).map(zg).filter(Boolean).filter(function(T){return T.contains(k.target)}),I=P.length>0?u(k,P[0]):!c.current.noIsolation;I&&k.cancelable&&k.preventDefault()}}},[]),h=x.useCallback(function(w,k,j,M){var P={name:w,delta:k,target:j,should:M};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(I){return I!==P})},1)},[]),p=x.useCallback(function(w){n.current=Pl(w),r.current=void 0},[]),g=x.useCallback(function(w){h(w.type,Ag(w),w.target,u(w,e.lockRef.current))},[]),y=x.useCallback(function(w){h(w.type,Pl(w),w.target,u(w,e.lockRef.current))},[]);x.useEffect(function(){return Mi.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Ii),document.addEventListener("touchmove",f,Ii),document.addEventListener("touchstart",p,Ii),function(){Mi=Mi.filter(function(w){return w!==s}),document.removeEventListener("wheel",f,Ii),document.removeEventListener("touchmove",f,Ii),document.removeEventListener("touchstart",p,Ii)}},[]);var S=e.removeScrollBar,C=e.inert;return x.createElement(x.Fragment,null,C?x.createElement(s,{styles:aE(o)}):null,S?x.createElement(Qj,{gapMode:"margin"}):null)}const cE=d5(Hx,lE);var Gx=x.forwardRef(function(e,t){return x.createElement(Ic,vr({},e,{ref:t,sideCar:cE}))});Gx.classNames=Ic.classNames;const uE=Gx;function dE(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:c,finalFocusRef:u,returnFocusOnClose:f,preserveScrollBarGap:h,lockFocusAcrossFrames:p,isOpen:g}=Qo(),[y,S]=b3();x.useEffect(()=>{!y&&S&&setTimeout(S)},[y,S]);const C=Lx(r,g);return l.jsx(hx,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:u,restoreFocus:f,contentRef:r,lockFocusAcrossFrames:p,children:l.jsx(uE,{removeScrollBar:!h,allowPinchZoom:c,enabled:C===1&&s,forwardProps:!0,children:e.children})})}var ho=he((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...c}=e,{getDialogProps:u,getDialogContainerProps:f}=Qo(),h=u(c,t),p=f(o),g=Ae("chakra-modal__content",n),y=la(),S={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...y.dialog},C={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...y.dialogContainer},{motionPreset:w}=Qo();return l.jsx(dE,{children:l.jsx(oe.div,{...p,className:"chakra-modal__content-container",tabIndex:-1,__css:C,children:l.jsx(Fx,{preset:w,motionProps:s,className:g,...h,__css:S,children:r})})})});ho.displayName="ModalContent";function qx(e){const{leastDestructiveRef:t,...n}=e;return l.jsx(fo,{...n,initialFocusRef:t})}var Yx=he((e,t)=>l.jsx(ho,{ref:t,role:"alertdialog",...e})),zr=he((e,t
|
||
|
position: relative;
|
||
|
width: -moz-fit-content;
|
||
|
width: fit-content;
|
||
|
height: -moz-fit-content;
|
||
|
height: fit-content;
|
||
|
overflow: hidden;
|
||
|
-webkit-touch-callout: none; /* iOS Safari */
|
||
|
-webkit-user-select: none; /* Safari */
|
||
|
-khtml-user-select: none; /* Konqueror HTML */
|
||
|
-moz-user-select: none; /* Firefox */
|
||
|
-ms-user-select: none; /* Internet Explorer/Edge */
|
||
|
user-select: none;
|
||
|
margin: 0;
|
||
|
padding: 0;
|
||
|
}
|
||
|
.transform-component-module_content__uCDPE {
|
||
|
display: flex;
|
||
|
flex-wrap: wrap;
|
||
|
width: -moz-fit-content;
|
||
|
width: fit-content;
|
||
|
height: -moz-fit-content;
|
||
|
height: fit-content;
|
||
|
margin: 0;
|
||
|
padding: 0;
|
||
|
transform-origin: 0% 0%;
|
||
|
}
|
||
|
.transform-component-module_content__uCDPE img {
|
||
|
pointer-events: none;
|
||
|
}
|
||
|
`,h0={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};ZP(JP);var eI=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,o=e.contentClass,s=o===void 0?"":o,c=e.wrapperStyle,u=e.contentStyle,f=e.wrapperProps,h=f===void 0?{}:f,p=e.contentProps,g=p===void 0?{}:p,y=x.useContext(Bc).init,S=x.useRef(null),C=x.useRef(null);return x.useEffect(function(){var w=S.current,k=C.current;w!==null&&k!==null&&y&&y(w,k)},[]),ke.createElement("div",lo({},h,{ref:S,className:"react-transform-wrapper ".concat(h0.wrapper," ").concat(r),style:c}),ke.createElement("div",lo({},g,{ref:C,className:"react-transform-component ".concat(h0.content," ").concat(s),style:u}),t))},a4=function(){var e=x.useContext(Bc),t=x.useState(dt(e||{})),n=t[0],r=t[1];if(!e)throw new Error("Transform context mus be placed inside TransformWrapper");return x.useEffect(function(){e.onChange(function(o){r(o)})},[e]),n};ke.forwardRef(function(e,t){var n=x.useRef(null),r=x.useContext(Bc);return x.useEffect(function(){return r.onChange(function(o){if(n.current){var s=0,c=0;n.current.style.transform=r.handleTransformStyles(s,c,1/o.state.scale)}})},[r]),ke.createElement("div",lo({},e,{ref:IP([n,t])}))});const tI=()=>{const[e,t]=x.useState(0),[n,r]=x.useState(1),[o,s]=x.useState(1);return{rotation:e,scaleX:n,scaleY:o,flipHorizontally:()=>{r(n*-1)},flipVertically:()=>{s(o*-1)},rotateCounterClockwise:()=>{t(e===-270?0:e-90)},rotateClockwise:()=>{t(e===270?0:e+90)},reset:()=>{t(0),r(1),s(1)}}},nI=({flipHorizontally:e,flipVertically:t,rotateCounterClockwise:n,rotateClockwise:r,reset:o})=>{const{zoomIn:s,zoomOut:c,resetTransform:u}=a4();return l.jsxs(en,{isAttached:!0,orientation:"vertical",children:[l.jsx(le,{icon:l.jsx(J7,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>s(),fontSize:20}),l.jsx(le,{icon:l.jsx(e8,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>c(),fontSize:20}),l.jsx(le,{icon:l.jsx(Q7,{}),"aria-label":"Rotate Counter-Clockwise",tooltip:"Rotate Counter-Clockwise",onClick:n,fontSize:20}),l.jsx(le,{icon:l.jsx(Z7,{}),"aria-label":"Rotate Clockwise",tooltip:"Rotate Clockwise",onClick:r,fontSize:20}),l.jsx(le,{icon:l.jsx(Zg,{}),"aria-label":"Flip Horizontally",tooltip:"Flip Horizontally",onClick:e,fontSize:20}),l.jsx(le,{icon:l.jsx(Zg,{style:{transform:"rotate(90deg)"}}),"aria-label":"Flip Vertically",tooltip:"Flip Vertically",onClick:t,fontSize:20}),l.jsx(le,{icon:l.jsx(Jh,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{u(),o()},fontSize:20})]})};function rI({image:e,alt:t,ref:n,styleClass:r,rotation:o,scaleX:s,scaleY:c}){const{centerView:u}=a4();return l.jsx(eI,{wrapperStyle:{width:"100%",height:"100%"},children:l.jsx("img",{style:{transform:`rotate(${o}deg) scaleX(${s}) scaleY(${c})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>u(1,0,"easeOut")})})}const oI=be([Vr,oi],(e,t)=>{const{currentImage:n}=e,{shouldShowImageDetails:r}=t;return{viewerImageToDisplay:n,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:te.isEqual}});function iI(){const e=Y(),t=O(y=>y.lightbox.isLightboxOpen),{rotation:n,scaleX:r,scaleY:o,flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:h}=tI(),{viewerImageToDisplay:p,shouldShowImageDetails:g}=O(oI);return fe("Esc",()=>{t&&e(Ho(!1))},[t]),l.jsx(QP,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:l.jsxs(We,{sx:{width:"100%",height:"100%",overflow:"hidden",position:"absolute",insetInlineStart:0,top:0,zIndex:30,animation:"popIn 0.3s ease-in",bg:"base.800"},children:[l.jsxs(B,{sx:{flexDir:"column",position:"absolute",top:4,insetInlineStart:4,gap:4,zIndex:3},children:[l.jsx(le,{icon:l.jsx(X7,{}),"aria-label":"Exit Viewer",onClick:()=>{e(Ho(!1))},fontSize:20}),l.jsx(nI,{flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:h})]}),l.jsxs(B,{children:[l.jsxs($n,{sx:{overflow:"hidden",gridTemplateColumns:"auto max-content",placeItems:"center",width:"100vw",height:"100vh",bg:"base.850"},children:[p&&l.jsxs(l.Fragment,{children:[l.jsx(rI,{rotation
|
||
|
* @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 XI=function(t){var n={},r=x,o=Ul,s=Object.assign;function c(i){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+i,d=1;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=Symbol.for("react.element"),h=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),T=Symbol.iterator;function D(i){return i===null||typeof i!="object"?null:(i=T&&i[T]||i["@@iterator"],typeof i=="function"?i:null)}function _(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case p:return"Fragment";case h:return"Portal";case y:return"Profiler";case g:return"StrictMode";case k:return"Suspense";case j:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case C:return(i.displayName||"Context")+".Consumer";case S:return(i._context.displayName||"Context")+".Provider";case w:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case M:return a=i.displayName||null,a!==null?a:_(i.type)||"Memo";case P:a=i._payload,i=i._init;try{return _(i(a))}catch{}}return null}function z(i){var a=i.type;switch(i.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=a.render,i=i.displayName||i.name||"",a.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _(a);case 8:return a===g?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function V(i){var a=i,d=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,a.flags&4098&&(d=a.return),i=a.return;while(i)}return a.tag===3?d:null}function F(i){if(V(i)!==i)throw Error(c(188))}function L(i){var a=i.alternate;if(!a){if(a=V(i),a===null)throw Error(c(188));return a!==i?null:i}for(var d=i,m=a;;){var v=d.return;if(v===null)break;var b=v.alternate;if(b===null){if(m=v.return,m!==null){d=m;continue}break}if(v.child===b.child){for(b=v.child;b;){if(b===d)return F(v),i;if(b===m)return F(v),a;b=b.sibling}throw Error(c(188))}if(d.return!==m.return)d=v,m=b;else{for(var E=!1,A=v.child;A;){if(A===d){E=!0,d=v,m=b;break}if(A===m){E=!0,m=v,d=b;break}A=A.sibling}if(!E){for(A=b.child;A;){if(A===d){E=!0,d=b,m=v;break}if(A===m){E=!0,m=b,d=v;break}A=A.sibling}if(!E)throw Error(c(189))}}if(d.alternate!==m)throw Error(c(190))}if(d.tag!==3)throw Error(c(188));return d.stateNode.current===d?i:a}function K(i){return i=L(i),i!==null?$(i):null}function $(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var a=$(i);if(a!==null)return a;i=i.sibling}return null}function Q(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){if(i.tag!==4){var a=Q(i);if(a!==null)return a}i=i.sibling}return null}var re=Array.isArray,ie=t.getPublicInstance,U=t.getRootHostContext,X=t.getChildHostContext,ne=t.prepareForCommit,ce=t.resetAfterCommit,Re=t.createInstance,ze=t.appendInitialChild,Me=t.finalizeInitialChildren,J=t.prepareUpdate,ue=t.shouldSetTextContent,Ie=t.createTextInstance,Be=t.scheduleTimeout,Ne=t.cancelTimeout,Ge=t.noTimeout,Qe=t.isPrimaryRenderer,ve=t.supportsMutation,_e=t.supportsPersistence,qe=t.supportsHydration,ge
|
||
|
`+Jc+i}var eu=!1;function tu(i,a){if(!i||eu)return"";eu=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(ae){var m=ae}Reflect.construct(i,[],a)}else{try{a.call()}catch(ae){m=ae}i.call(a.prototype)}else{try{throw Error()}catch(ae){m=ae}i()}}catch(ae){if(ae&&m&&typeof ae.stack=="string"){for(var v=ae.stack.split(`
|
||
|
`),b=m.stack.split(`
|
||
|
`),E=v.length-1,A=b.length-1;1<=E&&0<=A&&v[E]!==b[A];)A--;for(;1<=E&&0<=A;E--,A--)if(v[E]!==b[A]){if(E!==1||A!==1)do if(E--,A--,0>A||v[E]!==b[A]){var W=`
|
||
|
`+v[E].replace(" at new "," at ");return i.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",i.displayName)),W}while(1<=E&&0<=A);break}}}finally{eu=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?ha(i):""}var Wb=Object.prototype.hasOwnProperty,nu=[],di=-1;function Gr(i){return{current:i}}function bt(i){0>di||(i.current=nu[di],nu[di]=null,di--)}function gt(i,a){di++,nu[di]=i.current,i.current=a}var qr={},an=Gr(qr),gn=Gr(!1),Co=qr;function fi(i,a){var d=i.type.contextTypes;if(!d)return qr;var m=i.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var v={},b;for(b in d)v[b]=a[b];return m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=a,i.__reactInternalMemoizedMaskedChildContext=v),v}function xn(i){return i=i.childContextTypes,i!=null}function js(){bt(gn),bt(an)}function Zp(i,a,d){if(an.current!==qr)throw Error(c(168));gt(an,a),gt(gn,d)}function Jp(i,a,d){var m=i.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return d;m=m.getChildContext();for(var v in m)if(!(v in a))throw Error(c(108,z(i)||"Unknown",v));return s({},d,m)}function Es(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||qr,Co=an.current,gt(an,i),gt(gn,gn.current),!0}function em(i,a,d){var m=i.stateNode;if(!m)throw Error(c(169));d?(i=Jp(i,a,Co),m.__reactInternalMemoizedMergedChildContext=i,bt(gn),bt(an),gt(an,i)):bt(gn),gt(gn,d)}var Kn=Math.clz32?Math.clz32:$b,Vb=Math.log,Ub=Math.LN2;function $b(i){return i>>>=0,i===0?32:31-(Vb(i)/Ub|0)|0}var Ps=64,Is=4194304;function pa(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Ms(i,a){var d=i.pendingLanes;if(d===0)return 0;var m=0,v=i.suspendedLanes,b=i.pingedLanes,E=d&268435455;if(E!==0){var A=E&~v;A!==0?m=pa(A):(b&=E,b!==0&&(m=pa(b)))}else E=d&~v,E!==0?m=pa(E):b!==0&&(m=pa(b));if(m===0)return 0;if(a!==0&&a!==m&&!(a&v)&&(v=m&-m,b=a&-a,v>=b||v===16&&(b&4194240)!==0))return a;if(m&4&&(m|=d&16),a=i.entangledLanes,a!==0)for(i=i.entanglements,a&=m;0<a;)d=31-Kn(a),v=1<<d,m|=i[d],a&=~v;return m}function Gb(i,a){switch(i){case 1:case 2:case 4:return a+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qb(i,a){for(var d=i.suspendedLanes,m=i.pingedLanes,v=i.expirationTimes,b=i.pendingLanes;0<b;){var E=31-Kn(b),A=1<<E,W=v[E];W===-1?(!(A&d)||A&m)&&(v[E]=Gb(A,a)):W<=a&&(i.expiredLanes|=A),b&=~A}}function ru(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function tm(){var i=Ps;return Ps<<=1,!(Ps&4194240)&&(Ps=64),i}function ou(i){for(var a=[],d=0;31>d;d++)a.push(i);return a}function ma(i,a,d){i.pendingLanes|=a,a!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,a=31-Kn(a),i[a]=d}function Yb(i,a){var d=i.pendingLanes&~a;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=a,i.mutableReadLanes&=a,i.entangledLanes&=a,a=i.entanglements;var m=i.eventTimes;for(i=i.expirationTimes;0<d;){var v=31-Kn(d),b=1<<v;a[v]=0,m[v]=-1,i[v]=-1,d&=~b}}function iu(i,a){var d=i.entangledLanes|=a;for(i=i.entanglements;d;){var m=31-Kn(d),v=1<<m;v&a|i[m]&a&&(i[m]|=a),d&=~v}}var ot=0;function nm(i){return i&=-i,1<i?4<i?i&268435455?16:536870912:4:1}var au=o.unstable_scheduleCallback,rm=o.unstable_cancelCallback,Kb=o.unstable_sho
|
||
|
Error generating stack: `+b.message+`
|
||
|
`+b.stack}return{value:i,source:a,stack:v,digest:null}}function zu(i,a,d){return{value:i,source:null,stack:d??null,digest:a??null}}function Ru(i,a){try{console.error(a.value)}catch(d){setTimeout(function(){throw d})}}var dS=typeof WeakMap=="function"?WeakMap:Map;function Um(i,a,d){d=Ir(-1,d),d.tag=3,d.payload={element:null};var m=a.value;return d.callback=function(){sl||(sl=!0,nd=m),Ru(i,a)},d}function $m(i,a,d){d=Ir(-1,d),d.tag=3;var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var v=a.value;d.payload=function(){return m(v)},d.callback=function(){Ru(i,a)}}var b=i.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(d.callback=function(){Ru(i,a),typeof m!="function"&&(Xr===null?Xr=new Set([this]):Xr.add(this));var E=a.stack;this.componentDidCatch(a.value,{componentStack:E!==null?E:""})}),d}function Gm(i,a,d){var m=i.pingCache;if(m===null){m=i.pingCache=new dS;var v=new Set;m.set(a,v)}else v=m.get(a),v===void 0&&(v=new Set,m.set(a,v));v.has(d)||(v.add(d),i=jS.bind(null,i,a,d),a.then(i,i))}function qm(i){do{var a;if((a=i.tag===13)&&(a=i.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return i;i=i.return}while(i!==null);return null}function Ym(i,a,d,m,v){return i.mode&1?(i.flags|=65536,i.lanes=v,i):(i===a?i.flags|=65536:(i.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(a=Ir(-1,1),a.tag=2,Kr(d,a,1))),d.lanes|=1),i)}var fS=u.ReactCurrentOwner,yn=!1;function mn(i,a,d,m){a.child=i===null?Sm(a,null,d,m):xi(a,i.child,d,m)}function Km(i,a,d,m,v){d=d.render;var b=a.ref;return gi(a,v),m=Mu(i,a,d,m,b,v),d=Tu(),i!==null&&!yn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~v,Mr(i,a,v)):(It&&d&&uu(a),a.flags|=1,mn(i,a,m,v),a.child)}function Xm(i,a,d,m,v){if(i===null){var b=d.type;return typeof b=="function"&&!ld(b)&&b.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(a.tag=15,a.type=b,Qm(i,a,b,m,v)):(i=hl(d.type,null,m,a,a.mode,v),i.ref=a.ref,i.return=a,a.child=i)}if(b=i.child,!(i.lanes&v)){var E=b.memoizedProps;if(d=d.compare,d=d!==null?d:zs,d(E,m)&&i.ref===a.ref)return Mr(i,a,v)}return a.flags|=1,i=eo(b,m),i.ref=a.ref,i.return=a,a.child=i}function Qm(i,a,d,m,v){if(i!==null){var b=i.memoizedProps;if(zs(b,m)&&i.ref===a.ref)if(yn=!1,a.pendingProps=m=b,(i.lanes&v)!==0)i.flags&131072&&(yn=!0);else return a.lanes=i.lanes,Mr(i,a,v)}return Nu(i,a,d,m,v)}function Zm(i,a,d){var m=a.pendingProps,v=m.children,b=i!==null?i.memoizedState:null;if(m.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(wi,_n),_n|=d;else{if(!(d&1073741824))return i=b!==null?b.baseLanes|d:d,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:i,cachePool:null,transitions:null},a.updateQueue=null,gt(wi,_n),_n|=i,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=b!==null?b.baseLanes:d,gt(wi,_n),_n|=m}else b!==null?(m=b.baseLanes|d,a.memoizedState=null):m=d,gt(wi,_n),_n|=m;return mn(i,a,v,d),a.child}function Jm(i,a){var d=a.ref;(i===null&&d!==null||i!==null&&i.ref!==d)&&(a.flags|=512,a.flags|=2097152)}function Nu(i,a,d,m,v){var b=xn(d)?Co:an.current;return b=fi(a,b),gi(a,v),d=Mu(i,a,d,m,b,v),m=Tu(),i!==null&&!yn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~v,Mr(i,a,v)):(It&&m&&uu(a),a.flags|=1,mn(i,a,d,v),a.child)}function ev(i,a,d,m,v){if(xn(d)){var b=!0;Es(a)}else b=!1;if(gi(a,v),a.stateNode===null)Ks(i,a),gm(a,d,m),Cu(a,d,m,v),m=!0;else if(i===null){var E=a.stateNode,A=a.memoizedProps;E.props=A;var W=E.context,ae=d.contextType;typeof ae=="object"&&ae!==null?ae=zn(ae):(ae=xn(d)?Co:an.current,ae=fi(a,ae));var Ee=d.getDerivedStateFromProps,Ue=typeof Ee=="function"||typeof E.getSnapshotBeforeUpdate=="function";Ue||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(A!==m||W!==ae)&&xm(a,E,m,ae),Yr=!1;var ye=a.memoizedState;E.state=ye,Ls(a,m,E,v),W=a.memoizedState,A!==m||ye!==W||gn.current||Yr?(typeof Ee=="function"&&(Su(a,d,Ee,m),W=a.memoizedState),(A=Yr||vm(a,d,A,m,ye,W,ae))?(Ue||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="
|
||
|
`+(m.join(" > ")+`
|
||
|
|
||
|
No matching component was found for:
|
||
|
`)+i.join(" > ")}return null},n.getPublicRootInstance=function(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return ie(i.child.stateNode);default:return i.child.stateNode}},n.injectIntoDevTools=function(i){if(i={bundleType:i.bundleType,version:i.version,rendererPackageName:i.rendererPackageName,rendererConfig:i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:_S,findFiberByHostInstance:i.findFiberByHostInstance||DS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")i=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)i=!0;else{try{Ts=a.inject(i),ir=a}catch{}i=!!a.checkDCE}}return i},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(i,a,d,m){if(!N)throw Error(c(363));i=Qu(i,a);var v=Ze(i,d,m).disconnect;return{disconnect:function(){v()}}},n.registerMutableSourceForHydration=function(i,a){var d=a._getVersion;d=d(a._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[a,d]:i.mutableSourceEagerHydrationData.push(a,d)},n.runWithPriority=function(i,a){var d=ot;try{return ot=i,a()}finally{ot=d}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(i,a,d,m){var v=a.current,b=un(),E=Zr(v);return d=_v(d),a.context===null?a.context=d:a.pendingContext=d,a=Ir(b,E),a.payload={element:i},m=m===void 0?null:m,m!==null&&(a.callback=m),i=Kr(v,a,E),i!==null&&(Fn(i,v,E,b),Fs(i,v,E)),E},n};(function(e){e.exports=XI})(KI);const QI=yC(Af);var fc={},ZI={get exports(){return fc},set exports(e){fc=e}},ai={};/**
|
||
|
* @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.
|
||
|
*/ai.ConcurrentRoot=1;ai.ContinuousEventPriority=4;ai.DefaultEventPriority=16;ai.DiscreteEventPriority=1;ai.IdleEventPriority=536870912;ai.LegacyRoot=0;(function(e){e.exports=ai})(ZI);const C0={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let w0=!1,k0=!1;const _p=".react-konva-event",JI=`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
|
||
|
`,eM=`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
|
||
|
`,tM={};function Hc(e,t,n=tM){if(!w0&&"zIndex"in t&&(console.warn(eM),w0=!0),!k0&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(JI),k0=!0)}for(var s in n)if(!C0[s]){var c=s.slice(0,2)==="on",u=n[s]!==t[s];if(c&&u){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e.off(f,n[s])}var h=!t.hasOwnProperty(s);h&&e.setAttr(s,void 0)}var p=t._useStrictMode,g={},y=!1;const S={};for(var s in t)if(!C0[s]){var c=s.slice(0,2)==="on",C=n[s]!==t[s];if(c&&C){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[s]&&(S[f]=t[s])}!c&&(t[s]!==n[s]||p&&t[s]!==e.getAttr(s))&&(y=!0,g[s]=t[s])}y&&(e.setAttrs(g),xo(e));for(var f in S)e.on(f+_p,S[f])}function xo(e){if(!bC.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const p4={},nM={};qa.Node.prototype._applyProps=Hc;function rM(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),xo(e)}function oM(e,t,n){let r=qa[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=qa.Group);const o={},s={};for(var c in t){var u=c.slice(0,2)==="on";u?s[c]=t[c]:o[c]=t[c]}const f=new r(o);return Hc(f,s),f}function iM(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function aM(e,t,n){return!1}function sM(e){return e}function lM(){return null}function cM(){return null}function uM(e,t,n,r){return nM}function dM(){}function fM(e){}function hM(e,t){return!1}function pM(){return p4}function mM(){return p4}const vM=setTimeout,gM=clearTimeout,xM=-1;function yM(e,t){return!1}const bM=!1,SM=!0,CM=!0;function wM(e,t){t.parent===e?t.moveToTop():e.add(t),xo(e)}function kM(e,t){t.parent===e?t.moveToTop():e.add(t),xo(e)}function m4(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),xo(e)}function jM(e,t,n){m4(e,t,n)}function EM(e,t){t.destroy(),t.off(_p),xo(e)}function PM(e,t){t.destroy(),t.off(_p),xo(e)}function IM(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function MM(e,t,n){}function TM(e,t,n,r,o){Hc(e,o,r)}function _M(e){e.hide(),xo(e)}function DM(e){}function OM(e,t){(t.visible==null||t.visible)&&e.show()}function AM(e,t){}function zM(e){}function RM(){}const NM=()=>fc.DefaultEventPriority,FM=Object.freeze(Object.defineProperty({__proto__:null,appendChild:wM,appendChildToContainer:kM,appendInitialChild:rM,cancelTimeout:gM,clearContainer:zM,commitMount:MM,commitTextUpdate:IM,commitUpdate:TM,createInstance:oM,createTextInstance:iM,detachDeletedInstance:RM,finalizeInitialChildren:aM,getChildHostContext:mM,getCurrentEventPriority:NM,getPublicInstance:sM,getRootHostContext:pM,hideInstance:_M,hideTextInstance:DM,idlePriority:Ul.unstable_IdlePriority,insertBefore:m4,insertInContainerBefore:jM,isPrimaryRenderer:bM,noTimeout:xM,now:Ul.unstable_now,prepareForCommit:lM,preparePortalMount:cM,prepareUpdate:uM,removeChild:EM,removeChildFromContainer:PM,resetAfterCommit:dM,resetTextContent:fM,run:Ul.unstable_runWithPriority,scheduleTimeout:vM,shouldDeprioritizeSubtree:hM,shouldSetTextContent:yM,supportsMutation:CM,unhideInstance:OM,unhideTextInstance:AM,warnsIfNotActing:SM},Symbol.toStringTag,{value:"Module"}));var LM=Object.defineProperty,BM=Object.defineProperties,HM=Object.getOwnPropertyDescriptors,j0=Object.getOwnPropertySymbols,WM=Object.prototype.hasOwnProperty,VM=Object.prototype.propertyIsEnumerable,E0=(e,t,n)=>t in e?LM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P0=(e,t)=>{for(var n in t||(t={}))WM.call(t,n)&&E0(e,n,t[n]);if(j0)for(var n of j0(t))VM.call(t,n)&&E0(e,n,t[n]);return e},UM=(e,t)=>BM(e,HM(t));function v4(e,t,n){if(!e)return;if(n(e
|
||
|
<!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),bT=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=O(yT),[c,u]=x.useState(null),[f,h]=x.useState(0),p=x.useRef(null),g=x.useCallback(()=>{h(f+1),setTimeout(g,500)},[f]);return x.useEffect(()=>{if(c)return;const y=new Image;y.onload=()=>{u(y)},y.src=I0(n)},[c,n]),x.useEffect(()=>{c&&(c.src=I0(n))},[c,n]),x.useEffect(()=>{const y=setInterval(()=>h(S=>(S+1)%5),50);return()=>clearInterval(y)},[]),!c||!te.isNumber(r.x)||!te.isNumber(r.y)||!te.isNumber(s)||!te.isNumber(o.width)||!te.isNumber(o.height)?null:l.jsx(Hr,{ref:p,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:c,fillPatternOffsetY:te.isNumber(f)?f:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},ST=be([tt],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),CT=e=>{const{...t}=e,{objects:n}=O(ST);return l.jsx(Br,{listening:!1,...t,children:n.filter(OC).map((r,o)=>l.jsx(hc,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},o))})};var Oo=x,wT=function(t,n,r){const o=Oo.useRef("loading"),s=Oo.useRef(),[c,u]=Oo.useState(0),f=Oo.useRef(),h=Oo.useRef(),p=Oo.useRef();return(f.current!==t||h.current!==n||p.current!==r)&&(o.current="loading",s.current=void 0,f.current=t,h.current=n,p.current=r),Oo.useLayoutEffect(function(){if(!t)return;var g=document.createElement("img");function y(){o.current="loaded",s.current=g,u(Math.random())}function S(){o.current="failed",s.current=void 0,u(Math.random())}return g.addEventListener("load",y),g.addEventListener("error",S),n&&(g.crossOrigin=n),r&&(g.referrerpolicy=r),g.src=t,function(){g.removeEventListener("load",y),g.removeEventListener("error",S)}},[t,n,r]),[s.current,o.current]};const S4=e=>{const{url:t,x:n,y:r}=e,[o]=wT(t);return l.jsx(y4,{x:n,y:r,image:o,listening:!1})},kT=be([tt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),jT=()=>{const{objects:e}=O(kT);return e?l.jsx(Br,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(M1(t))return l.jsx(S4,{x:t.x,y:t.y,url:t.image.url},n);if(AC(t)){const r=l.jsx(hc,{points:t.points,stroke:t.color?Yo(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?l.jsx(Br,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(zC(t))return l.jsx(Hr,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Yo(t.color)},n);if(RC(t))return l.jsx(Hr,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},ET=be([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:o,boundingBoxCoordinates:{x:s,y:c},boundingBoxDimensions:{width:u,height:f}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:c,width:u,height:f}},{memoizeOptions:{resultEqualityCheck:te.isEqual}}),PT=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:c,width:u,height:f}=O(ET);return l.jsxs(Br,{...t,children:[r&&n&&l.jsx(S4,{url:n.image.url,x:s,y:c}),o&&l.jsxs(Br,{children:[l.jsx(Hr,{x:s,y:c,width:u,height:f,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),l.jsx(Hr,{x:s,y:c,width:u,height:f,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},IT=be([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:o}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shoul
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wD(e){if(Array.isArray(e))return Bf(e)}function z0(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 R0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z0(Object(n),!0).forEach(function(r){z4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function z4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function es(e,t){return ED(e)||jD(e,t)||R4(e,t)||kD()}function kD(){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 R4(e,t){if(e){if(typeof e=="string")return Bf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bf(e,t)}}function Bf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function ED(e){if(Array.isArray(e))return e}var PD="file-invalid-type",ID="file-too-large",MD="file-too-small",TD="too-many-files",_D=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:PD,message:"File type must be ".concat(n)}},N0=function(t){return{code:ID,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},F0=function(t){return{code:MD,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},DD={code:TD,message:"Too many files"};function N4(e,t){var n=e.type==="application/x-moz-file"||bD(e,t);return[n,n?null:_D(t)]}function F4(e,t,n){if(Fo(e.size))if(Fo(t)&&Fo(n)){if(e.size>n)return[!1,N0(n)];if(e.size<t)return[!1,F0(t)]}else{if(Fo(t)&&e.size<t)return[!1,F0(t)];if(Fo(n)&&e.size>n)return[!1,N0(n)]}return[!0,null]}function Fo(e){return e!=null}function OD(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var h=N4(f,n),p=es(h,1),g=p[0],y=F4(f,r,o),S=es(y,1),C=S[0],w=u?u(f):null;return g&&C&&!w})}function vc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Nl(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function L0(e){e.preventDefault()}function AD(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function zD(e){return e.indexOf("Edge/")!==-1}function RD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return AD(e)||zD(e)}function hr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),c=1;c<o;c++)s[c-1]=arguments[c];return t.some(function(u){return!vc(r)&&u&&u.apply(void 0,[r].concat(s)),vc(r)})}}function ND(){return"showOpenFilePicker"in window}function FD(e){if(Fo(e)){var t=Object.entries(e).filter(function(n){var r=es(n,2),o=r[0],s=r[1],c=!0;return L4(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),c=!1),(!Array.isArray(s)||!s.every(B4))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var o=es(r,2),s=o[0],c=o[1];return R0(R0({},n),{},z4({},s,c))},{});return[{description:"Files",accept:t}]}return e}function LD(e){if(Fo(e))return Object.entries(e).reduce(function(t,n){var r=es(n,2),o=r[0],s=r[1];return[].concat(A0(t),[o],A0(s))},[]).filter(function(t){return L4(t)||B4(t)}).join(",")}function BD(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function HD(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function L4(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function B4(e){return/^.*\.[\w]+$/.test(e)}var WD=["children"],VD=["open"],UD=["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 YD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function KD(e){if(Array.isArray(e))return Hf(e)}function Wd(e,t){return ZD(e)||QD(e,t)||H4(e,t)||XD()}function XD(){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 H4(e,t){if(e){if(typeof e=="string")return Hf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hf(e,t)}}function Hf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function QD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function ZD(e){if(Array.isArray(e))return e}function B0(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 Ot(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?B0(Object(n),!0).forEach(function(r){Wf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):B0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gc(e,t){if(e==null)return{};var n=JD(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 JD(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 Rp=x.forwardRef(function(e,t){var n=e.children,r=gc(e,WD),o=V4(r),s=o.open,c=gc(o,VD);return x.useImperativeHandle(t,function(){return{open:s}},[s]),ke.createElement(x.Fragment,null,n(Ot(Ot({},c),{},{open:s})))});Rp.displayName="Dropzone";var W4={disabled:!1,getFilesFromEvent:dD,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};Rp.defaultProps=W4;Rp.propTypes={children:lt.func,accept:lt.objectOf(lt.arrayOf(lt.string)),multiple:lt.bool,preventDropOnDocument:lt.bool,noClick:lt.bool,noKeyboard:lt.bool,noDrag:lt.bool,noDragEventsBubbling:lt.bool,minSize:lt.number,maxSize:lt.number,maxFiles:lt.number,disabled:lt.bool,getFilesFromEvent:lt.func,onFileDialogCancel:lt.func,onFileDialogOpen:lt.func,useFsAccessApi:lt.bool,autoFocus:lt.bool,onDragEnter:lt.func,onDragLeave:lt.func,onDragOver:lt.func,onDrop:lt.func,onDropAccepted:lt.func,onDropRejected:lt.func,onError:lt.func,validator:lt.func};var Vf={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function V4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Ot(Ot({},W4),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,h=t.onDragEnter,p=t.onDragLeave,g=t.onDragOver,y=t.onDrop,S=t.onDropAccepted,C=t.onDropRejected,w=t.onFileDialogCancel,k=t.onFileDialogOpen,j=t.useFsAccessApi,M=t.autoFocus,P=t.preventDropOnDocument,I=t.noClick,T=t.noKeyboard,D=t.noDrag,_=t.noDragEventsBubbling,z=t.onError,V=t.validator,F=x.useMemo(function(){return LD(n)},[n]),L=x.useMemo(function(){return FD(n)},[n]),K=x.useMemo(function(){return typeof k=="function"?k:H0},[k]),$=x.useMemo(function(){return typeof w=="function"?w:H0},[w]),Q=x.useRef(null),re=x.useRef(null),ie=x.useReducer(eO,Vf),U=Wd(ie,2),X=U[0],ne=U[1],ce=X.isFocused,Re=X.isFileDialogActive,ze=x.useRef(typeof window<"u"&&window.isSecureContext&&j&&ND()),Me=function(){!ze.current&&Re&&setTimeout(function(){if(re.current){var se=re.current.files;se.length||(ne({type:"closeDialog"}),$())}},300)};x.useEffe
|
||
|
${D.message}`,"");o({title:s("toast.uploadFailed"),description:I,status:"error",isClosable:!0})},[s,o]),p=x.useCallback(async P=>{n(Vg({imageFile:P}))},[n]),g=x.useCallback((P,I)=>{I.forEach(T=>{h(T)}),P.forEach(T=>{p(T)})},[p,h]),{getRootProps:y,getInputProps:S,isDragAccept:C,isDragReject:w,isDragActive:k,open:j}=V4({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:g,onDragOver:()=>u(!0),maxFiles:1});f(j),x.useEffect(()=>{const P=I=>{var z;const T=(z=I.clipboardData)==null?void 0:z.items;if(!T)return;const D=[];for(const V of T)V.kind==="file"&&["image/png","image/jpg"].includes(V.type)&&D.push(V);if(!D.length)return;if(I.stopImmediatePropagation(),D.length>1){o({description:s("toast.uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const _=D[0].getAsFile();if(!_){o({description:s("toast.uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(Vg({imageFile:_}))};return document.addEventListener("paste",P),()=>{document.removeEventListener("paste",P)}},[s,n,o,r]);const M=["img2img","unifiedCanvas"].includes(r)?` to ${Hn[r].tooltip}`:"";return l.jsx(Xh.Provider,{value:j,children:l.jsxs(We,{...y({style:{}}),onKeyDown:P=>{P.key},children:[l.jsx("input",{...S()}),t,k&&c&&l.jsx(tO,{isDragAccept:C,isDragReject:w,overlaySecondaryText:M,setIsHandlingUpload:u})]})})},rO=be(Pt,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),oO=be(Pt,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),iO=()=>{const e=Y(),t=O(rO),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:o}=O(oO),[s,c]=x.useState(!0),u=x.useRef(null);x.useLayoutEffect(()=>{u.current!==null&&s&&(u.current.scrollTop=u.current.scrollHeight)},[s,t,n]);const f=()=>{e(d2()),e(vd(!n))};fe("`",()=>{e(vd(!n))},[n]),fe("esc",()=>{e(vd(!1))});const h=()=>{u.current&&s&&u.current.scrollTop<u.current.scrollHeight-u.current.clientHeight&&c(!1)};return l.jsxs(l.Fragment,{children:[n&&l.jsx(Ny,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",insetInlineStart:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:l.jsx(B,{sx:{flexDirection:"column",width:"100vw",overflow:"auto",direction:"column",fontFamily:"monospace",pt:0,pr:4,pb:4,pl:12,borderTopWidth:5,bg:"base.850",borderColor:"base.700"},ref:u,onScroll:h,children:t.map((p,g)=>{const{timestamp:y,message:S,level:C}=p,w=C==="info"?"base":C;return l.jsxs(B,{sx:{gap:2,color:`${w}.300`},children:[l.jsxs(Ce,{fontWeight:"600",children:[y,":"]}),l.jsx(Ce,{wordBreak:"break-all",children:S})]},g)})})}),n&&l.jsx(Yt,{hasArrow:!0,label:s?"Autoscroll On":"Autoscroll Off",children:l.jsx(le,{size:"sm","aria-label":"Toggle autoscroll",icon:l.jsx(k8,{}),onClick:()=>c(!s),isChecked:s,sx:{position:"fixed",insetInlineStart:2,bottom:12,zIndex:"10000"}})}),l.jsx(Yt,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:l.jsx(le,{size:"sm","aria-label":"Toggle Log Viewer",icon:n?l.jsx(H8,{}):l.jsx(Iy,{}),onClick:f,sx:{position:"fixed",insetInlineStart:2,bottom:2,zIndex:"10000"},colorScheme:r||!o?"error":"base"})})]})},aO=be(Pt,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:te.isEqual}}),sO=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=O(aO),o=t?Math.round(t*100/n):0;return l.jsx(Zx,{value:o,isIndeterminate:e&&!r,height:dp,zIndex:99})};function lO(e){const{title:t,hotkey:n,description:r}=e;return l.jsxs($n,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs($n,{children:[l.jsx(Ce,{fontWeight:600,children:t}),r&&l.jsx(Ce,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),l.jsx(We,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function cO({children:e}){const{isOpen:t,onOpen:n,onClose:r}=uo(),{t:o}=Z(),s=[{title:o("hotkeys.invoke.title"),desc:o("hotkeys.invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys.cancel.title"
|